资源描述:
《the_ELF_object_file_format_introduction学习(001)》由会员上传分享,免费在线阅读,更多相关内容在学术论文-天天文库。
1、TheELFObjectFileFormat:IntroductionApr01,1995ByEricYoungdaleTheExecutableandLinkingFormat(ELF)hasbeenapopulartopiclately.PeoplewonderwhythekernelconfigurationsscriptaskswhetherornottoconfigureloadingELFexecutables.AsELFwilleventuallybethecommonobjectf
2、ileformatforLinuxbinaries,itisappropriatetodocumentitabit.Thismonth,EricintroducesustoELF,andnextmonthhewillgiveusaguidedtourofrealELFfiles.NowthatweareonthevergeofapublicreleaseofELFfileformatcompilersandutilities,itisalogicaltimetoexplainthedifferen
3、cesbetweena.outandELF,anddiscusshowtheywillbevisibletotheuser.AslongasIamatit,IwillalsoguideyouonatouroftheinternalsoftheELFfileformatandshowyouhowitworks.IrealizethatLinuxusersrangefrompeoplebrandnewtoUnixtopeoplewhohaveusedUnixsystemsforyears—forthi
4、sreasonIwillstartwithafairlybasicexplanationwhichmaybeoflittleusetothemoreexperiencedusers,becauseIwouldlikethisarticletobeusefulinsomewaytoasmanypeopleaspossible.Peopleoftenaskwhywearebotheringwithanewfileformat.Acouplereasonscometomind—first,thecurr
5、entsharedlibrariescanbesomewhatcumbersometobuild,especiallyforlargepackagessuchastheXWindowSystemthatspanmultipledirectories.Second,thecurrenta.outsharedlibraryschemedoesnotsupportthedlopen()function,whichallowsyoutotellthedynamicloadertoloadadditiona
6、lsharedlibraries.WhyELF?TheUnixcommunityseemstobestandardizingthisfileformat;variousimplementationsofSVr4suchasMIPS,Solaris,UnixwarecurrentlyuseELF;SCOwillreportedlyswitchtoELFinthenearfuture;andtherearerumorsofothervendorsswitchingtoELF.Oneinterestin
7、gsidenote—WindowsNTusesafileformatbasedupontheCOFFfileformat,theSVr3fileformatthattheUnixcommunityisabandoninginfavorofELF.Letusstartatthebeginning.UserswillgenerallyencounterthreetypesofELFfiles—.ofiles,regularexecutables,andsharedlibraries.Whileallo
8、fthesefilesservedifferentpurposes,theirinternalstructurefilesarequitesimilar.Thuswecanbeginwithageneraldescription,andproceedtoadiscussionofthespecificsofthethreefiletypes.Nextmonth,Iwilldemonstratetheuseofthereadelfprogram,whichcanbeusedtodis