资源描述:
《the_ELF_object_file_format_introduction(002)》由会员上传分享,免费在线阅读,更多相关内容在学术论文-天天文库。
1、TheELFObjectFileFormat:IntroductionApr01,1995ByEricYoungdaleTheExecutableandLinkingFormat(ELF)hasbeenapopulartopiclately.PeoplewonderwhythekernelconfigurationsscriptaskswhetherornottoconfigureloadingELFexecutables.AsELFwilleventuallybethecommonobjectfileformatforLinuxbin
2、aries,itisappropriatetodocumentitabit.Thismonth,EricintroducesustoELF,andnextmonthhewillgiveusaguidedtourofrealELFfiles.NowthatweareonthevergeofapublicreleaseofELFfileformatcompilersandutilities,itisalogicaltimetoexplainthedifferencesbetweena.outandELF,anddiscusshowtheyw
3、illbevisibletotheuser.AslongasIamatit,IwillalsoguideyouonatouroftheinternalsoftheELFfileformatandshowyouhowitworks.IrealizethatLinuxusersrangefrompeoplebrandnewtoUnixtopeoplewhohaveusedUnixsystemsforyears—forthisreasonIwillstartwithafairlybasicexplanationwhichmaybeoflitt
4、leusetothemoreexperiencedusers,becauseIwouldlikethisarticletobeusefulinsomewaytoasmanypeopleaspossible.Peopleoftenaskwhywearebotheringwithanewfileformat.Acouplereasonscometomind—first,thecurrentsharedlibrariescanbesomewhatcumbersometobuild,especiallyforlargepackagessucha
5、stheXWindowSystemthatspanmultipledirectories.Second,thecurrenta.outsharedlibraryschemedoesnotsupportthedlopen()function,whichallowsyoutotellthedynamicloadertoloadadditionalsharedlibraries.WhyELF?TheUnixcommunityseemstobestandardizingthisfileformat;variousimplementationso
6、fSVr4suchasMIPS,Solaris,UnixwarecurrentlyuseELF;SCOwillreportedlyswitchtoELFinthenearfuture;andtherearerumorsofothervendorsswitchingtoELF.Oneinterestingsidenote—WindowsNTusesafileformatbasedupontheCOFFfileformat,theSVr3fileformatthattheUnixcommunityisabandoninginfavorofE
7、LF.Letusstartatthebeginning.UserswillgenerallyencounterthreetypesofELFfiles—.ofiles,regularexecutables,andsharedlibraries.Whileallofthesefilesservedifferentpurposes,theirinternalstructurefilesarequitesimilar.Thuswecanbeginwithageneraldescription,andproceedtoadiscussionof
8、thespecificsofthethreefiletypes.Nextmonth,Iwilldemonstratetheuseofthereadelfprogram,whichcanbeusedtodis