您好,欢迎访问三七文档
当前位置:首页 > 商业/管理/HR > 销售管理 > gnu-linker
UsingldTheGNUlinkerldversion2Version2.14SteveChamberlainIanLanceTaylorRedHatIncnickc@credhat.com,doc@redhat.comUsingLD,theGNUlinkerEditedbyJeffreyOsier(jeffrey@cygnus.com)Copyrightc1991,92,93,94,95,96,97,98,99,2000,2001,2002,2003FreeSoftwareFoundation,Inc.Permissionisgrantedtocopy,distributeand/ormodifythisdocumentunderthetermsoftheGNUFreeDocumentationLicense,Version1.1oranylaterversionpublishedbytheFreeSoftwareFoundation;withnoInvariantSections,withnoFront-CoverTexts,andwithnoBack-CoverTexts.Acopyofthelicenseisincludedinthesectionentitled“GNUFreeDocumentationLicense”.iTableofContents1Overview..................................12Invocation.................................32.1CommandLineOptions.................................32.1.1OptionsSpecifictoi386PETargets.............212.2EnvironmentVariables..................................263LinkerScripts............................293.1BasicLinkerScriptConcepts............................293.2LinkerScriptFormat...................................303.3SimpleLinkerScriptExample...........................303.4SimpleLinkerScriptCommands.........................313.4.1SettingtheEntryPoint........................313.4.2CommandsDealingwithFiles..................313.4.3CommandsDealingwithObjectFileFormats....323.4.4OtherLinkerScriptCommands.................333.5AssigningValuestoSymbols............................343.5.1SimpleAssignments............................343.5.2PROVIDE....................................353.6SECTIONSCommand..................................353.6.1OutputSectionDescription.....................363.6.2OutputSectionName..........................363.6.3OutputSectionDescription.....................373.6.4InputSectionDescription......................373.6.4.1InputSectionBasics...................373.6.4.2InputSectionWildcardPatterns.......383.6.4.3InputSectionforCommonSymbols....393.6.4.4InputSectionandGarbageCollection..403.6.4.5InputSectionExample................403.6.5OutputSectionData...........................403.6.6OutputSectionKeywords......................413.6.7OutputSectionDiscarding.....................423.6.8OutputSectionAttributes......................433.6.8.1OutputSectionType..................433.6.8.2OutputSectionLMA..................433.6.8.3OutputSectionRegion................443.6.8.4OutputSectionPhdr..................443.6.8.5OutputSectionFill...................443.6.9OverlayDescription............................453.7MEMORYCommand...................................463.8PHDRSCommand.....................................483.9VERSIONCommand...................................50iiUsingLD,theGNUlinker3.10ExpressionsinLinkerScripts...........................523.10.1Constants....................................523.10.2SymbolNames...............................533.10.3TheLocationCounter........................533.10.4Operators....................................543.10.5Evaluation...................................543.10.6TheSectionofanExpression..................553.10.7BuiltinFunctions.............................553.11ImplicitLinkerScripts.................................584MachineDependentFeatures..............594.12ldandtheH8/300....................................594.13ldandtheIntel960Family............................594.14ld’sSupportforInterworkingBetweenARMandThumbCode..................................................594.15ldandHPPA32-bitELFSupport......................604.16ldandMMIX........................................604.17ldandMSP430.......................................614.18ld’sSupportforVariousTICOFFVersions.............614.19ldandWIN32(cygwin/mingw)........................614.20ldandXtensaProcessors..............................665BFD.....................................695.1HowItWorks:AnOutlineofBFD......................695.1.1InformationLoss..............................695.1.2TheBFDcanonicalobject-fileformat...........706ReportingBugs...........................736.1HaveYouFoundaBug?................................736.2HowtoReportBugs....................................73AppendixAMRICompatibleScriptFiles....77AppendixBGNUFreeDocumentationLicense........................................79ADDENDUM:HowtousethisLicenseforyourdocuments.....84Index.......................................85Chapter1:Overview11Overviewldcombinesanumberofobjectandarchivefiles,relocatestheirdataandtiesupsymbolreferences.Usuallythelaststepincompilingaprogramistorunld.ldacceptsLinkerCommandLanguagefileswritteninasupersetofAT&T’sLinkEditorCommandLanguagesyntax,toprovideexplicitandtotalcontroloverthelinkingprocess.ThisversionofldusesthegeneralpurposeBFDlibrariestooperateonobjectfiles.Thisallowsldtoread,combine,andwriteobjectfilesinmanydifferentformats—forexample,COFFora.out.Differentformatsmaybelinkedtogethertoproduceanyavailablekindofobjectfile.SeeChapter5[BFD],page69,formoreinformation.Asidefromitsflexibility,thegnulinkerismorehelpfulthanotherlinkersinprovidingdiagnosticinformation.Manylinkersabandonexecutionimmediatelyuponencounteringanerror;wheneverpossible,ldcontinu
本文标题:gnu-linker
链接地址:https://www.777doc.com/doc-6686982 .html