资源描述:
《the_ELF_object_file_format_introduction》由会员上传分享,免费在线阅读,更多相关内容在学术论文-天天文库。
1、TheELFObjectFileFormat:IntroductionApr01,1995ByEricYoungdaleTheExecutableandLinkingFormat(ELF)hasbeenapopulartopiclately.PeoplewonderwhythekernelconfigurationsscriptaskswhetherornottoconfigureloadingELFexecutables.AsELFwilleventuallybethecommonobjectfileformatforLinuxbinaries,
2、itisappropriatetodocumentitabit.Thismonth,EricintroducesustoELF,andnextmonthhewillgiveusaguidedtourofrealELFfiles.NowthatweareonthevergeofapublicreleaseofELFfileformatcompilersandutilities,itisalogicaltimetoexplainthedifferencesbetweena.outandELF,anddiscusshowtheywillbevisible
3、totheuser.AslongasIamatit,IwillalsoguideyouonatouroftheinternalsoftheELFfileformatandshowyouhowitworks.IrealizethatLinuxusersrangefrompeoplebrandnewtoUnixtopeoplewhohaveusedUnixsystemsforyears—forthisreasonIwillstartwithafairlybasicexplanationwhichmaybeoflittleusetothemoreexpe
4、riencedusers,becauseIwouldlikethisarticletobeusefulinsomewaytoasmanypeopleaspossible.Peopleoftenaskwhywearebotheringwithanewfileformat.Acouplereasonscometomind—first,thecurrentsharedlibrariescanbesomewhatcumbersometobuild,especiallyforlargepackagessuchastheXWindowSystemthatspa
5、nmultipledirectories.Second,thecurrenta.outsharedlibraryschemedoesnotsupportthedlopen()function,whichallowsyoutotellthedynamicloadertoloadadditionalsharedlibraries.WhyELF?TheUnixcommunityseemstobestandardizingthisfileformat;variousimplementationsofSVr4suchasMIPS,Solaris,Unixwa
6、recurrentlyuseELF;SCOwillreportedlyswitchtoELFinthenearfuture;andtherearerumorsofothervendorsswitchingtoELF.Oneinterestingsidenote—WindowsNTusesafileformatbasedupontheCOFFfileformat,theSVr3fileformatthattheUnixcommunityisabandoninginfavorofELF.Letusstartatthebeginning.Userswil
7、lgenerallyencounterthreetypesofELFfiles—.ofiles,regularexecutables,andsharedlibraries.Whileallofthesefilesservedifferentpurposes,theirinternalstructurefilesarequitesimilar.Thuswecanbeginwithageneraldescription,andproceedtoadiscussionofthespecificsofthethreefiletypes.Nextmonth,
8、Iwilldemonstratetheuseofthereadelfprogram,whichcanbeusedtodis