ld.html 706 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994599559965997599859996000600160026003600460056006600760086009601060116012601360146015601660176018601960206021602260236024602560266027602860296030603160326033603460356036603760386039604060416042604360446045604660476048604960506051605260536054605560566057605860596060606160626063606460656066606760686069607060716072607360746075607660776078607960806081608260836084608560866087608860896090609160926093609460956096609760986099610061016102610361046105610661076108610961106111611261136114611561166117611861196120612161226123612461256126612761286129613061316132613361346135613661376138613961406141614261436144614561466147614861496150615161526153615461556156615761586159616061616162616361646165616661676168616961706171617261736174617561766177617861796180618161826183618461856186618761886189619061916192619361946195619661976198619962006201620262036204620562066207620862096210621162126213621462156216621762186219622062216222622362246225622662276228622962306231623262336234623562366237623862396240624162426243624462456246624762486249625062516252625362546255625662576258625962606261626262636264626562666267626862696270627162726273627462756276627762786279628062816282628362846285628662876288628962906291629262936294629562966297629862996300630163026303630463056306630763086309631063116312631363146315631663176318631963206321632263236324632563266327632863296330633163326333633463356336633763386339634063416342634363446345634663476348634963506351635263536354635563566357635863596360636163626363636463656366636763686369637063716372637363746375637663776378637963806381638263836384638563866387638863896390639163926393639463956396639763986399640064016402640364046405640664076408640964106411641264136414641564166417641864196420642164226423642464256426642764286429643064316432643364346435643664376438643964406441644264436444644564466447644864496450645164526453645464556456645764586459646064616462646364646465646664676468646964706471647264736474647564766477647864796480648164826483648464856486648764886489649064916492649364946495649664976498649965006501650265036504650565066507650865096510651165126513651465156516651765186519652065216522652365246525652665276528652965306531653265336534653565366537653865396540654165426543654465456546654765486549655065516552655365546555655665576558655965606561656265636564656565666567656865696570657165726573657465756576657765786579658065816582658365846585658665876588658965906591659265936594659565966597659865996600660166026603660466056606660766086609661066116612661366146615661666176618661966206621662266236624662566266627662866296630663166326633663466356636663766386639664066416642664366446645664666476648664966506651665266536654665566566657665866596660666166626663666466656666666766686669667066716672667366746675667666776678667966806681668266836684668566866687668866896690669166926693669466956696669766986699670067016702670367046705670667076708670967106711671267136714671567166717671867196720672167226723672467256726672767286729673067316732673367346735673667376738673967406741674267436744674567466747674867496750675167526753675467556756675767586759676067616762676367646765676667676768676967706771677267736774677567766777677867796780678167826783678467856786678767886789679067916792679367946795679667976798679968006801680268036804680568066807680868096810681168126813681468156816681768186819682068216822682368246825682668276828682968306831683268336834683568366837683868396840684168426843684468456846684768486849685068516852685368546855685668576858685968606861686268636864686568666867686868696870687168726873687468756876687768786879688068816882688368846885688668876888688968906891689268936894689568966897689868996900690169026903690469056906690769086909691069116912691369146915691669176918691969206921692269236924692569266927692869296930693169326933693469356936693769386939694069416942694369446945694669476948694969506951695269536954695569566957695869596960696169626963696469656966696769686969697069716972697369746975697669776978697969806981698269836984698569866987698869896990699169926993699469956996699769986999700070017002700370047005700670077008700970107011701270137014701570167017701870197020702170227023702470257026702770287029703070317032703370347035703670377038703970407041704270437044704570467047704870497050705170527053705470557056705770587059706070617062706370647065706670677068706970707071707270737074707570767077707870797080708170827083708470857086708770887089709070917092709370947095709670977098709971007101710271037104710571067107710871097110711171127113711471157116711771187119712071217122712371247125712671277128712971307131713271337134713571367137713871397140714171427143714471457146714771487149715071517152715371547155715671577158715971607161716271637164716571667167716871697170717171727173717471757176717771787179718071817182718371847185718671877188718971907191719271937194719571967197719871997200720172027203720472057206720772087209721072117212721372147215721672177218721972207221722272237224722572267227722872297230723172327233723472357236723772387239724072417242724372447245724672477248724972507251725272537254725572567257725872597260726172627263726472657266726772687269727072717272727372747275727672777278727972807281728272837284728572867287728872897290729172927293729472957296729772987299730073017302730373047305730673077308730973107311731273137314731573167317731873197320732173227323732473257326732773287329733073317332733373347335733673377338733973407341734273437344734573467347734873497350735173527353735473557356735773587359736073617362736373647365736673677368736973707371737273737374737573767377737873797380738173827383738473857386738773887389739073917392739373947395739673977398739974007401740274037404740574067407740874097410741174127413741474157416741774187419742074217422742374247425742674277428742974307431743274337434743574367437743874397440744174427443744474457446744774487449745074517452745374547455745674577458745974607461746274637464746574667467746874697470747174727473747474757476747774787479748074817482748374847485748674877488748974907491749274937494749574967497749874997500750175027503750475057506750775087509751075117512751375147515751675177518751975207521752275237524752575267527752875297530753175327533753475357536753775387539754075417542754375447545754675477548754975507551755275537554755575567557755875597560756175627563756475657566756775687569757075717572757375747575757675777578757975807581758275837584758575867587758875897590759175927593759475957596759775987599760076017602760376047605760676077608760976107611761276137614761576167617761876197620762176227623762476257626762776287629763076317632763376347635763676377638763976407641764276437644764576467647764876497650765176527653765476557656765776587659766076617662766376647665766676677668766976707671767276737674767576767677767876797680768176827683768476857686768776887689769076917692769376947695769676977698769977007701770277037704770577067707770877097710771177127713771477157716771777187719772077217722772377247725772677277728772977307731773277337734773577367737773877397740774177427743774477457746774777487749775077517752775377547755775677577758775977607761776277637764776577667767776877697770777177727773777477757776777777787779778077817782778377847785778677877788778977907791779277937794779577967797779877997800780178027803780478057806780778087809781078117812781378147815781678177818781978207821782278237824782578267827782878297830783178327833783478357836783778387839784078417842784378447845784678477848784978507851785278537854785578567857785878597860786178627863786478657866786778687869787078717872787378747875787678777878787978807881788278837884788578867887788878897890789178927893789478957896789778987899790079017902790379047905790679077908790979107911791279137914791579167917791879197920792179227923792479257926792779287929793079317932793379347935793679377938793979407941794279437944794579467947794879497950795179527953795479557956795779587959796079617962796379647965796679677968796979707971797279737974797579767977797879797980798179827983798479857986798779887989799079917992799379947995799679977998799980008001800280038004800580068007800880098010801180128013801480158016801780188019802080218022802380248025802680278028802980308031803280338034803580368037803880398040804180428043804480458046804780488049805080518052805380548055805680578058805980608061806280638064806580668067806880698070807180728073807480758076807780788079808080818082808380848085808680878088808980908091809280938094809580968097809880998100810181028103810481058106810781088109811081118112811381148115811681178118811981208121812281238124812581268127812881298130813181328133813481358136813781388139814081418142814381448145814681478148814981508151815281538154815581568157815881598160816181628163816481658166816781688169817081718172817381748175817681778178817981808181818281838184818581868187818881898190819181928193819481958196819781988199820082018202820382048205820682078208820982108211821282138214821582168217821882198220822182228223822482258226822782288229823082318232823382348235823682378238823982408241824282438244824582468247824882498250825182528253825482558256825782588259826082618262826382648265826682678268826982708271827282738274827582768277827882798280828182828283828482858286828782888289829082918292829382948295829682978298829983008301830283038304830583068307830883098310831183128313831483158316831783188319832083218322832383248325832683278328832983308331833283338334833583368337833883398340834183428343834483458346834783488349835083518352835383548355835683578358835983608361836283638364836583668367836883698370837183728373837483758376837783788379838083818382838383848385838683878388838983908391839283938394839583968397839883998400840184028403840484058406840784088409841084118412841384148415841684178418841984208421842284238424842584268427842884298430843184328433843484358436843784388439844084418442844384448445844684478448844984508451845284538454845584568457845884598460846184628463846484658466846784688469847084718472847384748475847684778478847984808481848284838484848584868487848884898490849184928493849484958496849784988499850085018502850385048505850685078508850985108511851285138514851585168517851885198520852185228523852485258526852785288529853085318532853385348535853685378538853985408541854285438544854585468547854885498550855185528553855485558556855785588559856085618562856385648565856685678568856985708571857285738574857585768577857885798580858185828583858485858586858785888589859085918592859385948595859685978598859986008601860286038604860586068607860886098610861186128613861486158616861786188619862086218622862386248625862686278628862986308631863286338634863586368637863886398640864186428643864486458646864786488649865086518652865386548655865686578658865986608661866286638664866586668667866886698670867186728673867486758676867786788679868086818682868386848685868686878688868986908691869286938694869586968697869886998700870187028703870487058706870787088709871087118712871387148715871687178718871987208721872287238724872587268727872887298730873187328733873487358736873787388739874087418742874387448745874687478748874987508751875287538754875587568757875887598760876187628763876487658766876787688769877087718772877387748775877687778778877987808781878287838784878587868787878887898790879187928793879487958796879787988799880088018802880388048805880688078808880988108811881288138814881588168817881888198820882188228823882488258826882788288829883088318832883388348835883688378838883988408841884288438844884588468847884888498850885188528853885488558856885788588859886088618862886388648865886688678868886988708871887288738874887588768877887888798880888188828883888488858886888788888889889088918892889388948895889688978898889989008901890289038904890589068907890889098910891189128913891489158916891789188919892089218922892389248925892689278928892989308931893289338934893589368937893889398940894189428943894489458946894789488949895089518952895389548955895689578958895989608961896289638964896589668967896889698970897189728973897489758976897789788979898089818982898389848985898689878988898989908991899289938994899589968997899889999000900190029003900490059006900790089009901090119012901390149015901690179018901990209021902290239024902590269027902890299030903190329033903490359036903790389039904090419042904390449045904690479048904990509051905290539054905590569057905890599060906190629063906490659066906790689069907090719072907390749075907690779078907990809081908290839084908590869087908890899090909190929093909490959096909790989099910091019102910391049105910691079108910991109111911291139114911591169117911891199120912191229123912491259126912791289129913091319132913391349135913691379138913991409141914291439144914591469147914891499150915191529153915491559156915791589159916091619162916391649165916691679168916991709171917291739174917591769177917891799180918191829183918491859186918791889189919091919192919391949195919691979198919992009201920292039204920592069207920892099210921192129213921492159216921792189219922092219222922392249225922692279228922992309231923292339234923592369237923892399240924192429243924492459246924792489249925092519252925392549255925692579258925992609261926292639264926592669267926892699270927192729273927492759276927792789279928092819282928392849285928692879288928992909291929292939294929592969297929892999300930193029303930493059306930793089309931093119312931393149315931693179318931993209321932293239324932593269327932893299330933193329333933493359336933793389339934093419342934393449345934693479348934993509351935293539354935593569357935893599360936193629363936493659366936793689369937093719372937393749375937693779378937993809381938293839384938593869387938893899390939193929393939493959396939793989399940094019402940394049405940694079408940994109411941294139414941594169417941894199420942194229423942494259426942794289429943094319432943394349435943694379438943994409441944294439444944594469447944894499450945194529453945494559456945794589459946094619462946394649465946694679468946994709471947294739474947594769477947894799480948194829483948494859486948794889489949094919492949394949495949694979498949995009501950295039504950595069507950895099510951195129513951495159516951795189519952095219522952395249525952695279528952995309531953295339534953595369537953895399540954195429543954495459546954795489549955095519552955395549555955695579558955995609561956295639564956595669567956895699570957195729573957495759576957795789579958095819582958395849585958695879588958995909591959295939594959595969597959895999600960196029603960496059606960796089609961096119612961396149615961696179618961996209621962296239624962596269627962896299630963196329633963496359636963796389639964096419642964396449645964696479648964996509651965296539654965596569657965896599660966196629663966496659666966796689669967096719672967396749675967696779678967996809681968296839684968596869687968896899690969196929693969496959696969796989699970097019702970397049705970697079708970997109711971297139714971597169717971897199720972197229723972497259726972797289729973097319732973397349735973697379738973997409741974297439744974597469747974897499750975197529753975497559756975797589759976097619762976397649765976697679768976997709771977297739774977597769777977897799780978197829783978497859786978797889789979097919792979397949795979697979798979998009801980298039804980598069807980898099810981198129813981498159816981798189819982098219822982398249825982698279828982998309831983298339834983598369837983898399840984198429843984498459846984798489849985098519852985398549855985698579858985998609861986298639864986598669867986898699870987198729873987498759876987798789879988098819882988398849885988698879888988998909891989298939894989598969897989898999900990199029903990499059906990799089909991099119912991399149915991699179918991999209921992299239924992599269927992899299930993199329933993499359936993799389939994099419942994399449945994699479948994999509951995299539954995599569957995899599960996199629963996499659966996799689969997099719972997399749975997699779978997999809981998299839984998599869987998899899990999199929993999499959996999799989999100001000110002100031000410005100061000710008100091001010011100121001310014100151001610017100181001910020100211002210023100241002510026100271002810029100301003110032100331003410035100361003710038100391004010041100421004310044100451004610047100481004910050100511005210053100541005510056100571005810059100601006110062100631006410065100661006710068100691007010071100721007310074100751007610077100781007910080100811008210083100841008510086100871008810089100901009110092100931009410095100961009710098100991010010101101021010310104101051010610107101081010910110101111011210113101141011510116101171011810119101201012110122101231012410125101261012710128101291013010131101321013310134101351013610137101381013910140101411014210143101441014510146101471014810149101501015110152101531015410155101561015710158101591016010161101621016310164101651016610167101681016910170101711017210173101741017510176101771017810179101801018110182101831018410185101861018710188101891019010191101921019310194101951019610197101981019910200102011020210203102041020510206102071020810209102101021110212102131021410215102161021710218102191022010221102221022310224102251022610227102281022910230102311023210233102341023510236102371023810239102401024110242102431024410245102461024710248102491025010251102521025310254102551025610257102581025910260102611026210263102641026510266102671026810269102701027110272102731027410275102761027710278102791028010281102821028310284102851028610287102881028910290102911029210293102941029510296102971029810299103001030110302103031030410305103061030710308103091031010311103121031310314103151031610317103181031910320103211032210323103241032510326103271032810329103301033110332103331033410335103361033710338103391034010341103421034310344103451034610347103481034910350103511035210353103541035510356103571035810359103601036110362103631036410365103661036710368103691037010371103721037310374103751037610377103781037910380103811038210383103841038510386103871038810389103901039110392103931039410395103961039710398103991040010401104021040310404104051040610407104081040910410104111041210413104141041510416104171041810419104201042110422104231042410425104261042710428104291043010431104321043310434104351043610437104381043910440104411044210443104441044510446104471044810449104501045110452104531045410455104561045710458104591046010461104621046310464104651046610467104681046910470104711047210473104741047510476104771047810479104801048110482104831048410485104861048710488104891049010491104921049310494104951049610497104981049910500105011050210503105041050510506105071050810509105101051110512105131051410515105161051710518105191052010521105221052310524105251052610527105281052910530105311053210533105341053510536105371053810539105401054110542105431054410545105461054710548105491055010551105521055310554105551055610557105581055910560105611056210563105641056510566105671056810569105701057110572105731057410575105761057710578105791058010581105821058310584105851058610587105881058910590105911059210593105941059510596105971059810599106001060110602106031060410605106061060710608106091061010611106121061310614106151061610617106181061910620106211062210623106241062510626106271062810629106301063110632106331063410635106361063710638106391064010641106421064310644106451064610647106481064910650106511065210653106541065510656106571065810659106601066110662106631066410665106661066710668106691067010671106721067310674106751067610677106781067910680106811068210683106841068510686106871068810689106901069110692106931069410695106961069710698106991070010701107021070310704107051070610707107081070910710107111071210713107141071510716107171071810719107201072110722107231072410725107261072710728107291073010731107321073310734107351073610737107381073910740107411074210743107441074510746107471074810749107501075110752107531075410755107561075710758107591076010761107621076310764107651076610767107681076910770107711077210773107741077510776107771077810779107801078110782107831078410785107861078710788107891079010791107921079310794107951079610797107981079910800108011080210803108041080510806108071080810809108101081110812108131081410815108161081710818108191082010821108221082310824108251082610827108281082910830108311083210833108341083510836108371083810839108401084110842108431084410845108461084710848108491085010851108521085310854108551085610857108581085910860108611086210863108641086510866108671086810869108701087110872108731087410875108761087710878108791088010881108821088310884108851088610887108881088910890108911089210893108941089510896108971089810899109001090110902109031090410905109061090710908109091091010911109121091310914109151091610917109181091910920109211092210923109241092510926109271092810929109301093110932109331093410935109361093710938109391094010941109421094310944109451094610947109481094910950109511095210953109541095510956109571095810959109601096110962109631096410965109661096710968109691097010971109721097310974109751097610977109781097910980109811098210983109841098510986109871098810989109901099110992109931099410995109961099710998109991100011001110021100311004110051100611007110081100911010110111101211013110141101511016110171101811019110201102111022110231102411025110261102711028110291103011031110321103311034110351103611037110381103911040110411104211043110441104511046110471104811049110501105111052110531105411055110561105711058110591106011061110621106311064110651106611067110681106911070110711107211073110741107511076110771107811079110801108111082110831108411085110861108711088110891109011091110921109311094110951109611097110981109911100111011110211103111041110511106111071110811109111101111111112111131111411115111161111711118111191112011121111221112311124111251112611127111281112911130111311113211133111341113511136111371113811139111401114111142111431114411145111461114711148111491115011151111521115311154111551115611157111581115911160111611116211163111641116511166111671116811169111701117111172111731117411175111761117711178111791118011181111821118311184111851118611187111881118911190111911119211193111941119511196111971119811199112001120111202112031120411205112061120711208112091121011211112121121311214112151121611217112181121911220112211122211223112241122511226112271122811229112301123111232112331123411235112361123711238112391124011241112421124311244112451124611247112481124911250112511125211253112541125511256112571125811259112601126111262112631126411265112661126711268112691127011271112721127311274112751127611277112781127911280112811128211283112841128511286112871128811289112901129111292112931129411295112961129711298112991130011301113021130311304113051130611307113081130911310113111131211313113141131511316113171131811319113201132111322113231132411325113261132711328113291133011331113321133311334113351133611337113381133911340113411134211343113441134511346113471134811349113501135111352113531135411355113561135711358113591136011361113621136311364113651136611367113681136911370113711137211373113741137511376113771137811379113801138111382113831138411385113861138711388113891139011391113921139311394113951139611397113981139911400114011140211403114041140511406114071140811409114101141111412114131141411415114161141711418114191142011421114221142311424114251142611427114281142911430114311143211433114341143511436114371143811439114401144111442114431144411445114461144711448114491145011451114521145311454114551145611457114581145911460114611146211463114641146511466114671146811469114701147111472114731147411475114761147711478114791148011481114821148311484114851148611487114881148911490114911149211493114941149511496114971149811499115001150111502115031150411505115061150711508115091151011511115121151311514115151151611517115181151911520115211152211523115241152511526115271152811529115301153111532115331153411535115361153711538115391154011541115421154311544115451154611547115481154911550115511155211553115541155511556115571155811559115601156111562115631156411565115661156711568115691157011571115721157311574115751157611577115781157911580115811158211583115841158511586115871158811589115901159111592115931159411595115961159711598115991160011601116021160311604116051160611607116081160911610116111161211613116141161511616116171161811619116201162111622116231162411625116261162711628116291163011631116321163311634116351163611637116381163911640116411164211643116441164511646116471164811649116501165111652116531165411655116561165711658116591166011661116621166311664116651166611667116681166911670116711167211673116741167511676116771167811679116801168111682116831168411685116861168711688116891169011691116921169311694116951169611697116981169911700117011170211703117041170511706117071170811709117101171111712117131171411715117161171711718117191172011721117221172311724117251172611727117281172911730117311173211733117341173511736117371173811739117401174111742117431174411745117461174711748117491175011751117521175311754117551175611757117581175911760117611176211763117641176511766117671176811769117701177111772117731177411775117761177711778117791178011781117821178311784117851178611787117881178911790117911179211793117941179511796117971179811799118001180111802118031180411805118061180711808118091181011811118121181311814118151181611817118181181911820118211182211823118241182511826118271182811829118301183111832118331183411835118361183711838118391184011841118421184311844118451184611847118481184911850118511185211853118541185511856118571185811859118601186111862118631186411865118661186711868118691187011871118721187311874118751187611877118781187911880118811188211883118841188511886118871188811889118901189111892118931189411895118961189711898118991190011901119021190311904119051190611907119081190911910119111191211913119141191511916
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
  2. <html>
  3. <!-- This file documents the GNU linker LD
  4. (Arm GNU Toolchain 13.3.Rel1 (Build arm-13.24))
  5. version 2.42.0.
  6. Copyright (C) 1991-2024 Free Software Foundation, Inc.
  7. Permission is granted to copy, distribute and/or modify this document
  8. under the terms of the GNU Free Documentation License, Version 1.3
  9. or any later version published by the Free Software Foundation;
  10. with no Invariant Sections, with no Front-Cover Texts, and with no
  11. Back-Cover Texts. A copy of the license is included in the
  12. section entitled "GNU Free Documentation License". -->
  13. <!-- Created by GNU Texinfo 6.7, http://www.gnu.org/software/texinfo/ -->
  14. <head>
  15. <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  16. <title>LD</title>
  17. <meta name="description" content="LD">
  18. <meta name="keywords" content="LD">
  19. <meta name="resource-type" content="document">
  20. <meta name="distribution" content="global">
  21. <meta name="Generator" content="makeinfo">
  22. <link href="#Top" rel="start" title="Top">
  23. <link href="#LD-Index" rel="index" title="LD Index">
  24. <link href="#SEC_Contents" rel="contents" title="Table of Contents">
  25. <style type="text/css">
  26. <!--
  27. a.summary-letter {text-decoration: none}
  28. blockquote.indentedblock {margin-right: 0em}
  29. div.display {margin-left: 3.2em}
  30. div.example {margin-left: 3.2em}
  31. div.lisp {margin-left: 3.2em}
  32. kbd {font-style: oblique}
  33. pre.display {font-family: inherit}
  34. pre.format {font-family: inherit}
  35. pre.menu-comment {font-family: serif}
  36. pre.menu-preformatted {font-family: serif}
  37. span.nolinebreak {white-space: nowrap}
  38. span.roman {font-family: initial; font-weight: normal}
  39. span.sansserif {font-family: sans-serif; font-weight: normal}
  40. ul.no-bullet {list-style: none}
  41. -->
  42. </style>
  43. </head>
  44. <body lang="en">
  45. <span id="SEC_Contents"></span>
  46. <h2 class="contents-heading">Table of Contents</h2>
  47. <div class="contents">
  48. <ul class="no-bullet">
  49. <li><a id="toc-Overview-1" href="#Overview">1 Overview</a></li>
  50. <li><a id="toc-Invocation-1" href="#Invocation">2 Invocation</a>
  51. <ul class="no-bullet">
  52. <li><a id="toc-Command_002dline-Options" href="#Options">2.1 Command-line Options</a>
  53. <ul class="no-bullet">
  54. <li><a id="toc-Options-Specific-to-i386-PE-Targets" href="#Options-Specific-to-i386-PE-Targets">2.1.1 Options Specific to i386 PE Targets</a></li>
  55. <li><a id="toc-Options-specific-to-C6X-uClinux-targets" href="#Options-specific-to-C6X-uClinux-targets">2.1.2 Options specific to C6X uClinux targets</a></li>
  56. <li><a id="toc-Options-specific-to-C_002dSKY-targets" href="#Options-specific-to-C_002dSKY-targets">2.1.3 Options specific to C-SKY targets</a></li>
  57. <li><a id="toc-Options-specific-to-Motorola-68HC11-and-68HC12-targets" href="#Options-specific-to-Motorola-68HC11-and-68HC12-targets">2.1.4 Options specific to Motorola 68HC11 and 68HC12 targets</a></li>
  58. <li><a id="toc-Options-specific-to-Motorola-68K-target" href="#Options-specific-to-Motorola-68K-target">2.1.5 Options specific to Motorola 68K target</a></li>
  59. <li><a id="toc-Options-specific-to-MIPS-targets" href="#Options-specific-to-MIPS-targets">2.1.6 Options specific to MIPS targets</a></li>
  60. <li><a id="toc-Options-specific-to-PDP11-targets" href="#Options-specific-to-PDP11-targets">2.1.7 Options specific to PDP11 targets</a></li>
  61. </ul></li>
  62. <li><a id="toc-Environment-Variables" href="#Environment">2.2 Environment Variables</a></li>
  63. </ul></li>
  64. <li><a id="toc-Linker-Scripts" href="#Scripts">3 Linker Scripts</a>
  65. <ul class="no-bullet">
  66. <li><a id="toc-Basic-Linker-Script-Concepts" href="#Basic-Script-Concepts">3.1 Basic Linker Script Concepts</a></li>
  67. <li><a id="toc-Linker-Script-Format" href="#Script-Format">3.2 Linker Script Format</a></li>
  68. <li><a id="toc-Simple-Linker-Script-Example" href="#Simple-Example">3.3 Simple Linker Script Example</a></li>
  69. <li><a id="toc-Simple-Linker-Script-Commands" href="#Simple-Commands">3.4 Simple Linker Script Commands</a>
  70. <ul class="no-bullet">
  71. <li><a id="toc-Setting-the-Entry-Point" href="#Entry-Point">3.4.1 Setting the Entry Point</a></li>
  72. <li><a id="toc-Commands-Dealing-with-Files" href="#File-Commands">3.4.2 Commands Dealing with Files</a></li>
  73. <li><a id="toc-Commands-Dealing-with-Object-File-Formats" href="#Format-Commands">3.4.3 Commands Dealing with Object File Formats</a></li>
  74. <li><a id="toc-Assign-alias-names-to-memory-regions" href="#REGION_005fALIAS">3.4.4 Assign alias names to memory regions</a></li>
  75. <li><a id="toc-Other-Linker-Script-Commands" href="#Miscellaneous-Commands">3.4.5 Other Linker Script Commands</a></li>
  76. </ul></li>
  77. <li><a id="toc-Assigning-Values-to-Symbols" href="#Assignments">3.5 Assigning Values to Symbols</a>
  78. <ul class="no-bullet">
  79. <li><a id="toc-Simple-Assignments-1" href="#Simple-Assignments">3.5.1 Simple Assignments</a></li>
  80. <li><a id="toc-HIDDEN-1" href="#HIDDEN">3.5.2 HIDDEN</a></li>
  81. <li><a id="toc-PROVIDE-1" href="#PROVIDE">3.5.3 PROVIDE</a></li>
  82. <li><a id="toc-PROVIDE_005fHIDDEN-1" href="#PROVIDE_005fHIDDEN">3.5.4 PROVIDE_HIDDEN</a></li>
  83. <li><a id="toc-Source-Code-Reference-1" href="#Source-Code-Reference">3.5.5 Source Code Reference</a></li>
  84. </ul></li>
  85. <li><a id="toc-SECTIONS-Command" href="#SECTIONS">3.6 SECTIONS Command</a>
  86. <ul class="no-bullet">
  87. <li><a id="toc-Output-Section-Description-1" href="#Output-Section-Description">3.6.1 Output Section Description</a></li>
  88. <li><a id="toc-Output-Section-Name-1" href="#Output-Section-Name">3.6.2 Output Section Name</a></li>
  89. <li><a id="toc-Output-Section-Address-1" href="#Output-Section-Address">3.6.3 Output Section Address</a></li>
  90. <li><a id="toc-Input-Section-Description" href="#Input-Section">3.6.4 Input Section Description</a>
  91. <ul class="no-bullet">
  92. <li><a id="toc-Input-Section-Basics-1" href="#Input-Section-Basics">3.6.4.1 Input Section Basics</a></li>
  93. <li><a id="toc-Input-Section-Wildcard-Patterns" href="#Input-Section-Wildcards">3.6.4.2 Input Section Wildcard Patterns</a></li>
  94. <li><a id="toc-Input-Section-for-Common-Symbols" href="#Input-Section-Common">3.6.4.3 Input Section for Common Symbols</a></li>
  95. <li><a id="toc-Input-Section-and-Garbage-Collection" href="#Input-Section-Keep">3.6.4.4 Input Section and Garbage Collection</a></li>
  96. <li><a id="toc-Input-Section-Example-1" href="#Input-Section-Example">3.6.4.5 Input Section Example</a></li>
  97. </ul></li>
  98. <li><a id="toc-Output-Section-Data-1" href="#Output-Section-Data">3.6.5 Output Section Data</a></li>
  99. <li><a id="toc-Output-Section-Keywords-1" href="#Output-Section-Keywords">3.6.6 Output Section Keywords</a></li>
  100. <li><a id="toc-Output-Section-Discarding-1" href="#Output-Section-Discarding">3.6.7 Output Section Discarding</a></li>
  101. <li><a id="toc-Output-Section-Attributes-1" href="#Output-Section-Attributes">3.6.8 Output Section Attributes</a>
  102. <ul class="no-bullet">
  103. <li><a id="toc-Output-Section-Type-1" href="#Output-Section-Type">3.6.8.1 Output Section Type</a></li>
  104. <li><a id="toc-Output-Section-LMA-1" href="#Output-Section-LMA">3.6.8.2 Output Section LMA</a></li>
  105. <li><a id="toc-Forced-Output-Alignment-1" href="#Forced-Output-Alignment">3.6.8.3 Forced Output Alignment</a></li>
  106. <li><a id="toc-Forced-Input-Alignment-1" href="#Forced-Input-Alignment">3.6.8.4 Forced Input Alignment</a></li>
  107. <li><a id="toc-Output-Section-Constraint-1" href="#Output-Section-Constraint">3.6.8.5 Output Section Constraint</a></li>
  108. <li><a id="toc-Output-Section-Region-1" href="#Output-Section-Region">3.6.8.6 Output Section Region</a></li>
  109. <li><a id="toc-Output-Section-Phdr-1" href="#Output-Section-Phdr">3.6.8.7 Output Section Phdr</a></li>
  110. <li><a id="toc-Output-Section-Fill-1" href="#Output-Section-Fill">3.6.8.8 Output Section Fill</a></li>
  111. </ul></li>
  112. <li><a id="toc-Overlay-Description-1" href="#Overlay-Description">3.6.9 Overlay Description</a></li>
  113. </ul></li>
  114. <li><a id="toc-MEMORY-Command" href="#MEMORY">3.7 MEMORY Command</a></li>
  115. <li><a id="toc-PHDRS-Command" href="#PHDRS">3.8 PHDRS Command</a></li>
  116. <li><a id="toc-VERSION-Command" href="#VERSION">3.9 VERSION Command</a></li>
  117. <li><a id="toc-Expressions-in-Linker-Scripts" href="#Expressions">3.10 Expressions in Linker Scripts</a>
  118. <ul class="no-bullet">
  119. <li><a id="toc-Constants-1" href="#Constants">3.10.1 Constants</a></li>
  120. <li><a id="toc-Symbolic-Constants-1" href="#Symbolic-Constants">3.10.2 Symbolic Constants</a></li>
  121. <li><a id="toc-Symbol-Names" href="#Symbols">3.10.3 Symbol Names</a></li>
  122. <li><a id="toc-Orphan-Sections-1" href="#Orphan-Sections">3.10.4 Orphan Sections</a></li>
  123. <li><a id="toc-The-Location-Counter" href="#Location-Counter">3.10.5 The Location Counter</a></li>
  124. <li><a id="toc-Operators-1" href="#Operators">3.10.6 Operators</a></li>
  125. <li><a id="toc-Evaluation-1" href="#Evaluation">3.10.7 Evaluation</a></li>
  126. <li><a id="toc-The-Section-of-an-Expression" href="#Expression-Section">3.10.8 The Section of an Expression</a></li>
  127. <li><a id="toc-Builtin-Functions-1" href="#Builtin-Functions">3.10.9 Builtin Functions</a></li>
  128. </ul></li>
  129. <li><a id="toc-Implicit-Linker-Scripts-1" href="#Implicit-Linker-Scripts">3.11 Implicit Linker Scripts</a></li>
  130. </ul></li>
  131. <li><a id="toc-Linker-Plugins" href="#Plugins">4 Linker Plugins</a>
  132. <ul class="no-bullet">
  133. <li><a id="toc-Static-Library-Dependencies-Plugin" href="#libdep-Plugin">4.1 Static Library Dependencies Plugin</a></li>
  134. </ul></li>
  135. <li><a id="toc-Special-Sections-1" href="#Special-Sections">5 Special Sections</a></li>
  136. <li><a id="toc-Machine-Dependent-Features" href="#Machine-Dependent">6 Machine Dependent Features</a>
  137. <ul class="no-bullet">
  138. <li><a id="toc-ld-and-the-H8_002f300" href="#H8_002f300">6.1 <code>ld</code> and the H8/300</a></li>
  139. <li><a id="toc-ld-and-the-Motorola-68HC11-and-68HC12-families" href="#M68HC11_002f68HC12">6.2 <code>ld</code> and the Motorola 68HC11 and 68HC12 families</a>
  140. <ul class="no-bullet">
  141. <li><a id="toc-Linker-Relaxation" href="#Linker-Relaxation">6.2.1 Linker Relaxation</a></li>
  142. <li><a id="toc-Trampoline-Generation" href="#Trampoline-Generation">6.2.2 Trampoline Generation</a></li>
  143. </ul></li>
  144. <li><a id="toc-ld-and-the-ARM-family" href="#ARM">6.3 <code>ld</code> and the ARM family</a></li>
  145. <li><a id="toc-ld-and-HPPA-32_002dbit-ELF-Support" href="#HPPA-ELF32">6.4 <code>ld</code> and HPPA 32-bit ELF Support</a></li>
  146. <li><a id="toc-ld-and-the-Motorola-68K-family" href="#M68K">6.5 <code>ld</code> and the Motorola 68K family</a></li>
  147. <li><a id="toc-ld-and-the-MIPS-family" href="#MIPS">6.6 <code>ld</code> and the MIPS family</a></li>
  148. <li><a id="toc-ld-and-MMIX" href="#MMIX">6.7 <code>ld</code> and MMIX</a></li>
  149. <li><a id="toc-ld-and-MSP430" href="#MSP430">6.8 <code>ld</code> and MSP430</a></li>
  150. <li><a id="toc-ld-and-NDS32" href="#NDS32">6.9 <code>ld</code> and NDS32</a></li>
  151. <li><a id="toc-ld-and-the-Altera-Nios-II" href="#Nios-II">6.10 <code>ld</code> and the Altera Nios II</a></li>
  152. <li><a id="toc-ld-and-PowerPC-32_002dbit-ELF-Support" href="#PowerPC-ELF32">6.11 <code>ld</code> and PowerPC 32-bit ELF Support</a></li>
  153. <li><a id="toc-ld-and-PowerPC64-64_002dbit-ELF-Support" href="#PowerPC64-ELF64">6.12 <code>ld</code> and PowerPC64 64-bit ELF Support</a></li>
  154. <li><a id="toc-ld-and-S_002f390-ELF-Support" href="#S_002f390-ELF">6.13 <code>ld</code> and S/390 ELF Support</a></li>
  155. <li><a id="toc-ld-and-SPU-ELF-Support" href="#SPU-ELF">6.14 <code>ld</code> and SPU ELF Support</a></li>
  156. <li><a id="toc-ld_0027s-Support-for-Various-TI-COFF-Versions" href="#TI-COFF">6.15 <code>ld</code>&rsquo;s Support for Various TI COFF Versions</a></li>
  157. <li><a id="toc-ld-and-WIN32-_0028cygwin_002fmingw_0029" href="#WIN32">6.16 <code>ld</code> and WIN32 (cygwin/mingw)</a></li>
  158. <li><a id="toc-ld-and-Xtensa-Processors" href="#Xtensa">6.17 <code>ld</code> and Xtensa Processors</a></li>
  159. </ul></li>
  160. <li><a id="toc-BFD-1" href="#BFD">7 BFD</a>
  161. <ul class="no-bullet">
  162. <li><a id="toc-How-It-Works_003a-An-Outline-of-BFD" href="#BFD-outline">7.1 How It Works: An Outline of BFD</a>
  163. <ul class="no-bullet">
  164. <li><a id="toc-Information-Loss" href="#BFD-information-loss">7.1.1 Information Loss</a></li>
  165. <li><a id="toc-The-BFD-canonical-object_002dfile-format" href="#Canonical-format">7.1.2 The BFD canonical object-file format</a></li>
  166. </ul></li>
  167. </ul></li>
  168. <li><a id="toc-Reporting-Bugs-1" href="#Reporting-Bugs">8 Reporting Bugs</a>
  169. <ul class="no-bullet">
  170. <li><a id="toc-Have-You-Found-a-Bug_003f" href="#Bug-Criteria">8.1 Have You Found a Bug?</a></li>
  171. <li><a id="toc-How-to-Report-Bugs" href="#Bug-Reporting">8.2 How to Report Bugs</a></li>
  172. </ul></li>
  173. <li><a id="toc-MRI-Compatible-Script-Files" href="#MRI">Appendix A MRI Compatible Script Files</a></li>
  174. <li><a id="toc-GNU-Free-Documentation-License-1" href="#GNU-Free-Documentation-License">Appendix B GNU Free Documentation License</a></li>
  175. <li><a id="toc-LD-Index-1" href="#LD-Index" rel="index">LD Index</a></li>
  176. </ul>
  177. </div>
  178. <span id="Top"></span><div class="header">
  179. <p>
  180. Next: <a href="#Overview" accesskey="n" rel="next">Overview</a> &nbsp; [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#LD-Index" title="Index" rel="index">Index</a>]</p>
  181. </div>
  182. <span id="LD"></span><h1 class="top">LD</h1>
  183. <p>This file documents the <small>GNU</small> linker ld
  184. (Arm GNU Toolchain 13.3.Rel1 (Build arm-13.24))
  185. version 2.42.0.
  186. </p>
  187. <p>This document is distributed under the terms of the GNU Free
  188. Documentation License version 1.3. A copy of the license is included
  189. in the section entitled &ldquo;GNU Free Documentation License&rdquo;.
  190. </p>
  191. <table class="menu" border="0" cellspacing="0">
  192. <tr><td align="left" valign="top">&bull; <a href="#Overview" accesskey="1">Overview</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">Overview
  193. </td></tr>
  194. <tr><td align="left" valign="top">&bull; <a href="#Invocation" accesskey="2">Invocation</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">Invocation
  195. </td></tr>
  196. <tr><td align="left" valign="top">&bull; <a href="#Scripts" accesskey="3">Scripts</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">Linker Scripts
  197. </td></tr>
  198. <tr><td align="left" valign="top">&bull; <a href="#Plugins" accesskey="4">Plugins</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">Linker Plugins
  199. </td></tr>
  200. <tr><td align="left" valign="top">&bull; <a href="#Special-Sections" accesskey="5">Special Sections</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">Special Sections
  201. </td></tr>
  202. <tr><td align="left" valign="top">&bull; <a href="#Machine-Dependent" accesskey="6">Machine Dependent</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">Machine Dependent Features
  203. </td></tr>
  204. <tr><td align="left" valign="top">&bull; <a href="#BFD" accesskey="7">BFD</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">BFD
  205. </td></tr>
  206. <tr><th colspan="3" align="left" valign="top"><pre class="menu-comment">
  207. </pre></th></tr><tr><td align="left" valign="top">&bull; <a href="#Reporting-Bugs" accesskey="8">Reporting Bugs</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">Reporting Bugs
  208. </td></tr>
  209. <tr><td align="left" valign="top">&bull; <a href="#MRI" accesskey="9">MRI</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">MRI Compatible Script Files
  210. </td></tr>
  211. <tr><td align="left" valign="top">&bull; <a href="#GNU-Free-Documentation-License">GNU Free Documentation License</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">GNU Free Documentation License
  212. </td></tr>
  213. <tr><td align="left" valign="top">&bull; <a href="#LD-Index" rel="index">LD Index</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">LD Index
  214. </td></tr>
  215. </table>
  216. <hr>
  217. <span id="Overview"></span><div class="header">
  218. <p>
  219. Next: <a href="#Invocation" accesskey="n" rel="next">Invocation</a>, Previous: <a href="#Top" accesskey="p" rel="prev">Top</a>, Up: <a href="#Top" accesskey="u" rel="up">Top</a> &nbsp; [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#LD-Index" title="Index" rel="index">Index</a>]</p>
  220. </div>
  221. <span id="Overview-1"></span><h2 class="chapter">1 Overview</h2>
  222. <span id="index-GNU-linker"></span>
  223. <span id="index-what-is-this_003f"></span>
  224. <p><code>ld</code> combines a number of object and archive files, relocates
  225. their data and ties up symbol references. Usually the last step in
  226. compiling a program is to run <code>ld</code>.
  227. </p>
  228. <p><code>ld</code> accepts Linker Command Language files written in
  229. a superset of AT&amp;T&rsquo;s Link Editor Command Language syntax,
  230. to provide explicit and total control over the linking process.
  231. </p>
  232. <p>This version of <code>ld</code> uses the general purpose BFD libraries
  233. to operate on object files. This allows <code>ld</code> to read, combine, and
  234. write object files in many different formats&mdash;for example, COFF or
  235. <code>a.out</code>. Different formats may be linked together to produce any
  236. available kind of object file. See <a href="#BFD">BFD</a>, for more information.
  237. </p>
  238. <p>Aside from its flexibility, the <small>GNU</small> linker is more helpful than other
  239. linkers in providing diagnostic information. Many linkers abandon
  240. execution immediately upon encountering an error; whenever possible,
  241. <code>ld</code> continues executing, allowing you to identify other errors
  242. (or, in some cases, to get an output file in spite of the error).
  243. </p>
  244. <hr>
  245. <span id="Invocation"></span><div class="header">
  246. <p>
  247. Next: <a href="#Scripts" accesskey="n" rel="next">Scripts</a>, Previous: <a href="#Overview" accesskey="p" rel="prev">Overview</a>, Up: <a href="#Top" accesskey="u" rel="up">Top</a> &nbsp; [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#LD-Index" title="Index" rel="index">Index</a>]</p>
  248. </div>
  249. <span id="Invocation-1"></span><h2 class="chapter">2 Invocation</h2>
  250. <p>The <small>GNU</small> linker <code>ld</code> is meant to cover a broad range of situations,
  251. and to be as compatible as possible with other linkers. As a result,
  252. you have many choices to control its behavior.
  253. </p>
  254. <table class="menu" border="0" cellspacing="0">
  255. <tr><td align="left" valign="top">&bull; <a href="#Options" accesskey="1">Options</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">Command-line Options
  256. </td></tr>
  257. <tr><td align="left" valign="top">&bull; <a href="#Environment" accesskey="2">Environment</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">Environment Variables
  258. </td></tr>
  259. </table>
  260. <hr>
  261. <span id="Options"></span><div class="header">
  262. <p>
  263. Next: <a href="#Environment" accesskey="n" rel="next">Environment</a>, Up: <a href="#Invocation" accesskey="u" rel="up">Invocation</a> &nbsp; [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#LD-Index" title="Index" rel="index">Index</a>]</p>
  264. </div>
  265. <span id="Command_002dline-Options"></span><h3 class="section">2.1 Command-line Options</h3>
  266. <span id="index-command-line"></span>
  267. <span id="index-options"></span>
  268. <p>The linker supports a plethora of command-line options, but in actual
  269. practice few of them are used in any particular context.
  270. <span id="index-standard-Unix-system"></span>
  271. For instance, a frequent use of <code>ld</code> is to link standard Unix
  272. object files on a standard, supported Unix system. On such a system, to
  273. link a file <code>hello.o</code>:
  274. </p>
  275. <div class="example">
  276. <pre class="example">ld -o <var>output</var> /lib/crt0.o hello.o -lc
  277. </pre></div>
  278. <p>This tells <code>ld</code> to produce a file called <var>output</var> as the
  279. result of linking the file <code>/lib/crt0.o</code> with <code>hello.o</code> and
  280. the library <code>libc.a</code>, which will come from the standard search
  281. directories. (See the discussion of the &lsquo;<samp>-l</samp>&rsquo; option below.)
  282. </p>
  283. <p>Some of the command-line options to <code>ld</code> may be specified at any
  284. point in the command line. However, options which refer to files, such
  285. as &lsquo;<samp>-l</samp>&rsquo; or &lsquo;<samp>-T</samp>&rsquo;, cause the file to be read at the point at
  286. which the option appears in the command line, relative to the object
  287. files and other file options. Repeating non-file options with a
  288. different argument will either have no further effect, or override prior
  289. occurrences (those further to the left on the command line) of that
  290. option. Options which may be meaningfully specified more than once are
  291. noted in the descriptions below.
  292. </p>
  293. <span id="index-object-files"></span>
  294. <p>Non-option arguments are object files or archives which are to be linked
  295. together. They may follow, precede, or be mixed in with command-line
  296. options, except that an object file argument may not be placed between
  297. an option and its argument.
  298. </p>
  299. <p>Usually the linker is invoked with at least one object file, but you can
  300. specify other forms of binary input files using &lsquo;<samp>-l</samp>&rsquo;, &lsquo;<samp>-R</samp>&rsquo;,
  301. and the script command language. If <em>no</em> binary input files at all
  302. are specified, the linker does not produce any output, and issues the
  303. message &lsquo;<samp>No input files</samp>&rsquo;.
  304. </p>
  305. <p>If the linker cannot recognize the format of an object file, it will
  306. assume that it is a linker script. A script specified in this way
  307. augments the main linker script used for the link (either the default
  308. linker script or the one specified by using &lsquo;<samp>-T</samp>&rsquo;). This feature
  309. permits the linker to link against a file which appears to be an object
  310. or an archive, but actually merely defines some symbol values, or uses
  311. <code>INPUT</code> or <code>GROUP</code> to load other objects. Specifying a
  312. script in this way merely augments the main linker script, with the
  313. extra commands placed after the main script; use the &lsquo;<samp>-T</samp>&rsquo; option
  314. to replace the default linker script entirely, but note the effect of
  315. the <code>INSERT</code> command. See <a href="#Scripts">Scripts</a>.
  316. </p>
  317. <p>For options whose names are a single letter,
  318. option arguments must either follow the option letter without intervening
  319. whitespace, or be given as separate arguments immediately following the
  320. option that requires them.
  321. </p>
  322. <p>For options whose names are multiple letters, either one dash or two can
  323. precede the option name; for example, &lsquo;<samp>-trace-symbol</samp>&rsquo; and
  324. &lsquo;<samp>--trace-symbol</samp>&rsquo; are equivalent. Note&mdash;there is one exception to
  325. this rule. Multiple letter options that start with a lower case &rsquo;o&rsquo; can
  326. only be preceded by two dashes. This is to reduce confusion with the
  327. &lsquo;<samp>-o</samp>&rsquo; option. So for example &lsquo;<samp>-omagic</samp>&rsquo; sets the output file
  328. name to &lsquo;<samp>magic</samp>&rsquo; whereas &lsquo;<samp>--omagic</samp>&rsquo; sets the NMAGIC flag on the
  329. output.
  330. </p>
  331. <p>Arguments to multiple-letter options must either be separated from the
  332. option name by an equals sign, or be given as separate arguments
  333. immediately following the option that requires them. For example,
  334. &lsquo;<samp>--trace-symbol foo</samp>&rsquo; and &lsquo;<samp>--trace-symbol=foo</samp>&rsquo; are equivalent.
  335. Unique abbreviations of the names of multiple-letter options are
  336. accepted.
  337. </p>
  338. <p>Note&mdash;if the linker is being invoked indirectly, via a compiler driver
  339. (e.g. &lsquo;<samp>gcc</samp>&rsquo;) then all the linker command-line options should be
  340. prefixed by &lsquo;<samp>-Wl,</samp>&rsquo; (or whatever is appropriate for the particular
  341. compiler driver) like this:
  342. </p>
  343. <div class="example">
  344. <pre class="example"> gcc -Wl,--start-group foo.o bar.o -Wl,--end-group
  345. </pre></div>
  346. <p>This is important, because otherwise the compiler driver program may
  347. silently drop the linker options, resulting in a bad link. Confusion
  348. may also arise when passing options that require values through a
  349. driver, as the use of a space between option and argument acts as
  350. a separator, and causes the driver to pass only the option to the linker
  351. and the argument to the compiler. In this case, it is simplest to use
  352. the joined forms of both single- and multiple-letter options, such as:
  353. </p>
  354. <div class="example">
  355. <pre class="example"> gcc foo.o bar.o -Wl,-eENTRY -Wl,-Map=a.map
  356. </pre></div>
  357. <p>Here is a table of the generic command-line switches accepted by the GNU
  358. linker:
  359. </p>
  360. <dl compact="compact">
  361. <dt><code>@<var>file</var></code></dt>
  362. <dd><p>Read command-line options from <var>file</var>. The options read are
  363. inserted in place of the original @<var>file</var> option. If <var>file</var>
  364. does not exist, or cannot be read, then the option will be treated
  365. literally, and not removed.
  366. </p>
  367. <p>Options in <var>file</var> are separated by whitespace. A whitespace
  368. character may be included in an option by surrounding the entire
  369. option in either single or double quotes. Any character (including a
  370. backslash) may be included by prefixing the character to be included
  371. with a backslash. The <var>file</var> may itself contain additional
  372. @<var>file</var> options; any such options will be processed recursively.
  373. </p>
  374. <span id="index-_002da-keyword"></span>
  375. </dd>
  376. <dt><code>-a <var>keyword</var></code></dt>
  377. <dd><p>This option is supported for HP/UX compatibility. The <var>keyword</var>
  378. argument must be one of the strings &lsquo;<samp>archive</samp>&rsquo;, &lsquo;<samp>shared</samp>&rsquo;, or
  379. &lsquo;<samp>default</samp>&rsquo;. &lsquo;<samp>-aarchive</samp>&rsquo; is functionally equivalent to
  380. &lsquo;<samp>-Bstatic</samp>&rsquo;, and the other two keywords are functionally equivalent
  381. to &lsquo;<samp>-Bdynamic</samp>&rsquo;. This option may be used any number of times.
  382. </p>
  383. <span id="index-_002d_002daudit-AUDITLIB"></span>
  384. </dd>
  385. <dt><code>--audit <var>AUDITLIB</var></code></dt>
  386. <dd><p>Adds <var>AUDITLIB</var> to the <code>DT_AUDIT</code> entry of the dynamic section.
  387. <var>AUDITLIB</var> is not checked for existence, nor will it use the DT_SONAME
  388. specified in the library. If specified multiple times <code>DT_AUDIT</code>
  389. will contain a colon separated list of audit interfaces to use. If the linker
  390. finds an object with an audit entry while searching for shared libraries,
  391. it will add a corresponding <code>DT_DEPAUDIT</code> entry in the output file.
  392. This option is only meaningful on ELF platforms supporting the rtld-audit
  393. interface.
  394. </p>
  395. <span id="index-binary-input-format"></span>
  396. <span id="index-_002db-format"></span>
  397. <span id="index-_002d_002dformat_003dformat"></span>
  398. <span id="index-input-format"></span>
  399. <span id="index-input-format-1"></span>
  400. </dd>
  401. <dt><code>-b <var>input-format</var></code></dt>
  402. <dt><code>--format=<var>input-format</var></code></dt>
  403. <dd><p><code>ld</code> may be configured to support more than one kind of object
  404. file. If your <code>ld</code> is configured this way, you can use the
  405. &lsquo;<samp>-b</samp>&rsquo; option to specify the binary format for input object files
  406. that follow this option on the command line. Even when <code>ld</code> is
  407. configured to support alternative object formats, you don&rsquo;t usually need
  408. to specify this, as <code>ld</code> should be configured to expect as a
  409. default input format the most usual format on each machine.
  410. <var>input-format</var> is a text string, the name of a particular format
  411. supported by the BFD libraries. (You can list the available binary
  412. formats with &lsquo;<samp>objdump -i</samp>&rsquo;.)
  413. See <a href="#BFD">BFD</a>.
  414. </p>
  415. <p>You may want to use this option if you are linking files with an unusual
  416. binary format. You can also use &lsquo;<samp>-b</samp>&rsquo; to switch formats explicitly (when
  417. linking object files of different formats), by including
  418. &lsquo;<samp>-b <var>input-format</var></samp>&rsquo; before each group of object files in a
  419. particular format.
  420. </p>
  421. <p>The default format is taken from the environment variable
  422. <code>GNUTARGET</code>.
  423. See <a href="#Environment">Environment</a>.
  424. You can also define the input format from a script, using the command
  425. <code>TARGET</code>;
  426. see <a href="#Format-Commands">Format Commands</a>.
  427. </p>
  428. <span id="index-_002dc-MRI_002dcmdfile"></span>
  429. <span id="index-_002d_002dmri_002dscript_003dMRI_002dcmdfile"></span>
  430. <span id="index-compatibility_002c-MRI"></span>
  431. </dd>
  432. <dt><code>-c <var>MRI-commandfile</var></code></dt>
  433. <dt><code>--mri-script=<var>MRI-commandfile</var></code></dt>
  434. <dd><p>For compatibility with linkers produced by MRI, <code>ld</code> accepts script
  435. files written in an alternate, restricted command language, described in
  436. <a href="#MRI">MRI Compatible Script Files</a>.
  437. Introduce MRI script files with
  438. the option &lsquo;<samp>-c</samp>&rsquo;; use the &lsquo;<samp>-T</samp>&rsquo; option to run linker
  439. scripts written in the general-purpose <code>ld</code> scripting language.
  440. If <var>MRI-cmdfile</var> does not exist, <code>ld</code> looks for it in the directories
  441. specified by any &lsquo;<samp>-L</samp>&rsquo; options.
  442. </p>
  443. <span id="index-common-allocation"></span>
  444. <span id="index-_002dd"></span>
  445. <span id="index-_002ddc"></span>
  446. <span id="index-_002ddp"></span>
  447. </dd>
  448. <dt><code>-d</code></dt>
  449. <dt><code>-dc</code></dt>
  450. <dt><code>-dp</code></dt>
  451. <dd><p>These three options are equivalent; multiple forms are supported for
  452. compatibility with other linkers. They assign space to common symbols
  453. even if a relocatable output file is specified (with &lsquo;<samp>-r</samp>&rsquo;). The
  454. script command <code>FORCE_COMMON_ALLOCATION</code> has the same effect.
  455. See <a href="#Miscellaneous-Commands">Miscellaneous Commands</a>.
  456. </p>
  457. <span id="index-_002d_002ddepaudit-AUDITLIB"></span>
  458. <span id="index-_002dP-AUDITLIB"></span>
  459. </dd>
  460. <dt><code>--depaudit <var>AUDITLIB</var></code></dt>
  461. <dt><code>-P <var>AUDITLIB</var></code></dt>
  462. <dd><p>Adds <var>AUDITLIB</var> to the <code>DT_DEPAUDIT</code> entry of the dynamic section.
  463. <var>AUDITLIB</var> is not checked for existence, nor will it use the DT_SONAME
  464. specified in the library. If specified multiple times <code>DT_DEPAUDIT</code>
  465. will contain a colon separated list of audit interfaces to use. This
  466. option is only meaningful on ELF platforms supporting the rtld-audit interface.
  467. The -P option is provided for Solaris compatibility.
  468. </p>
  469. <span id="index-_002d_002denable_002dlinker_002dversion"></span>
  470. </dd>
  471. <dt><code>--enable-linker-version</code></dt>
  472. <dd><p>Enables the <code>LINKER_VERSION</code> linker script directive, described
  473. in <a href="#Output-Section-Data">Output Section Data</a>. If this directive is used in a linker
  474. script and this option has been enabled then a string containing the
  475. linker version will be inserted at the current point.
  476. </p>
  477. <p>Note - this location of this option on the linker command line is
  478. significant. It will only affect linker scripts that come after it on
  479. the command line, or which are built into the linker.
  480. </p>
  481. <span id="index-_002d_002ddisable_002dlinker_002dversion"></span>
  482. </dd>
  483. <dt><code>--disable-linker-version</code></dt>
  484. <dd><p>Disables the <code>LINKER_VERSION</code> linker script directive, so that it
  485. does not insert a version string. This is the default.
  486. </p>
  487. <span id="index-_002d_002denable_002dnon_002dcontiguous_002dregions"></span>
  488. </dd>
  489. <dt><code>--enable-non-contiguous-regions</code></dt>
  490. <dd><p>This option avoids generating an error if an input section does not
  491. fit a matching output section. The linker tries to allocate the input
  492. section to subseque nt matching output sections, and generates an
  493. error only if no output section is large enough. This is useful when
  494. several non-contiguous memory regions are available and the input
  495. section does not require a particular one. The order in which input
  496. sections are evaluated does not change, for instance:
  497. </p>
  498. <div class="example">
  499. <pre class="example"> MEMORY {
  500. MEM1 (rwx) : ORIGIN = 0x1000, LENGTH = 0x14
  501. MEM2 (rwx) : ORIGIN = 0x1000, LENGTH = 0x40
  502. MEM3 (rwx) : ORIGIN = 0x2000, LENGTH = 0x40
  503. }
  504. SECTIONS {
  505. mem1 : { *(.data.*); } &gt; MEM1
  506. mem2 : { *(.data.*); } &gt; MEM2
  507. mem3 : { *(.data.*); } &gt; MEM3
  508. }
  509. with input sections:
  510. .data.1: size 8
  511. .data.2: size 0x10
  512. .data.3: size 4
  513. results in .data.1 affected to mem1, and .data.2 and .data.3
  514. affected to mem2, even though .data.3 would fit in mem3.
  515. </pre></div>
  516. <p>This option is incompatible with INSERT statements because it changes
  517. the way input sections are mapped to output sections.
  518. </p>
  519. <span id="index-_002d_002denable_002dnon_002dcontiguous_002dregions_002dwarnings"></span>
  520. </dd>
  521. <dt><code>--enable-non-contiguous-regions-warnings</code></dt>
  522. <dd><p>This option enables warnings when
  523. <code>--enable-non-contiguous-regions</code> allows possibly unexpected
  524. matches in sections mapping, potentially leading to silently
  525. discarding a section instead of failing because it does not fit any
  526. output region.
  527. </p>
  528. <span id="index-entry-point_002c-from-command-line"></span>
  529. <span id="index-_002de-entry"></span>
  530. <span id="index-_002d_002dentry_003dentry"></span>
  531. </dd>
  532. <dt><code>-e <var>entry</var></code></dt>
  533. <dt><code>--entry=<var>entry</var></code></dt>
  534. <dd><p>Use <var>entry</var> as the explicit symbol for beginning execution of your
  535. program, rather than the default entry point. If there is no symbol
  536. named <var>entry</var>, the linker will try to parse <var>entry</var> as a number,
  537. and use that as the entry address (the number will be interpreted in
  538. base 10; you may use a leading &lsquo;<samp>0x</samp>&rsquo; for base 16, or a leading
  539. &lsquo;<samp>0</samp>&rsquo; for base 8). See <a href="#Entry-Point">Entry Point</a>, for a discussion of defaults
  540. and other ways of specifying the entry point.
  541. </p>
  542. <span id="index-_002d_002dexclude_002dlibs"></span>
  543. </dd>
  544. <dt><code>--exclude-libs <var>lib</var>,<var>lib</var>,...</code></dt>
  545. <dd><p>Specifies a list of archive libraries from which symbols should not be automatically
  546. exported. The library names may be delimited by commas or colons. Specifying
  547. <code>--exclude-libs ALL</code> excludes symbols in all archive libraries from
  548. automatic export. This option is available only for the i386 PE targeted
  549. port of the linker and for ELF targeted ports. For i386 PE, symbols
  550. explicitly listed in a .def file are still exported, regardless of this
  551. option. For ELF targeted ports, symbols affected by this option will
  552. be treated as hidden.
  553. </p>
  554. <span id="index-_002d_002dexclude_002dmodules_002dfor_002dimplib"></span>
  555. </dd>
  556. <dt><code>--exclude-modules-for-implib <var>module</var>,<var>module</var>,...</code></dt>
  557. <dd><p>Specifies a list of object files or archive members, from which symbols
  558. should not be automatically exported, but which should be copied wholesale
  559. into the import library being generated during the link. The module names
  560. may be delimited by commas or colons, and must match exactly the filenames
  561. used by <code>ld</code> to open the files; for archive members, this is simply
  562. the member name, but for object files the name listed must include and
  563. match precisely any path used to specify the input file on the linker&rsquo;s
  564. command-line. This option is available only for the i386 PE targeted port
  565. of the linker. Symbols explicitly listed in a .def file are still exported,
  566. regardless of this option.
  567. </p>
  568. <span id="index-dynamic-symbol-table"></span>
  569. <span id="index-_002dE"></span>
  570. <span id="index-_002d_002dexport_002ddynamic"></span>
  571. <span id="index-_002d_002dno_002dexport_002ddynamic"></span>
  572. </dd>
  573. <dt><code>-E</code></dt>
  574. <dt><code>--export-dynamic</code></dt>
  575. <dt><code>--no-export-dynamic</code></dt>
  576. <dd><p>When creating a dynamically linked executable, using the <samp>-E</samp>
  577. option or the <samp>--export-dynamic</samp> option causes the linker to add
  578. all symbols to the dynamic symbol table. The dynamic symbol table is the
  579. set of symbols which are visible from dynamic objects at run time.
  580. </p>
  581. <p>If you do not use either of these options (or use the
  582. <samp>--no-export-dynamic</samp> option to restore the default behavior), the
  583. dynamic symbol table will normally contain only those symbols which are
  584. referenced by some dynamic object mentioned in the link.
  585. </p>
  586. <p>If you use <code>dlopen</code> to load a dynamic object which needs to refer
  587. back to the symbols defined by the program, rather than some other
  588. dynamic object, then you will probably need to use this option when
  589. linking the program itself.
  590. </p>
  591. <p>You can also use the dynamic list to control what symbols should
  592. be added to the dynamic symbol table if the output format supports it.
  593. See the description of &lsquo;<samp>--dynamic-list</samp>&rsquo;.
  594. </p>
  595. <p>Note that this option is specific to ELF targeted ports. PE targets
  596. support a similar function to export all symbols from a DLL or EXE; see
  597. the description of &lsquo;<samp>--export-all-symbols</samp>&rsquo; below.
  598. </p>
  599. <span id="index-_002d_002dexport_002ddynamic_002dsymbol_003dglob"></span>
  600. <span id="index-export-dynamic-symbol"></span>
  601. </dd>
  602. <dt><code>--export-dynamic-symbol=<var>glob</var></code></dt>
  603. <dd><p>When creating a dynamically linked executable, symbols matching
  604. <var>glob</var> will be added to the dynamic symbol table. When creating a
  605. shared library, references to symbols matching <var>glob</var> will not be
  606. bound to the definitions within the shared library. This option is a
  607. no-op when creating a shared library and &lsquo;<samp>-Bsymbolic</samp>&rsquo; or
  608. &lsquo;<samp>--dynamic-list</samp>&rsquo; are not specified. This option is only meaningful
  609. on ELF platforms which support shared libraries.
  610. </p>
  611. <span id="index-_002d_002dexport_002ddynamic_002dsymbol_002dlist_003dfile"></span>
  612. <span id="index-export-dynamic-symbol-list"></span>
  613. </dd>
  614. <dt><code>--export-dynamic-symbol-list=<var>file</var></code></dt>
  615. <dd><p>Specify a &lsquo;<samp>--export-dynamic-symbol</samp>&rsquo; for each pattern in the file.
  616. The format of the file is the same as the version node without
  617. scope and node name. See <a href="#VERSION">VERSION</a> for more information.
  618. </p>
  619. <span id="index-big_002dendian-objects"></span>
  620. <span id="index-endianness"></span>
  621. <span id="index-_002dEB"></span>
  622. </dd>
  623. <dt><code>-EB</code></dt>
  624. <dd><p>Link big-endian objects. This affects the default output format.
  625. </p>
  626. <span id="index-little_002dendian-objects"></span>
  627. <span id="index-_002dEL"></span>
  628. </dd>
  629. <dt><code>-EL</code></dt>
  630. <dd><p>Link little-endian objects. This affects the default output format.
  631. </p>
  632. <span id="index-_002df-name"></span>
  633. <span id="index-_002d_002dauxiliary_003dname"></span>
  634. </dd>
  635. <dt><code>-f <var>name</var></code></dt>
  636. <dt><code>--auxiliary=<var>name</var></code></dt>
  637. <dd><p>When creating an ELF shared object, set the internal DT_AUXILIARY field
  638. to the specified name. This tells the dynamic linker that the symbol
  639. table of the shared object should be used as an auxiliary filter on the
  640. symbol table of the shared object <var>name</var>.
  641. </p>
  642. <p>If you later link a program against this filter object, then, when you
  643. run the program, the dynamic linker will see the DT_AUXILIARY field. If
  644. the dynamic linker resolves any symbols from the filter object, it will
  645. first check whether there is a definition in the shared object
  646. <var>name</var>. If there is one, it will be used instead of the definition
  647. in the filter object. The shared object <var>name</var> need not exist.
  648. Thus the shared object <var>name</var> may be used to provide an alternative
  649. implementation of certain functions, perhaps for debugging or for
  650. machine-specific performance.
  651. </p>
  652. <p>This option may be specified more than once. The DT_AUXILIARY entries
  653. will be created in the order in which they appear on the command line.
  654. </p>
  655. <span id="index-_002dF-name"></span>
  656. <span id="index-_002d_002dfilter_003dname"></span>
  657. </dd>
  658. <dt><code>-F <var>name</var></code></dt>
  659. <dt><code>--filter=<var>name</var></code></dt>
  660. <dd><p>When creating an ELF shared object, set the internal DT_FILTER field to
  661. the specified name. This tells the dynamic linker that the symbol table
  662. of the shared object which is being created should be used as a filter
  663. on the symbol table of the shared object <var>name</var>.
  664. </p>
  665. <p>If you later link a program against this filter object, then, when you
  666. run the program, the dynamic linker will see the DT_FILTER field. The
  667. dynamic linker will resolve symbols according to the symbol table of the
  668. filter object as usual, but it will actually link to the definitions
  669. found in the shared object <var>name</var>. Thus the filter object can be
  670. used to select a subset of the symbols provided by the object
  671. <var>name</var>.
  672. </p>
  673. <p>Some older linkers used the <samp>-F</samp> option throughout a compilation
  674. toolchain for specifying object-file format for both input and output
  675. object files.
  676. The <small>GNU</small> linker uses other mechanisms for this purpose: the
  677. <samp>-b</samp>, <samp>--format</samp>, <samp>--oformat</samp> options, the
  678. <code>TARGET</code> command in linker scripts, and the <code>GNUTARGET</code>
  679. environment variable.
  680. The <small>GNU</small> linker will ignore the <samp>-F</samp> option when not
  681. creating an ELF shared object.
  682. </p>
  683. <span id="index-finalization-function"></span>
  684. <span id="index-_002dfini_003dname"></span>
  685. </dd>
  686. <dt><code>-fini=<var>name</var></code></dt>
  687. <dd><p>When creating an ELF executable or shared object, call NAME when the
  688. executable or shared object is unloaded, by setting DT_FINI to the
  689. address of the function. By default, the linker uses <code>_fini</code> as
  690. the function to call.
  691. </p>
  692. <span id="index-_002dg"></span>
  693. </dd>
  694. <dt><code>-g</code></dt>
  695. <dd><p>Ignored. Provided for compatibility with other tools.
  696. </p>
  697. <span id="index-_002dG-value"></span>
  698. <span id="index-_002d_002dgpsize_003dvalue"></span>
  699. <span id="index-object-size"></span>
  700. </dd>
  701. <dt><code>-G <var>value</var></code></dt>
  702. <dt><code>--gpsize=<var>value</var></code></dt>
  703. <dd><p>Set the maximum size of objects to be optimized using the GP register to
  704. <var>size</var>. This is only meaningful for object file formats such as
  705. MIPS ELF that support putting large and small objects into different
  706. sections. This is ignored for other object file formats.
  707. </p>
  708. <span id="index-runtime-library-name"></span>
  709. <span id="index-_002dh-name"></span>
  710. <span id="index-_002dsoname_003dname"></span>
  711. </dd>
  712. <dt><code>-h <var>name</var></code></dt>
  713. <dt><code>-soname=<var>name</var></code></dt>
  714. <dd><p>When creating an ELF shared object, set the internal DT_SONAME field to
  715. the specified name. When an executable is linked with a shared object
  716. which has a DT_SONAME field, then when the executable is run the dynamic
  717. linker will attempt to load the shared object specified by the DT_SONAME
  718. field rather than using the file name given to the linker.
  719. </p>
  720. <span id="index-_002di"></span>
  721. <span id="index-incremental-link"></span>
  722. </dd>
  723. <dt><code>-i</code></dt>
  724. <dd><p>Perform an incremental link (same as option &lsquo;<samp>-r</samp>&rsquo;).
  725. </p>
  726. <span id="index-initialization-function"></span>
  727. <span id="index-_002dinit_003dname"></span>
  728. </dd>
  729. <dt><code>-init=<var>name</var></code></dt>
  730. <dd><p>When creating an ELF executable or shared object, call NAME when the
  731. executable or shared object is loaded, by setting DT_INIT to the address
  732. of the function. By default, the linker uses <code>_init</code> as the
  733. function to call.
  734. </p>
  735. <span id="index-archive-files_002c-from-cmd-line"></span>
  736. <span id="index-_002dl-namespec"></span>
  737. <span id="index-_002d_002dlibrary_003dnamespec"></span>
  738. </dd>
  739. <dt><code>-l <var>namespec</var></code></dt>
  740. <dt><code>--library=<var>namespec</var></code></dt>
  741. <dd><p>Add the archive or object file specified by <var>namespec</var> to the
  742. list of files to link. This option may be used any number of times.
  743. If <var>namespec</var> is of the form <samp>:<var>filename</var></samp>, <code>ld</code>
  744. will search the library path for a file called <var>filename</var>, otherwise it
  745. will search the library path for a file called <samp>lib<var>namespec</var>.a</samp>.
  746. </p>
  747. <p>On systems which support shared libraries, <code>ld</code> may also search for
  748. files other than <samp>lib<var>namespec</var>.a</samp>. Specifically, on ELF
  749. and SunOS systems, <code>ld</code> will search a directory for a library
  750. called <samp>lib<var>namespec</var>.so</samp> before searching for one called
  751. <samp>lib<var>namespec</var>.a</samp>. (By convention, a <code>.so</code> extension
  752. indicates a shared library.) Note that this behavior does not apply
  753. to <samp>:<var>filename</var></samp>, which always specifies a file called
  754. <var>filename</var>.
  755. </p>
  756. <p>The linker will search an archive only once, at the location where it is
  757. specified on the command line. If the archive defines a symbol which
  758. was undefined in some object which appeared before the archive on the
  759. command line, the linker will include the appropriate file(s) from the
  760. archive. However, an undefined symbol in an object appearing later on
  761. the command line will not cause the linker to search the archive again.
  762. </p>
  763. <p>See the <samp>-(</samp> option for a way to force the linker to search
  764. archives multiple times.
  765. </p>
  766. <p>You may list the same archive multiple times on the command line.
  767. </p>
  768. <p>This type of archive searching is standard for Unix linkers. However,
  769. if you are using <code>ld</code> on AIX, note that it is different from the
  770. behaviour of the AIX linker.
  771. </p>
  772. <span id="index-search-directory_002c-from-cmd-line"></span>
  773. <span id="index-_002dL-dir"></span>
  774. <span id="index-_002d_002dlibrary_002dpath_003ddir"></span>
  775. </dd>
  776. <dt><code>-L <var>searchdir</var></code></dt>
  777. <dt><code>--library-path=<var>searchdir</var></code></dt>
  778. <dd><p>Add path <var>searchdir</var> to the list of paths that <code>ld</code> will search
  779. for archive libraries and <code>ld</code> control scripts. You may use this
  780. option any number of times. The directories are searched in the order
  781. in which they are specified on the command line. Directories specified
  782. on the command line are searched before the default directories. All
  783. <samp>-L</samp> options apply to all <samp>-l</samp> options, regardless of the
  784. order in which the options appear. <samp>-L</samp> options do not affect
  785. how <code>ld</code> searches for a linker script unless <samp>-T</samp>
  786. option is specified.
  787. </p>
  788. <p>If <var>searchdir</var> begins with <code>=</code> or <code>$SYSROOT</code>, then this
  789. prefix will be replaced by the <em>sysroot prefix</em>, controlled by the
  790. &lsquo;<samp>--sysroot</samp>&rsquo; option, or specified when the linker is configured.
  791. </p>
  792. <p>The default set of paths searched (without being specified with
  793. &lsquo;<samp>-L</samp>&rsquo;) depends on which emulation mode <code>ld</code> is using, and in
  794. some cases also on how it was configured. See <a href="#Environment">Environment</a>.
  795. </p>
  796. <p>The paths can also be specified in a link script with the
  797. <code>SEARCH_DIR</code> command. Directories specified this way are searched
  798. at the point in which the linker script appears in the command line.
  799. </p>
  800. <span id="index-emulation"></span>
  801. <span id="index-_002dm-emulation"></span>
  802. </dd>
  803. <dt><code>-m <var>emulation</var></code></dt>
  804. <dd><p>Emulate the <var>emulation</var> linker. You can list the available
  805. emulations with the &lsquo;<samp>--verbose</samp>&rsquo; or &lsquo;<samp>-V</samp>&rsquo; options.
  806. </p>
  807. <p>If the &lsquo;<samp>-m</samp>&rsquo; option is not used, the emulation is taken from the
  808. <code>LDEMULATION</code> environment variable, if that is defined.
  809. </p>
  810. <p>Otherwise, the default emulation depends upon how the linker was
  811. configured.
  812. </p>
  813. <span id="index-remapping-inputs"></span>
  814. <span id="index-_002d_002dremap_002dinputs_003dpattern_003dfilename"></span>
  815. <span id="index-_002d_002dremap_002dinputs_002dfile_003dfile"></span>
  816. </dd>
  817. <dt><code>--remap-inputs=<samp>pattern</samp>=<samp>filename</samp></code></dt>
  818. <dt><code>--remap-inputs-file=<samp>file</samp></code></dt>
  819. <dd><p>These options allow the names of input files to be changed before the
  820. linker attempts to open them. The option
  821. <samp>--remap-inputs=foo.o=bar.o</samp> will cause any attempt to load a
  822. file called <samp>foo.o</samp> to instead try to load a file called
  823. <samp>bar.o</samp>. Wildcard patterns are permitted in the first filename,
  824. so <samp>--remap-inputs=foo*.o=bar.o</samp> will rename any input file that
  825. matches <samp>foo*.o</samp> to <samp>bar.o</samp>.
  826. </p>
  827. <p>An alternative form of the option
  828. <samp>--remap-inputs-file=filename</samp> allows the remappings to be read
  829. from a file. Each line in the file can contain a single remapping.
  830. Blank lines are ignored. Anything from a hash character (&lsquo;<samp>#</samp>&rsquo;) to
  831. the end of a line is considered to be a comment and is also ignored.
  832. The mapping pattern can be separated from the filename by whitespace
  833. or an equals (&lsquo;<samp>=</samp>&rsquo;) character.
  834. </p>
  835. <p>The options can be specified multiple times. Their contents
  836. accumulate. The remappings will be processed in the order in which
  837. they occur on the command line, and if they come from a file, in the
  838. order in which they occur in the file. If a match is made, no further
  839. checking for that filename will be performed.
  840. </p>
  841. <p>If the replacement filename is <samp>/dev/null</samp> or just <samp>NUL</samp>
  842. then the remapping will actually cause the input file to be ignored.
  843. This can be a convenient way to experiment with removing input files
  844. from a complicated build environment.
  845. </p>
  846. <p>Note that this option is position dependent and only affects filenames
  847. that come after it on the command line. Thus:
  848. </p>
  849. <div class="example">
  850. <pre class="example"> ld foo.o --remap-inputs=foo.o=bar.o
  851. </pre></div>
  852. <p>Will have no effect, whereas:
  853. </p>
  854. <div class="example">
  855. <pre class="example"> ld --remap-inputs=foo.o=bar.o foo.o
  856. </pre></div>
  857. <p>Will rename the input file <samp>foo.o</samp> to <samp>bar.o</samp>.
  858. </p>
  859. <p>Note - these options also affect files referenced by <em>INPUT</em>
  860. statements in linker scripts. But since linker scripts are processed
  861. after the entire command line is read, the position of the remap
  862. options on the command line is not significant.
  863. </p>
  864. <p>If the <samp>verbose</samp> option is enabled then any mappings that match
  865. will be reported, although again the <samp>verbose</samp> option needs to
  866. be enabled on the command line <em>before</em> the remaped filenames
  867. appear.
  868. </p>
  869. <p>If the <samp>-Map</samp> or <samp>--print-map</samp> options are enabled then
  870. the remapping list will be included in the map output.
  871. </p>
  872. <span id="index-link-map"></span>
  873. <span id="index-_002dM"></span>
  874. <span id="index-_002d_002dprint_002dmap"></span>
  875. </dd>
  876. <dt><code>-M</code></dt>
  877. <dt><code>--print-map</code></dt>
  878. <dd><p>Print a link map to the standard output. A link map provides
  879. information about the link, including the following:
  880. </p>
  881. <ul>
  882. <li> Where object files are mapped into memory.
  883. </li><li> How common symbols are allocated.
  884. </li><li> All archive members included in the link, with a mention of the symbol
  885. which caused the archive member to be brought in.
  886. </li><li> The values assigned to symbols.
  887. <p>Note - symbols whose values are computed by an expression which
  888. involves a reference to a previous value of the same symbol may not
  889. have correct result displayed in the link map. This is because the
  890. linker discards intermediate results and only retains the final value
  891. of an expression. Under such circumstances the linker will display
  892. the final value enclosed by square brackets. Thus for example a
  893. linker script containing:
  894. </p>
  895. <div class="example">
  896. <pre class="example"> foo = 1
  897. foo = foo * 4
  898. foo = foo + 8
  899. </pre></div>
  900. <p>will produce the following output in the link map if the <samp>-M</samp>
  901. option is used:
  902. </p>
  903. <div class="example">
  904. <pre class="example"> 0x00000001 foo = 0x1
  905. [0x0000000c] foo = (foo * 0x4)
  906. [0x0000000c] foo = (foo + 0x8)
  907. </pre></div>
  908. <p>See <a href="#Expressions">Expressions</a> for more information about expressions in linker
  909. scripts.
  910. </p>
  911. </li><li> How GNU properties are merged.
  912. <p>When the linker merges input .note.gnu.property sections into one output
  913. .note.gnu.property section, some properties are removed or updated.
  914. These actions are reported in the link map. For example:
  915. </p>
  916. <div class="example">
  917. <pre class="example">Removed property 0xc0000002 to merge foo.o (0x1) and bar.o (not found)
  918. </pre></div>
  919. <p>This indicates that property 0xc0000002 is removed from output when
  920. merging properties in <samp>foo.o</samp>, whose property 0xc0000002 value
  921. is 0x1, and <samp>bar.o</samp>, which doesn&rsquo;t have property 0xc0000002.
  922. </p>
  923. <div class="example">
  924. <pre class="example">Updated property 0xc0010001 (0x1) to merge foo.o (0x1) and bar.o (0x1)
  925. </pre></div>
  926. <p>This indicates that property 0xc0010001 value is updated to 0x1 in output
  927. when merging properties in <samp>foo.o</samp>, whose 0xc0010001 property value
  928. is 0x1, and <samp>bar.o</samp>, whose 0xc0010001 property value is 0x1.
  929. </p>
  930. </li><li> On some ELF targets, a list of fixups inserted by <samp>--relax</samp>
  931. <div class="example">
  932. <pre class="example">foo.o: Adjusting branch at 0x00000008 towards &quot;far&quot; in section .text
  933. </pre></div>
  934. <p>This indicates that the branch at 0x00000008 in foo.o, targeting
  935. the symbol &quot;far&quot; in section .text, has been replaced by a trampoline.
  936. </p>
  937. </li></ul>
  938. <span id="index-link-map-discarded"></span>
  939. <span id="index-_002d_002dprint_002dmap_002ddiscarded"></span>
  940. <span id="index-_002d_002dno_002dprint_002dmap_002ddiscarded"></span>
  941. </dd>
  942. <dt><code>--print-map-discarded</code></dt>
  943. <dt><code>--no-print-map-discarded</code></dt>
  944. <dd><p>Print (or do not print) the list of discarded and garbage collected sections
  945. in the link map. Enabled by default.
  946. </p>
  947. <span id="index-_002d_002dprint_002dmap_002dlocals"></span>
  948. <span id="index-_002d_002dno_002dprint_002dmap_002dlocals"></span>
  949. </dd>
  950. <dt><code>--print-map-locals</code></dt>
  951. <dt><code>--no-print-map-locals</code></dt>
  952. <dd><p>Print (or do not print) local symbols in the link map. Local symbols
  953. will have the text &lsquo;<samp>(local)</samp>&rsquo; printed before their name, and will
  954. be listed after all of the global symbols in a given section.
  955. Temporary local symbols (typically those that start with &lsquo;<samp>.L</samp>&rsquo;)
  956. will not be included in the output. Disabled by default.
  957. </p>
  958. <span id="index-_002dn"></span>
  959. <span id="index-read_002donly-text"></span>
  960. <span id="index-NMAGIC"></span>
  961. <span id="index-_002d_002dnmagic"></span>
  962. </dd>
  963. <dt><code>-n</code></dt>
  964. <dt><code>--nmagic</code></dt>
  965. <dd><p>Turn off page alignment of sections, and disable linking against shared
  966. libraries. If the output format supports Unix style magic numbers,
  967. mark the output as <code>NMAGIC</code>.
  968. </p>
  969. <span id="index-_002dN"></span>
  970. <span id="index-_002d_002domagic"></span>
  971. <span id="index-read_002fwrite-from-cmd-line"></span>
  972. <span id="index-OMAGIC"></span>
  973. </dd>
  974. <dt><code>-N</code></dt>
  975. <dt><code>--omagic</code></dt>
  976. <dd><p>Set the text and data sections to be readable and writable. Also, do
  977. not page-align the data segment, and disable linking against shared
  978. libraries. If the output format supports Unix style magic numbers,
  979. mark the output as <code>OMAGIC</code>. Note: Although a writable text section
  980. is allowed for PE-COFF targets, it does not conform to the format
  981. specification published by Microsoft.
  982. </p>
  983. <span id="index-_002d_002dno_002domagic"></span>
  984. <span id="index-OMAGIC-1"></span>
  985. </dd>
  986. <dt><code>--no-omagic</code></dt>
  987. <dd><p>This option negates most of the effects of the <samp>-N</samp> option. It
  988. sets the text section to be read-only, and forces the data segment to
  989. be page-aligned. Note - this option does not enable linking against
  990. shared libraries. Use <samp>-Bdynamic</samp> for this.
  991. </p>
  992. <span id="index-_002do-output"></span>
  993. <span id="index-_002d_002doutput_003doutput"></span>
  994. <span id="index-naming-the-output-file"></span>
  995. </dd>
  996. <dt><code>-o <var>output</var></code></dt>
  997. <dt><code>--output=<var>output</var></code></dt>
  998. <dd><p>Use <var>output</var> as the name for the program produced by <code>ld</code>; if this
  999. option is not specified, the name <samp>a.out</samp> is used by default. The
  1000. script command <code>OUTPUT</code> can also specify the output file name.
  1001. </p>
  1002. <span id="index-_002d_002ddependency_002dfile_003ddepfile"></span>
  1003. <span id="index-dependency-file"></span>
  1004. </dd>
  1005. <dt><code>--dependency-file=<var>depfile</var></code></dt>
  1006. <dd><p>Write a <em>dependency file</em> to <var>depfile</var>. This file contains a rule
  1007. suitable for <code>make</code> describing the output file and all the input files
  1008. that were read to produce it. The output is similar to the compiler&rsquo;s
  1009. output with &lsquo;<samp>-M -MP</samp>&rsquo; (see <a href="https://gcc.gnu.org/onlinedocs/gcc/Preprocessor-Options.html#Preprocessor-Options">Options
  1010. Controlling the Preprocessor</a> in <cite>Using the GNU Compiler
  1011. Collection</cite>). Note that there is no option like the compiler&rsquo;s &lsquo;<samp>-MM</samp>&rsquo;,
  1012. to exclude &ldquo;system files&rdquo; (which is not a well-specified concept in the
  1013. linker, unlike &ldquo;system headers&rdquo; in the compiler). So the output from
  1014. &lsquo;<samp>--dependency-file</samp>&rsquo; is always specific to the exact state of the
  1015. installation where it was produced, and should not be copied into
  1016. distributed makefiles without careful editing.
  1017. </p>
  1018. <span id="index-_002dO-level"></span>
  1019. <span id="index-generating-optimized-output"></span>
  1020. </dd>
  1021. <dt><code>-O <var>level</var></code></dt>
  1022. <dd><p>If <var>level</var> is a numeric values greater than zero <code>ld</code> optimizes
  1023. the output. This might take significantly longer and therefore probably
  1024. should only be enabled for the final binary. At the moment this
  1025. option only affects ELF shared library generation. Future releases of
  1026. the linker may make more use of this option. Also currently there is
  1027. no difference in the linker&rsquo;s behaviour for different non-zero values
  1028. of this option. Again this may change with future releases.
  1029. </p>
  1030. <span id="index-_002dplugin-name"></span>
  1031. </dd>
  1032. <dt><code>-plugin <var>name</var></code></dt>
  1033. <dd><p>Involve a plugin in the linking process. The <var>name</var> parameter is
  1034. the absolute filename of the plugin. Usually this parameter is
  1035. automatically added by the complier, when using link time
  1036. optimization, but users can also add their own plugins if they so
  1037. wish.
  1038. </p>
  1039. <p>Note that the location of the compiler originated plugins is different
  1040. from the place where the <code>ar</code>, <code>nm</code> and
  1041. <code>ranlib</code> programs search for their plugins. In order for
  1042. those commands to make use of a compiler based plugin it must first be
  1043. copied into the <samp>${libdir}/bfd-plugins</samp> directory. All gcc
  1044. based linker plugins are backward compatible, so it is sufficient to
  1045. just copy in the newest one.
  1046. </p>
  1047. <span id="index-_002d_002dpush_002dstate"></span>
  1048. <span id="index-push-state-governing-input-file-handling"></span>
  1049. </dd>
  1050. <dt><code>--push-state</code></dt>
  1051. <dd><p>The <samp>--push-state</samp> allows one to preserve the current state of the
  1052. flags which govern the input file handling so that they can all be
  1053. restored with one corresponding <samp>--pop-state</samp> option.
  1054. </p>
  1055. <p>The option which are covered are: <samp>-Bdynamic</samp>, <samp>-Bstatic</samp>,
  1056. <samp>-dn</samp>, <samp>-dy</samp>, <samp>-call_shared</samp>, <samp>-non_shared</samp>,
  1057. <samp>-static</samp>, <samp>-N</samp>, <samp>-n</samp>, <samp>--whole-archive</samp>,
  1058. <samp>--no-whole-archive</samp>, <samp>-r</samp>, <samp>-Ur</samp>,
  1059. <samp>--copy-dt-needed-entries</samp>, <samp>--no-copy-dt-needed-entries</samp>,
  1060. <samp>--as-needed</samp>, <samp>--no-as-needed</samp>, and <samp>-a</samp>.
  1061. </p>
  1062. <p>One target for this option are specifications for <samp>pkg-config</samp>. When
  1063. used with the <samp>--libs</samp> option all possibly needed libraries are
  1064. listed and then possibly linked with all the time. It is better to return
  1065. something as follows:
  1066. </p>
  1067. <div class="example">
  1068. <pre class="example">-Wl,--push-state,--as-needed -libone -libtwo -Wl,--pop-state
  1069. </pre></div>
  1070. <span id="index-_002d_002dpop_002dstate"></span>
  1071. <span id="index-pop-state-governing-input-file-handling"></span>
  1072. </dd>
  1073. <dt><code>--pop-state</code></dt>
  1074. <dd><p>Undoes the effect of &ndash;push-state, restores the previous values of the
  1075. flags governing input file handling.
  1076. </p>
  1077. <span id="index-_002dq"></span>
  1078. <span id="index-_002d_002demit_002drelocs"></span>
  1079. <span id="index-retain-relocations-in-final-executable"></span>
  1080. </dd>
  1081. <dt><code>-q</code></dt>
  1082. <dt><code>--emit-relocs</code></dt>
  1083. <dd><p>Leave relocation sections and contents in fully linked executables.
  1084. Post link analysis and optimization tools may need this information in
  1085. order to perform correct modifications of executables. This results
  1086. in larger executables.
  1087. </p>
  1088. <p>This option is currently only supported on ELF platforms.
  1089. </p>
  1090. <span id="index-_002d_002dforce_002ddynamic"></span>
  1091. <span id="index-forcing-the-creation-of-dynamic-sections"></span>
  1092. </dd>
  1093. <dt><code>--force-dynamic</code></dt>
  1094. <dd><p>Force the output file to have dynamic sections. This option is specific
  1095. to VxWorks targets.
  1096. </p>
  1097. <span id="index-partial-link"></span>
  1098. <span id="index-relocatable-output"></span>
  1099. <span id="index-_002dr"></span>
  1100. <span id="index-_002d_002drelocatable"></span>
  1101. </dd>
  1102. <dt><code>-r</code></dt>
  1103. <dt><code>--relocatable</code></dt>
  1104. <dd><p>Generate relocatable output&mdash;i.e., generate an output file that can in
  1105. turn serve as input to <code>ld</code>. This is often called <em>partial
  1106. linking</em>. As a side effect, in environments that support standard Unix
  1107. magic numbers, this option also sets the output file&rsquo;s magic number to
  1108. <code>OMAGIC</code>.
  1109. If this option is not specified, an absolute file is produced. When
  1110. linking C++ programs, this option <em>will not</em> resolve references to
  1111. constructors; to do that, use &lsquo;<samp>-Ur</samp>&rsquo;.
  1112. </p>
  1113. <p>When an input file does not have the same format as the output file,
  1114. partial linking is only supported if that input file does not contain any
  1115. relocations. Different output formats can have further restrictions; for
  1116. example some <code>a.out</code>-based formats do not support partial linking
  1117. with input files in other formats at all.
  1118. </p>
  1119. <p>This option does the same thing as &lsquo;<samp>-i</samp>&rsquo;.
  1120. </p>
  1121. <span id="index-_002dR-file"></span>
  1122. <span id="index-_002d_002djust_002dsymbols_003dfile"></span>
  1123. <span id="index-symbol_002donly-input"></span>
  1124. </dd>
  1125. <dt><code>-R <var>filename</var></code></dt>
  1126. <dt><code>--just-symbols=<var>filename</var></code></dt>
  1127. <dd><p>Read symbol names and their addresses from <var>filename</var>, but do not
  1128. relocate it or include it in the output. This allows your output file
  1129. to refer symbolically to absolute locations of memory defined in other
  1130. programs. You may use this option more than once.
  1131. </p>
  1132. <p>For compatibility with other ELF linkers, if the <samp>-R</samp> option is
  1133. followed by a directory name, rather than a file name, it is treated as
  1134. the <samp>-rpath</samp> option.
  1135. </p>
  1136. <span id="index-_002ds"></span>
  1137. <span id="index-_002d_002dstrip_002dall"></span>
  1138. <span id="index-strip-all-symbols"></span>
  1139. </dd>
  1140. <dt><code>-s</code></dt>
  1141. <dt><code>--strip-all</code></dt>
  1142. <dd><p>Omit all symbol information from the output file.
  1143. </p>
  1144. <span id="index-_002dS"></span>
  1145. <span id="index-_002d_002dstrip_002ddebug"></span>
  1146. <span id="index-strip-debugger-symbols"></span>
  1147. </dd>
  1148. <dt><code>-S</code></dt>
  1149. <dt><code>--strip-debug</code></dt>
  1150. <dd><p>Omit debugger symbol information (but not all symbols) from the output file.
  1151. </p>
  1152. <span id="index-_002d_002dstrip_002ddiscarded"></span>
  1153. <span id="index-_002d_002dno_002dstrip_002ddiscarded"></span>
  1154. </dd>
  1155. <dt><code>--strip-discarded</code></dt>
  1156. <dt><code>--no-strip-discarded</code></dt>
  1157. <dd><p>Omit (or do not omit) global symbols defined in discarded sections.
  1158. Enabled by default.
  1159. </p>
  1160. <span id="index-_002dt"></span>
  1161. <span id="index-_002d_002dtrace"></span>
  1162. <span id="index-input-files_002c-displaying"></span>
  1163. </dd>
  1164. <dt><code>-t</code></dt>
  1165. <dt><code>--trace</code></dt>
  1166. <dd><p>Print the names of the input files as <code>ld</code> processes them. If
  1167. &lsquo;<samp>-t</samp>&rsquo; is given twice then members within archives are also printed.
  1168. &lsquo;<samp>-t</samp>&rsquo; output is useful to generate a list of all the object files
  1169. and scripts involved in linking, for example, when packaging files for
  1170. a linker bug report.
  1171. </p>
  1172. <span id="index-_002dT-script"></span>
  1173. <span id="index-_002d_002dscript_003dscript"></span>
  1174. <span id="index-script-files"></span>
  1175. </dd>
  1176. <dt><code>-T <var>scriptfile</var></code></dt>
  1177. <dt><code>--script=<var>scriptfile</var></code></dt>
  1178. <dd><p>Use <var>scriptfile</var> as the linker script. This script replaces
  1179. <code>ld</code>&rsquo;s default linker script (rather than adding to it),
  1180. unless the script contains <code>INSERT</code>, so
  1181. <var>commandfile</var> must specify everything necessary to describe the
  1182. output file. See <a href="#Scripts">Scripts</a>. If <var>scriptfile</var> does not exist in
  1183. the current directory, <code>ld</code> looks for it in the directories
  1184. specified by any preceding &lsquo;<samp>-L</samp>&rsquo; options. Multiple &lsquo;<samp>-T</samp>&rsquo;
  1185. options accumulate.
  1186. </p>
  1187. <span id="index-_002ddT-script"></span>
  1188. <span id="index-_002d_002ddefault_002dscript_003dscript"></span>
  1189. <span id="index-script-files-1"></span>
  1190. </dd>
  1191. <dt><code>-dT <var>scriptfile</var></code></dt>
  1192. <dt><code>--default-script=<var>scriptfile</var></code></dt>
  1193. <dd><p>Use <var>scriptfile</var> as the default linker script. See <a href="#Scripts">Scripts</a>.
  1194. </p>
  1195. <p>This option is similar to the <samp>--script</samp> option except that
  1196. processing of the script is delayed until after the rest of the
  1197. command line has been processed. This allows options placed after the
  1198. <samp>--default-script</samp> option on the command line to affect the
  1199. behaviour of the linker script, which can be important when the linker
  1200. command line cannot be directly controlled by the user. (eg because
  1201. the command line is being constructed by another tool, such as
  1202. &lsquo;<samp>gcc</samp>&rsquo;).
  1203. </p>
  1204. <span id="index-_002du-symbol"></span>
  1205. <span id="index-_002d_002dundefined_003dsymbol"></span>
  1206. <span id="index-undefined-symbol"></span>
  1207. </dd>
  1208. <dt><code>-u <var>symbol</var></code></dt>
  1209. <dt><code>--undefined=<var>symbol</var></code></dt>
  1210. <dd><p>Force <var>symbol</var> to be entered in the output file as an undefined
  1211. symbol. Doing this may, for example, trigger linking of additional
  1212. modules from standard libraries. &lsquo;<samp>-u</samp>&rsquo; may be repeated with
  1213. different option arguments to enter additional undefined symbols. This
  1214. option is equivalent to the <code>EXTERN</code> linker script command.
  1215. </p>
  1216. <p>If this option is being used to force additional modules to be pulled
  1217. into the link, and if it is an error for the symbol to remain
  1218. undefined, then the option <samp>--require-defined</samp> should be used
  1219. instead.
  1220. </p>
  1221. <span id="index-_002d_002drequire_002ddefined_003dsymbol"></span>
  1222. <span id="index-symbols_002c-require-defined"></span>
  1223. <span id="index-defined-symbol"></span>
  1224. </dd>
  1225. <dt><code>--require-defined=<var>symbol</var></code></dt>
  1226. <dd><p>Require that <var>symbol</var> is defined in the output file. This option
  1227. is the same as option <samp>--undefined</samp> except that if <var>symbol</var>
  1228. is not defined in the output file then the linker will issue an error
  1229. and exit. The same effect can be achieved in a linker script by using
  1230. <code>EXTERN</code>, <code>ASSERT</code> and <code>DEFINED</code> together. This option
  1231. can be used multiple times to require additional symbols.
  1232. </p>
  1233. <span id="index-_002dUr"></span>
  1234. <span id="index-constructors"></span>
  1235. </dd>
  1236. <dt><code>-Ur</code></dt>
  1237. <dd>
  1238. <p>For programs that do not use constructors or destructors, or for ELF
  1239. based systems this option is equivalent to <samp>-r</samp>: it generates
  1240. relocatable output&mdash;i.e., an output file that can in turn serve as
  1241. input to <code>ld</code>. For other binaries however the <samp>-Ur</samp>
  1242. option is similar to <samp>-r</samp> but it also resolves references to
  1243. constructors and destructors.
  1244. </p>
  1245. <p>For those systems where <samp>-r</samp> and <samp>-Ur</samp> behave
  1246. differently, it does not work to use <samp>-Ur</samp> on files that were
  1247. themselves linked with <samp>-Ur</samp>; once the constructor table has
  1248. been built, it cannot be added to. Use <samp>-Ur</samp> only for the last
  1249. partial link, and <samp>-r</samp> for the others.
  1250. </p>
  1251. <span id="index-_002d_002dorphan_002dhandling_003dMODE"></span>
  1252. <span id="index-orphan-sections"></span>
  1253. <span id="index-sections_002c-orphan"></span>
  1254. </dd>
  1255. <dt><code>--orphan-handling=<var>MODE</var></code></dt>
  1256. <dd><p>Control how orphan sections are handled. An orphan section is one not
  1257. specifically mentioned in a linker script. See <a href="#Orphan-Sections">Orphan Sections</a>.
  1258. </p>
  1259. <p><var>MODE</var> can have any of the following values:
  1260. </p>
  1261. <dl compact="compact">
  1262. <dt><code>place</code></dt>
  1263. <dd><p>Orphan sections are placed into a suitable output section following
  1264. the strategy described in <a href="#Orphan-Sections">Orphan Sections</a>. The option
  1265. &lsquo;<samp>--unique</samp>&rsquo; also affects how sections are placed.
  1266. </p>
  1267. </dd>
  1268. <dt><code>discard</code></dt>
  1269. <dd><p>All orphan sections are discarded, by placing them in the
  1270. &lsquo;<samp>/DISCARD/</samp>&rsquo; section (see <a href="#Output-Section-Discarding">Output Section Discarding</a>).
  1271. </p>
  1272. </dd>
  1273. <dt><code>warn</code></dt>
  1274. <dd><p>The linker will place the orphan section as for <code>place</code> and also
  1275. issue a warning.
  1276. </p>
  1277. </dd>
  1278. <dt><code>error</code></dt>
  1279. <dd><p>The linker will exit with an error if any orphan section is found.
  1280. </p></dd>
  1281. </dl>
  1282. <p>The default if &lsquo;<samp>--orphan-handling</samp>&rsquo; is not given is <code>place</code>.
  1283. </p>
  1284. <span id="index-_002d_002dunique_005b_003dSECTION_005d"></span>
  1285. </dd>
  1286. <dt><code>--unique[=<var>SECTION</var>]</code></dt>
  1287. <dd><p>Creates a separate output section for every input section matching
  1288. <var>SECTION</var>, or if the optional wildcard <var>SECTION</var> argument is
  1289. missing, for every orphan input section. An orphan section is one not
  1290. specifically mentioned in a linker script. You may use this option
  1291. multiple times on the command line; It prevents the normal merging of
  1292. input sections with the same name, overriding output section assignments
  1293. in a linker script.
  1294. </p>
  1295. <span id="index-_002dv"></span>
  1296. <span id="index-_002dV"></span>
  1297. <span id="index-_002d_002dversion"></span>
  1298. <span id="index-version"></span>
  1299. </dd>
  1300. <dt><code>-v</code></dt>
  1301. <dt><code>--version</code></dt>
  1302. <dt><code>-V</code></dt>
  1303. <dd><p>Display the version number for <code>ld</code>. The <samp>-V</samp> option also
  1304. lists the supported emulations. See also the description of the
  1305. <samp>--enable-linker-version</samp> in <a href="#Options">Command-line Options</a>
  1306. which can be used to insert the linker version string into a binary.
  1307. </p>
  1308. <span id="index-_002dx"></span>
  1309. <span id="index-_002d_002ddiscard_002dall"></span>
  1310. <span id="index-deleting-local-symbols"></span>
  1311. </dd>
  1312. <dt><code>-x</code></dt>
  1313. <dt><code>--discard-all</code></dt>
  1314. <dd><p>Delete all local symbols.
  1315. </p>
  1316. <span id="index-_002dX"></span>
  1317. <span id="index-_002d_002ddiscard_002dlocals"></span>
  1318. <span id="index-local-symbols_002c-deleting"></span>
  1319. </dd>
  1320. <dt><code>-X</code></dt>
  1321. <dt><code>--discard-locals</code></dt>
  1322. <dd><p>Delete all temporary local symbols. (These symbols start with
  1323. system-specific local label prefixes, typically &lsquo;<samp>.L</samp>&rsquo; for ELF systems
  1324. or &lsquo;<samp>L</samp>&rsquo; for traditional a.out systems.)
  1325. </p>
  1326. <span id="index-_002dy-symbol"></span>
  1327. <span id="index-_002d_002dtrace_002dsymbol_003dsymbol"></span>
  1328. <span id="index-symbol-tracing"></span>
  1329. </dd>
  1330. <dt><code>-y <var>symbol</var></code></dt>
  1331. <dt><code>--trace-symbol=<var>symbol</var></code></dt>
  1332. <dd><p>Print the name of each linked file in which <var>symbol</var> appears. This
  1333. option may be given any number of times. On many systems it is necessary
  1334. to prepend an underscore.
  1335. </p>
  1336. <p>This option is useful when you have an undefined symbol in your link but
  1337. don&rsquo;t know where the reference is coming from.
  1338. </p>
  1339. <span id="index-_002dY-path"></span>
  1340. </dd>
  1341. <dt><code>-Y <var>path</var></code></dt>
  1342. <dd><p>Add <var>path</var> to the default library search path. This option exists
  1343. for Solaris compatibility.
  1344. </p>
  1345. <span id="index-_002dz-keyword"></span>
  1346. </dd>
  1347. <dt><code>-z <var>keyword</var></code></dt>
  1348. <dd><p>The recognized keywords are:
  1349. </p><dl compact="compact">
  1350. <dt>&lsquo;<samp>call-nop=prefix-addr</samp>&rsquo;</dt>
  1351. <dt>&lsquo;<samp>call-nop=suffix-nop</samp>&rsquo;</dt>
  1352. <dt>&lsquo;<samp>call-nop=prefix-<var>byte</var></samp>&rsquo;</dt>
  1353. <dt>&lsquo;<samp>call-nop=suffix-<var>byte</var></samp>&rsquo;</dt>
  1354. <dd><p>Specify the 1-byte <code>NOP</code> padding when transforming indirect call
  1355. to a locally defined function, foo, via its GOT slot.
  1356. <samp>call-nop=prefix-addr</samp> generates <code>0x67 call foo</code>.
  1357. <samp>call-nop=suffix-nop</samp> generates <code>call foo 0x90</code>.
  1358. <samp>call-nop=prefix-<var>byte</var></samp> generates <code><var>byte</var> call foo</code>.
  1359. <samp>call-nop=suffix-<var>byte</var></samp> generates <code>call foo <var>byte</var></code>.
  1360. Supported for i386 and x86_64.
  1361. </p>
  1362. </dd>
  1363. <dt>&lsquo;<samp>cet-report=none</samp>&rsquo;</dt>
  1364. <dt>&lsquo;<samp>cet-report=warning</samp>&rsquo;</dt>
  1365. <dt>&lsquo;<samp>cet-report=error</samp>&rsquo;</dt>
  1366. <dd><p>Specify how to report the missing GNU_PROPERTY_X86_FEATURE_1_IBT and
  1367. GNU_PROPERTY_X86_FEATURE_1_SHSTK properties in input .note.gnu.property
  1368. section. <samp>cet-report=none</samp>, which is the default, will make the
  1369. linker not report missing properties in input files.
  1370. <samp>cet-report=warning</samp> will make the linker issue a warning for
  1371. missing properties in input files. <samp>cet-report=error</samp> will make
  1372. the linker issue an error for missing properties in input files.
  1373. Note that <samp>ibt</samp> will turn off the missing
  1374. GNU_PROPERTY_X86_FEATURE_1_IBT property report and <samp>shstk</samp> will
  1375. turn off the missing GNU_PROPERTY_X86_FEATURE_1_SHSTK property report.
  1376. Supported for Linux/i386 and Linux/x86_64.
  1377. </p>
  1378. </dd>
  1379. <dt>&lsquo;<samp>combreloc</samp>&rsquo;</dt>
  1380. <dt>&lsquo;<samp>nocombreloc</samp>&rsquo;</dt>
  1381. <dd><p>Combine multiple dynamic relocation sections and sort to improve
  1382. dynamic symbol lookup caching. Do not do this if &lsquo;<samp>nocombreloc</samp>&rsquo;.
  1383. </p>
  1384. </dd>
  1385. <dt>&lsquo;<samp>common</samp>&rsquo;</dt>
  1386. <dt>&lsquo;<samp>nocommon</samp>&rsquo;</dt>
  1387. <dd><p>Generate common symbols with STT_COMMON type during a relocatable
  1388. link. Use STT_OBJECT type if &lsquo;<samp>nocommon</samp>&rsquo;.
  1389. </p>
  1390. </dd>
  1391. <dt>&lsquo;<samp>common-page-size=<var>value</var></samp>&rsquo;</dt>
  1392. <dd><p>Set the page size most commonly used to <var>value</var>. Memory image
  1393. layout will be optimized to minimize memory pages if the system is
  1394. using pages of this size.
  1395. </p>
  1396. </dd>
  1397. <dt>&lsquo;<samp>defs</samp>&rsquo;</dt>
  1398. <dd><p>Report unresolved symbol references from regular object files. This
  1399. is done even if the linker is creating a non-symbolic shared library.
  1400. This option is the inverse of &lsquo;<samp>-z undefs</samp>&rsquo;.
  1401. </p>
  1402. </dd>
  1403. <dt>&lsquo;<samp>dynamic-undefined-weak</samp>&rsquo;</dt>
  1404. <dt>&lsquo;<samp>nodynamic-undefined-weak</samp>&rsquo;</dt>
  1405. <dd><p>Make undefined weak symbols dynamic when building a dynamic object,
  1406. if they are referenced from a regular object file and not forced local
  1407. by symbol visibility or versioning. Do not make them dynamic if
  1408. &lsquo;<samp>nodynamic-undefined-weak</samp>&rsquo;. If neither option is given, a target
  1409. may default to either option being in force, or make some other
  1410. selection of undefined weak symbols dynamic. Not all targets support
  1411. these options.
  1412. </p>
  1413. </dd>
  1414. <dt>&lsquo;<samp>execstack</samp>&rsquo;</dt>
  1415. <dd><p>Marks the object as requiring executable stack.
  1416. </p>
  1417. </dd>
  1418. <dt>&lsquo;<samp>global</samp>&rsquo;</dt>
  1419. <dd><p>This option is only meaningful when building a shared object. It makes
  1420. the symbols defined by this shared object available for symbol resolution
  1421. of subsequently loaded libraries.
  1422. </p>
  1423. </dd>
  1424. <dt>&lsquo;<samp>globalaudit</samp>&rsquo;</dt>
  1425. <dd><p>This option is only meaningful when building a dynamic executable.
  1426. This option marks the executable as requiring global auditing by
  1427. setting the <code>DF_1_GLOBAUDIT</code> bit in the <code>DT_FLAGS_1</code> dynamic
  1428. tag. Global auditing requires that any auditing library defined via
  1429. the <samp>--depaudit</samp> or <samp>-P</samp> command-line options be run for
  1430. all dynamic objects loaded by the application.
  1431. </p>
  1432. </dd>
  1433. <dt>&lsquo;<samp>ibtplt</samp>&rsquo;</dt>
  1434. <dd><p>Generate Intel Indirect Branch Tracking (IBT) enabled PLT entries.
  1435. Supported for Linux/i386 and Linux/x86_64.
  1436. </p>
  1437. </dd>
  1438. <dt>&lsquo;<samp>ibt</samp>&rsquo;</dt>
  1439. <dd><p>Generate GNU_PROPERTY_X86_FEATURE_1_IBT in .note.gnu.property section
  1440. to indicate compatibility with IBT. This also implies <samp>ibtplt</samp>.
  1441. Supported for Linux/i386 and Linux/x86_64.
  1442. </p>
  1443. </dd>
  1444. <dt>&lsquo;<samp>indirect-extern-access</samp>&rsquo;</dt>
  1445. <dt>&lsquo;<samp>noindirect-extern-access</samp>&rsquo;</dt>
  1446. <dd><p>Generate GNU_PROPERTY_1_NEEDED_INDIRECT_EXTERN_ACCESS in
  1447. .note.gnu.property section to indicate that object file requires
  1448. canonical function pointers and cannot be used with copy relocation.
  1449. This option also implies <samp>noextern-protected-data</samp> and
  1450. <samp>nocopyreloc</samp>. Supported for i386 and x86-64.
  1451. </p>
  1452. <p><samp>noindirect-extern-access</samp> removes
  1453. GNU_PROPERTY_1_NEEDED_INDIRECT_EXTERN_ACCESS from .note.gnu.property
  1454. section.
  1455. </p>
  1456. </dd>
  1457. <dt>&lsquo;<samp>initfirst</samp>&rsquo;</dt>
  1458. <dd><p>This option is only meaningful when building a shared object.
  1459. It marks the object so that its runtime initialization will occur
  1460. before the runtime initialization of any other objects brought into
  1461. the process at the same time. Similarly the runtime finalization of
  1462. the object will occur after the runtime finalization of any other
  1463. objects.
  1464. </p>
  1465. </dd>
  1466. <dt>&lsquo;<samp>interpose</samp>&rsquo;</dt>
  1467. <dd><p>Specify that the dynamic loader should modify its symbol search order
  1468. so that symbols in this shared library interpose all other shared
  1469. libraries not so marked.
  1470. </p>
  1471. </dd>
  1472. <dt>&lsquo;<samp>unique</samp>&rsquo;</dt>
  1473. <dt>&lsquo;<samp>nounique</samp>&rsquo;</dt>
  1474. <dd><p>When generating a shared library or other dynamically loadable ELF
  1475. object mark it as one that should (by default) only ever be loaded once,
  1476. and only in the main namespace (when using <code>dlmopen</code>). This is
  1477. primarily used to mark fundamental libraries such as libc, libpthread et
  1478. al which do not usually function correctly unless they are the sole instances
  1479. of themselves. This behaviour can be overridden by the <code>dlmopen</code> caller
  1480. and does not apply to certain loading mechanisms (such as audit libraries).
  1481. </p>
  1482. </dd>
  1483. <dt>&lsquo;<samp>lam-u48</samp>&rsquo;</dt>
  1484. <dd><p>Generate GNU_PROPERTY_X86_FEATURE_1_LAM_U48 in .note.gnu.property section
  1485. to indicate compatibility with Intel LAM_U48. Supported for Linux/x86_64.
  1486. </p>
  1487. </dd>
  1488. <dt>&lsquo;<samp>lam-u57</samp>&rsquo;</dt>
  1489. <dd><p>Generate GNU_PROPERTY_X86_FEATURE_1_LAM_U57 in .note.gnu.property section
  1490. to indicate compatibility with Intel LAM_U57. Supported for Linux/x86_64.
  1491. </p>
  1492. </dd>
  1493. <dt>&lsquo;<samp>lam-u48-report=none</samp>&rsquo;</dt>
  1494. <dt>&lsquo;<samp>lam-u48-report=warning</samp>&rsquo;</dt>
  1495. <dt>&lsquo;<samp>lam-u48-report=error</samp>&rsquo;</dt>
  1496. <dd><p>Specify how to report the missing GNU_PROPERTY_X86_FEATURE_1_LAM_U48
  1497. property in input .note.gnu.property section.
  1498. <samp>lam-u48-report=none</samp>, which is the default, will make the
  1499. linker not report missing properties in input files.
  1500. <samp>lam-u48-report=warning</samp> will make the linker issue a warning for
  1501. missing properties in input files. <samp>lam-u48-report=error</samp> will
  1502. make the linker issue an error for missing properties in input files.
  1503. Supported for Linux/x86_64.
  1504. </p>
  1505. </dd>
  1506. <dt>&lsquo;<samp>lam-u57-report=none</samp>&rsquo;</dt>
  1507. <dt>&lsquo;<samp>lam-u57-report=warning</samp>&rsquo;</dt>
  1508. <dt>&lsquo;<samp>lam-u57-report=error</samp>&rsquo;</dt>
  1509. <dd><p>Specify how to report the missing GNU_PROPERTY_X86_FEATURE_1_LAM_U57
  1510. property in input .note.gnu.property section.
  1511. <samp>lam-u57-report=none</samp>, which is the default, will make the
  1512. linker not report missing properties in input files.
  1513. <samp>lam-u57-report=warning</samp> will make the linker issue a warning for
  1514. missing properties in input files. <samp>lam-u57-report=error</samp> will
  1515. make the linker issue an error for missing properties in input files.
  1516. Supported for Linux/x86_64.
  1517. </p>
  1518. </dd>
  1519. <dt>&lsquo;<samp>lam-report=none</samp>&rsquo;</dt>
  1520. <dt>&lsquo;<samp>lam-report=warning</samp>&rsquo;</dt>
  1521. <dt>&lsquo;<samp>lam-report=error</samp>&rsquo;</dt>
  1522. <dd><p>Specify how to report the missing GNU_PROPERTY_X86_FEATURE_1_LAM_U48 and
  1523. GNU_PROPERTY_X86_FEATURE_1_LAM_U57 properties in input .note.gnu.property
  1524. section. <samp>lam-report=none</samp>, which is the default, will make the
  1525. linker not report missing properties in input files.
  1526. <samp>lam-report=warning</samp> will make the linker issue a warning for
  1527. missing properties in input files. <samp>lam-report=error</samp> will make
  1528. the linker issue an error for missing properties in input files.
  1529. Supported for Linux/x86_64.
  1530. </p>
  1531. </dd>
  1532. <dt>&lsquo;<samp>lazy</samp>&rsquo;</dt>
  1533. <dd><p>When generating an executable or shared library, mark it to tell the
  1534. dynamic linker to defer function call resolution to the point when
  1535. the function is called (lazy binding), rather than at load time.
  1536. Lazy binding is the default.
  1537. </p>
  1538. </dd>
  1539. <dt>&lsquo;<samp>loadfltr</samp>&rsquo;</dt>
  1540. <dd><p>Specify that the object&rsquo;s filters be processed immediately at runtime.
  1541. </p>
  1542. </dd>
  1543. <dt>&lsquo;<samp>max-page-size=<var>value</var></samp>&rsquo;</dt>
  1544. <dd><p>Set the maximum memory page size supported to <var>value</var>.
  1545. </p>
  1546. </dd>
  1547. <dt>&lsquo;<samp>mark-plt</samp>&rsquo;</dt>
  1548. <dt>&lsquo;<samp>nomark-plt</samp>&rsquo;</dt>
  1549. <dd><p>Mark PLT entries with dynamic tags, DT_X86_64_PLT, DT_X86_64_PLTSZ and
  1550. DT_X86_64_PLTENT. Since this option stores a non-zero value in the
  1551. r_addend field of R_X86_64_JUMP_SLOT relocations, the resulting
  1552. executables and shared libraries are incompatible with dynamic linkers,
  1553. such as those in older versions of glibc without the change to ignore
  1554. r_addend in R_X86_64_GLOB_DAT and R_X86_64_JUMP_SLOT relocations, which
  1555. don&rsquo;t ignore the r_addend field of R_X86_64_JUMP_SLOT relocations.
  1556. Supported for x86_64.
  1557. </p>
  1558. </dd>
  1559. <dt>&lsquo;<samp>muldefs</samp>&rsquo;</dt>
  1560. <dd><p>Allow multiple definitions.
  1561. </p>
  1562. </dd>
  1563. <dt>&lsquo;<samp>nocopyreloc</samp>&rsquo;</dt>
  1564. <dd><p>Disable linker generated .dynbss variables used in place of variables
  1565. defined in shared libraries. May result in dynamic text relocations.
  1566. </p>
  1567. </dd>
  1568. <dt>&lsquo;<samp>nodefaultlib</samp>&rsquo;</dt>
  1569. <dd><p>Specify that the dynamic loader search for dependencies of this object
  1570. should ignore any default library search paths.
  1571. </p>
  1572. </dd>
  1573. <dt>&lsquo;<samp>nodelete</samp>&rsquo;</dt>
  1574. <dd><p>Specify that the object shouldn&rsquo;t be unloaded at runtime.
  1575. </p>
  1576. </dd>
  1577. <dt>&lsquo;<samp>nodlopen</samp>&rsquo;</dt>
  1578. <dd><p>Specify that the object is not available to <code>dlopen</code>.
  1579. </p>
  1580. </dd>
  1581. <dt>&lsquo;<samp>nodump</samp>&rsquo;</dt>
  1582. <dd><p>Specify that the object can not be dumped by <code>dldump</code>.
  1583. </p>
  1584. </dd>
  1585. <dt>&lsquo;<samp>noexecstack</samp>&rsquo;</dt>
  1586. <dd><p>Marks the object as not requiring executable stack.
  1587. </p>
  1588. </dd>
  1589. <dt>&lsquo;<samp>noextern-protected-data</samp>&rsquo;</dt>
  1590. <dd><p>Don&rsquo;t treat protected data symbols as external when building a shared
  1591. library. This option overrides the linker backend default. It can be
  1592. used to work around incorrect relocations against protected data symbols
  1593. generated by compiler. Updates on protected data symbols by another
  1594. module aren&rsquo;t visible to the resulting shared library. Supported for
  1595. i386 and x86-64.
  1596. </p>
  1597. </dd>
  1598. <dt>&lsquo;<samp>noreloc-overflow</samp>&rsquo;</dt>
  1599. <dd><p>Disable relocation overflow check. This can be used to disable
  1600. relocation overflow check if there will be no dynamic relocation
  1601. overflow at run-time. Supported for x86_64.
  1602. </p>
  1603. </dd>
  1604. <dt>&lsquo;<samp>now</samp>&rsquo;</dt>
  1605. <dd><p>When generating an executable or shared library, mark it to tell the
  1606. dynamic linker to resolve all symbols when the program is started, or
  1607. when the shared library is loaded by dlopen, instead of deferring
  1608. function call resolution to the point when the function is first
  1609. called.
  1610. </p>
  1611. </dd>
  1612. <dt>&lsquo;<samp>origin</samp>&rsquo;</dt>
  1613. <dd><p>Specify that the object requires &lsquo;<samp>$ORIGIN</samp>&rsquo; handling in paths.
  1614. </p>
  1615. </dd>
  1616. <dt>&lsquo;<samp>pack-relative-relocs</samp>&rsquo;</dt>
  1617. <dt>&lsquo;<samp>nopack-relative-relocs</samp>&rsquo;</dt>
  1618. <dd><p>Generate compact relative relocation in position-independent executable
  1619. and shared library. It adds <code>DT_RELR</code>, <code>DT_RELRSZ</code> and
  1620. <code>DT_RELRENT</code> entries to the dynamic section. It is ignored when
  1621. building position-dependent executable and relocatable output.
  1622. <samp>nopack-relative-relocs</samp> is the default, which disables compact
  1623. relative relocation. When linked against the GNU C Library, a
  1624. GLIBC_ABI_DT_RELR symbol version dependency on the shared C Library is
  1625. added to the output. Supported for i386 and x86-64.
  1626. </p>
  1627. </dd>
  1628. <dt>&lsquo;<samp>relro</samp>&rsquo;</dt>
  1629. <dt>&lsquo;<samp>norelro</samp>&rsquo;</dt>
  1630. <dd><p>Create an ELF <code>PT_GNU_RELRO</code> segment header in the object. This
  1631. specifies a memory segment that should be made read-only after
  1632. relocation, if supported. Specifying &lsquo;<samp>common-page-size</samp>&rsquo; smaller
  1633. than the system page size will render this protection ineffective.
  1634. Don&rsquo;t create an ELF <code>PT_GNU_RELRO</code> segment if &lsquo;<samp>norelro</samp>&rsquo;.
  1635. </p>
  1636. </dd>
  1637. <dt>&lsquo;<samp>report-relative-reloc</samp>&rsquo;</dt>
  1638. <dd><p>Report dynamic relative relocations generated by linker. Supported for
  1639. Linux/i386 and Linux/x86_64.
  1640. </p>
  1641. </dd>
  1642. <dt>&lsquo;<samp>sectionheader</samp>&rsquo;</dt>
  1643. <dt>&lsquo;<samp>nosectionheader</samp>&rsquo;</dt>
  1644. <dd><p>Generate section header. Don&rsquo;t generate section header if
  1645. &lsquo;<samp>nosectionheader</samp>&rsquo; is used. <samp>sectionheader</samp> is the default.
  1646. </p>
  1647. </dd>
  1648. <dt>&lsquo;<samp>separate-code</samp>&rsquo;</dt>
  1649. <dt>&lsquo;<samp>noseparate-code</samp>&rsquo;</dt>
  1650. <dd><p>Create separate code <code>PT_LOAD</code> segment header in the object. This
  1651. specifies a memory segment that should contain only instructions and must
  1652. be in wholly disjoint pages from any other data. Don&rsquo;t create separate
  1653. code <code>PT_LOAD</code> segment if &lsquo;<samp>noseparate-code</samp>&rsquo; is used.
  1654. </p>
  1655. </dd>
  1656. <dt>&lsquo;<samp>shstk</samp>&rsquo;</dt>
  1657. <dd><p>Generate GNU_PROPERTY_X86_FEATURE_1_SHSTK in .note.gnu.property section
  1658. to indicate compatibility with Intel Shadow Stack. Supported for
  1659. Linux/i386 and Linux/x86_64.
  1660. </p>
  1661. </dd>
  1662. <dt>&lsquo;<samp>stack-size=<var>value</var></samp>&rsquo;</dt>
  1663. <dd><p>Specify a stack size for an ELF <code>PT_GNU_STACK</code> segment.
  1664. Specifying zero will override any default non-zero sized
  1665. <code>PT_GNU_STACK</code> segment creation.
  1666. </p>
  1667. </dd>
  1668. <dt>&lsquo;<samp>start-stop-gc</samp>&rsquo;</dt>
  1669. <dt>&lsquo;<samp>nostart-stop-gc</samp>&rsquo;</dt>
  1670. <dd><span id="index-start_002dstop_002dgc"></span>
  1671. <p>When &lsquo;<samp>--gc-sections</samp>&rsquo; is in effect, a reference from a retained
  1672. section to <code>__start_SECNAME</code> or <code>__stop_SECNAME</code> causes all
  1673. input sections named <code>SECNAME</code> to also be retained, if
  1674. <code>SECNAME</code> is representable as a C identifier and either
  1675. <code>__start_SECNAME</code> or <code>__stop_SECNAME</code> is synthesized by the
  1676. linker. &lsquo;<samp>-z start-stop-gc</samp>&rsquo; disables this effect, allowing
  1677. sections to be garbage collected as if the special synthesized symbols
  1678. were not defined. &lsquo;<samp>-z start-stop-gc</samp>&rsquo; has no effect on a
  1679. definition of <code>__start_SECNAME</code> or <code>__stop_SECNAME</code> in an
  1680. object file or linker script. Such a definition will prevent the
  1681. linker providing a synthesized <code>__start_SECNAME</code> or
  1682. <code>__stop_SECNAME</code> respectively, and therefore the special
  1683. treatment by garbage collection for those references.
  1684. </p>
  1685. </dd>
  1686. <dt>&lsquo;<samp>start-stop-visibility=<var>value</var></samp>&rsquo;</dt>
  1687. <dd><span id="index-visibility"></span>
  1688. <span id="index-ELF-symbol-visibility"></span>
  1689. <p>Specify the ELF symbol visibility for synthesized
  1690. <code>__start_SECNAME</code> and <code>__stop_SECNAME</code> symbols (see <a href="#Input-Section-Example">Input Section Example</a>). <var>value</var> must be exactly &lsquo;<samp>default</samp>&rsquo;,
  1691. &lsquo;<samp>internal</samp>&rsquo;, &lsquo;<samp>hidden</samp>&rsquo;, or &lsquo;<samp>protected</samp>&rsquo;. If no &lsquo;<samp>-z
  1692. start-stop-visibility</samp>&rsquo; option is given, &lsquo;<samp>protected</samp>&rsquo; is used for
  1693. compatibility with historical practice. However, it&rsquo;s highly
  1694. recommended to use &lsquo;<samp>-z start-stop-visibility=hidden</samp>&rsquo; in new
  1695. programs and shared libraries so that these symbols are not exported
  1696. between shared objects, which is not usually what&rsquo;s intended.
  1697. </p>
  1698. </dd>
  1699. <dt>&lsquo;<samp>text</samp>&rsquo;</dt>
  1700. <dt>&lsquo;<samp>notext</samp>&rsquo;</dt>
  1701. <dt>&lsquo;<samp>textoff</samp>&rsquo;</dt>
  1702. <dd><p>Report an error if DT_TEXTREL is set, i.e., if the position-independent
  1703. or shared object has dynamic relocations in read-only sections. Don&rsquo;t
  1704. report an error if &lsquo;<samp>notext</samp>&rsquo; or &lsquo;<samp>textoff</samp>&rsquo;.
  1705. </p>
  1706. </dd>
  1707. <dt>&lsquo;<samp>undefs</samp>&rsquo;</dt>
  1708. <dd><p>Do not report unresolved symbol references from regular object files,
  1709. either when creating an executable, or when creating a shared library.
  1710. This option is the inverse of &lsquo;<samp>-z defs</samp>&rsquo;.
  1711. </p>
  1712. </dd>
  1713. <dt>&lsquo;<samp>unique-symbol</samp>&rsquo;</dt>
  1714. <dt>&lsquo;<samp>nounique-symbol</samp>&rsquo;</dt>
  1715. <dd><p>Avoid duplicated local symbol names in the symbol string table. Append
  1716. &quot;.<code>number</code>&quot; to duplicated local symbol names if &lsquo;<samp>unique-symbol</samp>&rsquo;
  1717. is used. <samp>nounique-symbol</samp> is the default.
  1718. </p>
  1719. </dd>
  1720. <dt>&lsquo;<samp>x86-64-baseline</samp>&rsquo;</dt>
  1721. <dt>&lsquo;<samp>x86-64-v2</samp>&rsquo;</dt>
  1722. <dt>&lsquo;<samp>x86-64-v3</samp>&rsquo;</dt>
  1723. <dt>&lsquo;<samp>x86-64-v4</samp>&rsquo;</dt>
  1724. <dd><p>Specify the x86-64 ISA level needed in .note.gnu.property section.
  1725. <samp>x86-64-baseline</samp> generates <code>GNU_PROPERTY_X86_ISA_1_BASELINE</code>.
  1726. <samp>x86-64-v2</samp> generates <code>GNU_PROPERTY_X86_ISA_1_V2</code>.
  1727. <samp>x86-64-v3</samp> generates <code>GNU_PROPERTY_X86_ISA_1_V3</code>.
  1728. <samp>x86-64-v4</samp> generates <code>GNU_PROPERTY_X86_ISA_1_V4</code>.
  1729. Supported for Linux/i386 and Linux/x86_64.
  1730. </p>
  1731. </dd>
  1732. </dl>
  1733. <p>Other keywords are ignored for Solaris compatibility.
  1734. </p>
  1735. <span id="index-_002d_0028"></span>
  1736. <span id="index-groups-of-archives"></span>
  1737. </dd>
  1738. <dt><code>-( <var>archives</var> -)</code></dt>
  1739. <dt><code>--start-group <var>archives</var> --end-group</code></dt>
  1740. <dd><p>The <var>archives</var> should be a list of archive files. They may be
  1741. either explicit file names, or &lsquo;<samp>-l</samp>&rsquo; options.
  1742. </p>
  1743. <p>The specified archives are searched repeatedly until no new undefined
  1744. references are created. Normally, an archive is searched only once in
  1745. the order that it is specified on the command line. If a symbol in that
  1746. archive is needed to resolve an undefined symbol referred to by an
  1747. object in an archive that appears later on the command line, the linker
  1748. would not be able to resolve that reference. By grouping the archives,
  1749. they will all be searched repeatedly until all possible references are
  1750. resolved.
  1751. </p>
  1752. <p>Using this option has a significant performance cost. It is best to use
  1753. it only when there are unavoidable circular references between two or
  1754. more archives.
  1755. </p>
  1756. <span id="index-_002d_002daccept_002dunknown_002dinput_002darch"></span>
  1757. <span id="index-_002d_002dno_002daccept_002dunknown_002dinput_002darch"></span>
  1758. </dd>
  1759. <dt><code>--accept-unknown-input-arch</code></dt>
  1760. <dt><code>--no-accept-unknown-input-arch</code></dt>
  1761. <dd><p>Tells the linker to accept input files whose architecture cannot be
  1762. recognised. The assumption is that the user knows what they are doing
  1763. and deliberately wants to link in these unknown input files. This was
  1764. the default behaviour of the linker, before release 2.14. The default
  1765. behaviour from release 2.14 onwards is to reject such input files, and
  1766. so the &lsquo;<samp>--accept-unknown-input-arch</samp>&rsquo; option has been added to
  1767. restore the old behaviour.
  1768. </p>
  1769. <span id="index-_002d_002das_002dneeded"></span>
  1770. <span id="index-_002d_002dno_002das_002dneeded"></span>
  1771. </dd>
  1772. <dt><code>--as-needed</code></dt>
  1773. <dt><code>--no-as-needed</code></dt>
  1774. <dd><p>This option affects ELF DT_NEEDED tags for dynamic libraries mentioned
  1775. on the command line after the <samp>--as-needed</samp> option. Normally
  1776. the linker will add a DT_NEEDED tag for each dynamic library mentioned
  1777. on the command line, regardless of whether the library is actually
  1778. needed or not. <samp>--as-needed</samp> causes a DT_NEEDED tag to only be
  1779. emitted for a library that <em>at that point in the link</em> satisfies a
  1780. non-weak undefined symbol reference from a regular object file or, if
  1781. the library is not found in the DT_NEEDED lists of other needed libraries, a
  1782. non-weak undefined symbol reference from another needed dynamic library.
  1783. Object files or libraries appearing on the command line <em>after</em>
  1784. the library in question do not affect whether the library is seen as
  1785. needed. This is similar to the rules for extraction of object files
  1786. from archives. <samp>--no-as-needed</samp> restores the default behaviour.
  1787. </p>
  1788. <p>Note: On Linux based systems the <samp>--as-needed</samp> option also has
  1789. an affect on the behaviour of the <samp>--rpath</samp> and
  1790. <samp>--rpath-link</samp> options. See the description of
  1791. <samp>--rpath-link</samp> for more details.
  1792. </p>
  1793. <span id="index-_002d_002dadd_002dneeded"></span>
  1794. <span id="index-_002d_002dno_002dadd_002dneeded"></span>
  1795. </dd>
  1796. <dt><code>--add-needed</code></dt>
  1797. <dt><code>--no-add-needed</code></dt>
  1798. <dd><p>These two options have been deprecated because of the similarity of
  1799. their names to the <samp>--as-needed</samp> and <samp>--no-as-needed</samp>
  1800. options. They have been replaced by <samp>--copy-dt-needed-entries</samp>
  1801. and <samp>--no-copy-dt-needed-entries</samp>.
  1802. </p>
  1803. <span id="index-_002dassert-keyword"></span>
  1804. </dd>
  1805. <dt><code>-assert <var>keyword</var></code></dt>
  1806. <dd><p>This option is ignored for SunOS compatibility.
  1807. </p>
  1808. <span id="index-_002dBdynamic"></span>
  1809. <span id="index-_002ddy"></span>
  1810. <span id="index-_002dcall_005fshared"></span>
  1811. </dd>
  1812. <dt><code>-Bdynamic</code></dt>
  1813. <dt><code>-dy</code></dt>
  1814. <dt><code>-call_shared</code></dt>
  1815. <dd><p>Link against dynamic libraries. This is only meaningful on platforms
  1816. for which shared libraries are supported. This option is normally the
  1817. default on such platforms. The different variants of this option are
  1818. for compatibility with various systems. You may use this option
  1819. multiple times on the command line: it affects library searching for
  1820. <samp>-l</samp> options which follow it.
  1821. </p>
  1822. <span id="index-_002dBgroup"></span>
  1823. </dd>
  1824. <dt><code>-Bgroup</code></dt>
  1825. <dd><p>Set the <code>DF_1_GROUP</code> flag in the <code>DT_FLAGS_1</code> entry in the dynamic
  1826. section. This causes the runtime linker to handle lookups in this
  1827. object and its dependencies to be performed only inside the group.
  1828. <samp>--unresolved-symbols=report-all</samp> is implied. This option is
  1829. only meaningful on ELF platforms which support shared libraries.
  1830. </p>
  1831. <span id="index-_002dBstatic"></span>
  1832. <span id="index-_002ddn"></span>
  1833. <span id="index-_002dnon_005fshared"></span>
  1834. <span id="index-_002dstatic"></span>
  1835. </dd>
  1836. <dt><code>-Bstatic</code></dt>
  1837. <dt><code>-dn</code></dt>
  1838. <dt><code>-non_shared</code></dt>
  1839. <dt><code>-static</code></dt>
  1840. <dd><p>Do not link against shared libraries. This is only meaningful on
  1841. platforms for which shared libraries are supported. The different
  1842. variants of this option are for compatibility with various systems. You
  1843. may use this option multiple times on the command line: it affects
  1844. library searching for <samp>-l</samp> options which follow it. This
  1845. option also implies <samp>--unresolved-symbols=report-all</samp>. This
  1846. option can be used with <samp>-shared</samp>. Doing so means that a
  1847. shared library is being created but that all of the library&rsquo;s external
  1848. references must be resolved by pulling in entries from static
  1849. libraries.
  1850. </p>
  1851. <span id="index-_002dBsymbolic"></span>
  1852. </dd>
  1853. <dt><code>-Bsymbolic</code></dt>
  1854. <dd><p>When creating a shared library, bind references to global symbols to the
  1855. definition within the shared library, if any. Normally, it is possible
  1856. for a program linked against a shared library to override the definition
  1857. within the shared library. This option is only meaningful on ELF
  1858. platforms which support shared libraries.
  1859. </p>
  1860. <span id="index-_002dBsymbolic_002dfunctions"></span>
  1861. </dd>
  1862. <dt><code>-Bsymbolic-functions</code></dt>
  1863. <dd><p>When creating a shared library, bind references to global function
  1864. symbols to the definition within the shared library, if any.
  1865. This option is only meaningful on ELF platforms which support shared
  1866. libraries.
  1867. </p>
  1868. <span id="index-_002dBno_002dsymbolic"></span>
  1869. </dd>
  1870. <dt><code>-Bno-symbolic</code></dt>
  1871. <dd><p>This option can cancel previously specified &lsquo;<samp>-Bsymbolic</samp>&rsquo; and
  1872. &lsquo;<samp>-Bsymbolic-functions</samp>&rsquo;.
  1873. </p>
  1874. <span id="index-_002d_002ddynamic_002dlist_003ddynamic_002dlist_002dfile"></span>
  1875. </dd>
  1876. <dt><code>--dynamic-list=<var>dynamic-list-file</var></code></dt>
  1877. <dd><p>Specify the name of a dynamic list file to the linker. This is
  1878. typically used when creating shared libraries to specify a list of
  1879. global symbols whose references shouldn&rsquo;t be bound to the definition
  1880. within the shared library, or creating dynamically linked executables
  1881. to specify a list of symbols which should be added to the symbol table
  1882. in the executable. This option is only meaningful on ELF platforms
  1883. which support shared libraries.
  1884. </p>
  1885. <p>The format of the dynamic list is the same as the version node without
  1886. scope and node name. See <a href="#VERSION">VERSION</a> for more information.
  1887. </p>
  1888. <span id="index-_002d_002ddynamic_002dlist_002ddata"></span>
  1889. </dd>
  1890. <dt><code>--dynamic-list-data</code></dt>
  1891. <dd><p>Include all global data symbols to the dynamic list.
  1892. </p>
  1893. <span id="index-_002d_002ddynamic_002dlist_002dcpp_002dnew"></span>
  1894. </dd>
  1895. <dt><code>--dynamic-list-cpp-new</code></dt>
  1896. <dd><p>Provide the builtin dynamic list for C++ operator new and delete. It
  1897. is mainly useful for building shared libstdc++.
  1898. </p>
  1899. <span id="index-_002d_002ddynamic_002dlist_002dcpp_002dtypeinfo"></span>
  1900. </dd>
  1901. <dt><code>--dynamic-list-cpp-typeinfo</code></dt>
  1902. <dd><p>Provide the builtin dynamic list for C++ runtime type identification.
  1903. </p>
  1904. <span id="index-_002d_002dcheck_002dsections"></span>
  1905. <span id="index-_002d_002dno_002dcheck_002dsections"></span>
  1906. </dd>
  1907. <dt><code>--check-sections</code></dt>
  1908. <dt><code>--no-check-sections</code></dt>
  1909. <dd><p>Asks the linker <em>not</em> to check section addresses after they have
  1910. been assigned to see if there are any overlaps. Normally the linker will
  1911. perform this check, and if it finds any overlaps it will produce
  1912. suitable error messages. The linker does know about, and does make
  1913. allowances for sections in overlays. The default behaviour can be
  1914. restored by using the command-line switch <samp>--check-sections</samp>.
  1915. Section overlap is not usually checked for relocatable links. You can
  1916. force checking in that case by using the <samp>--check-sections</samp>
  1917. option.
  1918. </p>
  1919. <span id="index-_002d_002dcopy_002ddt_002dneeded_002dentries"></span>
  1920. <span id="index-_002d_002dno_002dcopy_002ddt_002dneeded_002dentries"></span>
  1921. </dd>
  1922. <dt><code>--copy-dt-needed-entries</code></dt>
  1923. <dt><code>--no-copy-dt-needed-entries</code></dt>
  1924. <dd><p>This option affects the treatment of dynamic libraries referred to
  1925. by DT_NEEDED tags <em>inside</em> ELF dynamic libraries mentioned on the
  1926. command line. Normally the linker won&rsquo;t add a DT_NEEDED tag to the
  1927. output binary for each library mentioned in a DT_NEEDED tag in an
  1928. input dynamic library. With <samp>--copy-dt-needed-entries</samp>
  1929. specified on the command line however any dynamic libraries that
  1930. follow it will have their DT_NEEDED entries added. The default
  1931. behaviour can be restored with <samp>--no-copy-dt-needed-entries</samp>.
  1932. </p>
  1933. <p>This option also has an effect on the resolution of symbols in dynamic
  1934. libraries. With <samp>--copy-dt-needed-entries</samp> dynamic libraries
  1935. mentioned on the command line will be recursively searched, following
  1936. their DT_NEEDED tags to other libraries, in order to resolve symbols
  1937. required by the output binary. With the default setting however
  1938. the searching of dynamic libraries that follow it will stop with the
  1939. dynamic library itself. No DT_NEEDED links will be traversed to resolve
  1940. symbols.
  1941. </p>
  1942. <span id="index-cross-reference-table"></span>
  1943. <span id="index-_002d_002dcref"></span>
  1944. </dd>
  1945. <dt><code>--cref</code></dt>
  1946. <dd><p>Output a cross reference table. If a linker map file is being
  1947. generated, the cross reference table is printed to the map file.
  1948. Otherwise, it is printed on the standard output.
  1949. </p>
  1950. <p>The format of the table is intentionally simple, so that it may be
  1951. easily processed by a script if necessary. The symbols are printed out,
  1952. sorted by name. For each symbol, a list of file names is given. If the
  1953. symbol is defined, the first file listed is the location of the
  1954. definition. If the symbol is defined as a common value then any files
  1955. where this happens appear next. Finally any files that reference the
  1956. symbol are listed.
  1957. </p>
  1958. <span id="index-ctf-variables"></span>
  1959. <span id="index-_002d_002dctf_002dvariables"></span>
  1960. <span id="index-_002d_002dno_002dctf_002dvariables"></span>
  1961. </dd>
  1962. <dt><code>--ctf-variables</code></dt>
  1963. <dt><code>--no-ctf-variables</code></dt>
  1964. <dd><p>The CTF debuginfo format supports a section which encodes the names and
  1965. types of variables found in the program which do not appear in any symbol
  1966. table. These variables clearly cannot be looked up by address by
  1967. conventional debuggers, so the space used for their types and names is
  1968. usually wasted: the types are usually small but the names are often not.
  1969. <samp>--ctf-variables</samp> causes the generation of such a section.
  1970. The default behaviour can be restored with <samp>--no-ctf-variables</samp>.
  1971. </p>
  1972. <span id="index-ctf-type-sharing"></span>
  1973. <span id="index-_002d_002dctf_002dshare_002dtypes"></span>
  1974. </dd>
  1975. <dt><code>--ctf-share-types=<var>method</var></code></dt>
  1976. <dd><p>Adjust the method used to share types between translation units in CTF.
  1977. </p>
  1978. <dl compact="compact">
  1979. <dt>&lsquo;<samp>share-unconflicted</samp>&rsquo;</dt>
  1980. <dd><p>Put all types that do not have ambiguous definitions into the shared dictionary,
  1981. where debuggers can easily access them, even if they only occur in one
  1982. translation unit. This is the default.
  1983. </p>
  1984. </dd>
  1985. <dt>&lsquo;<samp>share-duplicated</samp>&rsquo;</dt>
  1986. <dd><p>Put only types that occur in multiple translation units into the shared
  1987. dictionary: types with only one definition go into per-translation-unit
  1988. dictionaries. Types with ambiguous definitions in multiple translation units
  1989. always go into per-translation-unit dictionaries. This tends to make the CTF
  1990. larger, but may reduce the amount of CTF in the shared dictionary. For very
  1991. large projects this may speed up opening the CTF and save memory in the CTF
  1992. consumer at runtime.
  1993. </p></dd>
  1994. </dl>
  1995. <span id="index-common-allocation-1"></span>
  1996. <span id="index-_002d_002dno_002ddefine_002dcommon"></span>
  1997. </dd>
  1998. <dt><code>--no-define-common</code></dt>
  1999. <dd><p>This option inhibits the assignment of addresses to common symbols.
  2000. The script command <code>INHIBIT_COMMON_ALLOCATION</code> has the same effect.
  2001. See <a href="#Miscellaneous-Commands">Miscellaneous Commands</a>.
  2002. </p>
  2003. <p>The &lsquo;<samp>--no-define-common</samp>&rsquo; option allows decoupling
  2004. the decision to assign addresses to Common symbols from the choice
  2005. of the output file type; otherwise a non-Relocatable output type
  2006. forces assigning addresses to Common symbols.
  2007. Using &lsquo;<samp>--no-define-common</samp>&rsquo; allows Common symbols that are referenced
  2008. from a shared library to be assigned addresses only in the main program.
  2009. This eliminates the unused duplicate space in the shared library,
  2010. and also prevents any possible confusion over resolving to the wrong
  2011. duplicate when there are many dynamic modules with specialized search
  2012. paths for runtime symbol resolution.
  2013. </p>
  2014. <span id="index-group-allocation-in-linker-script"></span>
  2015. <span id="index-section-groups"></span>
  2016. <span id="index-COMDAT"></span>
  2017. <span id="index-_002d_002dforce_002dgroup_002dallocation"></span>
  2018. </dd>
  2019. <dt><code>--force-group-allocation</code></dt>
  2020. <dd><p>This option causes the linker to place section group members like
  2021. normal input sections, and to delete the section groups. This is the
  2022. default behaviour for a final link but this option can be used to
  2023. change the behaviour of a relocatable link (&lsquo;<samp>-r</samp>&rsquo;). The script
  2024. command <code>FORCE_GROUP_ALLOCATION</code> has the same
  2025. effect. See <a href="#Miscellaneous-Commands">Miscellaneous Commands</a>.
  2026. </p>
  2027. <span id="index-symbols_002c-from-command-line"></span>
  2028. <span id="index-_002d_002ddefsym_003dsymbol_003dexp"></span>
  2029. </dd>
  2030. <dt><code>--defsym=<var>symbol</var>=<var>expression</var></code></dt>
  2031. <dd><p>Create a global symbol in the output file, containing the absolute
  2032. address given by <var>expression</var>. You may use this option as many
  2033. times as necessary to define multiple symbols in the command line. A
  2034. limited form of arithmetic is supported for the <var>expression</var> in this
  2035. context: you may give a hexadecimal constant or the name of an existing
  2036. symbol, or use <code>+</code> and <code>-</code> to add or subtract hexadecimal
  2037. constants or symbols. If you need more elaborate expressions, consider
  2038. using the linker command language from a script (see <a href="#Assignments">Assignments</a>).
  2039. <em>Note:</em> there should be no white space between <var>symbol</var>, the
  2040. equals sign (&ldquo;<tt class="key">=</tt>&rdquo;), and <var>expression</var>.
  2041. </p>
  2042. <p>The linker processes &lsquo;<samp>--defsym</samp>&rsquo; arguments and &lsquo;<samp>-T</samp>&rsquo; arguments
  2043. in order, placing &lsquo;<samp>--defsym</samp>&rsquo; before &lsquo;<samp>-T</samp>&rsquo; will define the
  2044. symbol before the linker script from &lsquo;<samp>-T</samp>&rsquo; is processed, while
  2045. placing &lsquo;<samp>--defsym</samp>&rsquo; after &lsquo;<samp>-T</samp>&rsquo; will define the symbol after
  2046. the linker script has been processed. This difference has
  2047. consequences for expressions within the linker script that use the
  2048. &lsquo;<samp>--defsym</samp>&rsquo; symbols, which order is correct will depend on what
  2049. you are trying to achieve.
  2050. </p>
  2051. <span id="index-demangling_002c-from-command-line"></span>
  2052. <span id="index-_002d_002ddemangle_005b_003dstyle_005d"></span>
  2053. <span id="index-_002d_002dno_002ddemangle"></span>
  2054. </dd>
  2055. <dt><code>--demangle[=<var>style</var>]</code></dt>
  2056. <dt><code>--no-demangle</code></dt>
  2057. <dd><p>These options control whether to demangle symbol names in error messages
  2058. and other output. When the linker is told to demangle, it tries to
  2059. present symbol names in a readable fashion: it strips leading
  2060. underscores if they are used by the object file format, and converts C++
  2061. mangled symbol names into user readable names. Different compilers have
  2062. different mangling styles. The optional demangling style argument can be used
  2063. to choose an appropriate demangling style for your compiler. The linker will
  2064. demangle by default unless the environment variable &lsquo;<samp>COLLECT_NO_DEMANGLE</samp>&rsquo;
  2065. is set. These options may be used to override the default.
  2066. </p>
  2067. <span id="index-dynamic-linker_002c-from-command-line"></span>
  2068. <span id="index-_002dIfile"></span>
  2069. <span id="index-_002d_002ddynamic_002dlinker_003dfile"></span>
  2070. </dd>
  2071. <dt><code>-I<var>file</var></code></dt>
  2072. <dt><code>--dynamic-linker=<var>file</var></code></dt>
  2073. <dd><p>Set the name of the dynamic linker. This is only meaningful when
  2074. generating dynamically linked ELF executables. The default dynamic
  2075. linker is normally correct; don&rsquo;t use this unless you know what you are
  2076. doing.
  2077. </p>
  2078. <span id="index-_002d_002dno_002ddynamic_002dlinker"></span>
  2079. </dd>
  2080. <dt><code>--no-dynamic-linker</code></dt>
  2081. <dd><p>When producing an executable file, omit the request for a dynamic
  2082. linker to be used at load-time. This is only meaningful for ELF
  2083. executables that contain dynamic relocations, and usually requires
  2084. entry point code that is capable of processing these relocations.
  2085. </p>
  2086. <span id="index-_002d_002dembedded_002drelocs"></span>
  2087. </dd>
  2088. <dt><code>--embedded-relocs</code></dt>
  2089. <dd><p>This option is similar to the <samp>--emit-relocs</samp> option except
  2090. that the relocs are stored in a target-specific section. This option
  2091. is only supported by the &lsquo;<samp>BFIN</samp>&rsquo;, &lsquo;<samp>CR16</samp>&rsquo; and <em>M68K</em>
  2092. targets.
  2093. </p>
  2094. <span id="index-_002d_002ddisable_002dmultiple_002dabs_002ddefs"></span>
  2095. </dd>
  2096. <dt><code>--disable-multiple-abs-defs</code></dt>
  2097. <dd><p>Do not allow multiple definitions with symbols included
  2098. in filename invoked by -R or &ndash;just-symbols
  2099. </p>
  2100. <span id="index-_002d_002dfatal_002dwarnings"></span>
  2101. <span id="index-_002d_002dno_002dfatal_002dwarnings"></span>
  2102. </dd>
  2103. <dt><code>--fatal-warnings</code></dt>
  2104. <dt><code>--no-fatal-warnings</code></dt>
  2105. <dd><p>Treat all warnings as errors. The default behaviour can be restored
  2106. with the option <samp>--no-fatal-warnings</samp>.
  2107. </p>
  2108. <span id="index-_002dw"></span>
  2109. <span id="index-_002d_002dno_002dwarnings"></span>
  2110. </dd>
  2111. <dt><code>-w</code></dt>
  2112. <dt><code>--no-warnings</code></dt>
  2113. <dd><p>Do not display any warning or error messages. This overrides
  2114. <samp>--fatal-warnings</samp> if it has been enabled. This option can be
  2115. used when it is known that the output binary will not work, but there
  2116. is still a need to create it.
  2117. </p>
  2118. <span id="index-_002d_002dforce_002dexe_002dsuffix"></span>
  2119. </dd>
  2120. <dt><code>--force-exe-suffix</code></dt>
  2121. <dd><p>Make sure that an output file has a .exe suffix.
  2122. </p>
  2123. <p>If a successfully built fully linked output file does not have a
  2124. <code>.exe</code> or <code>.dll</code> suffix, this option forces the linker to copy
  2125. the output file to one of the same name with a <code>.exe</code> suffix. This
  2126. option is useful when using unmodified Unix makefiles on a Microsoft
  2127. Windows host, since some versions of Windows won&rsquo;t run an image unless
  2128. it ends in a <code>.exe</code> suffix.
  2129. </p>
  2130. <span id="index-_002d_002dgc_002dsections"></span>
  2131. <span id="index-_002d_002dno_002dgc_002dsections"></span>
  2132. <span id="index-garbage-collection"></span>
  2133. </dd>
  2134. <dt><code>--gc-sections</code></dt>
  2135. <dt><code>--no-gc-sections</code></dt>
  2136. <dd><p>Enable garbage collection of unused input sections. It is ignored on
  2137. targets that do not support this option. The default behaviour (of not
  2138. performing this garbage collection) can be restored by specifying
  2139. &lsquo;<samp>--no-gc-sections</samp>&rsquo; on the command line. Note that garbage
  2140. collection for COFF and PE format targets is supported, but the
  2141. implementation is currently considered to be experimental.
  2142. </p>
  2143. <p>&lsquo;<samp>--gc-sections</samp>&rsquo; decides which input sections are used by
  2144. examining symbols and relocations. The section containing the entry
  2145. symbol and all sections containing symbols undefined on the
  2146. command-line will be kept, as will sections containing symbols
  2147. referenced by dynamic objects. Note that when building shared
  2148. libraries, the linker must assume that any visible symbol is
  2149. referenced. Once this initial set of sections has been determined,
  2150. the linker recursively marks as used any section referenced by their
  2151. relocations. See &lsquo;<samp>--entry</samp>&rsquo;, &lsquo;<samp>--undefined</samp>&rsquo;, and
  2152. &lsquo;<samp>--gc-keep-exported</samp>&rsquo;.
  2153. </p>
  2154. <p>This option can be set when doing a partial link (enabled with option
  2155. &lsquo;<samp>-r</samp>&rsquo;). In this case the root of symbols kept must be explicitly
  2156. specified either by one of the options &lsquo;<samp>--entry</samp>&rsquo;,
  2157. &lsquo;<samp>--undefined</samp>&rsquo;, or &lsquo;<samp>--gc-keep-exported</samp>&rsquo; or by a <code>ENTRY</code>
  2158. command in the linker script.
  2159. </p>
  2160. <p>As a GNU extension, ELF input sections marked with the
  2161. <code>SHF_GNU_RETAIN</code> flag will not be garbage collected.
  2162. </p>
  2163. <span id="index-_002d_002dprint_002dgc_002dsections"></span>
  2164. <span id="index-_002d_002dno_002dprint_002dgc_002dsections"></span>
  2165. <span id="index-garbage-collection-1"></span>
  2166. </dd>
  2167. <dt><code>--print-gc-sections</code></dt>
  2168. <dt><code>--no-print-gc-sections</code></dt>
  2169. <dd><p>List all sections removed by garbage collection. The listing is
  2170. printed on stderr. This option is only effective if garbage
  2171. collection has been enabled via the &lsquo;<samp>--gc-sections</samp>&rsquo;) option. The
  2172. default behaviour (of not listing the sections that are removed) can
  2173. be restored by specifying &lsquo;<samp>--no-print-gc-sections</samp>&rsquo; on the command
  2174. line.
  2175. </p>
  2176. <span id="index-_002d_002dgc_002dkeep_002dexported"></span>
  2177. <span id="index-garbage-collection-2"></span>
  2178. </dd>
  2179. <dt><code>--gc-keep-exported</code></dt>
  2180. <dd><p>When &lsquo;<samp>--gc-sections</samp>&rsquo; is enabled, this option prevents garbage
  2181. collection of unused input sections that contain global symbols having
  2182. default or protected visibility. This option is intended to be used for
  2183. executables where unreferenced sections would otherwise be garbage
  2184. collected regardless of the external visibility of contained symbols.
  2185. Note that this option has no effect when linking shared objects since
  2186. it is already the default behaviour. This option is only supported for
  2187. ELF format targets.
  2188. </p>
  2189. <span id="index-_002d_002dprint_002doutput_002dformat"></span>
  2190. <span id="index-output-format"></span>
  2191. </dd>
  2192. <dt><code>--print-output-format</code></dt>
  2193. <dd><p>Print the name of the default output format (perhaps influenced by
  2194. other command-line options). This is the string that would appear
  2195. in an <code>OUTPUT_FORMAT</code> linker script command (see <a href="#File-Commands">File Commands</a>).
  2196. </p>
  2197. <span id="index-_002d_002dprint_002dmemory_002dusage"></span>
  2198. <span id="index-memory-usage"></span>
  2199. </dd>
  2200. <dt><code>--print-memory-usage</code></dt>
  2201. <dd><p>Print used size, total size and used size of memory regions created with
  2202. the <a href="#MEMORY">MEMORY</a> command. This is useful on embedded targets to have a
  2203. quick view of amount of free memory. The format of the output has one
  2204. headline and one line per region. It is both human readable and easily
  2205. parsable by tools. Here is an example of an output:
  2206. </p>
  2207. <div class="example">
  2208. <pre class="example">Memory region Used Size Region Size %age Used
  2209. ROM: 256 KB 1 MB 25.00%
  2210. RAM: 32 B 2 GB 0.00%
  2211. </pre></div>
  2212. <span id="index-help"></span>
  2213. <span id="index-usage"></span>
  2214. <span id="index-_002d_002dhelp"></span>
  2215. </dd>
  2216. <dt><code>--help</code></dt>
  2217. <dd><p>Print a summary of the command-line options on the standard output and exit.
  2218. </p>
  2219. <span id="index-_002d_002dtarget_002dhelp"></span>
  2220. </dd>
  2221. <dt><code>--target-help</code></dt>
  2222. <dd><p>Print a summary of all target-specific options on the standard output and exit.
  2223. </p>
  2224. <span id="index-_002dMap_003dmapfile"></span>
  2225. </dd>
  2226. <dt><code>-Map=<var>mapfile</var></code></dt>
  2227. <dd><p>Print a link map to the file <var>mapfile</var>. See the description of the
  2228. <samp>-M</samp> option, above. If <var>mapfile</var> is just the character
  2229. <code>-</code> then the map will be written to stdout.
  2230. </p>
  2231. <p>Specifying a directory as <var>mapfile</var> causes the linker map to be
  2232. written as a file inside the directory. Normally name of the file
  2233. inside the directory is computed as the basename of the <var>output</var>
  2234. file with <code>.map</code> appended. If however the special character
  2235. <code>%</code> is used then this will be replaced by the full path of the
  2236. output file. Additionally if there are any characters after the
  2237. <var>%</var> symbol then <code>.map</code> will no longer be appended.
  2238. </p>
  2239. <div class="example">
  2240. <pre class="example"> -o foo.exe -Map=bar [Creates ./bar]
  2241. -o ../dir/foo.exe -Map=bar [Creates ./bar]
  2242. -o foo.exe -Map=../dir [Creates ../dir/foo.exe.map]
  2243. -o ../dir2/foo.exe -Map=../dir [Creates ../dir/foo.exe.map]
  2244. -o foo.exe -Map=% [Creates ./foo.exe.map]
  2245. -o ../dir/foo.exe -Map=% [Creates ../dir/foo.exe.map]
  2246. -o foo.exe -Map=%.bar [Creates ./foo.exe.bar]
  2247. -o ../dir/foo.exe -Map=%.bar [Creates ../dir/foo.exe.bar]
  2248. -o ../dir2/foo.exe -Map=../dir/% [Creates ../dir/../dir2/foo.exe.map]
  2249. -o ../dir2/foo.exe -Map=../dir/%.bar [Creates ../dir/../dir2/foo.exe.bar]
  2250. </pre></div>
  2251. <p>It is an error to specify more than one <code>%</code> character.
  2252. </p>
  2253. <p>If the map file already exists then it will be overwritten by this
  2254. operation.
  2255. </p>
  2256. <span id="index-memory-usage-1"></span>
  2257. <span id="index-_002d_002dno_002dkeep_002dmemory"></span>
  2258. </dd>
  2259. <dt><code>--no-keep-memory</code></dt>
  2260. <dd><p><code>ld</code> normally optimizes for speed over memory usage by caching the
  2261. symbol tables of input files in memory. This option tells <code>ld</code> to
  2262. instead optimize for memory usage, by rereading the symbol tables as
  2263. necessary. This may be required if <code>ld</code> runs out of memory space
  2264. while linking a large executable.
  2265. </p>
  2266. <span id="index-_002d_002dno_002dundefined"></span>
  2267. <span id="index-_002dz-defs"></span>
  2268. <span id="index-_002dz-undefs"></span>
  2269. </dd>
  2270. <dt><code>--no-undefined</code></dt>
  2271. <dt><code>-z defs</code></dt>
  2272. <dd><p>Report unresolved symbol references from regular object files. This
  2273. is done even if the linker is creating a non-symbolic shared library.
  2274. The switch <samp>--[no-]allow-shlib-undefined</samp> controls the
  2275. behaviour for reporting unresolved references found in shared
  2276. libraries being linked in.
  2277. </p>
  2278. <p>The effects of this option can be reverted by using <code>-z undefs</code>.
  2279. </p>
  2280. <span id="index-_002d_002dallow_002dmultiple_002ddefinition"></span>
  2281. <span id="index-_002dz-muldefs"></span>
  2282. </dd>
  2283. <dt><code>--allow-multiple-definition</code></dt>
  2284. <dt><code>-z muldefs</code></dt>
  2285. <dd><p>Normally when a symbol is defined multiple times, the linker will
  2286. report a fatal error. These options allow multiple definitions and the
  2287. first definition will be used.
  2288. </p>
  2289. <span id="index-_002d_002dallow_002dshlib_002dundefined"></span>
  2290. <span id="index-_002d_002dno_002dallow_002dshlib_002dundefined"></span>
  2291. </dd>
  2292. <dt><code>--allow-shlib-undefined</code></dt>
  2293. <dt><code>--no-allow-shlib-undefined</code></dt>
  2294. <dd><p>Allows or disallows undefined symbols in shared libraries.
  2295. This switch is similar to <samp>--no-undefined</samp> except that it
  2296. determines the behaviour when the undefined symbols are in a
  2297. shared library rather than a regular object file. It does not affect
  2298. how undefined symbols in regular object files are handled.
  2299. </p>
  2300. <p>The default behaviour is to report errors for any undefined symbols
  2301. referenced in shared libraries if the linker is being used to create
  2302. an executable, but to allow them if the linker is being used to create
  2303. a shared library.
  2304. </p>
  2305. <p>The reasons for allowing undefined symbol references in shared
  2306. libraries specified at link time are that:
  2307. </p>
  2308. <ul>
  2309. <li> A shared library specified at link time may not be the same as the one
  2310. that is available at load time, so the symbol might actually be
  2311. resolvable at load time.
  2312. </li><li> There are some operating systems, eg BeOS and HPPA, where undefined
  2313. symbols in shared libraries are normal.
  2314. <p>The BeOS kernel for example patches shared libraries at load time to
  2315. select whichever function is most appropriate for the current
  2316. architecture. This is used, for example, to dynamically select an
  2317. appropriate memset function.
  2318. </p></li></ul>
  2319. <span id="index-_002d_002derror_002dhandling_002dscript_003dscriptname"></span>
  2320. </dd>
  2321. <dt><code>--error-handling-script=<var>scriptname</var></code></dt>
  2322. <dd><p>If this option is provided then the linker will invoke
  2323. <var>scriptname</var> whenever an error is encountered. Currently however
  2324. only two kinds of error are supported: missing symbols and missing
  2325. libraries. Two arguments will be passed to script: the keyword
  2326. &ldquo;undefined-symbol&rdquo; or &lsquo;missing-lib&rdquo; and the <var>name</var> of the
  2327. undefined symbol or missing library. The intention is that the script
  2328. will provide suggestions to the user as to where the symbol or library
  2329. might be found. After the script has finished then the normal linker
  2330. error message will be displayed.
  2331. </p>
  2332. <p>The availability of this option is controlled by a configure time
  2333. switch, so it may not be present in specific implementations.
  2334. </p>
  2335. <span id="index-_002d_002dno_002dundefined_002dversion"></span>
  2336. </dd>
  2337. <dt><code>--no-undefined-version</code></dt>
  2338. <dd><p>Normally when a symbol has an undefined version, the linker will ignore
  2339. it. This option disallows symbols with undefined version and a fatal error
  2340. will be issued instead.
  2341. </p>
  2342. <span id="index-_002d_002ddefault_002dsymver"></span>
  2343. </dd>
  2344. <dt><code>--default-symver</code></dt>
  2345. <dd><p>Create and use a default symbol version (the soname) for unversioned
  2346. exported symbols.
  2347. </p>
  2348. <span id="index-_002d_002ddefault_002dimported_002dsymver"></span>
  2349. </dd>
  2350. <dt><code>--default-imported-symver</code></dt>
  2351. <dd><p>Create and use a default symbol version (the soname) for unversioned
  2352. imported symbols.
  2353. </p>
  2354. <span id="index-_002d_002dno_002dwarn_002dmismatch"></span>
  2355. </dd>
  2356. <dt><code>--no-warn-mismatch</code></dt>
  2357. <dd><p>Normally <code>ld</code> will give an error if you try to link together input
  2358. files that are mismatched for some reason, perhaps because they have
  2359. been compiled for different processors or for different endiannesses.
  2360. This option tells <code>ld</code> that it should silently permit such possible
  2361. errors. This option should only be used with care, in cases when you
  2362. have taken some special action that ensures that the linker errors are
  2363. inappropriate.
  2364. </p>
  2365. <span id="index-_002d_002dno_002dwarn_002dsearch_002dmismatch"></span>
  2366. </dd>
  2367. <dt><code>--no-warn-search-mismatch</code></dt>
  2368. <dd><p>Normally <code>ld</code> will give a warning if it finds an incompatible
  2369. library during a library search. This option silences the warning.
  2370. </p>
  2371. <span id="index-_002d_002dno_002dwhole_002darchive"></span>
  2372. </dd>
  2373. <dt><code>--no-whole-archive</code></dt>
  2374. <dd><p>Turn off the effect of the <samp>--whole-archive</samp> option for subsequent
  2375. archive files.
  2376. </p>
  2377. <span id="index-output-file-after-errors"></span>
  2378. <span id="index-_002d_002dnoinhibit_002dexec"></span>
  2379. </dd>
  2380. <dt><code>--noinhibit-exec</code></dt>
  2381. <dd><p>Retain the executable output file whenever it is still usable.
  2382. Normally, the linker will not produce an output file if it encounters
  2383. errors during the link process; it exits without writing an output file
  2384. when it issues any error whatsoever.
  2385. </p>
  2386. <span id="index-_002dnostdlib"></span>
  2387. </dd>
  2388. <dt><code>-nostdlib</code></dt>
  2389. <dd><p>Only search library directories explicitly specified on the
  2390. command line. Library directories specified in linker scripts
  2391. (including linker scripts specified on the command line) are ignored.
  2392. </p>
  2393. <span id="index-_002d_002doformat_003doutput_002dformat"></span>
  2394. </dd>
  2395. <dt><code>--oformat=<var>output-format</var></code></dt>
  2396. <dd><p><code>ld</code> may be configured to support more than one kind of object
  2397. file. If your <code>ld</code> is configured this way, you can use the
  2398. &lsquo;<samp>--oformat</samp>&rsquo; option to specify the binary format for the output
  2399. object file. Even when <code>ld</code> is configured to support alternative
  2400. object formats, you don&rsquo;t usually need to specify this, as <code>ld</code>
  2401. should be configured to produce as a default output format the most
  2402. usual format on each machine. <var>output-format</var> is a text string, the
  2403. name of a particular format supported by the BFD libraries. (You can
  2404. list the available binary formats with &lsquo;<samp>objdump -i</samp>&rsquo;.) The script
  2405. command <code>OUTPUT_FORMAT</code> can also specify the output format, but
  2406. this option overrides it. See <a href="#BFD">BFD</a>.
  2407. </p>
  2408. <span id="index-_002d_002dout_002dimplib"></span>
  2409. </dd>
  2410. <dt><code>--out-implib <var>file</var></code></dt>
  2411. <dd><p>Create an import library in <var>file</var> corresponding to the executable
  2412. the linker is generating (eg. a DLL or ELF program). This import
  2413. library (which should be called <code>*.dll.a</code> or <code>*.a</code> for DLLs)
  2414. may be used to link clients against the generated executable; this
  2415. behaviour makes it possible to skip a separate import library creation
  2416. step (eg. <code>dlltool</code> for DLLs). This option is only available for
  2417. the i386 PE and ELF targetted ports of the linker.
  2418. </p>
  2419. <span id="index-_002dpie"></span>
  2420. <span id="index-_002d_002dpic_002dexecutable"></span>
  2421. </dd>
  2422. <dt><code>-pie</code></dt>
  2423. <dt><code>--pic-executable</code></dt>
  2424. <dd><span id="index-position-independent-executables"></span>
  2425. <p>Create a position independent executable. This is currently only supported on
  2426. ELF platforms. Position independent executables are similar to shared
  2427. libraries in that they are relocated by the dynamic linker to the virtual
  2428. address the OS chooses for them (which can vary between invocations). Like
  2429. normal dynamically linked executables they can be executed and symbols
  2430. defined in the executable cannot be overridden by shared libraries.
  2431. </p>
  2432. <span id="index-_002dno_002dpie"></span>
  2433. </dd>
  2434. <dt><code>-no-pie</code></dt>
  2435. <dd><span id="index-position-dependent-executables"></span>
  2436. <p>Create a position dependent executable. This is the default.
  2437. </p>
  2438. <span id="index-_002dqmagic"></span>
  2439. </dd>
  2440. <dt><code>-qmagic</code></dt>
  2441. <dd><p>This option is ignored for Linux compatibility.
  2442. </p>
  2443. <span id="index-_002dQy"></span>
  2444. </dd>
  2445. <dt><code>-Qy</code></dt>
  2446. <dd><p>This option is ignored for SVR4 compatibility.
  2447. </p>
  2448. <span id="index-_002d_002drelax"></span>
  2449. <span id="index-synthesizing-linker"></span>
  2450. <span id="index-relaxing-addressing-modes"></span>
  2451. <span id="index-_002d_002dno_002drelax"></span>
  2452. </dd>
  2453. <dt><code>--relax</code></dt>
  2454. <dt><code>--no-relax</code></dt>
  2455. <dd><p>An option with machine dependent effects.
  2456. This option is only supported on a few targets.
  2457. See <a href="#H8_002f300"><code>ld</code> and the H8/300</a>.
  2458. See <a href="#Xtensa"><code>ld</code> and Xtensa Processors</a>.
  2459. See <a href="#M68HC11_002f68HC12"><code>ld</code> and the 68HC11 and 68HC12</a>.
  2460. See <a href="#Nios-II"><code>ld</code> and the Altera Nios II</a>.
  2461. See <a href="#PowerPC-ELF32"><code>ld</code> and PowerPC 32-bit ELF Support</a>.
  2462. </p>
  2463. <p>On some platforms the <samp>--relax</samp> option performs target specific,
  2464. global optimizations that become possible when the linker resolves
  2465. addressing in the program, such as relaxing address modes,
  2466. synthesizing new instructions, selecting shorter version of current
  2467. instructions, and combining constant values.
  2468. </p>
  2469. <p>On some platforms these link time global optimizations may make symbolic
  2470. debugging of the resulting executable impossible.
  2471. This is known to be the case for the Matsushita MN10200 and MN10300
  2472. family of processors.
  2473. </p>
  2474. <p>On platforms where the feature is supported, the option
  2475. <samp>--no-relax</samp> will disable it.
  2476. </p>
  2477. <p>On platforms where the feature is not supported, both <samp>--relax</samp>
  2478. and <samp>--no-relax</samp> are accepted, but ignored.
  2479. </p>
  2480. <span id="index-retaining-specified-symbols"></span>
  2481. <span id="index-stripping-all-but-some-symbols"></span>
  2482. <span id="index-symbols_002c-retaining-selectively"></span>
  2483. <span id="index-_002d_002dretain_002dsymbols_002dfile_003dfilename"></span>
  2484. </dd>
  2485. <dt><code>--retain-symbols-file=<var>filename</var></code></dt>
  2486. <dd><p>Retain <em>only</em> the symbols listed in the file <var>filename</var>,
  2487. discarding all others. <var>filename</var> is simply a flat file, with one
  2488. symbol name per line. This option is especially useful in environments
  2489. (such as VxWorks)
  2490. where a large global symbol table is accumulated gradually, to conserve
  2491. run-time memory.
  2492. </p>
  2493. <p>&lsquo;<samp>--retain-symbols-file</samp>&rsquo; does <em>not</em> discard undefined symbols,
  2494. or symbols needed for relocations.
  2495. </p>
  2496. <p>You may only specify &lsquo;<samp>--retain-symbols-file</samp>&rsquo; once in the command
  2497. line. It overrides &lsquo;<samp>-s</samp>&rsquo; and &lsquo;<samp>-S</samp>&rsquo;.
  2498. </p>
  2499. </dd>
  2500. <dt><code>-rpath=<var>dir</var></code></dt>
  2501. <dd><span id="index-runtime-library-search-path"></span>
  2502. <span id="index-_002drpath_003ddir"></span>
  2503. <p>Add a directory to the runtime library search path. This is used when
  2504. linking an ELF executable with shared objects. All <samp>-rpath</samp>
  2505. arguments are concatenated and passed to the runtime linker, which uses
  2506. them to locate shared objects at runtime.
  2507. </p>
  2508. <p>The <samp>-rpath</samp> option is also used when locating shared objects which
  2509. are needed by shared objects explicitly included in the link; see the
  2510. description of the <samp>-rpath-link</samp> option. Searching <samp>-rpath</samp>
  2511. in this way is only supported by native linkers and cross linkers which
  2512. have been configured with the <samp>--with-sysroot</samp> option.
  2513. </p>
  2514. <p>If <samp>-rpath</samp> is not used when linking an ELF executable, the
  2515. contents of the environment variable <code>LD_RUN_PATH</code> will be used if it
  2516. is defined.
  2517. </p>
  2518. <p>The <samp>-rpath</samp> option may also be used on SunOS. By default, on
  2519. SunOS, the linker will form a runtime search path out of all the
  2520. <samp>-L</samp> options it is given. If a <samp>-rpath</samp> option is used, the
  2521. runtime search path will be formed exclusively using the <samp>-rpath</samp>
  2522. options, ignoring the <samp>-L</samp> options. This can be useful when using
  2523. gcc, which adds many <samp>-L</samp> options which may be on NFS mounted
  2524. file systems.
  2525. </p>
  2526. <p>For compatibility with other ELF linkers, if the <samp>-R</samp> option is
  2527. followed by a directory name, rather than a file name, it is treated as
  2528. the <samp>-rpath</samp> option.
  2529. </p>
  2530. <span id="index-link_002dtime-runtime-library-search-path"></span>
  2531. <span id="index-_002drpath_002dlink_003ddir"></span>
  2532. </dd>
  2533. <dt><code>-rpath-link=<var>dir</var></code></dt>
  2534. <dd><p>When using ELF or SunOS, one shared library may require another. This
  2535. happens when an <code>ld -shared</code> link includes a shared library as one
  2536. of the input files.
  2537. </p>
  2538. <p>When the linker encounters such a dependency when doing a non-shared,
  2539. non-relocatable link, it will automatically try to locate the required
  2540. shared library and include it in the link, if it is not included
  2541. explicitly. In such a case, the <samp>-rpath-link</samp> option
  2542. specifies the first set of directories to search. The
  2543. <samp>-rpath-link</samp> option may specify a sequence of directory names
  2544. either by specifying a list of names separated by colons, or by
  2545. appearing multiple times.
  2546. </p>
  2547. <p>The tokens <var>$ORIGIN</var> and <var>$LIB</var> can appear in these search
  2548. directories. They will be replaced by the full path to the directory
  2549. containing the program or shared object in the case of <var>$ORIGIN</var>
  2550. and either &lsquo;<samp>lib</samp>&rsquo; - for 32-bit binaries - or &lsquo;<samp>lib64</samp>&rsquo; - for
  2551. 64-bit binaries - in the case of <var>$LIB</var>.
  2552. </p>
  2553. <p>The alternative form of these tokens - <var>${ORIGIN}</var> and
  2554. <var>${LIB}</var> can also be used. The token <var>$PLATFORM</var> is not
  2555. supported.
  2556. </p>
  2557. <p>This option should be used with caution as it overrides the search path
  2558. that may have been hard compiled into a shared library. In such a case it
  2559. is possible to use unintentionally a different search path than the
  2560. runtime linker would do.
  2561. </p>
  2562. <p>The linker uses the following search paths to locate required shared
  2563. libraries:
  2564. </p>
  2565. <ol>
  2566. <li> Any directories specified by <samp>-rpath-link</samp> options.
  2567. </li><li> Any directories specified by <samp>-rpath</samp> options. The difference
  2568. between <samp>-rpath</samp> and <samp>-rpath-link</samp> is that directories
  2569. specified by <samp>-rpath</samp> options are included in the executable and
  2570. used at runtime, whereas the <samp>-rpath-link</samp> option is only effective
  2571. at link time. Searching <samp>-rpath</samp> in this way is only supported
  2572. by native linkers and cross linkers which have been configured with
  2573. the <samp>--with-sysroot</samp> option.
  2574. </li><li> On an ELF system, for native linkers, if the <samp>-rpath</samp> and
  2575. <samp>-rpath-link</samp> options were not used, search the contents of the
  2576. environment variable <code>LD_RUN_PATH</code>.
  2577. </li><li> On SunOS, if the <samp>-rpath</samp> option was not used, search any
  2578. directories specified using <samp>-L</samp> options.
  2579. </li><li> For a native linker, search the contents of the environment
  2580. variable <code>LD_LIBRARY_PATH</code>.
  2581. </li><li> For a native ELF linker, the directories in <code>DT_RUNPATH</code> or
  2582. <code>DT_RPATH</code> of a shared library are searched for shared
  2583. libraries needed by it. The <code>DT_RPATH</code> entries are ignored if
  2584. <code>DT_RUNPATH</code> entries exist.
  2585. </li><li> For a linker for a Linux system, if the file <samp>/etc/ld.so.conf</samp>
  2586. exists, the list of directories found in that file. Note: the path
  2587. to this file is prefixed with the <code>sysroot</code> value, if that is
  2588. defined, and then any <code>prefix</code> string if the linker was
  2589. configured with the <code>--prefix=&lt;path&gt;</code> option.
  2590. </li><li> For a native linker on a FreeBSD system, any directories specified by
  2591. the <code>_PATH_ELF_HINTS</code> macro defined in the <samp>elf-hints.h</samp>
  2592. header file.
  2593. </li><li> Any directories specified by a <code>SEARCH_DIR</code> command in a
  2594. linker script given on the command line, including scripts specified
  2595. by <samp>-T</samp> (but not <samp>-dT</samp>).
  2596. </li><li> The default directories, normally <samp>/lib</samp> and <samp>/usr/lib</samp>.
  2597. </li><li> Any directories specified by a plugin LDPT_SET_EXTRA_LIBRARY_PATH.
  2598. </li><li> Any directories specified by a <code>SEARCH_DIR</code> command in a default
  2599. linker script.
  2600. </li></ol>
  2601. <p>Note however on Linux based systems there is an additional caveat: If
  2602. the <samp>--as-needed</samp> option is active <em>and</em> a shared library
  2603. is located which would normally satisfy the search <em>and</em> this
  2604. library does not have DT_NEEDED tag for <samp>libc.so</samp>
  2605. <em>and</em> there is a shared library later on in the set of search
  2606. directories which also satisfies the search <em>and</em>
  2607. this second shared library does have a DT_NEEDED tag for
  2608. <samp>libc.so</samp> <em>then</em> the second library will be selected instead
  2609. of the first.
  2610. </p>
  2611. <p>If the required shared library is not found, the linker will issue a
  2612. warning and continue with the link.
  2613. </p>
  2614. <span id="index-_002dshared"></span>
  2615. <span id="index-_002dBshareable"></span>
  2616. </dd>
  2617. <dt><code>-shared</code></dt>
  2618. <dt><code>-Bshareable</code></dt>
  2619. <dd><span id="index-shared-libraries"></span>
  2620. <p>Create a shared library. This is currently only supported on ELF, XCOFF
  2621. and SunOS platforms. On SunOS, the linker will automatically create a
  2622. shared library if the <samp>-e</samp> option is not used and there are
  2623. undefined symbols in the link.
  2624. </p>
  2625. <span id="index-_002d_002dsort_002dcommon"></span>
  2626. </dd>
  2627. <dt><code>--sort-common</code></dt>
  2628. <dt><code>--sort-common=ascending</code></dt>
  2629. <dt><code>--sort-common=descending</code></dt>
  2630. <dd><p>This option tells <code>ld</code> to sort the common symbols by alignment in
  2631. ascending or descending order when it places them in the appropriate output
  2632. sections. The symbol alignments considered are sixteen-byte or larger,
  2633. eight-byte, four-byte, two-byte, and one-byte. This is to prevent gaps
  2634. between symbols due to alignment constraints. If no sorting order is
  2635. specified, then descending order is assumed.
  2636. </p>
  2637. <span id="index-_002d_002dsort_002dsection_003dname"></span>
  2638. </dd>
  2639. <dt><code>--sort-section=name</code></dt>
  2640. <dd><p>This option will apply <code>SORT_BY_NAME</code> to all wildcard section
  2641. patterns in the linker script.
  2642. </p>
  2643. <span id="index-_002d_002dsort_002dsection_003dalignment"></span>
  2644. </dd>
  2645. <dt><code>--sort-section=alignment</code></dt>
  2646. <dd><p>This option will apply <code>SORT_BY_ALIGNMENT</code> to all wildcard section
  2647. patterns in the linker script.
  2648. </p>
  2649. <span id="index-_002d_002dspare_002ddynamic_002dtags"></span>
  2650. </dd>
  2651. <dt><code>--spare-dynamic-tags=<var>count</var></code></dt>
  2652. <dd><p>This option specifies the number of empty slots to leave in the
  2653. .dynamic section of ELF shared objects. Empty slots may be needed by
  2654. post processing tools, such as the prelinker. The default is 5.
  2655. </p>
  2656. <span id="index-_002d_002dsplit_002dby_002dfile"></span>
  2657. </dd>
  2658. <dt><code>--split-by-file[=<var>size</var>]</code></dt>
  2659. <dd><p>Similar to <samp>--split-by-reloc</samp> but creates a new output section for
  2660. each input file when <var>size</var> is reached. <var>size</var> defaults to a
  2661. size of 1 if not given.
  2662. </p>
  2663. <span id="index-_002d_002dsplit_002dby_002dreloc"></span>
  2664. </dd>
  2665. <dt><code>--split-by-reloc[=<var>count</var>]</code></dt>
  2666. <dd><p>Tries to creates extra sections in the output file so that no single
  2667. output section in the file contains more than <var>count</var> relocations.
  2668. This is useful when generating huge relocatable files for downloading into
  2669. certain real time kernels with the COFF object file format; since COFF
  2670. cannot represent more than 65535 relocations in a single section. Note
  2671. that this will fail to work with object file formats which do not
  2672. support arbitrary sections. The linker will not split up individual
  2673. input sections for redistribution, so if a single input section contains
  2674. more than <var>count</var> relocations one output section will contain that
  2675. many relocations. <var>count</var> defaults to a value of 32768.
  2676. </p>
  2677. <span id="index-_002d_002dstats"></span>
  2678. </dd>
  2679. <dt><code>--stats</code></dt>
  2680. <dd><p>Compute and display statistics about the operation of the linker, such
  2681. as execution time and memory usage.
  2682. </p>
  2683. <span id="index-_002d_002dsysroot_003ddirectory"></span>
  2684. </dd>
  2685. <dt><code>--sysroot=<var>directory</var></code></dt>
  2686. <dd><p>Use <var>directory</var> as the location of the sysroot, overriding the
  2687. configure-time default. This option is only supported by linkers
  2688. that were configured using <samp>--with-sysroot</samp>.
  2689. </p>
  2690. <span id="index-_002d_002dtask_002dlink"></span>
  2691. </dd>
  2692. <dt><code>--task-link</code></dt>
  2693. <dd><p>This is used by COFF/PE based targets to create a task-linked object
  2694. file where all of the global symbols have been converted to statics.
  2695. </p>
  2696. <span id="index-_002d_002dtraditional_002dformat"></span>
  2697. <span id="index-traditional-format"></span>
  2698. </dd>
  2699. <dt><code>--traditional-format</code></dt>
  2700. <dd><p>For some targets, the output of <code>ld</code> is different in some ways from
  2701. the output of some existing linker. This switch requests <code>ld</code> to
  2702. use the traditional format instead.
  2703. </p>
  2704. <span id="index-dbx"></span>
  2705. <p>For example, on SunOS, <code>ld</code> combines duplicate entries in the
  2706. symbol string table. This can reduce the size of an output file with
  2707. full debugging information by over 30 percent. Unfortunately, the SunOS
  2708. <code>dbx</code> program can not read the resulting program (<code>gdb</code> has no
  2709. trouble). The &lsquo;<samp>--traditional-format</samp>&rsquo; switch tells <code>ld</code> to not
  2710. combine duplicate entries.
  2711. </p>
  2712. <span id="index-_002d_002dsection_002dstart_003dsectionname_003dorg"></span>
  2713. </dd>
  2714. <dt><code>--section-start=<var>sectionname</var>=<var>org</var></code></dt>
  2715. <dd><p>Locate a section in the output file at the absolute
  2716. address given by <var>org</var>. You may use this option as many
  2717. times as necessary to locate multiple sections in the command
  2718. line.
  2719. <var>org</var> must be a single hexadecimal integer;
  2720. for compatibility with other linkers, you may omit the leading
  2721. &lsquo;<samp>0x</samp>&rsquo; usually associated with hexadecimal values. <em>Note:</em> there
  2722. should be no white space between <var>sectionname</var>, the equals
  2723. sign (&ldquo;<tt class="key">=</tt>&rdquo;), and <var>org</var>.
  2724. </p>
  2725. <span id="index-_002dTbss_003dorg"></span>
  2726. <span id="index-_002dTdata_003dorg"></span>
  2727. <span id="index-_002dTtext_003dorg"></span>
  2728. <span id="index-segment-origins_002c-cmd-line"></span>
  2729. </dd>
  2730. <dt><code>-Tbss=<var>org</var></code></dt>
  2731. <dt><code>-Tdata=<var>org</var></code></dt>
  2732. <dt><code>-Ttext=<var>org</var></code></dt>
  2733. <dd><p>Same as <samp>--section-start</samp>, with <code>.bss</code>, <code>.data</code> or
  2734. <code>.text</code> as the <var>sectionname</var>.
  2735. </p>
  2736. <span id="index-_002dTtext_002dsegment_003dorg"></span>
  2737. </dd>
  2738. <dt><code>-Ttext-segment=<var>org</var></code></dt>
  2739. <dd><span id="index-text-segment-origin_002c-cmd-line"></span>
  2740. <p>When creating an ELF executable, it will set the address of the first
  2741. byte of the text segment.
  2742. </p>
  2743. <span id="index-_002dTrodata_002dsegment_003dorg"></span>
  2744. </dd>
  2745. <dt><code>-Trodata-segment=<var>org</var></code></dt>
  2746. <dd><span id="index-rodata-segment-origin_002c-cmd-line"></span>
  2747. <p>When creating an ELF executable or shared object for a target where
  2748. the read-only data is in its own segment separate from the executable
  2749. text, it will set the address of the first byte of the read-only data segment.
  2750. </p>
  2751. <span id="index-_002dTldata_002dsegment_003dorg"></span>
  2752. </dd>
  2753. <dt><code>-Tldata-segment=<var>org</var></code></dt>
  2754. <dd><span id="index-ldata-segment-origin_002c-cmd-line"></span>
  2755. <p>When creating an ELF executable or shared object for x86-64 medium memory
  2756. model, it will set the address of the first byte of the ldata segment.
  2757. </p>
  2758. <span id="index-_002d_002dunresolved_002dsymbols"></span>
  2759. </dd>
  2760. <dt><code>--unresolved-symbols=<var>method</var></code></dt>
  2761. <dd><p>Determine how to handle unresolved symbols. There are four possible
  2762. values for &lsquo;<samp>method</samp>&rsquo;:
  2763. </p>
  2764. <dl compact="compact">
  2765. <dt>&lsquo;<samp>ignore-all</samp>&rsquo;</dt>
  2766. <dd><p>Do not report any unresolved symbols.
  2767. </p>
  2768. </dd>
  2769. <dt>&lsquo;<samp>report-all</samp>&rsquo;</dt>
  2770. <dd><p>Report all unresolved symbols. This is the default.
  2771. </p>
  2772. </dd>
  2773. <dt>&lsquo;<samp>ignore-in-object-files</samp>&rsquo;</dt>
  2774. <dd><p>Report unresolved symbols that are contained in shared libraries, but
  2775. ignore them if they come from regular object files.
  2776. </p>
  2777. </dd>
  2778. <dt>&lsquo;<samp>ignore-in-shared-libs</samp>&rsquo;</dt>
  2779. <dd><p>Report unresolved symbols that come from regular object files, but
  2780. ignore them if they come from shared libraries. This can be useful
  2781. when creating a dynamic binary and it is known that all the shared
  2782. libraries that it should be referencing are included on the linker&rsquo;s
  2783. command line.
  2784. </p></dd>
  2785. </dl>
  2786. <p>The behaviour for shared libraries on their own can also be controlled
  2787. by the <samp>--[no-]allow-shlib-undefined</samp> option.
  2788. </p>
  2789. <p>Normally the linker will generate an error message for each reported
  2790. unresolved symbol but the option <samp>--warn-unresolved-symbols</samp>
  2791. can change this to a warning.
  2792. </p>
  2793. <span id="index-_002d_002dverbose_005b_003dNUMBER_005d"></span>
  2794. <span id="index-verbose_005b_003dNUMBER_005d"></span>
  2795. </dd>
  2796. <dt><code>--dll-verbose</code></dt>
  2797. <dt><code>--verbose[=<var>NUMBER</var>]</code></dt>
  2798. <dd><p>Display the version number for <code>ld</code> and list the linker emulations
  2799. supported. Display which input files can and cannot be opened. Display
  2800. the linker script being used by the linker. If the optional <var>NUMBER</var>
  2801. argument &gt; 1, plugin symbol status will also be displayed.
  2802. </p>
  2803. <span id="index-_002d_002dversion_002dscript_003dversion_002dscriptfile"></span>
  2804. <span id="index-version-script_002c-symbol-versions"></span>
  2805. </dd>
  2806. <dt><code>--version-script=<var>version-scriptfile</var></code></dt>
  2807. <dd><p>Specify the name of a version script to the linker. This is typically
  2808. used when creating shared libraries to specify additional information
  2809. about the version hierarchy for the library being created. This option
  2810. is only fully supported on ELF platforms which support shared libraries;
  2811. see <a href="#VERSION">VERSION</a>. It is partially supported on PE platforms, which can
  2812. use version scripts to filter symbol visibility in auto-export mode: any
  2813. symbols marked &lsquo;<samp>local</samp>&rsquo; in the version script will not be exported.
  2814. See <a href="#WIN32">WIN32</a>.
  2815. </p>
  2816. <span id="index-_002d_002dwarn_002dcommon"></span>
  2817. <span id="index-warnings_002c-on-combining-symbols"></span>
  2818. <span id="index-combining-symbols_002c-warnings-on"></span>
  2819. </dd>
  2820. <dt><code>--warn-common</code></dt>
  2821. <dd><p>Warn when a common symbol is combined with another common symbol or with
  2822. a symbol definition. Unix linkers allow this somewhat sloppy practice,
  2823. but linkers on some other operating systems do not. This option allows
  2824. you to find potential problems from combining global symbols.
  2825. Unfortunately, some C libraries use this practice, so you may get some
  2826. warnings about symbols in the libraries as well as in your programs.
  2827. </p>
  2828. <p>There are three kinds of global symbols, illustrated here by C examples:
  2829. </p>
  2830. <dl compact="compact">
  2831. <dt>&lsquo;<samp>int i = 1;</samp>&rsquo;</dt>
  2832. <dd><p>A definition, which goes in the initialized data section of the output
  2833. file.
  2834. </p>
  2835. </dd>
  2836. <dt>&lsquo;<samp>extern int i;</samp>&rsquo;</dt>
  2837. <dd><p>An undefined reference, which does not allocate space.
  2838. There must be either a definition or a common symbol for the
  2839. variable somewhere.
  2840. </p>
  2841. </dd>
  2842. <dt>&lsquo;<samp>int i;</samp>&rsquo;</dt>
  2843. <dd><p>A common symbol. If there are only (one or more) common symbols for a
  2844. variable, it goes in the uninitialized data area of the output file.
  2845. The linker merges multiple common symbols for the same variable into a
  2846. single symbol. If they are of different sizes, it picks the largest
  2847. size. The linker turns a common symbol into a declaration, if there is
  2848. a definition of the same variable.
  2849. </p></dd>
  2850. </dl>
  2851. <p>The &lsquo;<samp>--warn-common</samp>&rsquo; option can produce five kinds of warnings.
  2852. Each warning consists of a pair of lines: the first describes the symbol
  2853. just encountered, and the second describes the previous symbol
  2854. encountered with the same name. One or both of the two symbols will be
  2855. a common symbol.
  2856. </p>
  2857. <ol>
  2858. <li> Turning a common symbol into a reference, because there is already a
  2859. definition for the symbol.
  2860. <div class="example">
  2861. <pre class="example"><var>file</var>(<var>section</var>): warning: common of `<var>symbol</var>'
  2862. overridden by definition
  2863. <var>file</var>(<var>section</var>): warning: defined here
  2864. </pre></div>
  2865. </li><li> Turning a common symbol into a reference, because a later definition for
  2866. the symbol is encountered. This is the same as the previous case,
  2867. except that the symbols are encountered in a different order.
  2868. <div class="example">
  2869. <pre class="example"><var>file</var>(<var>section</var>): warning: definition of `<var>symbol</var>'
  2870. overriding common
  2871. <var>file</var>(<var>section</var>): warning: common is here
  2872. </pre></div>
  2873. </li><li> Merging a common symbol with a previous same-sized common symbol.
  2874. <div class="example">
  2875. <pre class="example"><var>file</var>(<var>section</var>): warning: multiple common
  2876. of `<var>symbol</var>'
  2877. <var>file</var>(<var>section</var>): warning: previous common is here
  2878. </pre></div>
  2879. </li><li> Merging a common symbol with a previous larger common symbol.
  2880. <div class="example">
  2881. <pre class="example"><var>file</var>(<var>section</var>): warning: common of `<var>symbol</var>'
  2882. overridden by larger common
  2883. <var>file</var>(<var>section</var>): warning: larger common is here
  2884. </pre></div>
  2885. </li><li> Merging a common symbol with a previous smaller common symbol. This is
  2886. the same as the previous case, except that the symbols are
  2887. encountered in a different order.
  2888. <div class="example">
  2889. <pre class="example"><var>file</var>(<var>section</var>): warning: common of `<var>symbol</var>'
  2890. overriding smaller common
  2891. <var>file</var>(<var>section</var>): warning: smaller common is here
  2892. </pre></div>
  2893. </li></ol>
  2894. <span id="index-_002d_002dwarn_002dconstructors"></span>
  2895. </dd>
  2896. <dt><code>--warn-constructors</code></dt>
  2897. <dd><p>Warn if any global constructors are used. This is only useful for a few
  2898. object file formats. For formats like COFF or ELF, the linker can not
  2899. detect the use of global constructors.
  2900. </p>
  2901. <span id="index-_002d_002dwarn_002dexecstack"></span>
  2902. <span id="index-warnings_002c-on-executable-stack"></span>
  2903. <span id="index-executable-stack_002c-warnings-on"></span>
  2904. </dd>
  2905. <dt><code>--warn-execstack</code></dt>
  2906. <dt><code>--warn-execstack-objects</code></dt>
  2907. <dt><code>--no-warn-execstack</code></dt>
  2908. <dd><p>On ELF platforms the linker may generate warning messages if it is
  2909. asked to create an output file that contains an executable stack.
  2910. There are three possible states:
  2911. </p><ol>
  2912. <li> Do not generate any warnings.
  2913. </li><li> Always generate warnings, even if the executable stack is requested
  2914. via the <samp>-z execstack</samp> command line option.
  2915. </li><li> Only generate a warning if an object file requests an executable
  2916. stack, but not if the <samp>-z execstack</samp> option is used.
  2917. </li></ol>
  2918. <p>The default state depends upon how the linker was configured when it
  2919. was built. The <samp>--no-warn-execstack</samp> option always puts the
  2920. linker into the no-warnings state. The <samp>--warn-execstack</samp>
  2921. option puts the linker into the warn-always state. The
  2922. <samp>--warn-execstack-objects</samp> option puts the linker into the
  2923. warn-for-object-files-only state.
  2924. </p>
  2925. <p>Note: ELF format input files can specify that they need an executable
  2926. stack by having a <var>.note.GNU-stack</var> section with the executable
  2927. bit set in its section flags. They can specify that they do not need
  2928. an executable stack by having the same section, but without the
  2929. executable flag bit set. If an input file does not have a
  2930. <var>.note.GNU-stack</var> section then the default behaviour is target
  2931. specific. For some targets, then absence of such a section implies
  2932. that an executable stack <em>is</em> required. This is often a problem
  2933. for hand crafted assembler files.
  2934. </p>
  2935. <span id="index-_002d_002derror_002dexecstack"></span>
  2936. </dd>
  2937. <dt><code>--error-execstack</code></dt>
  2938. <dt><code>--no-error-execstack</code></dt>
  2939. <dd><p>If the linker is going to generate a warning message about an
  2940. executable stack then the <samp>--error-execstack</samp> option will
  2941. instead change that warning into an error. Note - this option does
  2942. not change the linker&rsquo;s execstack warning generation state. Use
  2943. <samp>--warn-execstack</samp> or <samp>--warn-execstack-objects</samp> to set
  2944. a specific warning state.
  2945. </p>
  2946. <p>The <samp>--no-error-execstack</samp> option will restore the default
  2947. behaviour of generating warning messages.
  2948. </p>
  2949. <span id="index-_002d_002dwarn_002dmultiple_002dgp"></span>
  2950. </dd>
  2951. <dt><code>--warn-multiple-gp</code></dt>
  2952. <dd><p>Warn if multiple global pointer values are required in the output file.
  2953. This is only meaningful for certain processors, such as the Alpha.
  2954. Specifically, some processors put large-valued constants in a special
  2955. section. A special register (the global pointer) points into the middle
  2956. of this section, so that constants can be loaded efficiently via a
  2957. base-register relative addressing mode. Since the offset in
  2958. base-register relative mode is fixed and relatively small (e.g., 16
  2959. bits), this limits the maximum size of the constant pool. Thus, in
  2960. large programs, it is often necessary to use multiple global pointer
  2961. values in order to be able to address all possible constants. This
  2962. option causes a warning to be issued whenever this case occurs.
  2963. </p>
  2964. <span id="index-_002d_002dwarn_002donce"></span>
  2965. <span id="index-warnings_002c-on-undefined-symbols"></span>
  2966. <span id="index-undefined-symbols_002c-warnings-on"></span>
  2967. </dd>
  2968. <dt><code>--warn-once</code></dt>
  2969. <dd><p>Only warn once for each undefined symbol, rather than once per module
  2970. which refers to it.
  2971. </p>
  2972. <span id="index-_002d_002dwarn_002drwx_002dsegments"></span>
  2973. <span id="index-warnings_002c-on-writeable-and-exectuable-segments"></span>
  2974. <span id="index-executable-segments_002c-warnings-on"></span>
  2975. </dd>
  2976. <dt><code>--warn-rwx-segments</code></dt>
  2977. <dt><code>--no-warn-rwx-segments</code></dt>
  2978. <dd><p>Warn if the linker creates a loadable, non-zero sized segment that has
  2979. all three of the read, write and execute permission flags set. Such a
  2980. segment represents a potential security vulnerability. In addition
  2981. warnings will be generated if a thread local storage segment is
  2982. created with the execute permission flag set, regardless of whether or
  2983. not it has the read and/or write flags set.
  2984. </p>
  2985. <p>These warnings are enabled by default. They can be disabled via the
  2986. <samp>--no-warn-rwx-segments</samp> option and re-enabled via the
  2987. <samp>--warn-rwx-segments</samp> option.
  2988. </p>
  2989. <span id="index-_002d_002derror_002drwx_002dsegments"></span>
  2990. </dd>
  2991. <dt><code>--error-rwx-segments</code></dt>
  2992. <dt><code>--no-error-rwx-segments</code></dt>
  2993. <dd><p>If the linker is going to generate a warning message about an
  2994. executable, writeable segment, or an executable TLS segment, then the
  2995. <samp>--error-rwx-segments</samp> option will turn this warning into an
  2996. error instead. The <samp>--no-error-rwx-segments</samp> option will
  2997. restore the default behaviour of just generating a warning message.
  2998. </p>
  2999. <p>Note - the <samp>--error-rwx-segments</samp> option does not by itself
  3000. turn on warnings about these segments. These warnings are either
  3001. enabled by default, if the linker was configured that way, or via the
  3002. <samp>--warn-rwx-segments</samp> command line option.
  3003. </p>
  3004. <span id="index-_002d_002dwarn_002dsection_002dalign"></span>
  3005. <span id="index-warnings_002c-on-section-alignment"></span>
  3006. <span id="index-section-alignment_002c-warnings-on"></span>
  3007. </dd>
  3008. <dt><code>--warn-section-align</code></dt>
  3009. <dd><p>Warn if the address of an output section is changed because of
  3010. alignment. Typically, the alignment will be set by an input section.
  3011. The address will only be changed if it not explicitly specified; that
  3012. is, if the <code>SECTIONS</code> command does not specify a start address for
  3013. the section (see <a href="#SECTIONS">SECTIONS</a>).
  3014. </p>
  3015. <span id="index-_002d_002dwarn_002dtextrel"></span>
  3016. </dd>
  3017. <dt><code>--warn-textrel</code></dt>
  3018. <dd><p>Warn if the linker adds DT_TEXTREL to a position-independent executable
  3019. or shared object.
  3020. </p>
  3021. <span id="index-_002d_002dwarn_002dalternate_002dem"></span>
  3022. </dd>
  3023. <dt><code>--warn-alternate-em</code></dt>
  3024. <dd><p>Warn if an object has alternate ELF machine code.
  3025. </p>
  3026. <span id="index-_002d_002dwarn_002dunresolved_002dsymbols"></span>
  3027. </dd>
  3028. <dt><code>--warn-unresolved-symbols</code></dt>
  3029. <dd><p>If the linker is going to report an unresolved symbol (see the option
  3030. <samp>--unresolved-symbols</samp>) it will normally generate an error.
  3031. This option makes it generate a warning instead.
  3032. </p>
  3033. <span id="index-_002d_002derror_002dunresolved_002dsymbols"></span>
  3034. </dd>
  3035. <dt><code>--error-unresolved-symbols</code></dt>
  3036. <dd><p>This restores the linker&rsquo;s default behaviour of generating errors when
  3037. it is reporting unresolved symbols.
  3038. </p>
  3039. <span id="index-_002d_002dwhole_002darchive"></span>
  3040. <span id="index-including-an-entire-archive"></span>
  3041. </dd>
  3042. <dt><code>--whole-archive</code></dt>
  3043. <dd><p>For each archive mentioned on the command line after the
  3044. <samp>--whole-archive</samp> option, include every object file in the archive
  3045. in the link, rather than searching the archive for the required object
  3046. files. This is normally used to turn an archive file into a shared
  3047. library, forcing every object to be included in the resulting shared
  3048. library. This option may be used more than once.
  3049. </p>
  3050. <p>Two notes when using this option from gcc: First, gcc doesn&rsquo;t know
  3051. about this option, so you have to use <samp>-Wl,-whole-archive</samp>.
  3052. Second, don&rsquo;t forget to use <samp>-Wl,-no-whole-archive</samp> after your
  3053. list of archives, because gcc will add its own list of archives to
  3054. your link and you may not want this flag to affect those as well.
  3055. </p>
  3056. <span id="index-_002d_002dwrap_003dsymbol"></span>
  3057. </dd>
  3058. <dt><code>--wrap=<var>symbol</var></code></dt>
  3059. <dd><p>Use a wrapper function for <var>symbol</var>. Any undefined reference to
  3060. <var>symbol</var> will be resolved to <code>__wrap_<var>symbol</var></code>. Any
  3061. undefined reference to <code>__real_<var>symbol</var></code> will be resolved to
  3062. <var>symbol</var>.
  3063. </p>
  3064. <p>This can be used to provide a wrapper for a system function. The
  3065. wrapper function should be called <code>__wrap_<var>symbol</var></code>. If it
  3066. wishes to call the system function, it should call
  3067. <code>__real_<var>symbol</var></code>.
  3068. </p>
  3069. <p>Here is a trivial example:
  3070. </p>
  3071. <div class="example">
  3072. <pre class="example">void *
  3073. __wrap_malloc (size_t c)
  3074. {
  3075. printf (&quot;malloc called with %zu\n&quot;, c);
  3076. return __real_malloc (c);
  3077. }
  3078. </pre></div>
  3079. <p>If you link other code with this file using <samp>--wrap malloc</samp>, then
  3080. all calls to <code>malloc</code> will call the function <code>__wrap_malloc</code>
  3081. instead. The call to <code>__real_malloc</code> in <code>__wrap_malloc</code> will
  3082. call the real <code>malloc</code> function.
  3083. </p>
  3084. <p>You may wish to provide a <code>__real_malloc</code> function as well, so that
  3085. links without the <samp>--wrap</samp> option will succeed. If you do this,
  3086. you should not put the definition of <code>__real_malloc</code> in the same
  3087. file as <code>__wrap_malloc</code>; if you do, the assembler may resolve the
  3088. call before the linker has a chance to wrap it to <code>malloc</code>.
  3089. </p>
  3090. <p>Only undefined references are replaced by the linker. So, translation unit
  3091. internal references to <var>symbol</var> are not resolved to
  3092. <code>__wrap_<var>symbol</var></code>. In the next example, the call to <code>f</code> in
  3093. <code>g</code> is not resolved to <code>__wrap_f</code>.
  3094. </p>
  3095. <div class="example">
  3096. <pre class="example">int
  3097. f (void)
  3098. {
  3099. return 123;
  3100. }
  3101. int
  3102. g (void)
  3103. {
  3104. return f();
  3105. }
  3106. </pre></div>
  3107. <span id="index-_002d_002deh_002dframe_002dhdr"></span>
  3108. <span id="index-_002d_002dno_002deh_002dframe_002dhdr"></span>
  3109. </dd>
  3110. <dt><code>--eh-frame-hdr</code></dt>
  3111. <dt><code>--no-eh-frame-hdr</code></dt>
  3112. <dd><p>Request (<samp>--eh-frame-hdr</samp>) or suppress
  3113. (<samp>--no-eh-frame-hdr</samp>) the creation of <code>.eh_frame_hdr</code>
  3114. section and ELF <code>PT_GNU_EH_FRAME</code> segment header.
  3115. </p>
  3116. <span id="index-_002d_002dld_002dgenerated_002dunwind_002dinfo"></span>
  3117. </dd>
  3118. <dt><code>--no-ld-generated-unwind-info</code></dt>
  3119. <dd><p>Request creation of <code>.eh_frame</code> unwind info for linker
  3120. generated code sections like PLT. This option is on by default
  3121. if linker generated unwind info is supported. This option also
  3122. controls the generation of <code>.sframe</code> stack trace info for linker
  3123. generated code sections like PLT.
  3124. </p>
  3125. <span id="index-_002d_002denable_002dnew_002ddtags"></span>
  3126. <span id="index-_002d_002ddisable_002dnew_002ddtags"></span>
  3127. </dd>
  3128. <dt><code>--enable-new-dtags</code></dt>
  3129. <dt><code>--disable-new-dtags</code></dt>
  3130. <dd><p>This linker can create the new dynamic tags in ELF. But the older ELF
  3131. systems may not understand them. If you specify
  3132. <samp>--enable-new-dtags</samp>, the new dynamic tags will be created as needed
  3133. and older dynamic tags will be omitted.
  3134. If you specify <samp>--disable-new-dtags</samp>, no new dynamic tags will be
  3135. created. By default, the new dynamic tags are not created. Note that
  3136. those options are only available for ELF systems.
  3137. </p>
  3138. <span id="index-_002d_002dhash_002dsize_003dnumber"></span>
  3139. </dd>
  3140. <dt><code>--hash-size=<var>number</var></code></dt>
  3141. <dd><p>Set the default size of the linker&rsquo;s hash tables to a prime number
  3142. close to <var>number</var>. Increasing this value can reduce the length of
  3143. time it takes the linker to perform its tasks, at the expense of
  3144. increasing the linker&rsquo;s memory requirements. Similarly reducing this
  3145. value can reduce the memory requirements at the expense of speed.
  3146. </p>
  3147. <span id="index-_002d_002dhash_002dstyle_003dstyle"></span>
  3148. </dd>
  3149. <dt><code>--hash-style=<var>style</var></code></dt>
  3150. <dd><p>Set the type of linker&rsquo;s hash table(s). <var>style</var> can be either
  3151. <code>sysv</code> for classic ELF <code>.hash</code> section, <code>gnu</code> for
  3152. new style GNU <code>.gnu.hash</code> section or <code>both</code> for both
  3153. the classic ELF <code>.hash</code> and new style GNU <code>.gnu.hash</code>
  3154. hash tables. The default depends upon how the linker was configured,
  3155. but for most Linux based systems it will be <code>both</code>.
  3156. </p>
  3157. <span id="index-_002d_002dcompress_002ddebug_002dsections_003dnone"></span>
  3158. <span id="index-_002d_002dcompress_002ddebug_002dsections_003dzlib"></span>
  3159. <span id="index-_002d_002dcompress_002ddebug_002dsections_003dzlib_002dgnu"></span>
  3160. <span id="index-_002d_002dcompress_002ddebug_002dsections_003dzlib_002dgabi"></span>
  3161. <span id="index-_002d_002dcompress_002ddebug_002dsections_003dzstd"></span>
  3162. </dd>
  3163. <dt><code>--compress-debug-sections=none</code></dt>
  3164. <dt><code>--compress-debug-sections=zlib</code></dt>
  3165. <dt><code>--compress-debug-sections=zlib-gnu</code></dt>
  3166. <dt><code>--compress-debug-sections=zlib-gabi</code></dt>
  3167. <dt><code>--compress-debug-sections=zstd</code></dt>
  3168. <dd><p>On ELF platforms, these options control how DWARF debug sections are
  3169. compressed using zlib.
  3170. </p>
  3171. <p><samp>--compress-debug-sections=none</samp> doesn&rsquo;t compress DWARF debug
  3172. sections. <samp>--compress-debug-sections=zlib-gnu</samp> compresses
  3173. DWARF debug sections and renames them to begin with &lsquo;<samp>.zdebug</samp>&rsquo;
  3174. instead of &lsquo;<samp>.debug</samp>&rsquo;. <samp>--compress-debug-sections=zlib-gabi</samp>
  3175. also compresses DWARF debug sections, but rather than renaming them it
  3176. sets the SHF_COMPRESSED flag in the sections&rsquo; headers.
  3177. </p>
  3178. <p>The <samp>--compress-debug-sections=zlib</samp> option is an alias for
  3179. <samp>--compress-debug-sections=zlib-gabi</samp>.
  3180. </p>
  3181. <p><samp>--compress-debug-sections=zstd</samp> compresses DWARF debug sections using
  3182. zstd.
  3183. </p>
  3184. <p>Note that this option overrides any compression in input debug
  3185. sections, so if a binary is linked with <samp>--compress-debug-sections=none</samp>
  3186. for example, then any compressed debug sections in input files will be
  3187. uncompressed before they are copied into the output binary.
  3188. </p>
  3189. <p>The default compression behaviour varies depending upon the target
  3190. involved and the configure options used to build the toolchain. The
  3191. default can be determined by examining the output from the linker&rsquo;s
  3192. <samp>--help</samp> option.
  3193. </p>
  3194. <span id="index-_002d_002dreduce_002dmemory_002doverheads"></span>
  3195. </dd>
  3196. <dt><code>--reduce-memory-overheads</code></dt>
  3197. <dd><p>This option reduces memory requirements at ld runtime, at the expense of
  3198. linking speed. This was introduced to select the old O(n^2) algorithm
  3199. for link map file generation, rather than the new O(n) algorithm which uses
  3200. about 40% more memory for symbol storage.
  3201. </p>
  3202. <p>Another effect of the switch is to set the default hash table size to
  3203. 1021, which again saves memory at the cost of lengthening the linker&rsquo;s
  3204. run time. This is not done however if the <samp>--hash-size</samp> switch
  3205. has been used.
  3206. </p>
  3207. <p>The <samp>--reduce-memory-overheads</samp> switch may be also be used to
  3208. enable other tradeoffs in future versions of the linker.
  3209. </p>
  3210. <span id="index-_002d_002dmax_002dcache_002dsize_003dsize"></span>
  3211. </dd>
  3212. <dt><code>--max-cache-size=<var>size</var></code></dt>
  3213. <dd><p><code>ld</code> normally caches the relocation information and symbol tables
  3214. of input files in memory with the unlimited size. This option sets the
  3215. maximum cache size to <var>size</var>.
  3216. </p>
  3217. <span id="index-_002d_002dbuild_002did"></span>
  3218. <span id="index-_002d_002dbuild_002did_003dstyle"></span>
  3219. </dd>
  3220. <dt><code>--build-id</code></dt>
  3221. <dt><code>--build-id=<var>style</var></code></dt>
  3222. <dd><p>Request the creation of a <code>.note.gnu.build-id</code> ELF note section
  3223. or a <code>.buildid</code> COFF section. The contents of the note are
  3224. unique bits identifying this linked file. <var>style</var> can be
  3225. <code>uuid</code> to use 128 random bits, <code>sha1</code> to use a 160-bit
  3226. <small>SHA1</small> hash on the normative parts of the output contents,
  3227. <code>md5</code> to use a 128-bit <small>MD5</small> hash on the normative parts of
  3228. the output contents, or <code>0x<var>hexstring</var></code> to use a chosen bit
  3229. string specified as an even number of hexadecimal digits (<code>-</code> and
  3230. <code>:</code> characters between digit pairs are ignored). If <var>style</var>
  3231. is omitted, <code>sha1</code> is used.
  3232. </p>
  3233. <p>The <code>md5</code> and <code>sha1</code> styles produces an identifier
  3234. that is always the same in an identical output file, but will be
  3235. unique among all nonidentical output files. It is not intended
  3236. to be compared as a checksum for the file&rsquo;s contents. A linked
  3237. file may be changed later by other tools, but the build ID bit
  3238. string identifying the original linked file does not change.
  3239. </p>
  3240. <p>Passing <code>none</code> for <var>style</var> disables the setting from any
  3241. <code>--build-id</code> options earlier on the command line.
  3242. </p>
  3243. <span id="index-_002d_002dpackage_002dmetadata_003dJSON"></span>
  3244. </dd>
  3245. <dt><code>--package-metadata=<var>JSON</var></code></dt>
  3246. <dd><p>Request the creation of a <code>.note.package</code> ELF note section. The
  3247. contents of the note are in JSON format, as per the package metadata
  3248. specification. For more information see:
  3249. https://systemd.io/ELF_PACKAGE_METADATA/
  3250. If the JSON argument is missing/empty then this will disable the
  3251. creation of the metadata note, if one had been enabled by an earlier
  3252. occurrence of the &ndash;package-metadata option.
  3253. If the linker has been built with libjansson, then the JSON string
  3254. will be validated.
  3255. </p></dd>
  3256. </dl>
  3257. <span id="Options-Specific-to-i386-PE-Targets"></span><h4 class="subsection">2.1.1 Options Specific to i386 PE Targets</h4>
  3258. <p>The i386 PE linker supports the <samp>-shared</samp> option, which causes
  3259. the output to be a dynamically linked library (DLL) instead of a
  3260. normal executable. You should name the output <code>*.dll</code> when you
  3261. use this option. In addition, the linker fully supports the standard
  3262. <code>*.def</code> files, which may be specified on the linker command line
  3263. like an object file (in fact, it should precede archives it exports
  3264. symbols from, to ensure that they get linked in, just like a normal
  3265. object file).
  3266. </p>
  3267. <p>In addition to the options common to all targets, the i386 PE linker
  3268. support additional command-line options that are specific to the i386
  3269. PE target. Options that take values may be separated from their
  3270. values by either a space or an equals sign.
  3271. </p>
  3272. <dl compact="compact">
  3273. <dd>
  3274. <span id="index-_002d_002dadd_002dstdcall_002dalias"></span>
  3275. </dd>
  3276. <dt><code>--add-stdcall-alias</code></dt>
  3277. <dd><p>If given, symbols with a stdcall suffix (@<var>nn</var>) will be exported
  3278. as-is and also with the suffix stripped.
  3279. [This option is specific to the i386 PE targeted port of the linker]
  3280. </p>
  3281. <span id="index-_002d_002dbase_002dfile"></span>
  3282. </dd>
  3283. <dt><code>--base-file <var>file</var></code></dt>
  3284. <dd><p>Use <var>file</var> as the name of a file in which to save the base
  3285. addresses of all the relocations needed for generating DLLs with
  3286. <samp>dlltool</samp>.
  3287. [This is an i386 PE specific option]
  3288. </p>
  3289. <span id="index-_002d_002ddll"></span>
  3290. </dd>
  3291. <dt><code>--dll</code></dt>
  3292. <dd><p>Create a DLL instead of a regular executable. You may also use
  3293. <samp>-shared</samp> or specify a <code>LIBRARY</code> in a given <code>.def</code>
  3294. file.
  3295. [This option is specific to the i386 PE targeted port of the linker]
  3296. </p>
  3297. <span id="index-_002d_002denable_002dlong_002dsection_002dnames"></span>
  3298. <span id="index-_002d_002ddisable_002dlong_002dsection_002dnames"></span>
  3299. </dd>
  3300. <dt><code>--enable-long-section-names</code></dt>
  3301. <dt><code>--disable-long-section-names</code></dt>
  3302. <dd><p>The PE variants of the COFF object format add an extension that permits
  3303. the use of section names longer than eight characters, the normal limit
  3304. for COFF. By default, these names are only allowed in object files, as
  3305. fully-linked executable images do not carry the COFF string table required
  3306. to support the longer names. As a GNU extension, it is possible to
  3307. allow their use in executable images as well, or to (probably pointlessly!)
  3308. disallow it in object files, by using these two options. Executable images
  3309. generated with these long section names are slightly non-standard, carrying
  3310. as they do a string table, and may generate confusing output when examined
  3311. with non-GNU PE-aware tools, such as file viewers and dumpers. However,
  3312. GDB relies on the use of PE long section names to find Dwarf-2 debug
  3313. information sections in an executable image at runtime, and so if neither
  3314. option is specified on the command-line, <code>ld</code> will enable long
  3315. section names, overriding the default and technically correct behaviour,
  3316. when it finds the presence of debug information while linking an executable
  3317. image and not stripping symbols.
  3318. [This option is valid for all PE targeted ports of the linker]
  3319. </p>
  3320. <span id="index-_002d_002denable_002dstdcall_002dfixup"></span>
  3321. <span id="index-_002d_002ddisable_002dstdcall_002dfixup"></span>
  3322. </dd>
  3323. <dt><code>--enable-stdcall-fixup</code></dt>
  3324. <dt><code>--disable-stdcall-fixup</code></dt>
  3325. <dd><p>If the link finds a symbol that it cannot resolve, it will attempt to
  3326. do &ldquo;fuzzy linking&rdquo; by looking for another defined symbol that differs
  3327. only in the format of the symbol name (cdecl vs stdcall) and will
  3328. resolve that symbol by linking to the match. For example, the
  3329. undefined symbol <code>_foo</code> might be linked to the function
  3330. <code>_foo@12</code>, or the undefined symbol <code>_bar@16</code> might be linked
  3331. to the function <code>_bar</code>. When the linker does this, it prints a
  3332. warning, since it normally should have failed to link, but sometimes
  3333. import libraries generated from third-party dlls may need this feature
  3334. to be usable. If you specify <samp>--enable-stdcall-fixup</samp>, this
  3335. feature is fully enabled and warnings are not printed. If you specify
  3336. <samp>--disable-stdcall-fixup</samp>, this feature is disabled and such
  3337. mismatches are considered to be errors.
  3338. [This option is specific to the i386 PE targeted port of the linker]
  3339. </p>
  3340. <span id="index-_002d_002dleading_002dunderscore"></span>
  3341. <span id="index-_002d_002dno_002dleading_002dunderscore"></span>
  3342. </dd>
  3343. <dt><code>--leading-underscore</code></dt>
  3344. <dt><code>--no-leading-underscore</code></dt>
  3345. <dd><p>For most targets default symbol-prefix is an underscore and is defined
  3346. in target&rsquo;s description. By this option it is possible to
  3347. disable/enable the default underscore symbol-prefix.
  3348. </p>
  3349. <span id="index-DLLs_002c-creating"></span>
  3350. <span id="index-_002d_002dexport_002dall_002dsymbols"></span>
  3351. </dd>
  3352. <dt><code>--export-all-symbols</code></dt>
  3353. <dd><p>If given, all global symbols in the objects used to build a DLL will
  3354. be exported by the DLL. Note that this is the default if there
  3355. otherwise wouldn&rsquo;t be any exported symbols. When symbols are
  3356. explicitly exported via DEF files or implicitly exported via function
  3357. attributes, the default is to not export anything else unless this
  3358. option is given. Note that the symbols <code>DllMain@12</code>,
  3359. <code>DllEntryPoint@0</code>, <code>DllMainCRTStartup@12</code>, and
  3360. <code>impure_ptr</code> will not be automatically
  3361. exported. Also, symbols imported from other DLLs will not be
  3362. re-exported, nor will symbols specifying the DLL&rsquo;s internal layout
  3363. such as those beginning with <code>_head_</code> or ending with
  3364. <code>_iname</code>. In addition, no symbols from <code>libgcc</code>,
  3365. <code>libstd++</code>, <code>libmingw32</code>, or <code>crtX.o</code> will be exported.
  3366. Symbols whose names begin with <code>__rtti_</code> or <code>__builtin_</code> will
  3367. not be exported, to help with C++ DLLs. Finally, there is an
  3368. extensive list of cygwin-private symbols that are not exported
  3369. (obviously, this applies on when building DLLs for cygwin targets).
  3370. These cygwin-excludes are: <code>_cygwin_dll_entry@12</code>,
  3371. <code>_cygwin_crt0_common@8</code>, <code>_cygwin_noncygwin_dll_entry@12</code>,
  3372. <code>_fmode</code>, <code>_impure_ptr</code>, <code>cygwin_attach_dll</code>,
  3373. <code>cygwin_premain0</code>, <code>cygwin_premain1</code>, <code>cygwin_premain2</code>,
  3374. <code>cygwin_premain3</code>, and <code>environ</code>.
  3375. [This option is specific to the i386 PE targeted port of the linker]
  3376. </p>
  3377. <span id="index-_002d_002dexclude_002dsymbols"></span>
  3378. </dd>
  3379. <dt><code>--exclude-symbols <var>symbol</var>,<var>symbol</var>,...</code></dt>
  3380. <dd><p>Specifies a list of symbols which should not be automatically
  3381. exported. The symbol names may be delimited by commas or colons.
  3382. [This option is specific to the i386 PE targeted port of the linker]
  3383. </p>
  3384. <span id="index-_002d_002dexclude_002dall_002dsymbols"></span>
  3385. </dd>
  3386. <dt><code>--exclude-all-symbols</code></dt>
  3387. <dd><p>Specifies no symbols should be automatically exported.
  3388. [This option is specific to the i386 PE targeted port of the linker]
  3389. </p>
  3390. <span id="index-_002d_002dfile_002dalignment"></span>
  3391. </dd>
  3392. <dt><code>--file-alignment</code></dt>
  3393. <dd><p>Specify the file alignment. Sections in the file will always begin at
  3394. file offsets which are multiples of this number. This defaults to
  3395. 512.
  3396. [This option is specific to the i386 PE targeted port of the linker]
  3397. </p>
  3398. <span id="index-heap-size"></span>
  3399. <span id="index-_002d_002dheap"></span>
  3400. </dd>
  3401. <dt><code>--heap <var>reserve</var></code></dt>
  3402. <dt><code>--heap <var>reserve</var>,<var>commit</var></code></dt>
  3403. <dd><p>Specify the number of bytes of memory to reserve (and optionally commit)
  3404. to be used as heap for this program. The default is 1MB reserved, 4K
  3405. committed.
  3406. [This option is specific to the i386 PE targeted port of the linker]
  3407. </p>
  3408. <span id="index-image-base"></span>
  3409. <span id="index-_002d_002dimage_002dbase"></span>
  3410. </dd>
  3411. <dt><code>--image-base <var>value</var></code></dt>
  3412. <dd><p>Use <var>value</var> as the base address of your program or dll. This is
  3413. the lowest memory location that will be used when your program or dll
  3414. is loaded. To reduce the need to relocate and improve performance of
  3415. your dlls, each should have a unique base address and not overlap any
  3416. other dlls. The default is 0x400000 for executables, and 0x10000000
  3417. for dlls.
  3418. [This option is specific to the i386 PE targeted port of the linker]
  3419. </p>
  3420. <span id="index-_002d_002dkill_002dat"></span>
  3421. </dd>
  3422. <dt><code>--kill-at</code></dt>
  3423. <dd><p>If given, the stdcall suffixes (@<var>nn</var>) will be stripped from
  3424. symbols before they are exported.
  3425. [This option is specific to the i386 PE targeted port of the linker]
  3426. </p>
  3427. <span id="index-_002d_002dlarge_002daddress_002daware"></span>
  3428. </dd>
  3429. <dt><code>--large-address-aware</code></dt>
  3430. <dd><p>If given, the appropriate bit in the &ldquo;Characteristics&rdquo; field of the COFF
  3431. header is set to indicate that this executable supports virtual addresses
  3432. greater than 2 gigabytes. This should be used in conjunction with the /3GB
  3433. or /USERVA=<var>value</var> megabytes switch in the &ldquo;[operating systems]&rdquo;
  3434. section of the BOOT.INI. Otherwise, this bit has no effect.
  3435. [This option is specific to PE targeted ports of the linker]
  3436. </p>
  3437. <span id="index-_002d_002ddisable_002dlarge_002daddress_002daware"></span>
  3438. </dd>
  3439. <dt><code>--disable-large-address-aware</code></dt>
  3440. <dd><p>Reverts the effect of a previous &lsquo;<samp>--large-address-aware</samp>&rsquo; option.
  3441. This is useful if &lsquo;<samp>--large-address-aware</samp>&rsquo; is always set by the compiler
  3442. driver (e.g. Cygwin gcc) and the executable does not support virtual
  3443. addresses greater than 2 gigabytes.
  3444. [This option is specific to PE targeted ports of the linker]
  3445. </p>
  3446. <span id="index-_002d_002dmajor_002dimage_002dversion"></span>
  3447. </dd>
  3448. <dt><code>--major-image-version <var>value</var></code></dt>
  3449. <dd><p>Sets the major number of the &ldquo;image version&rdquo;. Defaults to 1.
  3450. [This option is specific to the i386 PE targeted port of the linker]
  3451. </p>
  3452. <span id="index-_002d_002dmajor_002dos_002dversion"></span>
  3453. </dd>
  3454. <dt><code>--major-os-version <var>value</var></code></dt>
  3455. <dd><p>Sets the major number of the &ldquo;os version&rdquo;. Defaults to 4.
  3456. [This option is specific to the i386 PE targeted port of the linker]
  3457. </p>
  3458. <span id="index-_002d_002dmajor_002dsubsystem_002dversion"></span>
  3459. </dd>
  3460. <dt><code>--major-subsystem-version <var>value</var></code></dt>
  3461. <dd><p>Sets the major number of the &ldquo;subsystem version&rdquo;. Defaults to 4.
  3462. [This option is specific to the i386 PE targeted port of the linker]
  3463. </p>
  3464. <span id="index-_002d_002dminor_002dimage_002dversion"></span>
  3465. </dd>
  3466. <dt><code>--minor-image-version <var>value</var></code></dt>
  3467. <dd><p>Sets the minor number of the &ldquo;image version&rdquo;. Defaults to 0.
  3468. [This option is specific to the i386 PE targeted port of the linker]
  3469. </p>
  3470. <span id="index-_002d_002dminor_002dos_002dversion"></span>
  3471. </dd>
  3472. <dt><code>--minor-os-version <var>value</var></code></dt>
  3473. <dd><p>Sets the minor number of the &ldquo;os version&rdquo;. Defaults to 0.
  3474. [This option is specific to the i386 PE targeted port of the linker]
  3475. </p>
  3476. <span id="index-_002d_002dminor_002dsubsystem_002dversion"></span>
  3477. </dd>
  3478. <dt><code>--minor-subsystem-version <var>value</var></code></dt>
  3479. <dd><p>Sets the minor number of the &ldquo;subsystem version&rdquo;. Defaults to 0.
  3480. [This option is specific to the i386 PE targeted port of the linker]
  3481. </p>
  3482. <span id="index-DEF-files_002c-creating"></span>
  3483. <span id="index-DLLs_002c-creating-1"></span>
  3484. <span id="index-_002d_002doutput_002ddef"></span>
  3485. </dd>
  3486. <dt><code>--output-def <var>file</var></code></dt>
  3487. <dd><p>The linker will create the file <var>file</var> which will contain a DEF
  3488. file corresponding to the DLL the linker is generating. This DEF file
  3489. (which should be called <code>*.def</code>) may be used to create an import
  3490. library with <code>dlltool</code> or may be used as a reference to
  3491. automatically or implicitly exported symbols.
  3492. [This option is specific to the i386 PE targeted port of the linker]
  3493. </p>
  3494. <span id="index-DLLs_002c-creating-2"></span>
  3495. <span id="index-_002d_002denable_002dauto_002dimage_002dbase"></span>
  3496. </dd>
  3497. <dt><code>--enable-auto-image-base</code></dt>
  3498. <dt><code>--enable-auto-image-base=<var>value</var></code></dt>
  3499. <dd><p>Automatically choose the image base for DLLs, optionally starting with base
  3500. <var>value</var>, unless one is specified using the <code>--image-base</code> argument.
  3501. By using a hash generated from the dllname to create unique image bases
  3502. for each DLL, in-memory collisions and relocations which can delay program
  3503. execution are avoided.
  3504. [This option is specific to the i386 PE targeted port of the linker]
  3505. </p>
  3506. <span id="index-_002d_002ddisable_002dauto_002dimage_002dbase"></span>
  3507. </dd>
  3508. <dt><code>--disable-auto-image-base</code></dt>
  3509. <dd><p>Do not automatically generate a unique image base. If there is no
  3510. user-specified image base (<code>--image-base</code>) then use the platform
  3511. default.
  3512. [This option is specific to the i386 PE targeted port of the linker]
  3513. </p>
  3514. <span id="index-DLLs_002c-linking-to"></span>
  3515. <span id="index-_002d_002ddll_002dsearch_002dprefix"></span>
  3516. </dd>
  3517. <dt><code>--dll-search-prefix <var>string</var></code></dt>
  3518. <dd><p>When linking dynamically to a dll without an import library,
  3519. search for <code>&lt;string&gt;&lt;basename&gt;.dll</code> in preference to
  3520. <code>lib&lt;basename&gt;.dll</code>. This behaviour allows easy distinction
  3521. between DLLs built for the various &quot;subplatforms&quot;: native, cygwin,
  3522. uwin, pw, etc. For instance, cygwin DLLs typically use
  3523. <code>--dll-search-prefix=cyg</code>.
  3524. [This option is specific to the i386 PE targeted port of the linker]
  3525. </p>
  3526. <span id="index-_002d_002denable_002dauto_002dimport"></span>
  3527. </dd>
  3528. <dt><code>--enable-auto-import</code></dt>
  3529. <dd><p>Do sophisticated linking of <code>_symbol</code> to <code>__imp__symbol</code> for
  3530. DATA imports from DLLs, thus making it possible to bypass the dllimport
  3531. mechanism on the user side and to reference unmangled symbol names.
  3532. [This option is specific to the i386 PE targeted port of the linker]
  3533. </p>
  3534. <p>The following remarks pertain to the original implementation of the
  3535. feature and are obsolete nowadays for Cygwin and MinGW targets.
  3536. </p>
  3537. <p>Note: Use of the &rsquo;auto-import&rsquo; extension will cause the text section
  3538. of the image file to be made writable. This does not conform to the
  3539. PE-COFF format specification published by Microsoft.
  3540. </p>
  3541. <p>Note - use of the &rsquo;auto-import&rsquo; extension will also cause read only
  3542. data which would normally be placed into the .rdata section to be
  3543. placed into the .data section instead. This is in order to work
  3544. around a problem with consts that is described here:
  3545. http://www.cygwin.com/ml/cygwin/2004-09/msg01101.html
  3546. </p>
  3547. <p>Using &rsquo;auto-import&rsquo; generally will &rsquo;just work&rsquo; &ndash; but sometimes you may
  3548. see this message:
  3549. </p>
  3550. <p>&quot;variable &rsquo;&lt;var&gt;&rsquo; can&rsquo;t be auto-imported. Please read the
  3551. documentation for ld&rsquo;s <code>--enable-auto-import</code> for details.&quot;
  3552. </p>
  3553. <p>This message occurs when some (sub)expression accesses an address
  3554. ultimately given by the sum of two constants (Win32 import tables only
  3555. allow one). Instances where this may occur include accesses to member
  3556. fields of struct variables imported from a DLL, as well as using a
  3557. constant index into an array variable imported from a DLL. Any
  3558. multiword variable (arrays, structs, long long, etc) may trigger
  3559. this error condition. However, regardless of the exact data type
  3560. of the offending exported variable, ld will always detect it, issue
  3561. the warning, and exit.
  3562. </p>
  3563. <p>There are several ways to address this difficulty, regardless of the
  3564. data type of the exported variable:
  3565. </p>
  3566. <p>One way is to use &ndash;enable-runtime-pseudo-reloc switch. This leaves the task
  3567. of adjusting references in your client code for runtime environment, so
  3568. this method works only when runtime environment supports this feature.
  3569. </p>
  3570. <p>A second solution is to force one of the &rsquo;constants&rsquo; to be a variable &ndash;
  3571. that is, unknown and un-optimizable at compile time. For arrays,
  3572. there are two possibilities: a) make the indexee (the array&rsquo;s address)
  3573. a variable, or b) make the &rsquo;constant&rsquo; index a variable. Thus:
  3574. </p>
  3575. <div class="example">
  3576. <pre class="example">extern type extern_array[];
  3577. extern_array[1] --&gt;
  3578. { volatile type *t=extern_array; t[1] }
  3579. </pre></div>
  3580. <p>or
  3581. </p>
  3582. <div class="example">
  3583. <pre class="example">extern type extern_array[];
  3584. extern_array[1] --&gt;
  3585. { volatile int t=1; extern_array[t] }
  3586. </pre></div>
  3587. <p>For structs (and most other multiword data types) the only option
  3588. is to make the struct itself (or the long long, or the ...) variable:
  3589. </p>
  3590. <div class="example">
  3591. <pre class="example">extern struct s extern_struct;
  3592. extern_struct.field --&gt;
  3593. { volatile struct s *t=&amp;extern_struct; t-&gt;field }
  3594. </pre></div>
  3595. <p>or
  3596. </p>
  3597. <div class="example">
  3598. <pre class="example">extern long long extern_ll;
  3599. extern_ll --&gt;
  3600. { volatile long long * local_ll=&amp;extern_ll; *local_ll }
  3601. </pre></div>
  3602. <p>A third method of dealing with this difficulty is to abandon
  3603. &rsquo;auto-import&rsquo; for the offending symbol and mark it with
  3604. <code>__declspec(dllimport)</code>. However, in practice that
  3605. requires using compile-time #defines to indicate whether you are
  3606. building a DLL, building client code that will link to the DLL, or
  3607. merely building/linking to a static library. In making the choice
  3608. between the various methods of resolving the &rsquo;direct address with
  3609. constant offset&rsquo; problem, you should consider typical real-world usage:
  3610. </p>
  3611. <p>Original:
  3612. </p><div class="example">
  3613. <pre class="example">--foo.h
  3614. extern int arr[];
  3615. --foo.c
  3616. #include &quot;foo.h&quot;
  3617. void main(int argc, char **argv){
  3618. printf(&quot;%d\n&quot;,arr[1]);
  3619. }
  3620. </pre></div>
  3621. <p>Solution 1:
  3622. </p><div class="example">
  3623. <pre class="example">--foo.h
  3624. extern int arr[];
  3625. --foo.c
  3626. #include &quot;foo.h&quot;
  3627. void main(int argc, char **argv){
  3628. /* This workaround is for win32 and cygwin; do not &quot;optimize&quot; */
  3629. volatile int *parr = arr;
  3630. printf(&quot;%d\n&quot;,parr[1]);
  3631. }
  3632. </pre></div>
  3633. <p>Solution 2:
  3634. </p><div class="example">
  3635. <pre class="example">--foo.h
  3636. /* Note: auto-export is assumed (no __declspec(dllexport)) */
  3637. #if (defined(_WIN32) || defined(__CYGWIN__)) &amp;&amp; \
  3638. !(defined(FOO_BUILD_DLL) || defined(FOO_STATIC))
  3639. #define FOO_IMPORT __declspec(dllimport)
  3640. #else
  3641. #define FOO_IMPORT
  3642. #endif
  3643. extern FOO_IMPORT int arr[];
  3644. --foo.c
  3645. #include &quot;foo.h&quot;
  3646. void main(int argc, char **argv){
  3647. printf(&quot;%d\n&quot;,arr[1]);
  3648. }
  3649. </pre></div>
  3650. <p>A fourth way to avoid this problem is to re-code your
  3651. library to use a functional interface rather than a data interface
  3652. for the offending variables (e.g. set_foo() and get_foo() accessor
  3653. functions).
  3654. </p>
  3655. <span id="index-_002d_002ddisable_002dauto_002dimport"></span>
  3656. </dd>
  3657. <dt><code>--disable-auto-import</code></dt>
  3658. <dd><p>Do not attempt to do sophisticated linking of <code>_symbol</code> to
  3659. <code>__imp__symbol</code> for DATA imports from DLLs.
  3660. [This option is specific to the i386 PE targeted port of the linker]
  3661. </p>
  3662. <span id="index-_002d_002denable_002druntime_002dpseudo_002dreloc"></span>
  3663. </dd>
  3664. <dt><code>--enable-runtime-pseudo-reloc</code></dt>
  3665. <dd><p>If your code contains expressions described in &ndash;enable-auto-import section,
  3666. that is, DATA imports from DLL with non-zero offset, this switch will create
  3667. a vector of &rsquo;runtime pseudo relocations&rsquo; which can be used by runtime
  3668. environment to adjust references to such data in your client code.
  3669. [This option is specific to the i386 PE targeted port of the linker]
  3670. </p>
  3671. <span id="index-_002d_002ddisable_002druntime_002dpseudo_002dreloc"></span>
  3672. </dd>
  3673. <dt><code>--disable-runtime-pseudo-reloc</code></dt>
  3674. <dd><p>Do not create pseudo relocations for non-zero offset DATA imports from DLLs.
  3675. [This option is specific to the i386 PE targeted port of the linker]
  3676. </p>
  3677. <span id="index-_002d_002denable_002dextra_002dpe_002ddebug"></span>
  3678. </dd>
  3679. <dt><code>--enable-extra-pe-debug</code></dt>
  3680. <dd><p>Show additional debug info related to auto-import symbol thunking.
  3681. [This option is specific to the i386 PE targeted port of the linker]
  3682. </p>
  3683. <span id="index-_002d_002dsection_002dalignment"></span>
  3684. </dd>
  3685. <dt><code>--section-alignment</code></dt>
  3686. <dd><p>Sets the section alignment. Sections in memory will always begin at
  3687. addresses which are a multiple of this number. Defaults to 0x1000.
  3688. [This option is specific to the i386 PE targeted port of the linker]
  3689. </p>
  3690. <span id="index-stack-size"></span>
  3691. <span id="index-_002d_002dstack"></span>
  3692. </dd>
  3693. <dt><code>--stack <var>reserve</var></code></dt>
  3694. <dt><code>--stack <var>reserve</var>,<var>commit</var></code></dt>
  3695. <dd><p>Specify the number of bytes of memory to reserve (and optionally commit)
  3696. to be used as stack for this program. The default is 2MB reserved, 4K
  3697. committed.
  3698. [This option is specific to the i386 PE targeted port of the linker]
  3699. </p>
  3700. <span id="index-_002d_002dsubsystem"></span>
  3701. </dd>
  3702. <dt><code>--subsystem <var>which</var></code></dt>
  3703. <dt><code>--subsystem <var>which</var>:<var>major</var></code></dt>
  3704. <dt><code>--subsystem <var>which</var>:<var>major</var>.<var>minor</var></code></dt>
  3705. <dd><p>Specifies the subsystem under which your program will execute. The
  3706. legal values for <var>which</var> are <code>native</code>, <code>windows</code>,
  3707. <code>console</code>, <code>posix</code>, and <code>xbox</code>. You may optionally set
  3708. the subsystem version also. Numeric values are also accepted for
  3709. <var>which</var>.
  3710. [This option is specific to the i386 PE targeted port of the linker]
  3711. </p>
  3712. <p>The following options set flags in the <code>DllCharacteristics</code> field
  3713. of the PE file header:
  3714. [These options are specific to PE targeted ports of the linker]
  3715. </p>
  3716. <span id="index-_002d_002dhigh_002dentropy_002dva"></span>
  3717. </dd>
  3718. <dt><code>--high-entropy-va</code></dt>
  3719. <dt><code>--disable-high-entropy-va</code></dt>
  3720. <dd><p>Image is compatible with 64-bit address space layout randomization
  3721. (ASLR). This option is enabled by default for 64-bit PE images.
  3722. </p>
  3723. <p>This option also implies <samp>--dynamicbase</samp> and
  3724. <samp>--enable-reloc-section</samp>.
  3725. </p>
  3726. <span id="index-_002d_002ddynamicbase"></span>
  3727. </dd>
  3728. <dt><code>--dynamicbase</code></dt>
  3729. <dt><code>--disable-dynamicbase</code></dt>
  3730. <dd><p>The image base address may be relocated using address space layout
  3731. randomization (ASLR). This feature was introduced with MS Windows
  3732. Vista for i386 PE targets. This option is enabled by default but
  3733. can be disabled via the <samp>--disable-dynamicbase</samp> option.
  3734. This option also implies <samp>--enable-reloc-section</samp>.
  3735. </p>
  3736. <span id="index-_002d_002dforceinteg"></span>
  3737. </dd>
  3738. <dt><code>--forceinteg</code></dt>
  3739. <dt><code>--disable-forceinteg</code></dt>
  3740. <dd><p>Code integrity checks are enforced. This option is disabled by
  3741. default.
  3742. </p>
  3743. <span id="index-_002d_002dnxcompat"></span>
  3744. </dd>
  3745. <dt><code>--nxcompat</code></dt>
  3746. <dt><code>--disable-nxcompat</code></dt>
  3747. <dd><p>The image is compatible with the Data Execution Prevention.
  3748. This feature was introduced with MS Windows XP SP2 for i386 PE
  3749. targets. The option is enabled by default.
  3750. </p>
  3751. <span id="index-_002d_002dno_002disolation"></span>
  3752. </dd>
  3753. <dt><code>--no-isolation</code></dt>
  3754. <dt><code>--disable-no-isolation</code></dt>
  3755. <dd><p>Although the image understands isolation, do not isolate the image.
  3756. This option is disabled by default.
  3757. </p>
  3758. <span id="index-_002d_002dno_002dseh"></span>
  3759. </dd>
  3760. <dt><code>--no-seh</code></dt>
  3761. <dt><code>--disable-no-seh</code></dt>
  3762. <dd><p>The image does not use SEH. No SE handler may be called from
  3763. this image. This option is disabled by default.
  3764. </p>
  3765. <span id="index-_002d_002dno_002dbind"></span>
  3766. </dd>
  3767. <dt><code>--no-bind</code></dt>
  3768. <dt><code>--disable-no-bind</code></dt>
  3769. <dd><p>Do not bind this image. This option is disabled by default.
  3770. </p>
  3771. <span id="index-_002d_002dwdmdriver"></span>
  3772. </dd>
  3773. <dt><code>--wdmdriver</code></dt>
  3774. <dt><code>--disable-wdmdriver</code></dt>
  3775. <dd><p>The driver uses the MS Windows Driver Model. This option is disabled
  3776. by default.
  3777. </p>
  3778. <span id="index-_002d_002dtsaware"></span>
  3779. </dd>
  3780. <dt><code>--tsaware</code></dt>
  3781. <dt><code>--disable-tsaware</code></dt>
  3782. <dd><p>The image is Terminal Server aware. This option is disabled by
  3783. default.
  3784. </p>
  3785. <span id="index-_002d_002dinsert_002dtimestamp"></span>
  3786. </dd>
  3787. <dt><code>--insert-timestamp</code></dt>
  3788. <dt><code>--no-insert-timestamp</code></dt>
  3789. <dd><p>Insert a real timestamp into the image. This is the default behaviour
  3790. as it matches legacy code and it means that the image will work with
  3791. other, proprietary tools. The problem with this default is that it
  3792. will result in slightly different images being produced each time the
  3793. same sources are linked. The option <samp>--no-insert-timestamp</samp>
  3794. can be used to insert a zero value for the timestamp, this ensuring
  3795. that binaries produced from identical sources will compare
  3796. identically.
  3797. </p>
  3798. <p>If <samp>--insert-timestamp</samp> is active then the time inserted is
  3799. either the time that the linking takes place or, if the
  3800. <code>SOURCE_DATE_EPOCH</code> environment variable is defined, the number
  3801. of seconds since Unix epoch as specified by that variable.
  3802. </p>
  3803. <span id="index-_002d_002denable_002dreloc_002dsection"></span>
  3804. </dd>
  3805. <dt><code>--enable-reloc-section</code></dt>
  3806. <dt><code>--disable-reloc-section</code></dt>
  3807. <dd><p>Create the base relocation table, which is necessary if the image
  3808. is loaded at a different image base than specified in the PE header.
  3809. This option is enabled by default.
  3810. </p></dd>
  3811. </dl>
  3812. <span id="Options-specific-to-C6X-uClinux-targets"></span><h4 class="subsection">2.1.2 Options specific to C6X uClinux targets</h4>
  3813. <p>The C6X uClinux target uses a binary format called DSBT to support shared
  3814. libraries. Each shared library in the system needs to have a unique index;
  3815. all executables use an index of 0.
  3816. </p>
  3817. <dl compact="compact">
  3818. <dd>
  3819. <span id="index-_002d_002ddsbt_002dsize"></span>
  3820. </dd>
  3821. <dt><code>--dsbt-size <var>size</var></code></dt>
  3822. <dd><p>This option sets the number of entries in the DSBT of the current executable
  3823. or shared library to <var>size</var>. The default is to create a table with 64
  3824. entries.
  3825. </p>
  3826. <span id="index-_002d_002ddsbt_002dindex"></span>
  3827. </dd>
  3828. <dt><code>--dsbt-index <var>index</var></code></dt>
  3829. <dd><p>This option sets the DSBT index of the current executable or shared library
  3830. to <var>index</var>. The default is 0, which is appropriate for generating
  3831. executables. If a shared library is generated with a DSBT index of 0, the
  3832. <code>R_C6000_DSBT_INDEX</code> relocs are copied into the output file.
  3833. </p>
  3834. <span id="index-_002d_002dno_002dmerge_002dexidx_002dentries"></span>
  3835. <p>The &lsquo;<samp>--no-merge-exidx-entries</samp>&rsquo; switch disables the merging of adjacent
  3836. exidx entries in frame unwind info.
  3837. </p>
  3838. </dd>
  3839. </dl>
  3840. <span id="Options-specific-to-C_002dSKY-targets"></span><h4 class="subsection">2.1.3 Options specific to C-SKY targets</h4>
  3841. <dl compact="compact">
  3842. <dd>
  3843. <span id="index-_002d_002dbranch_002dstub-on-C_002dSKY"></span>
  3844. </dd>
  3845. <dt><code>--branch-stub</code></dt>
  3846. <dd><p>This option enables linker branch relaxation by inserting branch stub
  3847. sections when needed to extend the range of branches. This option is
  3848. usually not required since C-SKY supports branch and call instructions that
  3849. can access the full memory range and branch relaxation is normally handled by
  3850. the compiler or assembler.
  3851. </p>
  3852. <span id="index-_002d_002dstub_002dgroup_002dsize-on-C_002dSKY"></span>
  3853. </dd>
  3854. <dt><code>--stub-group-size=<var>N</var></code></dt>
  3855. <dd><p>This option allows finer control of linker branch stub creation.
  3856. It sets the maximum size of a group of input sections that can
  3857. be handled by one stub section. A negative value of <var>N</var> locates
  3858. stub sections after their branches, while a positive value allows stub
  3859. sections to appear either before or after the branches. Values of
  3860. &lsquo;<samp>1</samp>&rsquo; or &lsquo;<samp>-1</samp>&rsquo; indicate that the
  3861. linker should choose suitable defaults.
  3862. </p>
  3863. </dd>
  3864. </dl>
  3865. <span id="Options-specific-to-Motorola-68HC11-and-68HC12-targets"></span><h4 class="subsection">2.1.4 Options specific to Motorola 68HC11 and 68HC12 targets</h4>
  3866. <p>The 68HC11 and 68HC12 linkers support specific options to control the
  3867. memory bank switching mapping and trampoline code generation.
  3868. </p>
  3869. <dl compact="compact">
  3870. <dd>
  3871. <span id="index-_002d_002dno_002dtrampoline"></span>
  3872. </dd>
  3873. <dt><code>--no-trampoline</code></dt>
  3874. <dd><p>This option disables the generation of trampoline. By default a trampoline
  3875. is generated for each far function which is called using a <code>jsr</code>
  3876. instruction (this happens when a pointer to a far function is taken).
  3877. </p>
  3878. <span id="index-_002d_002dbank_002dwindow"></span>
  3879. </dd>
  3880. <dt><code>--bank-window <var>name</var></code></dt>
  3881. <dd><p>This option indicates to the linker the name of the memory region in
  3882. the &lsquo;<samp>MEMORY</samp>&rsquo; specification that describes the memory bank window.
  3883. The definition of such region is then used by the linker to compute
  3884. paging and addresses within the memory window.
  3885. </p>
  3886. </dd>
  3887. </dl>
  3888. <span id="Options-specific-to-Motorola-68K-target"></span><h4 class="subsection">2.1.5 Options specific to Motorola 68K target</h4>
  3889. <p>The following options are supported to control handling of GOT generation
  3890. when linking for 68K targets.
  3891. </p>
  3892. <dl compact="compact">
  3893. <dd>
  3894. <span id="index-_002d_002dgot"></span>
  3895. </dd>
  3896. <dt><code>--got=<var>type</var></code></dt>
  3897. <dd><p>This option tells the linker which GOT generation scheme to use.
  3898. <var>type</var> should be one of &lsquo;<samp>single</samp>&rsquo;, &lsquo;<samp>negative</samp>&rsquo;,
  3899. &lsquo;<samp>multigot</samp>&rsquo; or &lsquo;<samp>target</samp>&rsquo;. For more information refer to the
  3900. Info entry for <samp>ld</samp>.
  3901. </p>
  3902. </dd>
  3903. </dl>
  3904. <span id="Options-specific-to-MIPS-targets"></span><h4 class="subsection">2.1.6 Options specific to MIPS targets</h4>
  3905. <p>The following options are supported to control microMIPS instruction
  3906. generation and branch relocation checks for ISA mode transitions when
  3907. linking for MIPS targets.
  3908. </p>
  3909. <dl compact="compact">
  3910. <dd>
  3911. <span id="index-_002d_002dinsn32"></span>
  3912. </dd>
  3913. <dt><code>--insn32</code></dt>
  3914. <dd><span id="index-_002d_002dno_002dinsn32"></span>
  3915. </dd>
  3916. <dt><code>--no-insn32</code></dt>
  3917. <dd><p>These options control the choice of microMIPS instructions used in code
  3918. generated by the linker, such as that in the PLT or lazy binding stubs,
  3919. or in relaxation. If &lsquo;<samp>--insn32</samp>&rsquo; is used, then the linker only uses
  3920. 32-bit instruction encodings. By default or if &lsquo;<samp>--no-insn32</samp>&rsquo; is
  3921. used, all instruction encodings are used, including 16-bit ones where
  3922. possible.
  3923. </p>
  3924. <span id="index-_002d_002dignore_002dbranch_002disa"></span>
  3925. </dd>
  3926. <dt><code>--ignore-branch-isa</code></dt>
  3927. <dd><span id="index-_002d_002dno_002dignore_002dbranch_002disa"></span>
  3928. </dd>
  3929. <dt><code>--no-ignore-branch-isa</code></dt>
  3930. <dd><p>These options control branch relocation checks for invalid ISA mode
  3931. transitions. If &lsquo;<samp>--ignore-branch-isa</samp>&rsquo; is used, then the linker
  3932. accepts any branch relocations and any ISA mode transition required
  3933. is lost in relocation calculation, except for some cases of <code>BAL</code>
  3934. instructions which meet relaxation conditions and are converted to
  3935. equivalent <code>JALX</code> instructions as the associated relocation is
  3936. calculated. By default or if &lsquo;<samp>--no-ignore-branch-isa</samp>&rsquo; is used
  3937. a check is made causing the loss of an ISA mode transition to produce
  3938. an error.
  3939. </p>
  3940. <span id="index-_002d_002dcompact_002dbranches"></span>
  3941. </dd>
  3942. <dt><code>--compact-branches</code></dt>
  3943. <dd><span id="index-_002d_002dno_002dcompact_002dbranches"></span>
  3944. </dd>
  3945. <dt><code>--no-compact-branches</code></dt>
  3946. <dd><p>These options control the generation of compact instructions by the linker
  3947. in the PLT entries for MIPS R6.
  3948. </p>
  3949. </dd>
  3950. </dl>
  3951. <span id="Options-specific-to-PDP11-targets"></span><h4 class="subsection">2.1.7 Options specific to PDP11 targets</h4>
  3952. <p>For the pdp11-aout target, three variants of the output format can be
  3953. produced as selected by the following options. The default variant
  3954. for pdp11-aout is the &lsquo;<samp>--omagic</samp>&rsquo; option, whereas for other
  3955. targets &lsquo;<samp>--nmagic</samp>&rsquo; is the default. The &lsquo;<samp>--imagic</samp>&rsquo; option is
  3956. defined only for the pdp11-aout target, while the others are described
  3957. here as they apply to the pdp11-aout target.
  3958. </p>
  3959. <dl compact="compact">
  3960. <dd>
  3961. <span id="index-_002dN-1"></span>
  3962. </dd>
  3963. <dt><code>-N</code></dt>
  3964. <dd><span id="index-_002d_002domagic-1"></span>
  3965. </dd>
  3966. <dt><code>--omagic</code></dt>
  3967. <dd>
  3968. <p>Mark the output as <code>OMAGIC</code> (0407) in the <samp>a.out</samp> header to
  3969. indicate that the text segment is not to be write-protected and
  3970. shared. Since the text and data sections are both readable and
  3971. writable, the data section is allocated immediately contiguous after
  3972. the text segment. This is the oldest format for PDP11 executable
  3973. programs and is the default for <code>ld</code> on PDP11 Unix systems
  3974. from the beginning through 2.11BSD.
  3975. </p>
  3976. <span id="index-_002dn-1"></span>
  3977. </dd>
  3978. <dt><code>-n</code></dt>
  3979. <dd><span id="index-_002d_002dnmagic-1"></span>
  3980. </dd>
  3981. <dt><code>--nmagic</code></dt>
  3982. <dd>
  3983. <p>Mark the output as <code>NMAGIC</code> (0410) in the <samp>a.out</samp> header to
  3984. indicate that when the output file is executed, the text portion will
  3985. be read-only and shareable among all processes executing the same
  3986. file. This involves moving the data areas up to the first possible 8K
  3987. byte page boundary following the end of the text. This option creates
  3988. a <em>pure executable</em> format.
  3989. </p>
  3990. <span id="index-_002dz"></span>
  3991. </dd>
  3992. <dt><code>-z</code></dt>
  3993. <dd><span id="index-_002d_002dimagic"></span>
  3994. </dd>
  3995. <dt><code>--imagic</code></dt>
  3996. <dd>
  3997. <p>Mark the output as <code>IMAGIC</code> (0411) in the <samp>a.out</samp> header to
  3998. indicate that when the output file is executed, the program text and
  3999. data areas will be loaded into separate address spaces using the split
  4000. instruction and data space feature of the memory management unit in
  4001. larger models of the PDP11. This doubles the address space available
  4002. to the program. The text segment is again pure, write-protected, and
  4003. shareable. The only difference in the output format between this
  4004. option and the others, besides the magic number, is that both the text
  4005. and data sections start at location 0. The &lsquo;<samp>-z</samp>&rsquo; option selected
  4006. this format in 2.11BSD. This option creates a <em>separate
  4007. executable</em> format.
  4008. </p>
  4009. <span id="index-_002d_002dno_002domagic-1"></span>
  4010. </dd>
  4011. <dt><code>--no-omagic</code></dt>
  4012. <dd>
  4013. <p>Equivalent to &lsquo;<samp>--nmagic</samp>&rsquo; for pdp11-aout.
  4014. </p>
  4015. </dd>
  4016. </dl>
  4017. <hr>
  4018. <span id="Environment"></span><div class="header">
  4019. <p>
  4020. Previous: <a href="#Options" accesskey="p" rel="prev">Options</a>, Up: <a href="#Invocation" accesskey="u" rel="up">Invocation</a> &nbsp; [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#LD-Index" title="Index" rel="index">Index</a>]</p>
  4021. </div>
  4022. <span id="Environment-Variables"></span><h3 class="section">2.2 Environment Variables</h3>
  4023. <p>You can change the behaviour of <code>ld</code> with the environment variables
  4024. <code>GNUTARGET</code>,
  4025. <code>LDEMULATION</code> and <code>COLLECT_NO_DEMANGLE</code>.
  4026. </p>
  4027. <span id="index-GNUTARGET"></span>
  4028. <span id="index-default-input-format"></span>
  4029. <p><code>GNUTARGET</code> determines the input-file object format if you don&rsquo;t
  4030. use &lsquo;<samp>-b</samp>&rsquo; (or its synonym &lsquo;<samp>--format</samp>&rsquo;). Its value should be one
  4031. of the BFD names for an input format (see <a href="#BFD">BFD</a>). If there is no
  4032. <code>GNUTARGET</code> in the environment, <code>ld</code> uses the natural format
  4033. of the target. If <code>GNUTARGET</code> is set to <code>default</code> then BFD
  4034. attempts to discover the input format by examining binary input files;
  4035. this method often succeeds, but there are potential ambiguities, since
  4036. there is no method of ensuring that the magic number used to specify
  4037. object-file formats is unique. However, the configuration procedure for
  4038. BFD on each system places the conventional format for that system first
  4039. in the search-list, so ambiguities are resolved in favor of convention.
  4040. </p>
  4041. <span id="index-LDEMULATION"></span>
  4042. <span id="index-default-emulation"></span>
  4043. <span id="index-emulation_002c-default"></span>
  4044. <p><code>LDEMULATION</code> determines the default emulation if you don&rsquo;t use the
  4045. &lsquo;<samp>-m</samp>&rsquo; option. The emulation can affect various aspects of linker
  4046. behaviour, particularly the default linker script. You can list the
  4047. available emulations with the &lsquo;<samp>--verbose</samp>&rsquo; or &lsquo;<samp>-V</samp>&rsquo; options. If
  4048. the &lsquo;<samp>-m</samp>&rsquo; option is not used, and the <code>LDEMULATION</code> environment
  4049. variable is not defined, the default emulation depends upon how the
  4050. linker was configured.
  4051. </p>
  4052. <span id="index-COLLECT_005fNO_005fDEMANGLE"></span>
  4053. <span id="index-demangling_002c-default"></span>
  4054. <p>Normally, the linker will default to demangling symbols. However, if
  4055. <code>COLLECT_NO_DEMANGLE</code> is set in the environment, then it will
  4056. default to not demangling symbols. This environment variable is used in
  4057. a similar fashion by the <code>gcc</code> linker wrapper program. The default
  4058. may be overridden by the &lsquo;<samp>--demangle</samp>&rsquo; and &lsquo;<samp>--no-demangle</samp>&rsquo;
  4059. options.
  4060. </p>
  4061. <hr>
  4062. <span id="Scripts"></span><div class="header">
  4063. <p>
  4064. Next: <a href="#Plugins" accesskey="n" rel="next">Plugins</a>, Previous: <a href="#Invocation" accesskey="p" rel="prev">Invocation</a>, Up: <a href="#Top" accesskey="u" rel="up">Top</a> &nbsp; [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#LD-Index" title="Index" rel="index">Index</a>]</p>
  4065. </div>
  4066. <span id="Linker-Scripts"></span><h2 class="chapter">3 Linker Scripts</h2>
  4067. <span id="index-scripts"></span>
  4068. <span id="index-linker-scripts"></span>
  4069. <span id="index-command-files"></span>
  4070. <p>Every link is controlled by a <em>linker script</em>. This script is
  4071. written in the linker command language.
  4072. </p>
  4073. <p>The main purpose of the linker script is to describe how the sections in
  4074. the input files should be mapped into the output file, and to control
  4075. the memory layout of the output file. Most linker scripts do nothing
  4076. more than this. However, when necessary, the linker script can also
  4077. direct the linker to perform many other operations, using the commands
  4078. described below.
  4079. </p>
  4080. <p>The linker always uses a linker script. If you do not supply one
  4081. yourself, the linker will use a default script that is compiled into the
  4082. linker executable. You can use the &lsquo;<samp>--verbose</samp>&rsquo; command-line option
  4083. to display the default linker script. Certain command-line options,
  4084. such as &lsquo;<samp>-r</samp>&rsquo; or &lsquo;<samp>-N</samp>&rsquo;, will affect the default linker script.
  4085. </p>
  4086. <p>You may supply your own linker script by using the &lsquo;<samp>-T</samp>&rsquo; command
  4087. line option. When you do this, your linker script will replace the
  4088. default linker script.
  4089. </p>
  4090. <p>You may also use linker scripts implicitly by naming them as input files
  4091. to the linker, as though they were files to be linked. See <a href="#Implicit-Linker-Scripts">Implicit Linker Scripts</a>.
  4092. </p>
  4093. <table class="menu" border="0" cellspacing="0">
  4094. <tr><td align="left" valign="top">&bull; <a href="#Basic-Script-Concepts" accesskey="1">Basic Script Concepts</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">Basic Linker Script Concepts
  4095. </td></tr>
  4096. <tr><td align="left" valign="top">&bull; <a href="#Script-Format" accesskey="2">Script Format</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">Linker Script Format
  4097. </td></tr>
  4098. <tr><td align="left" valign="top">&bull; <a href="#Simple-Example" accesskey="3">Simple Example</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">Simple Linker Script Example
  4099. </td></tr>
  4100. <tr><td align="left" valign="top">&bull; <a href="#Simple-Commands" accesskey="4">Simple Commands</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">Simple Linker Script Commands
  4101. </td></tr>
  4102. <tr><td align="left" valign="top">&bull; <a href="#Assignments" accesskey="5">Assignments</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">Assigning Values to Symbols
  4103. </td></tr>
  4104. <tr><td align="left" valign="top">&bull; <a href="#SECTIONS" accesskey="6">SECTIONS</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">SECTIONS Command
  4105. </td></tr>
  4106. <tr><td align="left" valign="top">&bull; <a href="#MEMORY" accesskey="7">MEMORY</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">MEMORY Command
  4107. </td></tr>
  4108. <tr><td align="left" valign="top">&bull; <a href="#PHDRS" accesskey="8">PHDRS</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">PHDRS Command
  4109. </td></tr>
  4110. <tr><td align="left" valign="top">&bull; <a href="#VERSION" accesskey="9">VERSION</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">VERSION Command
  4111. </td></tr>
  4112. <tr><td align="left" valign="top">&bull; <a href="#Expressions">Expressions</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">Expressions in Linker Scripts
  4113. </td></tr>
  4114. <tr><td align="left" valign="top">&bull; <a href="#Implicit-Linker-Scripts">Implicit Linker Scripts</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">Implicit Linker Scripts
  4115. </td></tr>
  4116. </table>
  4117. <hr>
  4118. <span id="Basic-Script-Concepts"></span><div class="header">
  4119. <p>
  4120. Next: <a href="#Script-Format" accesskey="n" rel="next">Script Format</a>, Up: <a href="#Scripts" accesskey="u" rel="up">Scripts</a> &nbsp; [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#LD-Index" title="Index" rel="index">Index</a>]</p>
  4121. </div>
  4122. <span id="Basic-Linker-Script-Concepts"></span><h3 class="section">3.1 Basic Linker Script Concepts</h3>
  4123. <span id="index-linker-script-concepts"></span>
  4124. <p>We need to define some basic concepts and vocabulary in order to
  4125. describe the linker script language.
  4126. </p>
  4127. <p>The linker combines input files into a single output file. The output
  4128. file and each input file are in a special data format known as an
  4129. <em>object file format</em>. Each file is called an <em>object file</em>.
  4130. The output file is often called an <em>executable</em>, but for our
  4131. purposes we will also call it an object file. Each object file has,
  4132. among other things, a list of <em>sections</em>. We sometimes refer to a
  4133. section in an input file as an <em>input section</em>; similarly, a section
  4134. in the output file is an <em>output section</em>.
  4135. </p>
  4136. <p>Each section in an object file has a name and a size. Most sections
  4137. also have an associated block of data, known as the <em>section
  4138. contents</em>. A section may be marked as <em>loadable</em>, which means that
  4139. the contents should be loaded into memory when the output file is run.
  4140. A section with no contents may be <em>allocatable</em>, which means that an
  4141. area in memory should be set aside, but nothing in particular should be
  4142. loaded there (in some cases this memory must be zeroed out). A section
  4143. which is neither loadable nor allocatable typically contains some sort
  4144. of debugging information.
  4145. </p>
  4146. <p>Every loadable or allocatable output section has two addresses. The
  4147. first is the <em>VMA</em>, or virtual memory address. This is the address
  4148. the section will have when the output file is run. The second is the
  4149. <em>LMA</em>, or load memory address. This is the address at which the
  4150. section will be loaded. In most cases the two addresses will be the
  4151. same. An example of when they might be different is when a data section
  4152. is loaded into ROM, and then copied into RAM when the program starts up
  4153. (this technique is often used to initialize global variables in a ROM
  4154. based system). In this case the ROM address would be the LMA, and the
  4155. RAM address would be the VMA.
  4156. </p>
  4157. <p>You can see the sections in an object file by using the <code>objdump</code>
  4158. program with the &lsquo;<samp>-h</samp>&rsquo; option.
  4159. </p>
  4160. <p>Every object file also has a list of <em>symbols</em>, known as the
  4161. <em>symbol table</em>. A symbol may be defined or undefined. Each symbol
  4162. has a name, and each defined symbol has an address, among other
  4163. information. If you compile a C or C++ program into an object file, you
  4164. will get a defined symbol for every defined function and global or
  4165. static variable. Every undefined function or global variable which is
  4166. referenced in the input file will become an undefined symbol.
  4167. </p>
  4168. <p>You can see the symbols in an object file by using the <code>nm</code>
  4169. program, or by using the <code>objdump</code> program with the &lsquo;<samp>-t</samp>&rsquo;
  4170. option.
  4171. </p>
  4172. <hr>
  4173. <span id="Script-Format"></span><div class="header">
  4174. <p>
  4175. Next: <a href="#Simple-Example" accesskey="n" rel="next">Simple Example</a>, Previous: <a href="#Basic-Script-Concepts" accesskey="p" rel="prev">Basic Script Concepts</a>, Up: <a href="#Scripts" accesskey="u" rel="up">Scripts</a> &nbsp; [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#LD-Index" title="Index" rel="index">Index</a>]</p>
  4176. </div>
  4177. <span id="Linker-Script-Format"></span><h3 class="section">3.2 Linker Script Format</h3>
  4178. <span id="index-linker-script-format"></span>
  4179. <p>Linker scripts are text files.
  4180. </p>
  4181. <p>You write a linker script as a series of commands. Each command is
  4182. either a keyword, possibly followed by arguments, or an assignment to a
  4183. symbol. You may separate commands using semicolons. Whitespace is
  4184. generally ignored.
  4185. </p>
  4186. <p>Strings such as file or format names can normally be entered directly.
  4187. If the file name contains a character such as a comma which would
  4188. otherwise serve to separate file names, you may put the file name in
  4189. double quotes. There is no way to use a double quote character in a
  4190. file name.
  4191. </p>
  4192. <p>You may include comments in linker scripts just as in C, delimited by
  4193. &lsquo;<samp>/*</samp>&rsquo; and &lsquo;<samp>*/</samp>&rsquo;. As in C, comments are syntactically equivalent
  4194. to whitespace.
  4195. </p>
  4196. <hr>
  4197. <span id="Simple-Example"></span><div class="header">
  4198. <p>
  4199. Next: <a href="#Simple-Commands" accesskey="n" rel="next">Simple Commands</a>, Previous: <a href="#Script-Format" accesskey="p" rel="prev">Script Format</a>, Up: <a href="#Scripts" accesskey="u" rel="up">Scripts</a> &nbsp; [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#LD-Index" title="Index" rel="index">Index</a>]</p>
  4200. </div>
  4201. <span id="Simple-Linker-Script-Example"></span><h3 class="section">3.3 Simple Linker Script Example</h3>
  4202. <span id="index-linker-script-example"></span>
  4203. <span id="index-example-of-linker-script"></span>
  4204. <p>Many linker scripts are fairly simple.
  4205. </p>
  4206. <p>The simplest possible linker script has just one command:
  4207. &lsquo;<samp>SECTIONS</samp>&rsquo;. You use the &lsquo;<samp>SECTIONS</samp>&rsquo; command to describe the
  4208. memory layout of the output file.
  4209. </p>
  4210. <p>The &lsquo;<samp>SECTIONS</samp>&rsquo; command is a powerful command. Here we will
  4211. describe a simple use of it. Let&rsquo;s assume your program consists only of
  4212. code, initialized data, and uninitialized data. These will be in the
  4213. &lsquo;<samp>.text</samp>&rsquo;, &lsquo;<samp>.data</samp>&rsquo;, and &lsquo;<samp>.bss</samp>&rsquo; sections, respectively.
  4214. Let&rsquo;s assume further that these are the only sections which appear in
  4215. your input files.
  4216. </p>
  4217. <p>For this example, let&rsquo;s say that the code should be loaded at address
  4218. 0x10000, and that the data should start at address 0x8000000. Here is a
  4219. linker script which will do that:
  4220. </p><div class="example">
  4221. <pre class="example">SECTIONS
  4222. {
  4223. . = 0x10000;
  4224. .text : { *(.text) }
  4225. . = 0x8000000;
  4226. .data : { *(.data) }
  4227. .bss : { *(.bss) }
  4228. }
  4229. </pre></div>
  4230. <p>You write the &lsquo;<samp>SECTIONS</samp>&rsquo; command as the keyword &lsquo;<samp>SECTIONS</samp>&rsquo;,
  4231. followed by a series of symbol assignments and output section
  4232. descriptions enclosed in curly braces.
  4233. </p>
  4234. <p>The first line inside the &lsquo;<samp>SECTIONS</samp>&rsquo; command of the above example
  4235. sets the value of the special symbol &lsquo;<samp>.</samp>&rsquo;, which is the location
  4236. counter. If you do not specify the address of an output section in some
  4237. other way (other ways are described later), the address is set from the
  4238. current value of the location counter. The location counter is then
  4239. incremented by the size of the output section. At the start of the
  4240. &lsquo;<samp>SECTIONS</samp>&rsquo; command, the location counter has the value &lsquo;<samp>0</samp>&rsquo;.
  4241. </p>
  4242. <p>The second line defines an output section, &lsquo;<samp>.text</samp>&rsquo;. The colon is
  4243. required syntax which may be ignored for now. Within the curly braces
  4244. after the output section name, you list the names of the input sections
  4245. which should be placed into this output section. The &lsquo;<samp>*</samp>&rsquo; is a
  4246. wildcard which matches any file name. The expression &lsquo;<samp>*(.text)</samp>&rsquo;
  4247. means all &lsquo;<samp>.text</samp>&rsquo; input sections in all input files.
  4248. </p>
  4249. <p>Since the location counter is &lsquo;<samp>0x10000</samp>&rsquo; when the output section
  4250. &lsquo;<samp>.text</samp>&rsquo; is defined, the linker will set the address of the
  4251. &lsquo;<samp>.text</samp>&rsquo; section in the output file to be &lsquo;<samp>0x10000</samp>&rsquo;.
  4252. </p>
  4253. <p>The remaining lines define the &lsquo;<samp>.data</samp>&rsquo; and &lsquo;<samp>.bss</samp>&rsquo; sections in
  4254. the output file. The linker will place the &lsquo;<samp>.data</samp>&rsquo; output section
  4255. at address &lsquo;<samp>0x8000000</samp>&rsquo;. After the linker places the &lsquo;<samp>.data</samp>&rsquo;
  4256. output section, the value of the location counter will be
  4257. &lsquo;<samp>0x8000000</samp>&rsquo; plus the size of the &lsquo;<samp>.data</samp>&rsquo; output section. The
  4258. effect is that the linker will place the &lsquo;<samp>.bss</samp>&rsquo; output section
  4259. immediately after the &lsquo;<samp>.data</samp>&rsquo; output section in memory.
  4260. </p>
  4261. <p>The linker will ensure that each output section has the required
  4262. alignment, by increasing the location counter if necessary. In this
  4263. example, the specified addresses for the &lsquo;<samp>.text</samp>&rsquo; and &lsquo;<samp>.data</samp>&rsquo;
  4264. sections will probably satisfy any alignment constraints, but the linker
  4265. may have to create a small gap between the &lsquo;<samp>.data</samp>&rsquo; and &lsquo;<samp>.bss</samp>&rsquo;
  4266. sections.
  4267. </p>
  4268. <p>That&rsquo;s it! That&rsquo;s a simple and complete linker script.
  4269. </p>
  4270. <hr>
  4271. <span id="Simple-Commands"></span><div class="header">
  4272. <p>
  4273. Next: <a href="#Assignments" accesskey="n" rel="next">Assignments</a>, Previous: <a href="#Simple-Example" accesskey="p" rel="prev">Simple Example</a>, Up: <a href="#Scripts" accesskey="u" rel="up">Scripts</a> &nbsp; [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#LD-Index" title="Index" rel="index">Index</a>]</p>
  4274. </div>
  4275. <span id="Simple-Linker-Script-Commands"></span><h3 class="section">3.4 Simple Linker Script Commands</h3>
  4276. <span id="index-linker-script-simple-commands"></span>
  4277. <p>In this section we describe the simple linker script commands.
  4278. </p>
  4279. <table class="menu" border="0" cellspacing="0">
  4280. <tr><td align="left" valign="top">&bull; <a href="#Entry-Point" accesskey="1">Entry Point</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">Setting the entry point
  4281. </td></tr>
  4282. <tr><td align="left" valign="top">&bull; <a href="#File-Commands" accesskey="2">File Commands</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">Commands dealing with files
  4283. </td></tr>
  4284. <tr><td align="left" valign="top">&bull; <a href="#Format-Commands" accesskey="3">Format Commands</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">Commands dealing with object file formats
  4285. </td></tr>
  4286. <tr><th colspan="3" align="left" valign="top"><pre class="menu-comment">
  4287. </pre></th></tr><tr><td align="left" valign="top">&bull; <a href="#REGION_005fALIAS" accesskey="4">REGION_ALIAS</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">Assign alias names to memory regions
  4288. </td></tr>
  4289. <tr><td align="left" valign="top">&bull; <a href="#Miscellaneous-Commands" accesskey="5">Miscellaneous Commands</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">Other linker script commands
  4290. </td></tr>
  4291. </table>
  4292. <hr>
  4293. <span id="Entry-Point"></span><div class="header">
  4294. <p>
  4295. Next: <a href="#File-Commands" accesskey="n" rel="next">File Commands</a>, Up: <a href="#Simple-Commands" accesskey="u" rel="up">Simple Commands</a> &nbsp; [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#LD-Index" title="Index" rel="index">Index</a>]</p>
  4296. </div>
  4297. <span id="Setting-the-Entry-Point"></span><h4 class="subsection">3.4.1 Setting the Entry Point</h4>
  4298. <span id="index-ENTRY_0028symbol_0029"></span>
  4299. <span id="index-start-of-execution"></span>
  4300. <span id="index-first-instruction"></span>
  4301. <span id="index-entry-point"></span>
  4302. <p>The first instruction to execute in a program is called the <em>entry
  4303. point</em>. You can use the <code>ENTRY</code> linker script command to set the
  4304. entry point. The argument is a symbol name:
  4305. </p><div class="example">
  4306. <pre class="example">ENTRY(<var>symbol</var>)
  4307. </pre></div>
  4308. <p>There are several ways to set the entry point. The linker will set the
  4309. entry point by trying each of the following methods in order, and
  4310. stopping when one of them succeeds:
  4311. </p><ul>
  4312. <li> the &lsquo;<samp>-e</samp>&rsquo; <var>entry</var> command-line option;
  4313. </li><li> the <code>ENTRY(<var>symbol</var>)</code> command in a linker script;
  4314. </li><li> the value of a target-specific symbol, if it is defined; For many
  4315. targets this is <code>start</code>, but PE- and BeOS-based systems for example
  4316. check a list of possible entry symbols, matching the first one found.
  4317. </li><li> the address of the first byte of the code section, if present and an
  4318. executable is being created - the code section is usually
  4319. &lsquo;<samp>.text</samp>&rsquo;, but can be something else;
  4320. </li><li> The address <code>0</code>.
  4321. </li></ul>
  4322. <hr>
  4323. <span id="File-Commands"></span><div class="header">
  4324. <p>
  4325. Next: <a href="#Format-Commands" accesskey="n" rel="next">Format Commands</a>, Previous: <a href="#Entry-Point" accesskey="p" rel="prev">Entry Point</a>, Up: <a href="#Simple-Commands" accesskey="u" rel="up">Simple Commands</a> &nbsp; [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#LD-Index" title="Index" rel="index">Index</a>]</p>
  4326. </div>
  4327. <span id="Commands-Dealing-with-Files"></span><h4 class="subsection">3.4.2 Commands Dealing with Files</h4>
  4328. <span id="index-linker-script-file-commands"></span>
  4329. <p>Several linker script commands deal with files.
  4330. </p>
  4331. <dl compact="compact">
  4332. <dt><code>INCLUDE <var>filename</var></code></dt>
  4333. <dd><span id="index-INCLUDE-filename"></span>
  4334. <span id="index-including-a-linker-script"></span>
  4335. <p>Include the linker script <var>filename</var> at this point. The file will
  4336. be searched for in the current directory, and in any directory specified
  4337. with the <samp>-L</samp> option. You can nest calls to <code>INCLUDE</code> up to
  4338. 10 levels deep.
  4339. </p>
  4340. <p>You can place <code>INCLUDE</code> directives at the top level, in <code>MEMORY</code> or
  4341. <code>SECTIONS</code> commands, or in output section descriptions.
  4342. </p>
  4343. </dd>
  4344. <dt><code>INPUT(<var>file</var>, <var>file</var>, &hellip;)</code></dt>
  4345. <dt><code>INPUT(<var>file</var> <var>file</var> &hellip;)</code></dt>
  4346. <dd><span id="index-INPUT_0028files_0029"></span>
  4347. <span id="index-input-files-in-linker-scripts"></span>
  4348. <span id="index-input-object-files-in-linker-scripts"></span>
  4349. <span id="index-linker-script-input-object-files"></span>
  4350. <p>The <code>INPUT</code> command directs the linker to include the named files
  4351. in the link, as though they were named on the command line.
  4352. </p>
  4353. <p>For example, if you always want to include <samp>subr.o</samp> any time you do
  4354. a link, but you can&rsquo;t be bothered to put it on every link command line,
  4355. then you can put &lsquo;<samp>INPUT (subr.o)</samp>&rsquo; in your linker script.
  4356. </p>
  4357. <p>In fact, if you like, you can list all of your input files in the linker
  4358. script, and then invoke the linker with nothing but a &lsquo;<samp>-T</samp>&rsquo; option.
  4359. </p>
  4360. <p>In case a <em>sysroot prefix</em> is configured, and the filename starts
  4361. with the &lsquo;<samp>/</samp>&rsquo; character, and the script being processed was
  4362. located inside the <em>sysroot prefix</em>, the filename will be looked
  4363. for in the <em>sysroot prefix</em>. The <em>sysroot prefix</em> can also be forced by specifying
  4364. <code>=</code> as the first character in the filename path, or prefixing the
  4365. filename path with <code>$SYSROOT</code>. See also the description of
  4366. &lsquo;<samp>-L</samp>&rsquo; in <a href="#Options">Command-line Options</a>.
  4367. </p>
  4368. <p>If a <em>sysroot prefix</em> is not used then the linker will try to open
  4369. the file in the directory containing the linker script. If it is not
  4370. found the linker will then search the current directory. If it is still
  4371. not found the linker will search through the archive library search
  4372. path.
  4373. </p>
  4374. <p>If you use &lsquo;<samp>INPUT (-l<var>file</var>)</samp>&rsquo;, <code>ld</code> will transform the
  4375. name to <code>lib<var>file</var>.a</code>, as with the command-line argument
  4376. &lsquo;<samp>-l</samp>&rsquo;.
  4377. </p>
  4378. <p>When you use the <code>INPUT</code> command in an implicit linker script, the
  4379. files will be included in the link at the point at which the linker
  4380. script file is included. This can affect archive searching.
  4381. </p>
  4382. </dd>
  4383. <dt><code>GROUP(<var>file</var>, <var>file</var>, &hellip;)</code></dt>
  4384. <dt><code>GROUP(<var>file</var> <var>file</var> &hellip;)</code></dt>
  4385. <dd><span id="index-GROUP_0028files_0029"></span>
  4386. <span id="index-grouping-input-files"></span>
  4387. <p>The <code>GROUP</code> command is like <code>INPUT</code>, except that the named
  4388. files should all be archives, and they are searched repeatedly until no
  4389. new undefined references are created. See the description of &lsquo;<samp>-(</samp>&rsquo;
  4390. in <a href="#Options">Command-line Options</a>.
  4391. </p>
  4392. </dd>
  4393. <dt><code>AS_NEEDED(<var>file</var>, <var>file</var>, &hellip;)</code></dt>
  4394. <dt><code>AS_NEEDED(<var>file</var> <var>file</var> &hellip;)</code></dt>
  4395. <dd><span id="index-AS_005fNEEDED_0028files_0029"></span>
  4396. <p>This construct can appear only inside of the <code>INPUT</code> or <code>GROUP</code>
  4397. commands, among other filenames. The files listed will be handled
  4398. as if they appear directly in the <code>INPUT</code> or <code>GROUP</code> commands,
  4399. with the exception of ELF shared libraries, that will be added only
  4400. when they are actually needed. This construct essentially enables
  4401. <samp>--as-needed</samp> option for all the files listed inside of it
  4402. and restores previous <samp>--as-needed</samp> resp. <samp>--no-as-needed</samp>
  4403. setting afterwards.
  4404. </p>
  4405. </dd>
  4406. <dt><code>OUTPUT(<var>filename</var>)</code></dt>
  4407. <dd><span id="index-OUTPUT_0028filename_0029"></span>
  4408. <span id="index-output-file-name-in-linker-script"></span>
  4409. <p>The <code>OUTPUT</code> command names the output file. Using
  4410. <code>OUTPUT(<var>filename</var>)</code> in the linker script is exactly like using
  4411. &lsquo;<samp>-o <var>filename</var></samp>&rsquo; on the command line (see <a href="#Options">Command
  4412. Line Options</a>). If both are used, the command-line option takes
  4413. precedence.
  4414. </p>
  4415. <p>You can use the <code>OUTPUT</code> command to define a default name for the
  4416. output file other than the usual default of <samp>a.out</samp>.
  4417. </p>
  4418. </dd>
  4419. <dt><code>SEARCH_DIR(<var>path</var>)</code></dt>
  4420. <dd><span id="index-SEARCH_005fDIR_0028path_0029"></span>
  4421. <span id="index-library-search-path-in-linker-script"></span>
  4422. <span id="index-archive-search-path-in-linker-script"></span>
  4423. <span id="index-search-path-in-linker-script"></span>
  4424. <p>The <code>SEARCH_DIR</code> command adds <var>path</var> to the list of paths where
  4425. <code>ld</code> looks for archive libraries. Using
  4426. <code>SEARCH_DIR(<var>path</var>)</code> is exactly like using &lsquo;<samp>-L <var>path</var></samp>&rsquo;
  4427. on the command line (see <a href="#Options">Command-line Options</a>). If both
  4428. are used, then the linker will search both paths. Paths specified using
  4429. the command-line option are searched first.
  4430. </p>
  4431. </dd>
  4432. <dt><code>STARTUP(<var>filename</var>)</code></dt>
  4433. <dd><span id="index-STARTUP_0028filename_0029"></span>
  4434. <span id="index-first-input-file"></span>
  4435. <p>The <code>STARTUP</code> command is just like the <code>INPUT</code> command, except
  4436. that <var>filename</var> will become the first input file to be linked, as
  4437. though it were specified first on the command line. This may be useful
  4438. when using a system in which the entry point is always the start of the
  4439. first file.
  4440. </p></dd>
  4441. </dl>
  4442. <hr>
  4443. <span id="Format-Commands"></span><div class="header">
  4444. <p>
  4445. Next: <a href="#REGION_005fALIAS" accesskey="n" rel="next">REGION_ALIAS</a>, Previous: <a href="#File-Commands" accesskey="p" rel="prev">File Commands</a>, Up: <a href="#Simple-Commands" accesskey="u" rel="up">Simple Commands</a> &nbsp; [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#LD-Index" title="Index" rel="index">Index</a>]</p>
  4446. </div>
  4447. <span id="Commands-Dealing-with-Object-File-Formats"></span><h4 class="subsection">3.4.3 Commands Dealing with Object File Formats</h4>
  4448. <p>A couple of linker script commands deal with object file formats.
  4449. </p>
  4450. <dl compact="compact">
  4451. <dt><code>OUTPUT_FORMAT(<var>bfdname</var>)</code></dt>
  4452. <dt><code>OUTPUT_FORMAT(<var>default</var>, <var>big</var>, <var>little</var>)</code></dt>
  4453. <dd><span id="index-OUTPUT_005fFORMAT_0028bfdname_0029"></span>
  4454. <span id="index-output-file-format-in-linker-script"></span>
  4455. <p>The <code>OUTPUT_FORMAT</code> command names the BFD format to use for the
  4456. output file (see <a href="#BFD">BFD</a>). Using <code>OUTPUT_FORMAT(<var>bfdname</var>)</code> is
  4457. exactly like using &lsquo;<samp>--oformat <var>bfdname</var></samp>&rsquo; on the command line
  4458. (see <a href="#Options">Command-line Options</a>). If both are used, the command
  4459. line option takes precedence.
  4460. </p>
  4461. <p>You can use <code>OUTPUT_FORMAT</code> with three arguments to use different
  4462. formats based on the &lsquo;<samp>-EB</samp>&rsquo; and &lsquo;<samp>-EL</samp>&rsquo; command-line options.
  4463. This permits the linker script to set the output format based on the
  4464. desired endianness.
  4465. </p>
  4466. <p>If neither &lsquo;<samp>-EB</samp>&rsquo; nor &lsquo;<samp>-EL</samp>&rsquo; are used, then the output format
  4467. will be the first argument, <var>default</var>. If &lsquo;<samp>-EB</samp>&rsquo; is used, the
  4468. output format will be the second argument, <var>big</var>. If &lsquo;<samp>-EL</samp>&rsquo; is
  4469. used, the output format will be the third argument, <var>little</var>.
  4470. </p>
  4471. <p>For example, the default linker script for the MIPS ELF target uses this
  4472. command:
  4473. </p><div class="example">
  4474. <pre class="example">OUTPUT_FORMAT(elf32-bigmips, elf32-bigmips, elf32-littlemips)
  4475. </pre></div>
  4476. <p>This says that the default format for the output file is
  4477. &lsquo;<samp>elf32-bigmips</samp>&rsquo;, but if the user uses the &lsquo;<samp>-EL</samp>&rsquo; command-line
  4478. option, the output file will be created in the &lsquo;<samp>elf32-littlemips</samp>&rsquo;
  4479. format.
  4480. </p>
  4481. </dd>
  4482. <dt><code>TARGET(<var>bfdname</var>)</code></dt>
  4483. <dd><span id="index-TARGET_0028bfdname_0029"></span>
  4484. <span id="index-input-file-format-in-linker-script"></span>
  4485. <p>The <code>TARGET</code> command names the BFD format to use when reading input
  4486. files. It affects subsequent <code>INPUT</code> and <code>GROUP</code> commands.
  4487. This command is like using &lsquo;<samp>-b <var>bfdname</var></samp>&rsquo; on the command line
  4488. (see <a href="#Options">Command-line Options</a>). If the <code>TARGET</code> command
  4489. is used but <code>OUTPUT_FORMAT</code> is not, then the last <code>TARGET</code>
  4490. command is also used to set the format for the output file. See <a href="#BFD">BFD</a>.
  4491. </p></dd>
  4492. </dl>
  4493. <hr>
  4494. <span id="REGION_005fALIAS"></span><div class="header">
  4495. <p>
  4496. Next: <a href="#Miscellaneous-Commands" accesskey="n" rel="next">Miscellaneous Commands</a>, Previous: <a href="#Format-Commands" accesskey="p" rel="prev">Format Commands</a>, Up: <a href="#Simple-Commands" accesskey="u" rel="up">Simple Commands</a> &nbsp; [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#LD-Index" title="Index" rel="index">Index</a>]</p>
  4497. </div>
  4498. <span id="Assign-alias-names-to-memory-regions"></span><h4 class="subsection">3.4.4 Assign alias names to memory regions</h4>
  4499. <span id="index-REGION_005fALIAS_0028alias_002c-region_0029"></span>
  4500. <span id="index-region-alias"></span>
  4501. <span id="index-region-names"></span>
  4502. <p>Alias names can be added to existing memory regions created with the
  4503. <a href="#MEMORY">MEMORY</a> command. Each name corresponds to at most one memory region.
  4504. </p>
  4505. <div class="example">
  4506. <pre class="example">REGION_ALIAS(<var>alias</var>, <var>region</var>)
  4507. </pre></div>
  4508. <p>The <code>REGION_ALIAS</code> function creates an alias name <var>alias</var> for the
  4509. memory region <var>region</var>. This allows a flexible mapping of output sections
  4510. to memory regions. An example follows.
  4511. </p>
  4512. <p>Suppose we have an application for embedded systems which come with various
  4513. memory storage devices. All have a general purpose, volatile memory <code>RAM</code>
  4514. that allows code execution or data storage. Some may have a read-only,
  4515. non-volatile memory <code>ROM</code> that allows code execution and read-only data
  4516. access. The last variant is a read-only, non-volatile memory <code>ROM2</code> with
  4517. read-only data access and no code execution capability. We have four output
  4518. sections:
  4519. </p>
  4520. <ul>
  4521. <li> <code>.text</code> program code;
  4522. </li><li> <code>.rodata</code> read-only data;
  4523. </li><li> <code>.data</code> read-write initialized data;
  4524. </li><li> <code>.bss</code> read-write zero initialized data.
  4525. </li></ul>
  4526. <p>The goal is to provide a linker command file that contains a system independent
  4527. part defining the output sections and a system dependent part mapping the
  4528. output sections to the memory regions available on the system. Our embedded
  4529. systems come with three different memory setups <code>A</code>, <code>B</code> and
  4530. <code>C</code>:
  4531. </p><table>
  4532. <tr><td width="25%">Section</td><td width="25%">Variant A</td><td width="25%">Variant B</td><td width="25%">Variant C</td></tr>
  4533. <tr><td width="25%">.text</td><td width="25%">RAM</td><td width="25%">ROM</td><td width="25%">ROM</td></tr>
  4534. <tr><td width="25%">.rodata</td><td width="25%">RAM</td><td width="25%">ROM</td><td width="25%">ROM2</td></tr>
  4535. <tr><td width="25%">.data</td><td width="25%">RAM</td><td width="25%">RAM/ROM</td><td width="25%">RAM/ROM2</td></tr>
  4536. <tr><td width="25%">.bss</td><td width="25%">RAM</td><td width="25%">RAM</td><td width="25%">RAM</td></tr>
  4537. </table>
  4538. <p>The notation <code>RAM/ROM</code> or <code>RAM/ROM2</code> means that this section is
  4539. loaded into region <code>ROM</code> or <code>ROM2</code> respectively. Please note that
  4540. the load address of the <code>.data</code> section starts in all three variants at
  4541. the end of the <code>.rodata</code> section.
  4542. </p>
  4543. <p>The base linker script that deals with the output sections follows. It
  4544. includes the system dependent <code>linkcmds.memory</code> file that describes the
  4545. memory layout:
  4546. </p><div class="example">
  4547. <pre class="example">INCLUDE linkcmds.memory
  4548. SECTIONS
  4549. {
  4550. .text :
  4551. {
  4552. *(.text)
  4553. } &gt; REGION_TEXT
  4554. .rodata :
  4555. {
  4556. *(.rodata)
  4557. rodata_end = .;
  4558. } &gt; REGION_RODATA
  4559. .data : AT (rodata_end)
  4560. {
  4561. data_start = .;
  4562. *(.data)
  4563. } &gt; REGION_DATA
  4564. data_size = SIZEOF(.data);
  4565. data_load_start = LOADADDR(.data);
  4566. .bss :
  4567. {
  4568. *(.bss)
  4569. } &gt; REGION_BSS
  4570. }
  4571. </pre></div>
  4572. <p>Now we need three different <code>linkcmds.memory</code> files to define memory
  4573. regions and alias names. The content of <code>linkcmds.memory</code> for the three
  4574. variants <code>A</code>, <code>B</code> and <code>C</code>:
  4575. </p><dl compact="compact">
  4576. <dt><code>A</code></dt>
  4577. <dd><p>Here everything goes into the <code>RAM</code>.
  4578. </p><div class="example">
  4579. <pre class="example">MEMORY
  4580. {
  4581. RAM : ORIGIN = 0, LENGTH = 4M
  4582. }
  4583. REGION_ALIAS(&quot;REGION_TEXT&quot;, RAM);
  4584. REGION_ALIAS(&quot;REGION_RODATA&quot;, RAM);
  4585. REGION_ALIAS(&quot;REGION_DATA&quot;, RAM);
  4586. REGION_ALIAS(&quot;REGION_BSS&quot;, RAM);
  4587. </pre></div>
  4588. </dd>
  4589. <dt><code>B</code></dt>
  4590. <dd><p>Program code and read-only data go into the <code>ROM</code>. Read-write data goes
  4591. into the <code>RAM</code>. An image of the initialized data is loaded into the
  4592. <code>ROM</code> and will be copied during system start into the <code>RAM</code>.
  4593. </p><div class="example">
  4594. <pre class="example">MEMORY
  4595. {
  4596. ROM : ORIGIN = 0, LENGTH = 3M
  4597. RAM : ORIGIN = 0x10000000, LENGTH = 1M
  4598. }
  4599. REGION_ALIAS(&quot;REGION_TEXT&quot;, ROM);
  4600. REGION_ALIAS(&quot;REGION_RODATA&quot;, ROM);
  4601. REGION_ALIAS(&quot;REGION_DATA&quot;, RAM);
  4602. REGION_ALIAS(&quot;REGION_BSS&quot;, RAM);
  4603. </pre></div>
  4604. </dd>
  4605. <dt><code>C</code></dt>
  4606. <dd><p>Program code goes into the <code>ROM</code>. Read-only data goes into the
  4607. <code>ROM2</code>. Read-write data goes into the <code>RAM</code>. An image of the
  4608. initialized data is loaded into the <code>ROM2</code> and will be copied during
  4609. system start into the <code>RAM</code>.
  4610. </p><div class="example">
  4611. <pre class="example">MEMORY
  4612. {
  4613. ROM : ORIGIN = 0, LENGTH = 2M
  4614. ROM2 : ORIGIN = 0x10000000, LENGTH = 1M
  4615. RAM : ORIGIN = 0x20000000, LENGTH = 1M
  4616. }
  4617. REGION_ALIAS(&quot;REGION_TEXT&quot;, ROM);
  4618. REGION_ALIAS(&quot;REGION_RODATA&quot;, ROM2);
  4619. REGION_ALIAS(&quot;REGION_DATA&quot;, RAM);
  4620. REGION_ALIAS(&quot;REGION_BSS&quot;, RAM);
  4621. </pre></div>
  4622. </dd>
  4623. </dl>
  4624. <p>It is possible to write a common system initialization routine to copy the
  4625. <code>.data</code> section from <code>ROM</code> or <code>ROM2</code> into the <code>RAM</code> if
  4626. necessary:
  4627. </p><div class="example">
  4628. <pre class="example">#include &lt;string.h&gt;
  4629. extern char data_start [];
  4630. extern char data_size [];
  4631. extern char data_load_start [];
  4632. void copy_data(void)
  4633. {
  4634. if (data_start != data_load_start)
  4635. {
  4636. memcpy(data_start, data_load_start, (size_t) data_size);
  4637. }
  4638. }
  4639. </pre></div>
  4640. <hr>
  4641. <span id="Miscellaneous-Commands"></span><div class="header">
  4642. <p>
  4643. Previous: <a href="#REGION_005fALIAS" accesskey="p" rel="prev">REGION_ALIAS</a>, Up: <a href="#Simple-Commands" accesskey="u" rel="up">Simple Commands</a> &nbsp; [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#LD-Index" title="Index" rel="index">Index</a>]</p>
  4644. </div>
  4645. <span id="Other-Linker-Script-Commands"></span><h4 class="subsection">3.4.5 Other Linker Script Commands</h4>
  4646. <p>There are a few other linker scripts commands.
  4647. </p>
  4648. <dl compact="compact">
  4649. <dt><code>ASSERT(<var>exp</var>, <var>message</var>)</code></dt>
  4650. <dd><span id="index-ASSERT"></span>
  4651. <span id="index-assertion-in-linker-script"></span>
  4652. <p>Ensure that <var>exp</var> is non-zero. If it is zero, then exit the linker
  4653. with an error code, and print <var>message</var>.
  4654. </p>
  4655. <p>Note that assertions are checked before the final stages of linking
  4656. take place. This means that expressions involving symbols PROVIDEd
  4657. inside section definitions will fail if the user has not set values
  4658. for those symbols. The only exception to this rule is PROVIDEd
  4659. symbols that just reference dot. Thus an assertion like this:
  4660. </p>
  4661. <div class="example">
  4662. <pre class="example"> .stack :
  4663. {
  4664. PROVIDE (__stack = .);
  4665. PROVIDE (__stack_size = 0x100);
  4666. ASSERT ((__stack &gt; (_end + __stack_size)), &quot;Error: No room left for the stack&quot;);
  4667. }
  4668. </pre></div>
  4669. <p>will fail if <code>__stack_size</code> is not defined elsewhere. Symbols
  4670. PROVIDEd outside of section definitions are evaluated earlier, so they
  4671. can be used inside ASSERTions. Thus:
  4672. </p>
  4673. <div class="example">
  4674. <pre class="example"> PROVIDE (__stack_size = 0x100);
  4675. .stack :
  4676. {
  4677. PROVIDE (__stack = .);
  4678. ASSERT ((__stack &gt; (_end + __stack_size)), &quot;Error: No room left for the stack&quot;);
  4679. }
  4680. </pre></div>
  4681. <p>will work.
  4682. </p>
  4683. </dd>
  4684. <dt><code>EXTERN(<var>symbol</var> <var>symbol</var> &hellip;)</code></dt>
  4685. <dd><span id="index-EXTERN"></span>
  4686. <span id="index-undefined-symbol-in-linker-script"></span>
  4687. <p>Force <var>symbol</var> to be entered in the output file as an undefined
  4688. symbol. Doing this may, for example, trigger linking of additional
  4689. modules from standard libraries. You may list several <var>symbol</var>s for
  4690. each <code>EXTERN</code>, and you may use <code>EXTERN</code> multiple times. This
  4691. command has the same effect as the &lsquo;<samp>-u</samp>&rsquo; command-line option.
  4692. </p>
  4693. </dd>
  4694. <dt><code>FORCE_COMMON_ALLOCATION</code></dt>
  4695. <dd><span id="index-FORCE_005fCOMMON_005fALLOCATION"></span>
  4696. <span id="index-common-allocation-in-linker-script"></span>
  4697. <p>This command has the same effect as the &lsquo;<samp>-d</samp>&rsquo; command-line option:
  4698. to make <code>ld</code> assign space to common symbols even if a relocatable
  4699. output file is specified (&lsquo;<samp>-r</samp>&rsquo;).
  4700. </p>
  4701. </dd>
  4702. <dt><code>INHIBIT_COMMON_ALLOCATION</code></dt>
  4703. <dd><span id="index-INHIBIT_005fCOMMON_005fALLOCATION"></span>
  4704. <span id="index-common-allocation-in-linker-script-1"></span>
  4705. <p>This command has the same effect as the &lsquo;<samp>--no-define-common</samp>&rsquo;
  4706. command-line option: to make <code>ld</code> omit the assignment of addresses
  4707. to common symbols even for a non-relocatable output file.
  4708. </p>
  4709. </dd>
  4710. <dt><code>FORCE_GROUP_ALLOCATION</code></dt>
  4711. <dd><span id="index-FORCE_005fGROUP_005fALLOCATION"></span>
  4712. <span id="index-group-allocation-in-linker-script-1"></span>
  4713. <span id="index-section-groups-1"></span>
  4714. <span id="index-COMDAT-1"></span>
  4715. <p>This command has the same effect as the
  4716. &lsquo;<samp>--force-group-allocation</samp>&rsquo; command-line option: to make
  4717. <code>ld</code> place section group members like normal input sections,
  4718. and to delete the section groups even if a relocatable output file is
  4719. specified (&lsquo;<samp>-r</samp>&rsquo;).
  4720. </p>
  4721. </dd>
  4722. <dt><code>INSERT [ AFTER | BEFORE ] <var>output_section</var></code></dt>
  4723. <dd><span id="index-INSERT"></span>
  4724. <span id="index-insert-user-script-into-default-script"></span>
  4725. <p>This command is typically used in a script specified by &lsquo;<samp>-T</samp>&rsquo; to
  4726. augment the default <code>SECTIONS</code> with, for example, overlays. It
  4727. inserts all prior linker script statements after (or before)
  4728. <var>output_section</var>, and also causes &lsquo;<samp>-T</samp>&rsquo; to not override the
  4729. default linker script. The exact insertion point is as for orphan
  4730. sections. See <a href="#Location-Counter">Location Counter</a>. The insertion happens after the
  4731. linker has mapped input sections to output sections. Prior to the
  4732. insertion, since &lsquo;<samp>-T</samp>&rsquo; scripts are parsed before the default
  4733. linker script, statements in the &lsquo;<samp>-T</samp>&rsquo; script occur before the
  4734. default linker script statements in the internal linker representation
  4735. of the script. In particular, input section assignments will be made
  4736. to &lsquo;<samp>-T</samp>&rsquo; output sections before those in the default script. Here
  4737. is an example of how a &lsquo;<samp>-T</samp>&rsquo; script using <code>INSERT</code> might look:
  4738. </p>
  4739. <div class="example">
  4740. <pre class="example">SECTIONS
  4741. {
  4742. OVERLAY :
  4743. {
  4744. .ov1 { ov1*(.text) }
  4745. .ov2 { ov2*(.text) }
  4746. }
  4747. }
  4748. INSERT AFTER .text;
  4749. </pre></div>
  4750. <p>Note that when &lsquo;<samp>-T</samp>&rsquo; is used twice, once to override the default
  4751. script and once to augment that script using <code>INSERT</code> the order
  4752. of parsing and section assignments apply as for the default script.
  4753. The script with <code>INSERT</code> should be specified <em>first</em> on the
  4754. command line.
  4755. </p>
  4756. </dd>
  4757. <dt><code>NOCROSSREFS(<var>section</var> <var>section</var> &hellip;)</code></dt>
  4758. <dd><span id="index-NOCROSSREFS_0028sections_0029"></span>
  4759. <span id="index-cross-references"></span>
  4760. <p>This command may be used to tell <code>ld</code> to issue an error about any
  4761. references among certain output sections.
  4762. </p>
  4763. <p>In certain types of programs, particularly on embedded systems when
  4764. using overlays, when one section is loaded into memory, another section
  4765. will not be. Any direct references between the two sections would be
  4766. errors. For example, it would be an error if code in one section called
  4767. a function defined in the other section.
  4768. </p>
  4769. <p>The <code>NOCROSSREFS</code> command takes a list of output section names. If
  4770. <code>ld</code> detects any cross references between the sections, it reports
  4771. an error and returns a non-zero exit status. Note that the
  4772. <code>NOCROSSREFS</code> command uses output section names, not input section
  4773. names.
  4774. </p>
  4775. </dd>
  4776. <dt><code>NOCROSSREFS_TO(<var>tosection</var> <var>fromsection</var> &hellip;)</code></dt>
  4777. <dd><span id="index-NOCROSSREFS_005fTO_0028tosection-fromsections_0029"></span>
  4778. <span id="index-cross-references-1"></span>
  4779. <p>This command may be used to tell <code>ld</code> to issue an error about any
  4780. references to one section from a list of other sections.
  4781. </p>
  4782. <p>The <code>NOCROSSREFS</code> command is useful when ensuring that two or more
  4783. output sections are entirely independent but there are situations where
  4784. a one-way dependency is needed. For example, in a multi-core application
  4785. there may be shared code that can be called from each core but for safety
  4786. must never call back.
  4787. </p>
  4788. <p>The <code>NOCROSSREFS_TO</code> command takes a list of output section names.
  4789. The first section can not be referenced from any of the other sections.
  4790. If <code>ld</code> detects any references to the first section from any of
  4791. the other sections, it reports an error and returns a non-zero exit
  4792. status. Note that the <code>NOCROSSREFS_TO</code> command uses output section
  4793. names, not input section names.
  4794. </p>
  4795. </dd>
  4796. <dt><code>OUTPUT_ARCH(<var>bfdarch</var>)</code></dt>
  4797. <dd><span id="index-OUTPUT_005fARCH_0028bfdarch_0029"></span>
  4798. <span id="index-machine-architecture"></span>
  4799. <span id="index-architecture"></span>
  4800. <p>Specify a particular output machine architecture. The argument is one
  4801. of the names used by the BFD library (see <a href="#BFD">BFD</a>). You can see the
  4802. architecture of an object file by using the <code>objdump</code> program with
  4803. the &lsquo;<samp>-f</samp>&rsquo; option.
  4804. </p>
  4805. </dd>
  4806. <dt><code>LD_FEATURE(<var>string</var>)</code></dt>
  4807. <dd><span id="index-LD_005fFEATURE_0028string_0029"></span>
  4808. <p>This command may be used to modify <code>ld</code> behavior. If
  4809. <var>string</var> is <code>&quot;SANE_EXPR&quot;</code> then absolute symbols and numbers
  4810. in a script are simply treated as numbers everywhere.
  4811. See <a href="#Expression-Section">Expression Section</a>.
  4812. </p></dd>
  4813. </dl>
  4814. <hr>
  4815. <span id="Assignments"></span><div class="header">
  4816. <p>
  4817. Next: <a href="#SECTIONS" accesskey="n" rel="next">SECTIONS</a>, Previous: <a href="#Simple-Commands" accesskey="p" rel="prev">Simple Commands</a>, Up: <a href="#Scripts" accesskey="u" rel="up">Scripts</a> &nbsp; [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#LD-Index" title="Index" rel="index">Index</a>]</p>
  4818. </div>
  4819. <span id="Assigning-Values-to-Symbols"></span><h3 class="section">3.5 Assigning Values to Symbols</h3>
  4820. <span id="index-assignment-in-scripts"></span>
  4821. <span id="index-symbol-definition_002c-scripts"></span>
  4822. <span id="index-variables_002c-defining"></span>
  4823. <p>You may assign a value to a symbol in a linker script. This will define
  4824. the symbol and place it into the symbol table with a global scope.
  4825. </p>
  4826. <table class="menu" border="0" cellspacing="0">
  4827. <tr><td align="left" valign="top">&bull; <a href="#Simple-Assignments" accesskey="1">Simple Assignments</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">Simple Assignments
  4828. </td></tr>
  4829. <tr><td align="left" valign="top">&bull; <a href="#HIDDEN" accesskey="2">HIDDEN</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">HIDDEN
  4830. </td></tr>
  4831. <tr><td align="left" valign="top">&bull; <a href="#PROVIDE" accesskey="3">PROVIDE</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">PROVIDE
  4832. </td></tr>
  4833. <tr><td align="left" valign="top">&bull; <a href="#PROVIDE_005fHIDDEN" accesskey="4">PROVIDE_HIDDEN</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">PROVIDE_HIDDEN
  4834. </td></tr>
  4835. <tr><td align="left" valign="top">&bull; <a href="#Source-Code-Reference" accesskey="5">Source Code Reference</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">How to use a linker script defined symbol in source code
  4836. </td></tr>
  4837. </table>
  4838. <hr>
  4839. <span id="Simple-Assignments"></span><div class="header">
  4840. <p>
  4841. Next: <a href="#HIDDEN" accesskey="n" rel="next">HIDDEN</a>, Up: <a href="#Assignments" accesskey="u" rel="up">Assignments</a> &nbsp; [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#LD-Index" title="Index" rel="index">Index</a>]</p>
  4842. </div>
  4843. <span id="Simple-Assignments-1"></span><h4 class="subsection">3.5.1 Simple Assignments</h4>
  4844. <p>You may assign to a symbol using any of the C assignment operators:
  4845. </p>
  4846. <dl compact="compact">
  4847. <dt><code><var>symbol</var> = <var>expression</var> ;</code></dt>
  4848. <dt><code><var>symbol</var> += <var>expression</var> ;</code></dt>
  4849. <dt><code><var>symbol</var> -= <var>expression</var> ;</code></dt>
  4850. <dt><code><var>symbol</var> *= <var>expression</var> ;</code></dt>
  4851. <dt><code><var>symbol</var> /= <var>expression</var> ;</code></dt>
  4852. <dt><code><var>symbol</var> &lt;&lt;= <var>expression</var> ;</code></dt>
  4853. <dt><code><var>symbol</var> &gt;&gt;= <var>expression</var> ;</code></dt>
  4854. <dt><code><var>symbol</var> &amp;= <var>expression</var> ;</code></dt>
  4855. <dt><code><var>symbol</var> |= <var>expression</var> ;</code></dt>
  4856. </dl>
  4857. <p>The first case will define <var>symbol</var> to the value of
  4858. <var>expression</var>. In the other cases, <var>symbol</var> must already be
  4859. defined, and the value will be adjusted accordingly.
  4860. </p>
  4861. <p>The special symbol name &lsquo;<samp>.</samp>&rsquo; indicates the location counter. You
  4862. may only use this within a <code>SECTIONS</code> command. See <a href="#Location-Counter">Location Counter</a>.
  4863. </p>
  4864. <p>The semicolon after <var>expression</var> is required.
  4865. </p>
  4866. <p>Expressions are defined below; see <a href="#Expressions">Expressions</a>.
  4867. </p>
  4868. <p>You may write symbol assignments as commands in their own right, or as
  4869. statements within a <code>SECTIONS</code> command, or as part of an output
  4870. section description in a <code>SECTIONS</code> command.
  4871. </p>
  4872. <p>The section of the symbol will be set from the section of the
  4873. expression; for more information, see <a href="#Expression-Section">Expression Section</a>.
  4874. </p>
  4875. <p>Here is an example showing the three different places that symbol
  4876. assignments may be used:
  4877. </p>
  4878. <div class="example">
  4879. <pre class="example">floating_point = 0;
  4880. SECTIONS
  4881. {
  4882. .text :
  4883. {
  4884. *(.text)
  4885. _etext = .;
  4886. }
  4887. _bdata = (. + 3) &amp; ~ 3;
  4888. .data : { *(.data) }
  4889. }
  4890. </pre></div>
  4891. <p>In this example, the symbol &lsquo;<samp>floating_point</samp>&rsquo; will be defined as
  4892. zero. The symbol &lsquo;<samp>_etext</samp>&rsquo; will be defined as the address following
  4893. the last &lsquo;<samp>.text</samp>&rsquo; input section. The symbol &lsquo;<samp>_bdata</samp>&rsquo; will be
  4894. defined as the address following the &lsquo;<samp>.text</samp>&rsquo; output section aligned
  4895. upward to a 4 byte boundary.
  4896. </p>
  4897. <hr>
  4898. <span id="HIDDEN"></span><div class="header">
  4899. <p>
  4900. Next: <a href="#PROVIDE" accesskey="n" rel="next">PROVIDE</a>, Previous: <a href="#Simple-Assignments" accesskey="p" rel="prev">Simple Assignments</a>, Up: <a href="#Assignments" accesskey="u" rel="up">Assignments</a> &nbsp; [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#LD-Index" title="Index" rel="index">Index</a>]</p>
  4901. </div>
  4902. <span id="HIDDEN-1"></span><h4 class="subsection">3.5.2 HIDDEN</h4>
  4903. <span id="index-HIDDEN"></span>
  4904. <p>For ELF targeted ports, define a symbol that will be hidden and won&rsquo;t be
  4905. exported. The syntax is <code>HIDDEN(<var>symbol</var> = <var>expression</var>)</code>.
  4906. </p>
  4907. <p>Here is the example from <a href="#Simple-Assignments">Simple Assignments</a>, rewritten to use
  4908. <code>HIDDEN</code>:
  4909. </p>
  4910. <div class="example">
  4911. <pre class="example">HIDDEN(floating_point = 0);
  4912. SECTIONS
  4913. {
  4914. .text :
  4915. {
  4916. *(.text)
  4917. HIDDEN(_etext = .);
  4918. }
  4919. HIDDEN(_bdata = (. + 3) &amp; ~ 3);
  4920. .data : { *(.data) }
  4921. }
  4922. </pre></div>
  4923. <p>In this case none of the three symbols will be visible outside this module.
  4924. </p>
  4925. <hr>
  4926. <span id="PROVIDE"></span><div class="header">
  4927. <p>
  4928. Next: <a href="#PROVIDE_005fHIDDEN" accesskey="n" rel="next">PROVIDE_HIDDEN</a>, Previous: <a href="#HIDDEN" accesskey="p" rel="prev">HIDDEN</a>, Up: <a href="#Assignments" accesskey="u" rel="up">Assignments</a> &nbsp; [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#LD-Index" title="Index" rel="index">Index</a>]</p>
  4929. </div>
  4930. <span id="PROVIDE-1"></span><h4 class="subsection">3.5.3 PROVIDE</h4>
  4931. <span id="index-PROVIDE"></span>
  4932. <p>In some cases, it is desirable for a linker script to define a symbol
  4933. only if it is referenced and is not defined by any object included in
  4934. the link. For example, traditional linkers defined the symbol
  4935. &lsquo;<samp>etext</samp>&rsquo;. However, ANSI C requires that the user be able to use
  4936. &lsquo;<samp>etext</samp>&rsquo; as a function name without encountering an error. The
  4937. <code>PROVIDE</code> keyword may be used to define a symbol, such as
  4938. &lsquo;<samp>etext</samp>&rsquo;, only if it is referenced but not defined. The syntax is
  4939. <code>PROVIDE(<var>symbol</var> = <var>expression</var>)</code>.
  4940. </p>
  4941. <p>Here is an example of using <code>PROVIDE</code> to define &lsquo;<samp>etext</samp>&rsquo;:
  4942. </p><div class="example">
  4943. <pre class="example">SECTIONS
  4944. {
  4945. .text :
  4946. {
  4947. *(.text)
  4948. _etext = .;
  4949. PROVIDE(etext = .);
  4950. }
  4951. }
  4952. </pre></div>
  4953. <p>In this example, if the program defines &lsquo;<samp>_etext</samp>&rsquo; (with a leading
  4954. underscore), the linker will give a multiple definition diagnostic. If,
  4955. on the other hand, the program defines &lsquo;<samp>etext</samp>&rsquo; (with no leading
  4956. underscore), the linker will silently use the definition in the program.
  4957. If the program references &lsquo;<samp>etext</samp>&rsquo; but does not define it, the
  4958. linker will use the definition in the linker script.
  4959. </p>
  4960. <p>Note - the <code>PROVIDE</code> directive considers a common symbol to be
  4961. defined, even though such a symbol could be combined with the symbol
  4962. that the <code>PROVIDE</code> would create. This is particularly important
  4963. when considering constructor and destructor list symbols such as
  4964. &lsquo;<samp>__CTOR_LIST__</samp>&rsquo; as these are often defined as common symbols.
  4965. </p>
  4966. <hr>
  4967. <span id="PROVIDE_005fHIDDEN"></span><div class="header">
  4968. <p>
  4969. Next: <a href="#Source-Code-Reference" accesskey="n" rel="next">Source Code Reference</a>, Previous: <a href="#PROVIDE" accesskey="p" rel="prev">PROVIDE</a>, Up: <a href="#Assignments" accesskey="u" rel="up">Assignments</a> &nbsp; [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#LD-Index" title="Index" rel="index">Index</a>]</p>
  4970. </div>
  4971. <span id="PROVIDE_005fHIDDEN-1"></span><h4 class="subsection">3.5.4 PROVIDE_HIDDEN</h4>
  4972. <span id="index-PROVIDE_005fHIDDEN"></span>
  4973. <p>Similar to <code>PROVIDE</code>. For ELF targeted ports, the symbol will be
  4974. hidden and won&rsquo;t be exported.
  4975. </p>
  4976. <hr>
  4977. <span id="Source-Code-Reference"></span><div class="header">
  4978. <p>
  4979. Previous: <a href="#PROVIDE_005fHIDDEN" accesskey="p" rel="prev">PROVIDE_HIDDEN</a>, Up: <a href="#Assignments" accesskey="u" rel="up">Assignments</a> &nbsp; [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#LD-Index" title="Index" rel="index">Index</a>]</p>
  4980. </div>
  4981. <span id="Source-Code-Reference-1"></span><h4 class="subsection">3.5.5 Source Code Reference</h4>
  4982. <p>Accessing a linker script defined variable from source code is not
  4983. intuitive. In particular a linker script symbol is not equivalent to
  4984. a variable declaration in a high level language, it is instead a
  4985. symbol that does not have a value.
  4986. </p>
  4987. <p>Before going further, it is important to note that compilers often
  4988. transform names in the source code into different names when they are
  4989. stored in the symbol table. For example, Fortran compilers commonly
  4990. prepend or append an underscore, and C++ performs extensive &lsquo;<samp>name
  4991. mangling</samp>&rsquo;. Therefore there might be a discrepancy between the name
  4992. of a variable as it is used in source code and the name of the same
  4993. variable as it is defined in a linker script. For example in C a
  4994. linker script variable might be referred to as:
  4995. </p>
  4996. <div class="example">
  4997. <pre class="example"> extern int foo;
  4998. </pre></div>
  4999. <p>But in the linker script it might be defined as:
  5000. </p>
  5001. <div class="example">
  5002. <pre class="example"> _foo = 1000;
  5003. </pre></div>
  5004. <p>In the remaining examples however it is assumed that no name
  5005. transformation has taken place.
  5006. </p>
  5007. <p>When a symbol is declared in a high level language such as C, two
  5008. things happen. The first is that the compiler reserves enough space
  5009. in the program&rsquo;s memory to hold the <em>value</em> of the symbol. The
  5010. second is that the compiler creates an entry in the program&rsquo;s symbol
  5011. table which holds the symbol&rsquo;s <em>address</em>. ie the symbol table
  5012. contains the address of the block of memory holding the symbol&rsquo;s
  5013. value. So for example the following C declaration, at file scope:
  5014. </p>
  5015. <div class="example">
  5016. <pre class="example"> int foo = 1000;
  5017. </pre></div>
  5018. <p>creates an entry called &lsquo;<samp>foo</samp>&rsquo; in the symbol table. This entry
  5019. holds the address of an &lsquo;<samp>int</samp>&rsquo; sized block of memory where the
  5020. number 1000 is initially stored.
  5021. </p>
  5022. <p>When a program references a symbol the compiler generates code that
  5023. first accesses the symbol table to find the address of the symbol&rsquo;s
  5024. memory block and then code to read the value from that memory block.
  5025. So:
  5026. </p>
  5027. <div class="example">
  5028. <pre class="example"> foo = 1;
  5029. </pre></div>
  5030. <p>looks up the symbol &lsquo;<samp>foo</samp>&rsquo; in the symbol table, gets the address
  5031. associated with this symbol and then writes the value 1 into that
  5032. address. Whereas:
  5033. </p>
  5034. <div class="example">
  5035. <pre class="example"> int * a = &amp; foo;
  5036. </pre></div>
  5037. <p>looks up the symbol &lsquo;<samp>foo</samp>&rsquo; in the symbol table, gets its address
  5038. and then copies this address into the block of memory associated with
  5039. the variable &lsquo;<samp>a</samp>&rsquo;.
  5040. </p>
  5041. <p>Linker scripts symbol declarations, by contrast, create an entry in
  5042. the symbol table but do not assign any memory to them. Thus they are
  5043. an address without a value. So for example the linker script definition:
  5044. </p>
  5045. <div class="example">
  5046. <pre class="example"> foo = 1000;
  5047. </pre></div>
  5048. <p>creates an entry in the symbol table called &lsquo;<samp>foo</samp>&rsquo; which holds
  5049. the address of memory location 1000, but nothing special is stored at
  5050. address 1000. This means that you cannot access the <em>value</em> of a
  5051. linker script defined symbol - it has no value - all you can do is
  5052. access the <em>address</em> of a linker script defined symbol.
  5053. </p>
  5054. <p>Hence when you are using a linker script defined symbol in source code
  5055. you should always take the address of the symbol, and never attempt to
  5056. use its value. For example suppose you want to copy the contents of a
  5057. section of memory called .ROM into a section called .FLASH and the
  5058. linker script contains these declarations:
  5059. </p>
  5060. <div class="example">
  5061. <pre class="example"> start_of_ROM = .ROM;
  5062. end_of_ROM = .ROM + sizeof (.ROM);
  5063. start_of_FLASH = .FLASH;
  5064. </pre></div>
  5065. <p>Then the C source code to perform the copy would be:
  5066. </p>
  5067. <div class="example">
  5068. <pre class="example"> extern char start_of_ROM, end_of_ROM, start_of_FLASH;
  5069. memcpy (&amp; start_of_FLASH, &amp; start_of_ROM, &amp; end_of_ROM - &amp; start_of_ROM);
  5070. </pre></div>
  5071. <p>Note the use of the &lsquo;<samp>&amp;</samp>&rsquo; operators. These are correct.
  5072. Alternatively the symbols can be treated as the names of vectors or
  5073. arrays and then the code will again work as expected:
  5074. </p>
  5075. <div class="example">
  5076. <pre class="example"> extern char start_of_ROM[], end_of_ROM[], start_of_FLASH[];
  5077. memcpy (start_of_FLASH, start_of_ROM, end_of_ROM - start_of_ROM);
  5078. </pre></div>
  5079. <p>Note how using this method does not require the use of &lsquo;<samp>&amp;</samp>&rsquo;
  5080. operators.
  5081. </p>
  5082. <hr>
  5083. <span id="SECTIONS"></span><div class="header">
  5084. <p>
  5085. Next: <a href="#MEMORY" accesskey="n" rel="next">MEMORY</a>, Previous: <a href="#Assignments" accesskey="p" rel="prev">Assignments</a>, Up: <a href="#Scripts" accesskey="u" rel="up">Scripts</a> &nbsp; [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#LD-Index" title="Index" rel="index">Index</a>]</p>
  5086. </div>
  5087. <span id="SECTIONS-Command"></span><h3 class="section">3.6 SECTIONS Command</h3>
  5088. <span id="index-SECTIONS"></span>
  5089. <p>The <code>SECTIONS</code> command tells the linker how to map input sections
  5090. into output sections, and how to place the output sections in memory.
  5091. </p>
  5092. <p>The format of the <code>SECTIONS</code> command is:
  5093. </p><div class="example">
  5094. <pre class="example">SECTIONS
  5095. {
  5096. <var>sections-command</var>
  5097. <var>sections-command</var>
  5098. &hellip;
  5099. }
  5100. </pre></div>
  5101. <p>Each <var>sections-command</var> may of be one of the following:
  5102. </p>
  5103. <ul>
  5104. <li> an <code>ENTRY</code> command (see <a href="#Entry-Point">Entry command</a>)
  5105. </li><li> a symbol assignment (see <a href="#Assignments">Assignments</a>)
  5106. </li><li> an output section description
  5107. </li><li> an overlay description
  5108. </li></ul>
  5109. <p>The <code>ENTRY</code> command and symbol assignments are permitted inside the
  5110. <code>SECTIONS</code> command for convenience in using the location counter in
  5111. those commands. This can also make the linker script easier to
  5112. understand because you can use those commands at meaningful points in
  5113. the layout of the output file.
  5114. </p>
  5115. <p>Output section descriptions and overlay descriptions are described
  5116. below.
  5117. </p>
  5118. <p>If you do not use a <code>SECTIONS</code> command in your linker script, the
  5119. linker will place each input section into an identically named output
  5120. section in the order that the sections are first encountered in the
  5121. input files. If all input sections are present in the first file, for
  5122. example, the order of sections in the output file will match the order
  5123. in the first input file. The first section will be at address zero.
  5124. </p>
  5125. <table class="menu" border="0" cellspacing="0">
  5126. <tr><td align="left" valign="top">&bull; <a href="#Output-Section-Description" accesskey="1">Output Section Description</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">Output section description
  5127. </td></tr>
  5128. <tr><td align="left" valign="top">&bull; <a href="#Output-Section-Name" accesskey="2">Output Section Name</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">Output section name
  5129. </td></tr>
  5130. <tr><td align="left" valign="top">&bull; <a href="#Output-Section-Address" accesskey="3">Output Section Address</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">Output section address
  5131. </td></tr>
  5132. <tr><td align="left" valign="top">&bull; <a href="#Input-Section" accesskey="4">Input Section</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">Input section description
  5133. </td></tr>
  5134. <tr><td align="left" valign="top">&bull; <a href="#Output-Section-Data" accesskey="5">Output Section Data</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">Output section data
  5135. </td></tr>
  5136. <tr><td align="left" valign="top">&bull; <a href="#Output-Section-Keywords" accesskey="6">Output Section Keywords</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">Output section keywords
  5137. </td></tr>
  5138. <tr><td align="left" valign="top">&bull; <a href="#Output-Section-Discarding" accesskey="7">Output Section Discarding</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">Output section discarding
  5139. </td></tr>
  5140. <tr><td align="left" valign="top">&bull; <a href="#Output-Section-Attributes" accesskey="8">Output Section Attributes</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">Output section attributes
  5141. </td></tr>
  5142. <tr><td align="left" valign="top">&bull; <a href="#Overlay-Description" accesskey="9">Overlay Description</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">Overlay description
  5143. </td></tr>
  5144. </table>
  5145. <hr>
  5146. <span id="Output-Section-Description"></span><div class="header">
  5147. <p>
  5148. Next: <a href="#Output-Section-Name" accesskey="n" rel="next">Output Section Name</a>, Up: <a href="#SECTIONS" accesskey="u" rel="up">SECTIONS</a> &nbsp; [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#LD-Index" title="Index" rel="index">Index</a>]</p>
  5149. </div>
  5150. <span id="Output-Section-Description-1"></span><h4 class="subsection">3.6.1 Output Section Description</h4>
  5151. <p>The full description of an output section looks like this:
  5152. </p><div class="example">
  5153. <pre class="example"><var>section</var> [<var>address</var>] [(<var>type</var>)] :
  5154. [AT(<var>lma</var>)]
  5155. [ALIGN(<var>section_align</var>) | ALIGN_WITH_INPUT]
  5156. [SUBALIGN(<var>subsection_align</var>)]
  5157. [<var>constraint</var>]
  5158. {
  5159. <var>output-section-command</var>
  5160. <var>output-section-command</var>
  5161. &hellip;
  5162. } [&gt;<var>region</var>] [AT&gt;<var>lma_region</var>] [:<var>phdr</var> :<var>phdr</var> &hellip;] [=<var>fillexp</var>] [,]
  5163. </pre></div>
  5164. <p>Most output sections do not use most of the optional section attributes.
  5165. </p>
  5166. <p>The whitespace around <var>section</var> is required, so that the section
  5167. name is unambiguous. The colon and the curly braces are also required.
  5168. The comma at the end may be required if a <var>fillexp</var> is used and
  5169. the next <var>sections-command</var> looks like a continuation of the expression.
  5170. The line breaks and other white space are optional.
  5171. </p>
  5172. <p>Each <var>output-section-command</var> may be one of the following:
  5173. </p>
  5174. <ul>
  5175. <li> a symbol assignment (see <a href="#Assignments">Assignments</a>)
  5176. </li><li> an input section description (see <a href="#Input-Section">Input Section</a>)
  5177. </li><li> data values to include directly (see <a href="#Output-Section-Data">Output Section Data</a>)
  5178. </li><li> a special output section keyword (see <a href="#Output-Section-Keywords">Output Section Keywords</a>)
  5179. </li></ul>
  5180. <hr>
  5181. <span id="Output-Section-Name"></span><div class="header">
  5182. <p>
  5183. Next: <a href="#Output-Section-Address" accesskey="n" rel="next">Output Section Address</a>, Previous: <a href="#Output-Section-Description" accesskey="p" rel="prev">Output Section Description</a>, Up: <a href="#SECTIONS" accesskey="u" rel="up">SECTIONS</a> &nbsp; [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#LD-Index" title="Index" rel="index">Index</a>]</p>
  5184. </div>
  5185. <span id="Output-Section-Name-1"></span><h4 class="subsection">3.6.2 Output Section Name</h4>
  5186. <span id="index-name_002c-section"></span>
  5187. <span id="index-section-name"></span>
  5188. <p>The name of the output section is <var>section</var>. <var>section</var> must
  5189. meet the constraints of your output format. In formats which only
  5190. support a limited number of sections, such as <code>a.out</code>, the name
  5191. must be one of the names supported by the format (<code>a.out</code>, for
  5192. example, allows only &lsquo;<samp>.text</samp>&rsquo;, &lsquo;<samp>.data</samp>&rsquo; or &lsquo;<samp>.bss</samp>&rsquo;). If the
  5193. output format supports any number of sections, but with numbers and not
  5194. names (as is the case for Oasys), the name should be supplied as a
  5195. quoted numeric string. A section name may consist of any sequence of
  5196. characters, but a name which contains any unusual characters such as
  5197. commas must be quoted.
  5198. </p>
  5199. <p>The output section name &lsquo;<samp>/DISCARD/</samp>&rsquo; is special; <a href="#Output-Section-Discarding">Output Section Discarding</a>.
  5200. </p>
  5201. <hr>
  5202. <span id="Output-Section-Address"></span><div class="header">
  5203. <p>
  5204. Next: <a href="#Input-Section" accesskey="n" rel="next">Input Section</a>, Previous: <a href="#Output-Section-Name" accesskey="p" rel="prev">Output Section Name</a>, Up: <a href="#SECTIONS" accesskey="u" rel="up">SECTIONS</a> &nbsp; [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#LD-Index" title="Index" rel="index">Index</a>]</p>
  5205. </div>
  5206. <span id="Output-Section-Address-1"></span><h4 class="subsection">3.6.3 Output Section Address</h4>
  5207. <span id="index-address_002c-section"></span>
  5208. <span id="index-section-address"></span>
  5209. <p>The <var>address</var> is an expression for the VMA (the virtual memory
  5210. address) of the output section. This address is optional, but if it
  5211. is provided then the output address will be set exactly as specified.
  5212. </p>
  5213. <p>If the output address is not specified then one will be chosen for the
  5214. section, based on the heuristic below. This address will be adjusted
  5215. to fit the alignment requirement of the output section. The
  5216. alignment requirement is the strictest alignment of any input section
  5217. contained within the output section.
  5218. </p>
  5219. <p>The output section address heuristic is as follows:
  5220. </p>
  5221. <ul>
  5222. <li> If an output memory <var>region</var> is set for the section then it
  5223. is added to this region and its address will be the next free address
  5224. in that region.
  5225. </li><li> If the MEMORY command has been used to create a list of memory
  5226. regions then the first region which has attributes compatible with the
  5227. section is selected to contain it. The section&rsquo;s output address will
  5228. be the next free address in that region; <a href="#MEMORY">MEMORY</a>.
  5229. </li><li> If no memory regions were specified, or none match the section then
  5230. the output address will be based on the current value of the location
  5231. counter.
  5232. </li></ul>
  5233. <p>For example:
  5234. </p>
  5235. <div class="example">
  5236. <pre class="example">.text . : { *(.text) }
  5237. </pre></div>
  5238. <p>and
  5239. </p>
  5240. <div class="example">
  5241. <pre class="example">.text : { *(.text) }
  5242. </pre></div>
  5243. <p>are subtly different. The first will set the address of the
  5244. &lsquo;<samp>.text</samp>&rsquo; output section to the current value of the location
  5245. counter. The second will set it to the current value of the location
  5246. counter aligned to the strictest alignment of any of the &lsquo;<samp>.text</samp>&rsquo;
  5247. input sections.
  5248. </p>
  5249. <p>The <var>address</var> may be an arbitrary expression; <a href="#Expressions">Expressions</a>.
  5250. For example, if you want to align the section on a 0x10 byte boundary,
  5251. so that the lowest four bits of the section address are zero, you could
  5252. do something like this:
  5253. </p><div class="example">
  5254. <pre class="example">.text ALIGN(0x10) : { *(.text) }
  5255. </pre></div>
  5256. <p>This works because <code>ALIGN</code> returns the current location counter
  5257. aligned upward to the specified value.
  5258. </p>
  5259. <p>Specifying <var>address</var> for a section will change the value of the
  5260. location counter, provided that the section is non-empty. (Empty
  5261. sections are ignored).
  5262. </p>
  5263. <hr>
  5264. <span id="Input-Section"></span><div class="header">
  5265. <p>
  5266. Next: <a href="#Output-Section-Data" accesskey="n" rel="next">Output Section Data</a>, Previous: <a href="#Output-Section-Address" accesskey="p" rel="prev">Output Section Address</a>, Up: <a href="#SECTIONS" accesskey="u" rel="up">SECTIONS</a> &nbsp; [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#LD-Index" title="Index" rel="index">Index</a>]</p>
  5267. </div>
  5268. <span id="Input-Section-Description"></span><h4 class="subsection">3.6.4 Input Section Description</h4>
  5269. <span id="index-input-sections"></span>
  5270. <span id="index-mapping-input-sections-to-output-sections"></span>
  5271. <p>The most common output section command is an input section description.
  5272. </p>
  5273. <p>The input section description is the most basic linker script operation.
  5274. You use output sections to tell the linker how to lay out your program
  5275. in memory. You use input section descriptions to tell the linker how to
  5276. map the input files into your memory layout.
  5277. </p>
  5278. <table class="menu" border="0" cellspacing="0">
  5279. <tr><td align="left" valign="top">&bull; <a href="#Input-Section-Basics" accesskey="1">Input Section Basics</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">Input section basics
  5280. </td></tr>
  5281. <tr><td align="left" valign="top">&bull; <a href="#Input-Section-Wildcards" accesskey="2">Input Section Wildcards</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">Input section wildcard patterns
  5282. </td></tr>
  5283. <tr><td align="left" valign="top">&bull; <a href="#Input-Section-Common" accesskey="3">Input Section Common</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">Input section for common symbols
  5284. </td></tr>
  5285. <tr><td align="left" valign="top">&bull; <a href="#Input-Section-Keep" accesskey="4">Input Section Keep</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">Input section and garbage collection
  5286. </td></tr>
  5287. <tr><td align="left" valign="top">&bull; <a href="#Input-Section-Example" accesskey="5">Input Section Example</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">Input section example
  5288. </td></tr>
  5289. </table>
  5290. <hr>
  5291. <span id="Input-Section-Basics"></span><div class="header">
  5292. <p>
  5293. Next: <a href="#Input-Section-Wildcards" accesskey="n" rel="next">Input Section Wildcards</a>, Up: <a href="#Input-Section" accesskey="u" rel="up">Input Section</a> &nbsp; [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#LD-Index" title="Index" rel="index">Index</a>]</p>
  5294. </div>
  5295. <span id="Input-Section-Basics-1"></span><h4 class="subsubsection">3.6.4.1 Input Section Basics</h4>
  5296. <span id="index-input-section-basics"></span>
  5297. <p>An input section description consists of a file name optionally followed
  5298. by a list of section names in parentheses.
  5299. </p>
  5300. <p>The file name and the section name may be wildcard patterns, which we
  5301. describe further below (see <a href="#Input-Section-Wildcards">Input Section Wildcards</a>).
  5302. </p>
  5303. <p>The most common input section description is to include all input
  5304. sections with a particular name in the output section. For example, to
  5305. include all input &lsquo;<samp>.text</samp>&rsquo; sections, you would write:
  5306. </p><div class="example">
  5307. <pre class="example">*(.text)
  5308. </pre></div>
  5309. <p>Here the &lsquo;<samp>*</samp>&rsquo; is a wildcard which matches any file name. To exclude a list
  5310. <span id="index-EXCLUDE_005fFILE"></span>
  5311. of files from matching the file name wildcard, EXCLUDE_FILE may be used to
  5312. match all files except the ones specified in the EXCLUDE_FILE list. For
  5313. example:
  5314. </p><div class="example">
  5315. <pre class="example">EXCLUDE_FILE (*crtend.o *otherfile.o) *(.ctors)
  5316. </pre></div>
  5317. <p>will cause all .ctors sections from all files except <samp>crtend.o</samp>
  5318. and <samp>otherfile.o</samp> to be included. The EXCLUDE_FILE can also be
  5319. placed inside the section list, for example:
  5320. </p><div class="example">
  5321. <pre class="example">*(EXCLUDE_FILE (*crtend.o *otherfile.o) .ctors)
  5322. </pre></div>
  5323. <p>The result of this is identically to the previous example. Supporting
  5324. two syntaxes for EXCLUDE_FILE is useful if the section list contains
  5325. more than one section, as described below.
  5326. </p>
  5327. <p>There are two ways to include more than one section:
  5328. </p><div class="example">
  5329. <pre class="example">*(.text .rdata)
  5330. *(.text) *(.rdata)
  5331. </pre></div>
  5332. <p>The difference between these is the order in which the &lsquo;<samp>.text</samp>&rsquo; and
  5333. &lsquo;<samp>.rdata</samp>&rsquo; input sections will appear in the output section. In the
  5334. first example, they will be intermingled, appearing in the same order as
  5335. they are found in the linker input. In the second example, all
  5336. &lsquo;<samp>.text</samp>&rsquo; input sections will appear first, followed by all
  5337. &lsquo;<samp>.rdata</samp>&rsquo; input sections.
  5338. </p>
  5339. <p>When using EXCLUDE_FILE with more than one section, if the exclusion
  5340. is within the section list then the exclusion only applies to the
  5341. immediately following section, for example:
  5342. </p><div class="example">
  5343. <pre class="example">*(EXCLUDE_FILE (*somefile.o) .text .rdata)
  5344. </pre></div>
  5345. <p>will cause all &lsquo;<samp>.text</samp>&rsquo; sections from all files except
  5346. <samp>somefile.o</samp> to be included, while all &lsquo;<samp>.rdata</samp>&rsquo; sections
  5347. from all files, including <samp>somefile.o</samp>, will be included. To
  5348. exclude the &lsquo;<samp>.rdata</samp>&rsquo; sections from <samp>somefile.o</samp> the example
  5349. could be modified to:
  5350. </p><div class="example">
  5351. <pre class="example">*(EXCLUDE_FILE (*somefile.o) .text EXCLUDE_FILE (*somefile.o) .rdata)
  5352. </pre></div>
  5353. <p>Alternatively, placing the EXCLUDE_FILE outside of the section list,
  5354. before the input file selection, will cause the exclusion to apply for
  5355. all sections. Thus the previous example can be rewritten as:
  5356. </p><div class="example">
  5357. <pre class="example">EXCLUDE_FILE (*somefile.o) *(.text .rdata)
  5358. </pre></div>
  5359. <p>You can specify a file name to include sections from a particular file.
  5360. You would do this if one or more of your files contain special data that
  5361. needs to be at a particular location in memory. For example:
  5362. </p><div class="example">
  5363. <pre class="example">data.o(.data)
  5364. </pre></div>
  5365. <p>To refine the sections that are included based on the section flags
  5366. of an input section, INPUT_SECTION_FLAGS may be used.
  5367. </p>
  5368. <p>Here is a simple example for using Section header flags for ELF sections:
  5369. </p>
  5370. <div class="example">
  5371. <pre class="example">SECTIONS {
  5372. .text : { INPUT_SECTION_FLAGS (SHF_MERGE &amp; SHF_STRINGS) *(.text) }
  5373. .text2 : { INPUT_SECTION_FLAGS (!SHF_WRITE) *(.text) }
  5374. }
  5375. </pre></div>
  5376. <p>In this example, the output section &lsquo;<samp>.text</samp>&rsquo; will be comprised of any
  5377. input section matching the name *(.text) whose section header flags
  5378. <code>SHF_MERGE</code> and <code>SHF_STRINGS</code> are set. The output section
  5379. &lsquo;<samp>.text2</samp>&rsquo; will be comprised of any input section matching the name *(.text)
  5380. whose section header flag <code>SHF_WRITE</code> is clear.
  5381. </p>
  5382. <p>You can also specify files within archives by writing a pattern
  5383. matching the archive, a colon, then the pattern matching the file,
  5384. with no whitespace around the colon.
  5385. </p>
  5386. <dl compact="compact">
  5387. <dt>&lsquo;<samp>archive:file</samp>&rsquo;</dt>
  5388. <dd><p>matches file within archive
  5389. </p></dd>
  5390. <dt>&lsquo;<samp>archive:</samp>&rsquo;</dt>
  5391. <dd><p>matches the whole archive
  5392. </p></dd>
  5393. <dt>&lsquo;<samp>:file</samp>&rsquo;</dt>
  5394. <dd><p>matches file but not one in an archive
  5395. </p></dd>
  5396. </dl>
  5397. <p>Either one or both of &lsquo;<samp>archive</samp>&rsquo; and &lsquo;<samp>file</samp>&rsquo; can contain shell
  5398. wildcards. On DOS based file systems, the linker will assume that a
  5399. single letter followed by a colon is a drive specifier, so
  5400. &lsquo;<samp>c:myfile.o</samp>&rsquo; is a simple file specification, not &lsquo;<samp>myfile.o</samp>&rsquo;
  5401. within an archive called &lsquo;<samp>c</samp>&rsquo;. &lsquo;<samp>archive:file</samp>&rsquo; filespecs may
  5402. also be used within an <code>EXCLUDE_FILE</code> list, but may not appear in
  5403. other linker script contexts. For instance, you cannot extract a file
  5404. from an archive by using &lsquo;<samp>archive:file</samp>&rsquo; in an <code>INPUT</code>
  5405. command.
  5406. </p>
  5407. <p>If you use a file name without a list of sections, then all sections in
  5408. the input file will be included in the output section. This is not
  5409. commonly done, but it may by useful on occasion. For example:
  5410. </p><div class="example">
  5411. <pre class="example">data.o
  5412. </pre></div>
  5413. <p>When you use a file name which is not an &lsquo;<samp>archive:file</samp>&rsquo; specifier
  5414. and does not contain any wild card
  5415. characters, the linker will first see if you also specified the file
  5416. name on the linker command line or in an <code>INPUT</code> command. If you
  5417. did not, the linker will attempt to open the file as an input file, as
  5418. though it appeared on the command line. Note that this differs from an
  5419. <code>INPUT</code> command, because the linker will not search for the file in
  5420. the archive search path.
  5421. </p>
  5422. <hr>
  5423. <span id="Input-Section-Wildcards"></span><div class="header">
  5424. <p>
  5425. Next: <a href="#Input-Section-Common" accesskey="n" rel="next">Input Section Common</a>, Previous: <a href="#Input-Section-Basics" accesskey="p" rel="prev">Input Section Basics</a>, Up: <a href="#Input-Section" accesskey="u" rel="up">Input Section</a> &nbsp; [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#LD-Index" title="Index" rel="index">Index</a>]</p>
  5426. </div>
  5427. <span id="Input-Section-Wildcard-Patterns"></span><h4 class="subsubsection">3.6.4.2 Input Section Wildcard Patterns</h4>
  5428. <span id="index-input-section-wildcards"></span>
  5429. <span id="index-wildcard-file-name-patterns"></span>
  5430. <span id="index-file-name-wildcard-patterns"></span>
  5431. <span id="index-section-name-wildcard-patterns"></span>
  5432. <p>In an input section description, either the file name or the section
  5433. name or both may be wildcard patterns.
  5434. </p>
  5435. <p>The file name of &lsquo;<samp>*</samp>&rsquo; seen in many examples is a simple wildcard
  5436. pattern for the file name.
  5437. </p>
  5438. <p>The wildcard patterns are like those used by the Unix shell.
  5439. </p>
  5440. <dl compact="compact">
  5441. <dt>&lsquo;<samp>*</samp>&rsquo;</dt>
  5442. <dd><p>matches any number of characters
  5443. </p></dd>
  5444. <dt>&lsquo;<samp>?</samp>&rsquo;</dt>
  5445. <dd><p>matches any single character
  5446. </p></dd>
  5447. <dt>&lsquo;<samp>[<var>chars</var>]</samp>&rsquo;</dt>
  5448. <dd><p>matches a single instance of any of the <var>chars</var>; the &lsquo;<samp>-</samp>&rsquo;
  5449. character may be used to specify a range of characters, as in
  5450. &lsquo;<samp>[a-z]</samp>&rsquo; to match any lower case letter
  5451. </p></dd>
  5452. <dt>&lsquo;<samp>\</samp>&rsquo;</dt>
  5453. <dd><p>quotes the following character
  5454. </p></dd>
  5455. </dl>
  5456. <p>File name wildcard patterns only match files which are explicitly
  5457. specified on the command line or in an <code>INPUT</code> command. The linker
  5458. does not search directories to expand wildcards.
  5459. </p>
  5460. <p>If a file name matches more than one wildcard pattern, or if a file name
  5461. appears explicitly and is also matched by a wildcard pattern, the linker
  5462. will use the first match in the linker script. For example, this
  5463. sequence of input section descriptions is probably in error, because the
  5464. <samp>data.o</samp> rule will not be used:
  5465. </p><div class="example">
  5466. <pre class="example">.data : { *(.data) }
  5467. .data1 : { data.o(.data) }
  5468. </pre></div>
  5469. <span id="index-SORT_005fBY_005fNAME"></span>
  5470. <p>Normally, the linker will place files and sections matched by wildcards
  5471. in the order in which they are seen during the link. You can change
  5472. this by using the <code>SORT_BY_NAME</code> keyword, which appears before a wildcard
  5473. pattern in parentheses (e.g., <code>SORT_BY_NAME(.text*)</code>). When the
  5474. <code>SORT_BY_NAME</code> keyword is used, the linker will sort the files or sections
  5475. into ascending order by name before placing them in the output file.
  5476. </p>
  5477. <span id="index-SORT_005fBY_005fALIGNMENT"></span>
  5478. <p><code>SORT_BY_ALIGNMENT</code> is similar to <code>SORT_BY_NAME</code>.
  5479. <code>SORT_BY_ALIGNMENT</code> will sort sections into descending order of
  5480. alignment before placing them in the output file. Placing larger
  5481. alignments before smaller alignments can reduce the amount of padding
  5482. needed.
  5483. </p>
  5484. <span id="index-SORT_005fBY_005fINIT_005fPRIORITY"></span>
  5485. <p><code>SORT_BY_INIT_PRIORITY</code> is also similar to <code>SORT_BY_NAME</code>.
  5486. <code>SORT_BY_INIT_PRIORITY</code> will sort sections into ascending
  5487. numerical order of the GCC init_priority attribute encoded in the
  5488. section name before placing them in the output file. In
  5489. <code>.init_array.NNNNN</code> and <code>.fini_array.NNNNN</code>, <code>NNNNN</code> is
  5490. the init_priority. In <code>.ctors.NNNNN</code> and <code>.dtors.NNNNN</code>,
  5491. <code>NNNNN</code> is 65535 minus the init_priority.
  5492. </p>
  5493. <span id="index-SORT"></span>
  5494. <p><code>SORT</code> is an alias for <code>SORT_BY_NAME</code>.
  5495. </p>
  5496. <span id="index-REVERSE"></span>
  5497. <p><code>REVERSE</code> indicates that the sorting should be reversed. If used
  5498. on its own then <code>REVERSE</code> implies <code>SORT_BY_NAME</code>, otherwise
  5499. it reverses the enclosed <code>SORT..</code> command. Note - reverse
  5500. sorting of alignment is not currently supported.
  5501. </p>
  5502. <p>Note - the sorting commands only accept a single wildcard pattern. So
  5503. for example the following will not work:
  5504. </p><div class="example">
  5505. <pre class="example"> *(REVERSE(.text* .init*))
  5506. </pre></div>
  5507. <p>To resolve this problem list the patterns individually, like this:
  5508. </p><div class="example">
  5509. <pre class="example"> *(REVERSE(.text*))
  5510. *(REVERSE(.init*))
  5511. </pre></div>
  5512. <p>Note - you can put the <code>EXCLUDE_FILE</code> command inside a sorting
  5513. command, but not the other way around. So for example:
  5514. </p><div class="example">
  5515. <pre class="example"> *(SORT_BY_NAME(EXCLUDE_FILE(foo) .text*))
  5516. </pre></div>
  5517. <p>will work, but:
  5518. </p><div class="example">
  5519. <pre class="example"> *(EXCLUDE_FILE(foo) SORT_BY_NAME(.text*))
  5520. </pre></div>
  5521. <p>will not.
  5522. </p>
  5523. <p>When there are nested section sorting commands in linker script, there
  5524. can be at most 1 level of nesting for section sorting commands.
  5525. </p>
  5526. <ol>
  5527. <li> <code>SORT_BY_NAME</code> (<code>SORT_BY_ALIGNMENT</code> (wildcard section pattern)).
  5528. It will sort the input sections by name first, then by alignment if two
  5529. sections have the same name.
  5530. </li><li> <code>SORT_BY_ALIGNMENT</code> (<code>SORT_BY_NAME</code> (wildcard section pattern)).
  5531. It will sort the input sections by alignment first, then by name if two
  5532. sections have the same alignment.
  5533. </li><li> <code>SORT_BY_NAME</code> (<code>SORT_BY_NAME</code> (wildcard section pattern)) is
  5534. treated the same as <code>SORT_BY_NAME</code> (wildcard section pattern).
  5535. </li><li> <code>SORT_BY_ALIGNMENT</code> (<code>SORT_BY_ALIGNMENT</code> (wildcard section pattern))
  5536. is treated the same as <code>SORT_BY_ALIGNMENT</code> (wildcard section pattern).
  5537. </li><li> <code>SORT_BY_NAME</code> (<code>REVERSE</code> (wildcard section pattern))
  5538. reverse sorts by name.
  5539. </li><li> <code>REVERSE</code> (<code>SORT_BY_NAME</code> (wildcard section pattern))
  5540. reverse sorts by name.
  5541. </li><li> <code>SORT_BY_INIT_PRIORITY</code> (<code>REVERSE</code> (wildcard section pattern))
  5542. reverse sorts by init priority.
  5543. </li><li> All other nested section sorting commands are invalid.
  5544. </li></ol>
  5545. <p>When both command-line section sorting option and linker script
  5546. section sorting command are used, section sorting command always
  5547. takes precedence over the command-line option.
  5548. </p>
  5549. <p>If the section sorting command in linker script isn&rsquo;t nested, the
  5550. command-line option will make the section sorting command to be
  5551. treated as nested sorting command.
  5552. </p>
  5553. <ol>
  5554. <li> <code>SORT_BY_NAME</code> (wildcard section pattern ) with
  5555. <samp>--sort-sections alignment</samp> is equivalent to
  5556. <code>SORT_BY_NAME</code> (<code>SORT_BY_ALIGNMENT</code> (wildcard section pattern)).
  5557. </li><li> <code>SORT_BY_ALIGNMENT</code> (wildcard section pattern) with
  5558. <samp>--sort-section name</samp> is equivalent to
  5559. <code>SORT_BY_ALIGNMENT</code> (<code>SORT_BY_NAME</code> (wildcard section pattern)).
  5560. </li></ol>
  5561. <p>If the section sorting command in linker script is nested, the
  5562. command-line option will be ignored.
  5563. </p>
  5564. <span id="index-SORT_005fNONE"></span>
  5565. <p><code>SORT_NONE</code> disables section sorting by ignoring the command-line
  5566. section sorting option.
  5567. </p>
  5568. <p>If you ever get confused about where input sections are going, use the
  5569. &lsquo;<samp>-M</samp>&rsquo; linker option to generate a map file. The map file shows
  5570. precisely how input sections are mapped to output sections.
  5571. </p>
  5572. <p>This example shows how wildcard patterns might be used to partition
  5573. files. This linker script directs the linker to place all &lsquo;<samp>.text</samp>&rsquo;
  5574. sections in &lsquo;<samp>.text</samp>&rsquo; and all &lsquo;<samp>.bss</samp>&rsquo; sections in &lsquo;<samp>.bss</samp>&rsquo;.
  5575. The linker will place the &lsquo;<samp>.data</samp>&rsquo; section from all files beginning
  5576. with an upper case character in &lsquo;<samp>.DATA</samp>&rsquo;; for all other files, the
  5577. linker will place the &lsquo;<samp>.data</samp>&rsquo; section in &lsquo;<samp>.data</samp>&rsquo;.
  5578. </p><div class="example">
  5579. <pre class="example">SECTIONS {
  5580. .text : { *(.text) }
  5581. .DATA : { [A-Z]*(.data) }
  5582. .data : { *(.data) }
  5583. .bss : { *(.bss) }
  5584. }
  5585. </pre></div>
  5586. <hr>
  5587. <span id="Input-Section-Common"></span><div class="header">
  5588. <p>
  5589. Next: <a href="#Input-Section-Keep" accesskey="n" rel="next">Input Section Keep</a>, Previous: <a href="#Input-Section-Wildcards" accesskey="p" rel="prev">Input Section Wildcards</a>, Up: <a href="#Input-Section" accesskey="u" rel="up">Input Section</a> &nbsp; [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#LD-Index" title="Index" rel="index">Index</a>]</p>
  5590. </div>
  5591. <span id="Input-Section-for-Common-Symbols"></span><h4 class="subsubsection">3.6.4.3 Input Section for Common Symbols</h4>
  5592. <span id="index-common-symbol-placement"></span>
  5593. <span id="index-uninitialized-data-placement"></span>
  5594. <p>A special notation is needed for common symbols, because in many object
  5595. file formats common symbols do not have a particular input section. The
  5596. linker treats common symbols as though they are in an input section
  5597. named &lsquo;<samp>COMMON</samp>&rsquo;.
  5598. </p>
  5599. <p>You may use file names with the &lsquo;<samp>COMMON</samp>&rsquo; section just as with any
  5600. other input sections. You can use this to place common symbols from a
  5601. particular input file in one section while common symbols from other
  5602. input files are placed in another section.
  5603. </p>
  5604. <p>In most cases, common symbols in input files will be placed in the
  5605. &lsquo;<samp>.bss</samp>&rsquo; section in the output file. For example:
  5606. </p><div class="example">
  5607. <pre class="example">.bss { *(.bss) *(COMMON) }
  5608. </pre></div>
  5609. <span id="index-scommon-section"></span>
  5610. <span id="index-small-common-symbols"></span>
  5611. <p>Some object file formats have more than one type of common symbol. For
  5612. example, the MIPS ELF object file format distinguishes standard common
  5613. symbols and small common symbols. In this case, the linker will use a
  5614. different special section name for other types of common symbols. In
  5615. the case of MIPS ELF, the linker uses &lsquo;<samp>COMMON</samp>&rsquo; for standard common
  5616. symbols and &lsquo;<samp>.scommon</samp>&rsquo; for small common symbols. This permits you
  5617. to map the different types of common symbols into memory at different
  5618. locations.
  5619. </p>
  5620. <span id="index-_005bCOMMON_005d"></span>
  5621. <p>You will sometimes see &lsquo;<samp>[COMMON]</samp>&rsquo; in old linker scripts. This
  5622. notation is now considered obsolete. It is equivalent to
  5623. &lsquo;<samp>*(COMMON)</samp>&rsquo;.
  5624. </p>
  5625. <hr>
  5626. <span id="Input-Section-Keep"></span><div class="header">
  5627. <p>
  5628. Next: <a href="#Input-Section-Example" accesskey="n" rel="next">Input Section Example</a>, Previous: <a href="#Input-Section-Common" accesskey="p" rel="prev">Input Section Common</a>, Up: <a href="#Input-Section" accesskey="u" rel="up">Input Section</a> &nbsp; [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#LD-Index" title="Index" rel="index">Index</a>]</p>
  5629. </div>
  5630. <span id="Input-Section-and-Garbage-Collection"></span><h4 class="subsubsection">3.6.4.4 Input Section and Garbage Collection</h4>
  5631. <span id="index-KEEP"></span>
  5632. <span id="index-garbage-collection-3"></span>
  5633. <p>When link-time garbage collection is in use (&lsquo;<samp>--gc-sections</samp>&rsquo;),
  5634. it is often useful to mark sections that should not be eliminated.
  5635. This is accomplished by surrounding an input section&rsquo;s wildcard entry
  5636. with <code>KEEP()</code>, as in <code>KEEP(*(.init))</code> or
  5637. <code>KEEP(SORT_BY_NAME(*)(.ctors))</code>.
  5638. </p>
  5639. <hr>
  5640. <span id="Input-Section-Example"></span><div class="header">
  5641. <p>
  5642. Previous: <a href="#Input-Section-Keep" accesskey="p" rel="prev">Input Section Keep</a>, Up: <a href="#Input-Section" accesskey="u" rel="up">Input Section</a> &nbsp; [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#LD-Index" title="Index" rel="index">Index</a>]</p>
  5643. </div>
  5644. <span id="Input-Section-Example-1"></span><h4 class="subsubsection">3.6.4.5 Input Section Example</h4>
  5645. <p>The following example is a complete linker script. It tells the linker
  5646. to read all of the sections from file <samp>all.o</samp> and place them at the
  5647. start of output section &lsquo;<samp>outputa</samp>&rsquo; which starts at location
  5648. &lsquo;<samp>0x10000</samp>&rsquo;. All of section &lsquo;<samp>.input1</samp>&rsquo; from file <samp>foo.o</samp>
  5649. follows immediately, in the same output section. All of section
  5650. &lsquo;<samp>.input2</samp>&rsquo; from <samp>foo.o</samp> goes into output section
  5651. &lsquo;<samp>outputb</samp>&rsquo;, followed by section &lsquo;<samp>.input1</samp>&rsquo; from <samp>foo1.o</samp>.
  5652. All of the remaining &lsquo;<samp>.input1</samp>&rsquo; and &lsquo;<samp>.input2</samp>&rsquo; sections from any
  5653. files are written to output section &lsquo;<samp>outputc</samp>&rsquo;.
  5654. </p>
  5655. <div class="example">
  5656. <pre class="example">SECTIONS {
  5657. outputa 0x10000 :
  5658. {
  5659. all.o
  5660. foo.o (.input1)
  5661. }
  5662. </pre><pre class="example"> outputb :
  5663. {
  5664. foo.o (.input2)
  5665. foo1.o (.input1)
  5666. }
  5667. </pre><pre class="example"> outputc :
  5668. {
  5669. *(.input1)
  5670. *(.input2)
  5671. }
  5672. }
  5673. </pre></div>
  5674. <p>If an output section&rsquo;s name is the same as the input section&rsquo;s name
  5675. and is representable as a C identifier, then the linker will
  5676. automatically see <a href="#PROVIDE">PROVIDE</a> two symbols: __start_SECNAME and
  5677. __stop_SECNAME, where SECNAME is the name of the section. These
  5678. indicate the start address and end address of the output section
  5679. respectively. Note: most section names are not representable as
  5680. C identifiers because they contain a &lsquo;<samp>.</samp>&rsquo; character.
  5681. </p>
  5682. <hr>
  5683. <span id="Output-Section-Data"></span><div class="header">
  5684. <p>
  5685. Next: <a href="#Output-Section-Keywords" accesskey="n" rel="next">Output Section Keywords</a>, Previous: <a href="#Input-Section" accesskey="p" rel="prev">Input Section</a>, Up: <a href="#SECTIONS" accesskey="u" rel="up">SECTIONS</a> &nbsp; [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#LD-Index" title="Index" rel="index">Index</a>]</p>
  5686. </div>
  5687. <span id="Output-Section-Data-1"></span><h4 class="subsection">3.6.5 Output Section Data</h4>
  5688. <span id="index-data"></span>
  5689. <span id="index-section-data"></span>
  5690. <span id="index-output-section-data"></span>
  5691. <span id="index-ASCIZ-_0060_0060string_0027_0027"></span>
  5692. <span id="index-BYTE_0028expression_0029"></span>
  5693. <span id="index-SHORT_0028expression_0029"></span>
  5694. <span id="index-LONG_0028expression_0029"></span>
  5695. <span id="index-QUAD_0028expression_0029"></span>
  5696. <span id="index-SQUAD_0028expression_0029"></span>
  5697. <p>You can include explicit bytes of data in an output section by using
  5698. <code>BYTE</code>, <code>SHORT</code>, <code>LONG</code>, <code>QUAD</code>, or <code>SQUAD</code> as
  5699. an output section command. Each keyword is followed by an expression in
  5700. parentheses providing the value to store (see <a href="#Expressions">Expressions</a>). The
  5701. value of the expression is stored at the current value of the location
  5702. counter.
  5703. </p>
  5704. <p>The <code>BYTE</code>, <code>SHORT</code>, <code>LONG</code>, and <code>QUAD</code> commands
  5705. store one, two, four, and eight bytes (respectively). After storing the
  5706. bytes, the location counter is incremented by the number of bytes
  5707. stored.
  5708. </p>
  5709. <p>For example, this will store the byte 1 followed by the four byte value
  5710. of the symbol &lsquo;<samp>addr</samp>&rsquo;:
  5711. </p><div class="example">
  5712. <pre class="example">BYTE(1)
  5713. LONG(addr)
  5714. </pre></div>
  5715. <p>When using a 64 bit host or target, <code>QUAD</code> and <code>SQUAD</code> are the
  5716. same; they both store an 8 byte, or 64 bit, value. When both host and
  5717. target are 32 bits, an expression is computed as 32 bits. In this case
  5718. <code>QUAD</code> stores a 32 bit value zero extended to 64 bits, and
  5719. <code>SQUAD</code> stores a 32 bit value sign extended to 64 bits.
  5720. </p>
  5721. <p>If the object file format of the output file has an explicit endianness,
  5722. which is the normal case, the value will be stored in that endianness.
  5723. When the object file format does not have an explicit endianness, as is
  5724. true of, for example, S-records, the value will be stored in the
  5725. endianness of the first input object file.
  5726. </p>
  5727. <p>You can include a zero-terminated string in an output section by using
  5728. <code>ASCIZ</code>. The keyword is followed by a string which is stored at
  5729. the current value of the location counter adding a zero byte at the
  5730. end. If the string includes spaces it must be enclosed in double
  5731. quotes. The string may contain &rsquo;\n&rsquo;, &rsquo;\r&rsquo;, &rsquo;\t&rsquo; and octal numbers.
  5732. Hex numbers are not supported.
  5733. </p>
  5734. <p>For example, this string of 16 characters will create a 17 byte area
  5735. </p><div class="example">
  5736. <pre class="example"> ASCIZ &quot;This is 16 bytes&quot;
  5737. </pre></div>
  5738. <p>Note&mdash;these commands only work inside a section description and not
  5739. between them, so the following will produce an error from the linker:
  5740. </p><div class="example">
  5741. <pre class="example">SECTIONS {&nbsp;.text : {&nbsp;*(.text) }&nbsp;LONG(1) .data : {&nbsp;*(.data) }&nbsp;}&nbsp;</pre></div>
  5742. <p>whereas this will work:
  5743. </p><div class="example">
  5744. <pre class="example">SECTIONS {&nbsp;.text : {&nbsp;*(.text) ; LONG(1) }&nbsp;.data : {&nbsp;*(.data) }&nbsp;}&nbsp;</pre></div>
  5745. <span id="index-FILL_0028expression_0029"></span>
  5746. <span id="index-holes_002c-filling"></span>
  5747. <span id="index-unspecified-memory"></span>
  5748. <p>You may use the <code>FILL</code> command to set the fill pattern for the
  5749. current section. It is followed by an expression in parentheses. Any
  5750. otherwise unspecified regions of memory within the section (for example,
  5751. gaps left due to the required alignment of input sections) are filled
  5752. with the value of the expression, repeated as
  5753. necessary. A <code>FILL</code> statement covers memory locations after the
  5754. point at which it occurs in the section definition; by including more
  5755. than one <code>FILL</code> statement, you can have different fill patterns in
  5756. different parts of an output section.
  5757. </p>
  5758. <p>This example shows how to fill unspecified regions of memory with the
  5759. value &lsquo;<samp>0x90</samp>&rsquo;:
  5760. </p><div class="example">
  5761. <pre class="example">FILL(0x90909090)
  5762. </pre></div>
  5763. <p>The <code>FILL</code> command is similar to the &lsquo;<samp>=<var>fillexp</var></samp>&rsquo; output
  5764. section attribute, but it only affects the
  5765. part of the section following the <code>FILL</code> command, rather than the
  5766. entire section. If both are used, the <code>FILL</code> command takes
  5767. precedence. See <a href="#Output-Section-Fill">Output Section Fill</a>, for details on the fill
  5768. expression.
  5769. </p>
  5770. <p>Note - normally the value of <code>expression</code> is zero extended to 4
  5771. bytes when used to fill gaps. Thus &lsquo;<samp>FILL(144)</samp>&rsquo; will fill a
  5772. region with repeats of the pattern &lsquo;<samp>0 0 0 144</samp>&rsquo;. The value is
  5773. treated as a big-endian number, so for example
  5774. &lsquo;<samp>FILL(22 * 256 + 23)</samp>&rsquo; will fill the region with repeats of the
  5775. pattern &lsquo;<samp>0 0 22 23</samp>&rsquo;. If the expression results in a value with
  5776. more than 4 significant bytes only the least 4 bytes of the value will
  5777. be used.
  5778. </p>
  5779. <p>The above rules do not apply when the <code>expression</code> is a simple
  5780. hexadecimal number. In this case zero extension is not performed and
  5781. all bytes are significant. So &lsquo;<samp>FILL(0x90)</samp>&rsquo; will fill a region with
  5782. repeats of &lsquo;<samp>0x90</samp>&rsquo; with no zero bytes, and &lsquo;<samp>FILL(0x9192)</samp>&rsquo;
  5783. will fill the region with repeats of &lsquo;<samp>0x91 0x92</samp>&rsquo;. Zero bytes
  5784. in a hexadecimal expression are significant even at the start, so
  5785. &lsquo;<samp>FILL(0x0090)</samp>&rsquo; will fill a region with repeats of &lsquo;<samp>0x00 0x90</samp>&rsquo;.
  5786. </p>
  5787. <p>Hexadecimal numbers can be longer than 4 bytes, and all of the bytes
  5788. are significant, so &lsquo;<samp>FILL(0x123456789a)</samp>&rsquo; will fill a region with
  5789. repeats of the 5 byte sequence &lsquo;<samp>0x12 0x34 0x56 0x78 0x9a</samp>&rsquo;.
  5790. Excess bytes in a hexadecimal value beyond the size of a region will
  5791. be silently ignored.
  5792. </p>
  5793. <p>The above only applies to hexadecimal numbers specified as
  5794. &lsquo;<samp>0x[0-9][a-f][A-F]</samp>&rsquo;. Hexadecimal numbers specified with a
  5795. &lsquo;<samp>$</samp>&rsquo; prefix, or a &lsquo;<samp>h</samp>&rsquo;, &lsquo;<samp>H</samp>&rsquo;, &lsquo;<samp>x</samp>&rsquo; or &lsquo;<samp>X</samp>&rsquo; suffix
  5796. will follow the normal fill value rules. This also applies to
  5797. expressions that involve hexadecimal numbers, and hexadecimal numbers
  5798. that have a magnitude suffix.
  5799. </p>
  5800. <span id="index-LINKER_005fVERSION-1"></span>
  5801. <span id="index-LINKER_005fVERSION"></span>
  5802. <p>The <code>LINKER_VERSION</code> command inserts a string containing the
  5803. version of the linker at the current point. Note - by default this
  5804. directive is disabled and will do nothing. It only becomes active if
  5805. the <samp>--enable-linker-version</samp> command line option is used.
  5806. </p>
  5807. <p>Built-in linker scripts for ELF based targets already include this
  5808. directive in their &lsquo;<samp>.comment</samp>&rsquo; section.
  5809. </p>
  5810. <hr>
  5811. <span id="Output-Section-Keywords"></span><div class="header">
  5812. <p>
  5813. Next: <a href="#Output-Section-Discarding" accesskey="n" rel="next">Output Section Discarding</a>, Previous: <a href="#Output-Section-Data" accesskey="p" rel="prev">Output Section Data</a>, Up: <a href="#SECTIONS" accesskey="u" rel="up">SECTIONS</a> &nbsp; [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#LD-Index" title="Index" rel="index">Index</a>]</p>
  5814. </div>
  5815. <span id="Output-Section-Keywords-1"></span><h4 class="subsection">3.6.6 Output Section Keywords</h4>
  5816. <p>There are a couple of keywords which can appear as output section
  5817. commands.
  5818. </p>
  5819. <dl compact="compact">
  5820. <dd><span id="index-CREATE_005fOBJECT_005fSYMBOLS"></span>
  5821. <span id="index-input-filename-symbols"></span>
  5822. <span id="index-filename-symbols"></span>
  5823. </dd>
  5824. <dt><code>CREATE_OBJECT_SYMBOLS</code></dt>
  5825. <dd><p>The command tells the linker to create a symbol for each input file.
  5826. The name of each symbol will be the name of the corresponding input
  5827. file. The section of each symbol will be the output section in which
  5828. the <code>CREATE_OBJECT_SYMBOLS</code> command appears.
  5829. </p>
  5830. <p>This is conventional for the a.out object file format. It is not
  5831. normally used for any other object file format.
  5832. </p>
  5833. <span id="index-CONSTRUCTORS"></span>
  5834. <span id="index-C_002b_002b-constructors_002c-arranging-in-link"></span>
  5835. <span id="index-constructors_002c-arranging-in-link"></span>
  5836. </dd>
  5837. <dt><code>CONSTRUCTORS</code></dt>
  5838. <dd><p>When linking using the a.out object file format, the linker uses an
  5839. unusual set construct to support C++ global constructors and
  5840. destructors. When linking object file formats which do not support
  5841. arbitrary sections, such as ECOFF and XCOFF, the linker will
  5842. automatically recognize C++ global constructors and destructors by name.
  5843. For these object file formats, the <code>CONSTRUCTORS</code> command tells the
  5844. linker to place constructor information in the output section where the
  5845. <code>CONSTRUCTORS</code> command appears. The <code>CONSTRUCTORS</code> command is
  5846. ignored for other object file formats.
  5847. </p>
  5848. <p>The symbol <code><span class="nolinebreak">__CTOR_LIST__</span></code><!-- /@w --> marks the start of the global
  5849. constructors, and the symbol <code><span class="nolinebreak">__CTOR_END__</span></code><!-- /@w --> marks the end.
  5850. Similarly, <code><span class="nolinebreak">__DTOR_LIST__</span></code><!-- /@w --> and <code><span class="nolinebreak">__DTOR_END__</span></code><!-- /@w --> mark
  5851. the start and end of the global destructors. The
  5852. first word in the list is the number of entries, followed by the address
  5853. of each constructor or destructor, followed by a zero word. The
  5854. compiler must arrange to actually run the code. For these object file
  5855. formats <small>GNU</small> C++ normally calls constructors from a subroutine
  5856. <code>__main</code>; a call to <code>__main</code> is automatically inserted into
  5857. the startup code for <code>main</code>. <small>GNU</small> C++ normally runs
  5858. destructors either by using <code>atexit</code>, or directly from the function
  5859. <code>exit</code>.
  5860. </p>
  5861. <p>For object file formats such as <code>COFF</code> or <code>ELF</code> which support
  5862. arbitrary section names, <small>GNU</small> C++ will normally arrange to put the
  5863. addresses of global constructors and destructors into the <code>.ctors</code>
  5864. and <code>.dtors</code> sections. Placing the following sequence into your
  5865. linker script will build the sort of table which the <small>GNU</small> C++
  5866. runtime code expects to see.
  5867. </p>
  5868. <div class="example">
  5869. <pre class="example"> __CTOR_LIST__ = .;
  5870. LONG((__CTOR_END__ - __CTOR_LIST__) / 4 - 2)
  5871. *(.ctors)
  5872. LONG(0)
  5873. __CTOR_END__ = .;
  5874. __DTOR_LIST__ = .;
  5875. LONG((__DTOR_END__ - __DTOR_LIST__) / 4 - 2)
  5876. *(.dtors)
  5877. LONG(0)
  5878. __DTOR_END__ = .;
  5879. </pre></div>
  5880. <p>If you are using the <small>GNU</small> C++ support for initialization priority,
  5881. which provides some control over the order in which global constructors
  5882. are run, you must sort the constructors at link time to ensure that they
  5883. are executed in the correct order. When using the <code>CONSTRUCTORS</code>
  5884. command, use &lsquo;<samp>SORT_BY_NAME(CONSTRUCTORS)</samp>&rsquo; instead. When using the
  5885. <code>.ctors</code> and <code>.dtors</code> sections, use &lsquo;<samp>*(SORT_BY_NAME(.ctors))</samp>&rsquo; and
  5886. &lsquo;<samp>*(SORT_BY_NAME(.dtors))</samp>&rsquo; instead of just &lsquo;<samp>*(.ctors)</samp>&rsquo; and
  5887. &lsquo;<samp>*(.dtors)</samp>&rsquo;.
  5888. </p>
  5889. <p>Normally the compiler and linker will handle these issues automatically,
  5890. and you will not need to concern yourself with them. However, you may
  5891. need to consider this if you are using C++ and writing your own linker
  5892. scripts.
  5893. </p>
  5894. </dd>
  5895. </dl>
  5896. <hr>
  5897. <span id="Output-Section-Discarding"></span><div class="header">
  5898. <p>
  5899. Next: <a href="#Output-Section-Attributes" accesskey="n" rel="next">Output Section Attributes</a>, Previous: <a href="#Output-Section-Keywords" accesskey="p" rel="prev">Output Section Keywords</a>, Up: <a href="#SECTIONS" accesskey="u" rel="up">SECTIONS</a> &nbsp; [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#LD-Index" title="Index" rel="index">Index</a>]</p>
  5900. </div>
  5901. <span id="Output-Section-Discarding-1"></span><h4 class="subsection">3.6.7 Output Section Discarding</h4>
  5902. <span id="index-discarding-sections"></span>
  5903. <span id="index-sections_002c-discarding"></span>
  5904. <span id="index-removing-sections"></span>
  5905. <p>The linker will not normally create output sections with no contents.
  5906. This is for convenience when referring to input sections that may or
  5907. may not be present in any of the input files. For example:
  5908. </p><div class="example">
  5909. <pre class="example">.foo : { *(.foo) }
  5910. </pre></div>
  5911. <p>will only create a &lsquo;<samp>.foo</samp>&rsquo; section in the output file if there is a
  5912. &lsquo;<samp>.foo</samp>&rsquo; section in at least one input file, and if the input
  5913. sections are not all empty. Other link script directives that allocate
  5914. space in an output section will also create the output section. So
  5915. too will assignments to dot even if the assignment does not create
  5916. space, except for &lsquo;<samp>. = 0</samp>&rsquo;, &lsquo;<samp>. = . + 0</samp>&rsquo;, &lsquo;<samp>. = sym</samp>&rsquo;,
  5917. &lsquo;<samp>. = . + sym</samp>&rsquo; and &lsquo;<samp>. = ALIGN (. != 0, expr, 1)</samp>&rsquo; when
  5918. &lsquo;<samp>sym</samp>&rsquo; is an absolute symbol of value 0 defined in the script.
  5919. This allows you to force output of an empty section with &lsquo;<samp>. = .</samp>&rsquo;.
  5920. </p>
  5921. <p>The linker will ignore address assignments (see <a href="#Output-Section-Address">Output Section Address</a>)
  5922. on discarded output sections, except when the linker script defines
  5923. symbols in the output section. In that case the linker will obey
  5924. the address assignments, possibly advancing dot even though the
  5925. section is discarded.
  5926. </p>
  5927. <span id="index-_002fDISCARD_002f"></span>
  5928. <p>The special output section name &lsquo;<samp>/DISCARD/</samp>&rsquo; may be used to discard
  5929. input sections. Any input sections which are assigned to an output
  5930. section named &lsquo;<samp>/DISCARD/</samp>&rsquo; are not included in the output file.
  5931. </p>
  5932. <p>This can be used to discard input sections marked with the ELF flag
  5933. <code>SHF_GNU_RETAIN</code>, which would otherwise have been saved from linker
  5934. garbage collection.
  5935. </p>
  5936. <p>Note, sections that match the &lsquo;<samp>/DISCARD/</samp>&rsquo; output section will be
  5937. discarded even if they are in an ELF section group which has other
  5938. members which are not being discarded. This is deliberate.
  5939. Discarding takes precedence over grouping.
  5940. </p>
  5941. <hr>
  5942. <span id="Output-Section-Attributes"></span><div class="header">
  5943. <p>
  5944. Next: <a href="#Overlay-Description" accesskey="n" rel="next">Overlay Description</a>, Previous: <a href="#Output-Section-Discarding" accesskey="p" rel="prev">Output Section Discarding</a>, Up: <a href="#SECTIONS" accesskey="u" rel="up">SECTIONS</a> &nbsp; [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#LD-Index" title="Index" rel="index">Index</a>]</p>
  5945. </div>
  5946. <span id="Output-Section-Attributes-1"></span><h4 class="subsection">3.6.8 Output Section Attributes</h4>
  5947. <span id="index-output-section-attributes"></span>
  5948. <p>We showed above that the full description of an output section looked
  5949. like this:
  5950. </p>
  5951. <div class="example">
  5952. <pre class="example"><var>section</var> [<var>address</var>] [(<var>type</var>)] :
  5953. [AT(<var>lma</var>)]
  5954. [ALIGN(<var>section_align</var>) | ALIGN_WITH_INPUT]
  5955. [SUBALIGN(<var>subsection_align</var>)]
  5956. [<var>constraint</var>]
  5957. {
  5958. <var>output-section-command</var>
  5959. <var>output-section-command</var>
  5960. &hellip;
  5961. } [&gt;<var>region</var>] [AT&gt;<var>lma_region</var>] [:<var>phdr</var> :<var>phdr</var> &hellip;] [=<var>fillexp</var>]
  5962. </pre></div>
  5963. <p>We&rsquo;ve already described <var>section</var>, <var>address</var>, and
  5964. <var>output-section-command</var>. In this section we will describe the
  5965. remaining section attributes.
  5966. </p>
  5967. <table class="menu" border="0" cellspacing="0">
  5968. <tr><td align="left" valign="top">&bull; <a href="#Output-Section-Type" accesskey="1">Output Section Type</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">Output section type
  5969. </td></tr>
  5970. <tr><td align="left" valign="top">&bull; <a href="#Output-Section-LMA" accesskey="2">Output Section LMA</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">Output section LMA
  5971. </td></tr>
  5972. <tr><td align="left" valign="top">&bull; <a href="#Forced-Output-Alignment" accesskey="3">Forced Output Alignment</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">Forced Output Alignment
  5973. </td></tr>
  5974. <tr><td align="left" valign="top">&bull; <a href="#Forced-Input-Alignment" accesskey="4">Forced Input Alignment</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">Forced Input Alignment
  5975. </td></tr>
  5976. <tr><td align="left" valign="top">&bull; <a href="#Output-Section-Constraint" accesskey="5">Output Section Constraint</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">Output section constraint
  5977. </td></tr>
  5978. <tr><td align="left" valign="top">&bull; <a href="#Output-Section-Region" accesskey="6">Output Section Region</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">Output section region
  5979. </td></tr>
  5980. <tr><td align="left" valign="top">&bull; <a href="#Output-Section-Phdr" accesskey="7">Output Section Phdr</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">Output section phdr
  5981. </td></tr>
  5982. <tr><td align="left" valign="top">&bull; <a href="#Output-Section-Fill" accesskey="8">Output Section Fill</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">Output section fill
  5983. </td></tr>
  5984. </table>
  5985. <hr>
  5986. <span id="Output-Section-Type"></span><div class="header">
  5987. <p>
  5988. Next: <a href="#Output-Section-LMA" accesskey="n" rel="next">Output Section LMA</a>, Up: <a href="#Output-Section-Attributes" accesskey="u" rel="up">Output Section Attributes</a> &nbsp; [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#LD-Index" title="Index" rel="index">Index</a>]</p>
  5989. </div>
  5990. <span id="Output-Section-Type-1"></span><h4 class="subsubsection">3.6.8.1 Output Section Type</h4>
  5991. <p>Each output section may have a type. The type is a keyword in
  5992. parentheses. The following types are defined:
  5993. </p>
  5994. <dl compact="compact">
  5995. <dt><code>NOLOAD</code></dt>
  5996. <dd><p>The section should be marked as not loadable, so that it will not be
  5997. loaded into memory when the program is run.
  5998. </p>
  5999. </dd>
  6000. <dt><code>READONLY</code></dt>
  6001. <dd><p>The section should be marked as read-only.
  6002. </p>
  6003. </dd>
  6004. <dt><code>DSECT</code></dt>
  6005. <dt><code>COPY</code></dt>
  6006. <dt><code>INFO</code></dt>
  6007. <dt><code>OVERLAY</code></dt>
  6008. <dd><p>These type names are supported for backward compatibility, and are
  6009. rarely used. They all have the same effect: the section should be
  6010. marked as not allocatable, so that no memory is allocated for the
  6011. section when the program is run.
  6012. </p>
  6013. </dd>
  6014. <dt><code>TYPE = <var>type</var></code></dt>
  6015. <dd><p>Set the section type to the integer <var>type</var>. When generating an ELF
  6016. output file, type names <code>SHT_PROGBITS</code>, <code>SHT_STRTAB</code>,
  6017. <code>SHT_NOTE</code>, <code>SHT_NOBITS</code>, <code>SHT_INIT_ARRAY</code>,
  6018. <code>SHT_FINI_ARRAY</code>, and <code>SHT_PREINIT_ARRAY</code> are also allowed
  6019. for <var>type</var>. It is the user&rsquo;s responsibility to ensure that any
  6020. special requirements of the section type are met.
  6021. </p>
  6022. <p>Note - the TYPE only is used if some or all of the contents of the
  6023. section do not have an implicit type of their own. So for example:
  6024. </p><div class="example">
  6025. <pre class="example"> .foo . TYPE = SHT_PROGBITS { *(.bar) }
  6026. </pre></div>
  6027. <p>will set the type of section &lsquo;<samp>.foo</samp>&rsquo; to the type of the section
  6028. &lsquo;<samp>.bar</samp>&rsquo; in the input files, which may not be the SHT_PROGBITS
  6029. type. Whereas:
  6030. </p><div class="example">
  6031. <pre class="example"> .foo . TYPE = SHT_PROGBITS { BYTE(1) }
  6032. </pre></div>
  6033. <p>will set the type of &lsquo;<samp>.foo</samp>&rsquo; to SHT_PROGBBITS. If it is necessary
  6034. to override the type of incoming sections and force the output section
  6035. type then an extra piece of untyped data will be needed:
  6036. </p><div class="example">
  6037. <pre class="example"> .foo . TYPE = SHT_PROGBITS { BYTE(1); *(.bar) }
  6038. </pre></div>
  6039. </dd>
  6040. <dt><code>READONLY ( TYPE = <var>type</var> )</code></dt>
  6041. <dd><p>This form of the syntax combines the <var>READONLY</var> type with the
  6042. type specified by <var>type</var>.
  6043. </p>
  6044. </dd>
  6045. </dl>
  6046. <span id="index-NOLOAD"></span>
  6047. <span id="index-prevent-unnecessary-loading"></span>
  6048. <span id="index-loading_002c-preventing"></span>
  6049. <p>The linker normally sets the attributes of an output section based on
  6050. the input sections which map into it. You can override this by using
  6051. the section type. For example, in the script sample below, the
  6052. &lsquo;<samp>ROM</samp>&rsquo; section is addressed at memory location &lsquo;<samp>0</samp>&rsquo; and does not
  6053. need to be loaded when the program is run.
  6054. </p><div class="example">
  6055. <pre class="example">SECTIONS {
  6056. ROM 0 (NOLOAD) : { &hellip; }
  6057. &hellip;
  6058. }
  6059. </pre></div>
  6060. <hr>
  6061. <span id="Output-Section-LMA"></span><div class="header">
  6062. <p>
  6063. Next: <a href="#Forced-Output-Alignment" accesskey="n" rel="next">Forced Output Alignment</a>, Previous: <a href="#Output-Section-Type" accesskey="p" rel="prev">Output Section Type</a>, Up: <a href="#Output-Section-Attributes" accesskey="u" rel="up">Output Section Attributes</a> &nbsp; [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#LD-Index" title="Index" rel="index">Index</a>]</p>
  6064. </div>
  6065. <span id="Output-Section-LMA-1"></span><h4 class="subsubsection">3.6.8.2 Output Section LMA</h4>
  6066. <span id="index-AT_003elma_005fregion"></span>
  6067. <span id="index-AT_0028lma_0029"></span>
  6068. <span id="index-load-address"></span>
  6069. <span id="index-section-load-address"></span>
  6070. <p>Every section has a virtual address (VMA) and a load address (LMA); see
  6071. <a href="#Basic-Script-Concepts">Basic Script Concepts</a>. The virtual address is specified by the
  6072. see <a href="#Output-Section-Address">Output Section Address</a> described earlier. The load address is
  6073. specified by the <code>AT</code> or <code>AT&gt;</code> keywords. Specifying a load
  6074. address is optional.
  6075. </p>
  6076. <p>The <code>AT</code> keyword takes an expression as an argument. This
  6077. specifies the exact load address of the section. The <code>AT&gt;</code> keyword
  6078. takes the name of a memory region as an argument. See <a href="#MEMORY">MEMORY</a>. The
  6079. load address of the section is set to the next free address in the
  6080. region, aligned to the section&rsquo;s alignment requirements.
  6081. </p>
  6082. <p>If neither <code>AT</code> nor <code>AT&gt;</code> is specified for an allocatable
  6083. section, the linker will use the following heuristic to determine the
  6084. load address:
  6085. </p>
  6086. <ul>
  6087. <li> If the section has a specific VMA address, then this is used as
  6088. the LMA address as well.
  6089. </li><li> If the section is not allocatable then its LMA is set to its VMA.
  6090. </li><li> Otherwise if a memory region can be found that is compatible
  6091. with the current section, and this region contains at least one
  6092. section, then the LMA is set so the difference between the
  6093. VMA and LMA is the same as the difference between the VMA and LMA of
  6094. the last section in the located region.
  6095. </li><li> If no memory regions have been declared then a default region
  6096. that covers the entire address space is used in the previous step.
  6097. </li><li> If no suitable region could be found, or there was no previous
  6098. section then the LMA is set equal to the VMA.
  6099. </li></ul>
  6100. <span id="index-ROM-initialized-data"></span>
  6101. <span id="index-initialized-data-in-ROM"></span>
  6102. <p>This feature is designed to make it easy to build a ROM image. For
  6103. example, the following linker script creates three output sections: one
  6104. called &lsquo;<samp>.text</samp>&rsquo;, which starts at <code>0x1000</code>, one called
  6105. &lsquo;<samp>.mdata</samp>&rsquo;, which is loaded at the end of the &lsquo;<samp>.text</samp>&rsquo; section
  6106. even though its VMA is <code>0x2000</code>, and one called &lsquo;<samp>.bss</samp>&rsquo; to hold
  6107. uninitialized data at address <code>0x3000</code>. The symbol <code>_data</code> is
  6108. defined with the value <code>0x2000</code>, which shows that the location
  6109. counter holds the VMA value, not the LMA value.
  6110. </p>
  6111. <div class="example">
  6112. <pre class="example">SECTIONS
  6113. {
  6114. .text 0x1000 : { *(.text) _etext = . ; }
  6115. .mdata 0x2000 :
  6116. AT ( ADDR (.text) + SIZEOF (.text) )
  6117. { _data = . ; *(.data); _edata = . ; }
  6118. .bss 0x3000 :
  6119. { _bstart = . ; *(.bss) *(COMMON) ; _bend = . ;}
  6120. }
  6121. </pre></div>
  6122. <p>The run-time initialization code for use with a program generated with
  6123. this linker script would include something like the following, to copy
  6124. the initialized data from the ROM image to its runtime address. Notice
  6125. how this code takes advantage of the symbols defined by the linker
  6126. script.
  6127. </p>
  6128. <div class="example">
  6129. <pre class="example">extern char _etext, _data, _edata, _bstart, _bend;
  6130. char *src = &amp;_etext;
  6131. char *dst = &amp;_data;
  6132. /* ROM has data at end of text; copy it. */
  6133. while (dst &lt; &amp;_edata)
  6134. *dst++ = *src++;
  6135. /* Zero bss. */
  6136. for (dst = &amp;_bstart; dst&lt; &amp;_bend; dst++)
  6137. *dst = 0;
  6138. </pre></div>
  6139. <hr>
  6140. <span id="Forced-Output-Alignment"></span><div class="header">
  6141. <p>
  6142. Next: <a href="#Forced-Input-Alignment" accesskey="n" rel="next">Forced Input Alignment</a>, Previous: <a href="#Output-Section-LMA" accesskey="p" rel="prev">Output Section LMA</a>, Up: <a href="#Output-Section-Attributes" accesskey="u" rel="up">Output Section Attributes</a> &nbsp; [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#LD-Index" title="Index" rel="index">Index</a>]</p>
  6143. </div>
  6144. <span id="Forced-Output-Alignment-1"></span><h4 class="subsubsection">3.6.8.3 Forced Output Alignment</h4>
  6145. <span id="index-ALIGN_0028section_005falign_0029"></span>
  6146. <span id="index-forcing-output-section-alignment"></span>
  6147. <span id="index-output-section-alignment"></span>
  6148. <p>You can increase an output section&rsquo;s alignment by using ALIGN. As an
  6149. alternative you can enforce that the difference between the VMA and LMA remains
  6150. intact throughout this output section with the ALIGN_WITH_INPUT attribute.
  6151. </p>
  6152. <hr>
  6153. <span id="Forced-Input-Alignment"></span><div class="header">
  6154. <p>
  6155. Next: <a href="#Output-Section-Constraint" accesskey="n" rel="next">Output Section Constraint</a>, Previous: <a href="#Forced-Output-Alignment" accesskey="p" rel="prev">Forced Output Alignment</a>, Up: <a href="#Output-Section-Attributes" accesskey="u" rel="up">Output Section Attributes</a> &nbsp; [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#LD-Index" title="Index" rel="index">Index</a>]</p>
  6156. </div>
  6157. <span id="Forced-Input-Alignment-1"></span><h4 class="subsubsection">3.6.8.4 Forced Input Alignment</h4>
  6158. <span id="index-SUBALIGN_0028subsection_005falign_0029"></span>
  6159. <span id="index-forcing-input-section-alignment"></span>
  6160. <span id="index-input-section-alignment"></span>
  6161. <p>You can force input section alignment within an output section by using
  6162. SUBALIGN. The value specified overrides any alignment given by input
  6163. sections, whether larger or smaller.
  6164. </p>
  6165. <hr>
  6166. <span id="Output-Section-Constraint"></span><div class="header">
  6167. <p>
  6168. Next: <a href="#Output-Section-Region" accesskey="n" rel="next">Output Section Region</a>, Previous: <a href="#Forced-Input-Alignment" accesskey="p" rel="prev">Forced Input Alignment</a>, Up: <a href="#Output-Section-Attributes" accesskey="u" rel="up">Output Section Attributes</a> &nbsp; [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#LD-Index" title="Index" rel="index">Index</a>]</p>
  6169. </div>
  6170. <span id="Output-Section-Constraint-1"></span><h4 class="subsubsection">3.6.8.5 Output Section Constraint</h4>
  6171. <span id="index-ONLY_005fIF_005fRO"></span>
  6172. <span id="index-ONLY_005fIF_005fRW"></span>
  6173. <span id="index-constraints-on-output-sections"></span>
  6174. <p>You can specify that an output section should only be created if all
  6175. of its input sections are read-only or all of its input sections are
  6176. read-write by using the keyword <code>ONLY_IF_RO</code> and
  6177. <code>ONLY_IF_RW</code> respectively.
  6178. </p>
  6179. <hr>
  6180. <span id="Output-Section-Region"></span><div class="header">
  6181. <p>
  6182. Next: <a href="#Output-Section-Phdr" accesskey="n" rel="next">Output Section Phdr</a>, Previous: <a href="#Output-Section-Constraint" accesskey="p" rel="prev">Output Section Constraint</a>, Up: <a href="#Output-Section-Attributes" accesskey="u" rel="up">Output Section Attributes</a> &nbsp; [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#LD-Index" title="Index" rel="index">Index</a>]</p>
  6183. </div>
  6184. <span id="Output-Section-Region-1"></span><h4 class="subsubsection">3.6.8.6 Output Section Region</h4>
  6185. <span id="index-_003eregion"></span>
  6186. <span id="index-section_002c-assigning-to-memory-region"></span>
  6187. <span id="index-memory-regions-and-sections"></span>
  6188. <p>You can assign a section to a previously defined region of memory by
  6189. using &lsquo;<samp>&gt;<var>region</var></samp>&rsquo;. See <a href="#MEMORY">MEMORY</a>.
  6190. </p>
  6191. <p>Here is a simple example:
  6192. </p><div class="example">
  6193. <pre class="example">MEMORY { rom : ORIGIN = 0x1000, LENGTH = 0x1000 }
  6194. SECTIONS { ROM : { *(.text) } &gt;rom }
  6195. </pre></div>
  6196. <hr>
  6197. <span id="Output-Section-Phdr"></span><div class="header">
  6198. <p>
  6199. Next: <a href="#Output-Section-Fill" accesskey="n" rel="next">Output Section Fill</a>, Previous: <a href="#Output-Section-Region" accesskey="p" rel="prev">Output Section Region</a>, Up: <a href="#Output-Section-Attributes" accesskey="u" rel="up">Output Section Attributes</a> &nbsp; [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#LD-Index" title="Index" rel="index">Index</a>]</p>
  6200. </div>
  6201. <span id="Output-Section-Phdr-1"></span><h4 class="subsubsection">3.6.8.7 Output Section Phdr</h4>
  6202. <span id="index-_003aphdr"></span>
  6203. <span id="index-section_002c-assigning-to-program-header"></span>
  6204. <span id="index-program-headers-and-sections"></span>
  6205. <p>You can assign a section to a previously defined program segment by
  6206. using &lsquo;<samp>:<var>phdr</var></samp>&rsquo;. See <a href="#PHDRS">PHDRS</a>. If a section is assigned to
  6207. one or more segments, then all subsequent allocated sections will be
  6208. assigned to those segments as well, unless they use an explicitly
  6209. <code>:<var>phdr</var></code> modifier. You can use <code>:NONE</code> to tell the
  6210. linker to not put the section in any segment at all.
  6211. </p>
  6212. <p>Here is a simple example:
  6213. </p><div class="example">
  6214. <pre class="example">PHDRS { text PT_LOAD ; }
  6215. SECTIONS { .text : { *(.text) } :text }
  6216. </pre></div>
  6217. <hr>
  6218. <span id="Output-Section-Fill"></span><div class="header">
  6219. <p>
  6220. Previous: <a href="#Output-Section-Phdr" accesskey="p" rel="prev">Output Section Phdr</a>, Up: <a href="#Output-Section-Attributes" accesskey="u" rel="up">Output Section Attributes</a> &nbsp; [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#LD-Index" title="Index" rel="index">Index</a>]</p>
  6221. </div>
  6222. <span id="Output-Section-Fill-1"></span><h4 class="subsubsection">3.6.8.8 Output Section Fill</h4>
  6223. <span id="index-_003dfillexp"></span>
  6224. <span id="index-section-fill-pattern"></span>
  6225. <span id="index-fill-pattern_002c-entire-section"></span>
  6226. <p>You can set the fill pattern for an entire section by using
  6227. &lsquo;<samp>=<var>fillexp</var></samp>&rsquo;. <var>fillexp</var> is an expression
  6228. (see <a href="#Expressions">Expressions</a>). Any otherwise unspecified regions of memory
  6229. within the output section (for example, gaps left due to the required
  6230. alignment of input sections) will be filled with the value, repeated as
  6231. necessary. If the fill expression is a simple hex number, ie. a string
  6232. of hex digit starting with &lsquo;<samp>0x</samp>&rsquo; and without a trailing &lsquo;<samp>k</samp>&rsquo; or &lsquo;<samp>M</samp>&rsquo;, then
  6233. an arbitrarily long sequence of hex digits can be used to specify the
  6234. fill pattern; Leading zeros become part of the pattern too. For all
  6235. other cases, including extra parentheses or a unary <code>+</code>, the fill
  6236. pattern is the four least significant bytes of the value of the
  6237. expression. If the value is less than four bytes in size then it will
  6238. be zero extended to four bytes. In all cases, the number is big-endian.
  6239. </p>
  6240. <div class="example">
  6241. <pre class="example">Fill Value Fill Pattern
  6242. 0x90 90 90 90 90
  6243. 0x0090 00 90 00 90
  6244. 144 00 00 00 90
  6245. </pre></div>
  6246. <p>You can also change the fill value with a <code>FILL</code> command in the
  6247. output section commands; (see <a href="#Output-Section-Data">Output Section Data</a>).
  6248. </p>
  6249. <p>Here is a simple example:
  6250. </p><div class="example">
  6251. <pre class="example">SECTIONS { .text : { *(.text) } =0x90909090 }
  6252. </pre></div>
  6253. <hr>
  6254. <span id="Overlay-Description"></span><div class="header">
  6255. <p>
  6256. Previous: <a href="#Output-Section-Attributes" accesskey="p" rel="prev">Output Section Attributes</a>, Up: <a href="#SECTIONS" accesskey="u" rel="up">SECTIONS</a> &nbsp; [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#LD-Index" title="Index" rel="index">Index</a>]</p>
  6257. </div>
  6258. <span id="Overlay-Description-1"></span><h4 class="subsection">3.6.9 Overlay Description</h4>
  6259. <span id="index-OVERLAY"></span>
  6260. <span id="index-overlays"></span>
  6261. <p>An overlay description provides an easy way to describe sections which
  6262. are to be loaded as part of a single memory image but are to be run at
  6263. the same memory address. At run time, some sort of overlay manager will
  6264. copy the overlaid sections in and out of the runtime memory address as
  6265. required, perhaps by simply manipulating addressing bits. This approach
  6266. can be useful, for example, when a certain region of memory is faster
  6267. than another.
  6268. </p>
  6269. <p>Overlays are described using the <code>OVERLAY</code> command. The
  6270. <code>OVERLAY</code> command is used within a <code>SECTIONS</code> command, like an
  6271. output section description. The full syntax of the <code>OVERLAY</code>
  6272. command is as follows:
  6273. </p><div class="example">
  6274. <pre class="example">OVERLAY [<var>start</var>] : [NOCROSSREFS] [AT ( <var>ldaddr</var> )]
  6275. {
  6276. <var>secname1</var>
  6277. {
  6278. <var>output-section-command</var>
  6279. <var>output-section-command</var>
  6280. &hellip;
  6281. } [:<var>phdr</var>&hellip;] [=<var>fill</var>]
  6282. <var>secname2</var>
  6283. {
  6284. <var>output-section-command</var>
  6285. <var>output-section-command</var>
  6286. &hellip;
  6287. } [:<var>phdr</var>&hellip;] [=<var>fill</var>]
  6288. &hellip;
  6289. } [&gt;<var>region</var>] [:<var>phdr</var>&hellip;] [=<var>fill</var>] [,]
  6290. </pre></div>
  6291. <p>Everything is optional except <code>OVERLAY</code> (a keyword), and each
  6292. section must have a name (<var>secname1</var> and <var>secname2</var> above). The
  6293. section definitions within the <code>OVERLAY</code> construct are identical to
  6294. those within the general <code>SECTIONS</code> construct (see <a href="#SECTIONS">SECTIONS</a>),
  6295. except that no addresses and no memory regions may be defined for
  6296. sections within an <code>OVERLAY</code>.
  6297. </p>
  6298. <p>The comma at the end may be required if a <var>fill</var> is used and
  6299. the next <var>sections-command</var> looks like a continuation of the expression.
  6300. </p>
  6301. <p>The sections are all defined with the same starting address. The load
  6302. addresses of the sections are arranged such that they are consecutive in
  6303. memory starting at the load address used for the <code>OVERLAY</code> as a
  6304. whole (as with normal section definitions, the load address is optional,
  6305. and defaults to the start address; the start address is also optional,
  6306. and defaults to the current value of the location counter).
  6307. </p>
  6308. <p>If the <code>NOCROSSREFS</code> keyword is used, and there are any
  6309. references among the sections, the linker will report an error. Since
  6310. the sections all run at the same address, it normally does not make
  6311. sense for one section to refer directly to another.
  6312. See <a href="#Miscellaneous-Commands">NOCROSSREFS</a>.
  6313. </p>
  6314. <p>For each section within the <code>OVERLAY</code>, the linker automatically
  6315. provides two symbols. The symbol <code>__load_start_<var>secname</var></code> is
  6316. defined as the starting load address of the section. The symbol
  6317. <code>__load_stop_<var>secname</var></code> is defined as the final load address of
  6318. the section. Any characters within <var>secname</var> which are not legal
  6319. within C identifiers are removed. C (or assembler) code may use these
  6320. symbols to move the overlaid sections around as necessary.
  6321. </p>
  6322. <p>At the end of the overlay, the value of the location counter is set to
  6323. the start address of the overlay plus the size of the largest section.
  6324. </p>
  6325. <p>Here is an example. Remember that this would appear inside a
  6326. <code>SECTIONS</code> construct.
  6327. </p><div class="example">
  6328. <pre class="example"> OVERLAY 0x1000 : AT (0x4000)
  6329. {
  6330. .text0 { o1/*.o(.text) }
  6331. .text1 { o2/*.o(.text) }
  6332. }
  6333. </pre></div>
  6334. <p>This will define both &lsquo;<samp>.text0</samp>&rsquo; and &lsquo;<samp>.text1</samp>&rsquo; to start at
  6335. address 0x1000. &lsquo;<samp>.text0</samp>&rsquo; will be loaded at address 0x4000, and
  6336. &lsquo;<samp>.text1</samp>&rsquo; will be loaded immediately after &lsquo;<samp>.text0</samp>&rsquo;. The
  6337. following symbols will be defined if referenced: <code>__load_start_text0</code>,
  6338. <code>__load_stop_text0</code>, <code>__load_start_text1</code>,
  6339. <code>__load_stop_text1</code>.
  6340. </p>
  6341. <p>C code to copy overlay <code>.text1</code> into the overlay area might look
  6342. like the following.
  6343. </p>
  6344. <div class="example">
  6345. <pre class="example"> extern char __load_start_text1, __load_stop_text1;
  6346. memcpy ((char *) 0x1000, &amp;__load_start_text1,
  6347. &amp;__load_stop_text1 - &amp;__load_start_text1);
  6348. </pre></div>
  6349. <p>Note that the <code>OVERLAY</code> command is just syntactic sugar, since
  6350. everything it does can be done using the more basic commands. The above
  6351. example could have been written identically as follows.
  6352. </p>
  6353. <div class="example">
  6354. <pre class="example"> .text0 0x1000 : AT (0x4000) { o1/*.o(.text) }
  6355. PROVIDE (__load_start_text0 = LOADADDR (.text0));
  6356. PROVIDE (__load_stop_text0 = LOADADDR (.text0) + SIZEOF (.text0));
  6357. .text1 0x1000 : AT (0x4000 + SIZEOF (.text0)) { o2/*.o(.text) }
  6358. PROVIDE (__load_start_text1 = LOADADDR (.text1));
  6359. PROVIDE (__load_stop_text1 = LOADADDR (.text1) + SIZEOF (.text1));
  6360. . = 0x1000 + MAX (SIZEOF (.text0), SIZEOF (.text1));
  6361. </pre></div>
  6362. <hr>
  6363. <span id="MEMORY"></span><div class="header">
  6364. <p>
  6365. Next: <a href="#PHDRS" accesskey="n" rel="next">PHDRS</a>, Previous: <a href="#SECTIONS" accesskey="p" rel="prev">SECTIONS</a>, Up: <a href="#Scripts" accesskey="u" rel="up">Scripts</a> &nbsp; [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#LD-Index" title="Index" rel="index">Index</a>]</p>
  6366. </div>
  6367. <span id="MEMORY-Command"></span><h3 class="section">3.7 MEMORY Command</h3>
  6368. <span id="index-MEMORY"></span>
  6369. <span id="index-memory-regions"></span>
  6370. <span id="index-regions-of-memory"></span>
  6371. <span id="index-allocating-memory"></span>
  6372. <span id="index-discontinuous-memory"></span>
  6373. <p>The linker&rsquo;s default configuration permits allocation of all available
  6374. memory. You can override this by using the <code>MEMORY</code> command.
  6375. </p>
  6376. <p>The <code>MEMORY</code> command describes the location and size of blocks of
  6377. memory in the target. You can use it to describe which memory regions
  6378. may be used by the linker, and which memory regions it must avoid. You
  6379. can then assign sections to particular memory regions. The linker will
  6380. set section addresses based on the memory regions, and will warn about
  6381. regions that become too full. The linker will not shuffle sections
  6382. around to fit into the available regions.
  6383. </p>
  6384. <p>A linker script may contain many uses of the <code>MEMORY</code> command,
  6385. however, all memory blocks defined are treated as if they were
  6386. specified inside a single <code>MEMORY</code> command. The syntax for
  6387. <code>MEMORY</code> is:
  6388. </p><div class="example">
  6389. <pre class="example">MEMORY
  6390. {
  6391. <var>name</var> [(<var>attr</var>)] : ORIGIN = <var>origin</var>, LENGTH = <var>len</var>
  6392. &hellip;
  6393. }
  6394. </pre></div>
  6395. <p>The <var>name</var> is a name used in the linker script to refer to the
  6396. region. The region name has no meaning outside of the linker script.
  6397. Region names are stored in a separate name space, and will not conflict
  6398. with symbol names, file names, or section names. Each memory region
  6399. must have a distinct name within the <code>MEMORY</code> command. However you can
  6400. add later alias names to existing memory regions with the <a href="#REGION_005fALIAS">REGION_ALIAS</a>
  6401. command.
  6402. </p>
  6403. <span id="index-memory-region-attributes"></span>
  6404. <p>The <var>attr</var> string is an optional list of attributes that specify
  6405. whether to use a particular memory region for an input section which is
  6406. not explicitly mapped in the linker script. As described in
  6407. <a href="#SECTIONS">SECTIONS</a>, if you do not specify an output section for some input
  6408. section, the linker will create an output section with the same name as
  6409. the input section. If you define region attributes, the linker will use
  6410. them to select the memory region for the output section that it creates.
  6411. </p>
  6412. <p>The <var>attr</var> string must consist only of the following characters:
  6413. </p><dl compact="compact">
  6414. <dt>&lsquo;<samp>R</samp>&rsquo;</dt>
  6415. <dd><p>Read-only section
  6416. </p></dd>
  6417. <dt>&lsquo;<samp>W</samp>&rsquo;</dt>
  6418. <dd><p>Read/write section
  6419. </p></dd>
  6420. <dt>&lsquo;<samp>X</samp>&rsquo;</dt>
  6421. <dd><p>Executable section
  6422. </p></dd>
  6423. <dt>&lsquo;<samp>A</samp>&rsquo;</dt>
  6424. <dd><p>Allocatable section
  6425. </p></dd>
  6426. <dt>&lsquo;<samp>I</samp>&rsquo;</dt>
  6427. <dd><p>Initialized section
  6428. </p></dd>
  6429. <dt>&lsquo;<samp>L</samp>&rsquo;</dt>
  6430. <dd><p>Same as &lsquo;<samp>I</samp>&rsquo;
  6431. </p></dd>
  6432. <dt>&lsquo;<samp>!</samp>&rsquo;</dt>
  6433. <dd><p>Invert the sense of any of the attributes that follow
  6434. </p></dd>
  6435. </dl>
  6436. <p>If an unmapped section matches any of the listed attributes other than
  6437. &lsquo;<samp>!</samp>&rsquo;, it will be placed in the memory region. The &lsquo;<samp>!</samp>&rsquo;
  6438. attribute reverses the test for the characters that follow, so that an
  6439. unmapped section will be placed in the memory region only if it does
  6440. not match any of the attributes listed afterwards. Thus an attribute
  6441. string of &lsquo;<samp>RW!X</samp>&rsquo; will match any unmapped section that has either
  6442. or both of the &lsquo;<samp>R</samp>&rsquo; and &lsquo;<samp>W</samp>&rsquo; attributes, but only as long as
  6443. the section does not also have the &lsquo;<samp>X</samp>&rsquo; attribute.
  6444. </p>
  6445. <span id="index-ORIGIN-_003d"></span>
  6446. <span id="index-o-_003d"></span>
  6447. <span id="index-org-_003d"></span>
  6448. <p>The <var>origin</var> is an numerical expression for the start address of
  6449. the memory region. The expression must evaluate to a constant and it
  6450. cannot involve any symbols. The keyword <code>ORIGIN</code> may be
  6451. abbreviated to <code>org</code> or <code>o</code> (but not, for example,
  6452. <code>ORG</code>).
  6453. </p>
  6454. <span id="index-LENGTH-_003d"></span>
  6455. <span id="index-len-_003d"></span>
  6456. <span id="index-l-_003d"></span>
  6457. <p>The <var>len</var> is an expression for the size in bytes of the memory
  6458. region. As with the <var>origin</var> expression, the expression must
  6459. be numerical only and must evaluate to a constant. The keyword
  6460. <code>LENGTH</code> may be abbreviated to <code>len</code> or <code>l</code>.
  6461. </p>
  6462. <p>In the following example, we specify that there are two memory regions
  6463. available for allocation: one starting at &lsquo;<samp>0</samp>&rsquo; for 256 kilobytes,
  6464. and the other starting at &lsquo;<samp>0x40000000</samp>&rsquo; for four megabytes. The
  6465. linker will place into the &lsquo;<samp>rom</samp>&rsquo; memory region every section which
  6466. is not explicitly mapped into a memory region, and is either read-only
  6467. or executable. The linker will place other sections which are not
  6468. explicitly mapped into a memory region into the &lsquo;<samp>ram</samp>&rsquo; memory
  6469. region.
  6470. </p>
  6471. <div class="example">
  6472. <pre class="example">MEMORY
  6473. {
  6474. rom (rx) : ORIGIN = 0, LENGTH = 256K
  6475. ram (!rx) : org = 0x40000000, l = 4M
  6476. }
  6477. </pre></div>
  6478. <p>Once you define a memory region, you can direct the linker to place
  6479. specific output sections into that memory region by using the
  6480. &lsquo;<samp>&gt;<var>region</var></samp>&rsquo; output section attribute. For example, if you have
  6481. a memory region named &lsquo;<samp>mem</samp>&rsquo;, you would use &lsquo;<samp>&gt;mem</samp>&rsquo; in the
  6482. output section definition. See <a href="#Output-Section-Region">Output Section Region</a>. If no address
  6483. was specified for the output section, the linker will set the address to
  6484. the next available address within the memory region. If the combined
  6485. output sections directed to a memory region are too large for the
  6486. region, the linker will issue an error message.
  6487. </p>
  6488. <p>It is possible to access the origin and length of a memory in an
  6489. expression via the <code>ORIGIN(<var>memory</var>)</code> and
  6490. <code>LENGTH(<var>memory</var>)</code> functions:
  6491. </p>
  6492. <div class="example">
  6493. <pre class="example"> _fstack = ORIGIN(ram) + LENGTH(ram) - 4;
  6494. </pre></div>
  6495. <hr>
  6496. <span id="PHDRS"></span><div class="header">
  6497. <p>
  6498. Next: <a href="#VERSION" accesskey="n" rel="next">VERSION</a>, Previous: <a href="#MEMORY" accesskey="p" rel="prev">MEMORY</a>, Up: <a href="#Scripts" accesskey="u" rel="up">Scripts</a> &nbsp; [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#LD-Index" title="Index" rel="index">Index</a>]</p>
  6499. </div>
  6500. <span id="PHDRS-Command"></span><h3 class="section">3.8 PHDRS Command</h3>
  6501. <span id="index-PHDRS"></span>
  6502. <span id="index-program-headers"></span>
  6503. <span id="index-ELF-program-headers"></span>
  6504. <span id="index-program-segments"></span>
  6505. <span id="index-segments_002c-ELF"></span>
  6506. <p>The ELF object file format uses <em>program headers</em>, also knows as
  6507. <em>segments</em>. The program headers describe how the program should be
  6508. loaded into memory. You can print them out by using the <code>objdump</code>
  6509. program with the &lsquo;<samp>-p</samp>&rsquo; option.
  6510. </p>
  6511. <p>When you run an ELF program on a native ELF system, the system loader
  6512. reads the program headers in order to figure out how to load the
  6513. program. This will only work if the program headers are set correctly.
  6514. This manual does not describe the details of how the system loader
  6515. interprets program headers; for more information, see the ELF ABI.
  6516. </p>
  6517. <p>The linker will create reasonable program headers by default. However,
  6518. in some cases, you may need to specify the program headers more
  6519. precisely. You may use the <code>PHDRS</code> command for this purpose. When
  6520. the linker sees the <code>PHDRS</code> command in the linker script, it will
  6521. not create any program headers other than the ones specified.
  6522. </p>
  6523. <p>The linker only pays attention to the <code>PHDRS</code> command when
  6524. generating an ELF output file. In other cases, the linker will simply
  6525. ignore <code>PHDRS</code>.
  6526. </p>
  6527. <p>This is the syntax of the <code>PHDRS</code> command. The words <code>PHDRS</code>,
  6528. <code>FILEHDR</code>, <code>AT</code>, and <code>FLAGS</code> are keywords.
  6529. </p>
  6530. <div class="example">
  6531. <pre class="example">PHDRS
  6532. {
  6533. <var>name</var> <var>type</var> [ FILEHDR ] [ PHDRS ] [ AT ( <var>address</var> ) ]
  6534. [ FLAGS ( <var>flags</var> ) ] ;
  6535. }
  6536. </pre></div>
  6537. <p>The <var>name</var> is used only for reference in the <code>SECTIONS</code> command
  6538. of the linker script. It is not put into the output file. Program
  6539. header names are stored in a separate name space, and will not conflict
  6540. with symbol names, file names, or section names. Each program header
  6541. must have a distinct name. The headers are processed in order and it
  6542. is usual for them to map to sections in ascending load address order.
  6543. </p>
  6544. <p>Certain program header types describe segments of memory which the
  6545. system loader will load from the file. In the linker script, you
  6546. specify the contents of these segments by placing allocatable output
  6547. sections in the segments. You use the &lsquo;<samp>:<var>phdr</var></samp>&rsquo; output section
  6548. attribute to place a section in a particular segment. See <a href="#Output-Section-Phdr">Output Section Phdr</a>.
  6549. </p>
  6550. <p>It is normal to put certain sections in more than one segment. This
  6551. merely implies that one segment of memory contains another. You may
  6552. repeat &lsquo;<samp>:<var>phdr</var></samp>&rsquo;, using it once for each segment which should
  6553. contain the section.
  6554. </p>
  6555. <p>If you place a section in one or more segments using &lsquo;<samp>:<var>phdr</var></samp>&rsquo;,
  6556. then the linker will place all subsequent allocatable sections which do
  6557. not specify &lsquo;<samp>:<var>phdr</var></samp>&rsquo; in the same segments. This is for
  6558. convenience, since generally a whole set of contiguous sections will be
  6559. placed in a single segment. You can use <code>:NONE</code> to override the
  6560. default segment and tell the linker to not put the section in any
  6561. segment at all.
  6562. </p>
  6563. <span id="index-FILEHDR"></span>
  6564. <span id="index-PHDRS-1"></span>
  6565. <p>You may use the <code>FILEHDR</code> and <code>PHDRS</code> keywords after
  6566. the program header type to further describe the contents of the segment.
  6567. The <code>FILEHDR</code> keyword means that the segment should include the ELF
  6568. file header. The <code>PHDRS</code> keyword means that the segment should
  6569. include the ELF program headers themselves. If applied to a loadable
  6570. segment (<code>PT_LOAD</code>), all prior loadable segments must have one of
  6571. these keywords.
  6572. </p>
  6573. <p>The <var>type</var> may be one of the following. The numbers indicate the
  6574. value of the keyword.
  6575. </p>
  6576. <dl compact="compact">
  6577. <dt><code>PT_NULL</code> (0)</dt>
  6578. <dd><p>Indicates an unused program header.
  6579. </p>
  6580. </dd>
  6581. <dt><code>PT_LOAD</code> (1)</dt>
  6582. <dd><p>Indicates that this program header describes a segment to be loaded from
  6583. the file.
  6584. </p>
  6585. </dd>
  6586. <dt><code>PT_DYNAMIC</code> (2)</dt>
  6587. <dd><p>Indicates a segment where dynamic linking information can be found.
  6588. </p>
  6589. </dd>
  6590. <dt><code>PT_INTERP</code> (3)</dt>
  6591. <dd><p>Indicates a segment where the name of the program interpreter may be
  6592. found.
  6593. </p>
  6594. </dd>
  6595. <dt><code>PT_NOTE</code> (4)</dt>
  6596. <dd><p>Indicates a segment holding note information.
  6597. </p>
  6598. </dd>
  6599. <dt><code>PT_SHLIB</code> (5)</dt>
  6600. <dd><p>A reserved program header type, defined but not specified by the ELF
  6601. ABI.
  6602. </p>
  6603. </dd>
  6604. <dt><code>PT_PHDR</code> (6)</dt>
  6605. <dd><p>Indicates a segment where the program headers may be found.
  6606. </p>
  6607. </dd>
  6608. <dt><code>PT_TLS</code> (7)</dt>
  6609. <dd><p>Indicates a segment containing thread local storage.
  6610. </p>
  6611. </dd>
  6612. <dt><var>expression</var></dt>
  6613. <dd><p>An expression giving the numeric type of the program header. This may
  6614. be used for types not defined above.
  6615. </p></dd>
  6616. </dl>
  6617. <p>You can specify that a segment should be loaded at a particular address
  6618. in memory by using an <code>AT</code> expression. This is identical to the
  6619. <code>AT</code> command used as an output section attribute (see <a href="#Output-Section-LMA">Output Section LMA</a>). The <code>AT</code> command for a program header overrides the
  6620. output section attribute.
  6621. </p>
  6622. <p>The linker will normally set the segment flags based on the sections
  6623. which comprise the segment. You may use the <code>FLAGS</code> keyword to
  6624. explicitly specify the segment flags. The value of <var>flags</var> must be
  6625. an integer. It is used to set the <code>p_flags</code> field of the program
  6626. header.
  6627. </p>
  6628. <p>Here is an example of <code>PHDRS</code>. This shows a typical set of program
  6629. headers used on a native ELF system.
  6630. </p>
  6631. <div class="example">
  6632. <pre class="example">PHDRS
  6633. {
  6634. headers PT_PHDR PHDRS ;
  6635. interp PT_INTERP ;
  6636. text PT_LOAD FILEHDR PHDRS ;
  6637. data PT_LOAD ;
  6638. dynamic PT_DYNAMIC ;
  6639. }
  6640. SECTIONS
  6641. {
  6642. . = SIZEOF_HEADERS;
  6643. .interp : { *(.interp) } :text :interp
  6644. .text : { *(.text) } :text
  6645. .rodata : { *(.rodata) } /* defaults to :text */
  6646. &hellip;
  6647. . = . + 0x1000; /* move to a new page in memory */
  6648. .data : { *(.data) } :data
  6649. .dynamic : { *(.dynamic) } :data :dynamic
  6650. &hellip;
  6651. }
  6652. </pre></div>
  6653. <hr>
  6654. <span id="VERSION"></span><div class="header">
  6655. <p>
  6656. Next: <a href="#Expressions" accesskey="n" rel="next">Expressions</a>, Previous: <a href="#PHDRS" accesskey="p" rel="prev">PHDRS</a>, Up: <a href="#Scripts" accesskey="u" rel="up">Scripts</a> &nbsp; [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#LD-Index" title="Index" rel="index">Index</a>]</p>
  6657. </div>
  6658. <span id="VERSION-Command"></span><h3 class="section">3.9 VERSION Command</h3>
  6659. <span id="index-VERSION-_007bscript-text_007d"></span>
  6660. <span id="index-symbol-versions"></span>
  6661. <span id="index-version-script"></span>
  6662. <span id="index-versions-of-symbols"></span>
  6663. <p>The linker supports symbol versions when using ELF. Symbol versions are
  6664. only useful when using shared libraries. The dynamic linker can use
  6665. symbol versions to select a specific version of a function when it runs
  6666. a program that may have been linked against an earlier version of the
  6667. shared library.
  6668. </p>
  6669. <p>You can include a version script directly in the main linker script, or
  6670. you can supply the version script as an implicit linker script. You can
  6671. also use the &lsquo;<samp>--version-script</samp>&rsquo; linker option.
  6672. </p>
  6673. <p>The syntax of the <code>VERSION</code> command is simply
  6674. </p><div class="example">
  6675. <pre class="example">VERSION { version-script-commands }
  6676. </pre></div>
  6677. <p>The format of the version script commands is identical to that used by
  6678. Sun&rsquo;s linker in Solaris 2.5. The version script defines a tree of
  6679. version nodes. You specify the node names and interdependencies in the
  6680. version script. You can specify which symbols are bound to which
  6681. version nodes, and you can reduce a specified set of symbols to local
  6682. scope so that they are not globally visible outside of the shared
  6683. library.
  6684. </p>
  6685. <p>The easiest way to demonstrate the version script language is with a few
  6686. examples.
  6687. </p>
  6688. <div class="example">
  6689. <pre class="example">VERS_1.1 {
  6690. global:
  6691. foo1;
  6692. local:
  6693. old*;
  6694. original*;
  6695. new*;
  6696. };
  6697. VERS_1.2 {
  6698. foo2;
  6699. } VERS_1.1;
  6700. VERS_2.0 {
  6701. bar1; bar2;
  6702. extern &quot;C++&quot; {
  6703. ns::*;
  6704. &quot;f(int, double)&quot;;
  6705. };
  6706. } VERS_1.2;
  6707. </pre></div>
  6708. <p>This example version script defines three version nodes. The first
  6709. version node defined is &lsquo;<samp>VERS_1.1</samp>&rsquo;; it has no other dependencies.
  6710. The script binds the symbol &lsquo;<samp>foo1</samp>&rsquo; to &lsquo;<samp>VERS_1.1</samp>&rsquo;. It reduces
  6711. a number of symbols to local scope so that they are not visible outside
  6712. of the shared library; this is done using wildcard patterns, so that any
  6713. symbol whose name begins with &lsquo;<samp>old</samp>&rsquo;, &lsquo;<samp>original</samp>&rsquo;, or &lsquo;<samp>new</samp>&rsquo;
  6714. is matched. The wildcard patterns available are the same as those used
  6715. in the shell when matching filenames (also known as &ldquo;globbing&rdquo;).
  6716. However, if you specify the symbol name inside double quotes, then the
  6717. name is treated as literal, rather than as a glob pattern.
  6718. </p>
  6719. <p>Next, the version script defines node &lsquo;<samp>VERS_1.2</samp>&rsquo;. This node
  6720. depends upon &lsquo;<samp>VERS_1.1</samp>&rsquo;. The script binds the symbol &lsquo;<samp>foo2</samp>&rsquo;
  6721. to the version node &lsquo;<samp>VERS_1.2</samp>&rsquo;.
  6722. </p>
  6723. <p>Finally, the version script defines node &lsquo;<samp>VERS_2.0</samp>&rsquo;. This node
  6724. depends upon &lsquo;<samp>VERS_1.2</samp>&rsquo;. The scripts binds the symbols &lsquo;<samp>bar1</samp>&rsquo;
  6725. and &lsquo;<samp>bar2</samp>&rsquo; are bound to the version node &lsquo;<samp>VERS_2.0</samp>&rsquo;.
  6726. </p>
  6727. <p>When the linker finds a symbol defined in a library which is not
  6728. specifically bound to a version node, it will effectively bind it to an
  6729. unspecified base version of the library. You can bind all otherwise
  6730. unspecified symbols to a given version node by using &lsquo;<samp>global: *;</samp>&rsquo;
  6731. somewhere in the version script. Note that it&rsquo;s slightly crazy to use
  6732. wildcards in a global spec except on the last version node. Global
  6733. wildcards elsewhere run the risk of accidentally adding symbols to the
  6734. set exported for an old version. That&rsquo;s wrong since older versions
  6735. ought to have a fixed set of symbols.
  6736. </p>
  6737. <p>The names of the version nodes have no specific meaning other than what
  6738. they might suggest to the person reading them. The &lsquo;<samp>2.0</samp>&rsquo; version
  6739. could just as well have appeared in between &lsquo;<samp>1.1</samp>&rsquo; and &lsquo;<samp>1.2</samp>&rsquo;.
  6740. However, this would be a confusing way to write a version script.
  6741. </p>
  6742. <p>Node name can be omitted, provided it is the only version node
  6743. in the version script. Such version script doesn&rsquo;t assign any versions to
  6744. symbols, only selects which symbols will be globally visible out and which
  6745. won&rsquo;t.
  6746. </p>
  6747. <div class="example">
  6748. <pre class="example">{ global: foo; bar; local: *; };
  6749. </pre></div>
  6750. <p>When you link an application against a shared library that has versioned
  6751. symbols, the application itself knows which version of each symbol it
  6752. requires, and it also knows which version nodes it needs from each
  6753. shared library it is linked against. Thus at runtime, the dynamic
  6754. loader can make a quick check to make sure that the libraries you have
  6755. linked against do in fact supply all of the version nodes that the
  6756. application will need to resolve all of the dynamic symbols. In this
  6757. way it is possible for the dynamic linker to know with certainty that
  6758. all external symbols that it needs will be resolvable without having to
  6759. search for each symbol reference.
  6760. </p>
  6761. <p>The symbol versioning is in effect a much more sophisticated way of
  6762. doing minor version checking that SunOS does. The fundamental problem
  6763. that is being addressed here is that typically references to external
  6764. functions are bound on an as-needed basis, and are not all bound when
  6765. the application starts up. If a shared library is out of date, a
  6766. required interface may be missing; when the application tries to use
  6767. that interface, it may suddenly and unexpectedly fail. With symbol
  6768. versioning, the user will get a warning when they start their program if
  6769. the libraries being used with the application are too old.
  6770. </p>
  6771. <p>There are several GNU extensions to Sun&rsquo;s versioning approach. The
  6772. first of these is the ability to bind a symbol to a version node in the
  6773. source file where the symbol is defined instead of in the versioning
  6774. script. This was done mainly to reduce the burden on the library
  6775. maintainer. You can do this by putting something like:
  6776. </p><div class="example">
  6777. <pre class="example">__asm__(&quot;.symver original_foo,foo@VERS_1.1&quot;);
  6778. </pre></div>
  6779. <p>in the C source file. This renames the function &lsquo;<samp>original_foo</samp>&rsquo; to
  6780. be an alias for &lsquo;<samp>foo</samp>&rsquo; bound to the version node &lsquo;<samp>VERS_1.1</samp>&rsquo;.
  6781. The &lsquo;<samp>local:</samp>&rsquo; directive can be used to prevent the symbol
  6782. &lsquo;<samp>original_foo</samp>&rsquo; from being exported. A &lsquo;<samp>.symver</samp>&rsquo; directive
  6783. takes precedence over a version script.
  6784. </p>
  6785. <p>The second GNU extension is to allow multiple versions of the same
  6786. function to appear in a given shared library. In this way you can make
  6787. an incompatible change to an interface without increasing the major
  6788. version number of the shared library, while still allowing applications
  6789. linked against the old interface to continue to function.
  6790. </p>
  6791. <p>To do this, you must use multiple &lsquo;<samp>.symver</samp>&rsquo; directives in the
  6792. source file. Here is an example:
  6793. </p>
  6794. <div class="example">
  6795. <pre class="example">__asm__(&quot;.symver original_foo,foo@&quot;);
  6796. __asm__(&quot;.symver old_foo,foo@VERS_1.1&quot;);
  6797. __asm__(&quot;.symver old_foo1,foo@VERS_1.2&quot;);
  6798. __asm__(&quot;.symver new_foo,foo@@VERS_2.0&quot;);
  6799. </pre></div>
  6800. <p>In this example, &lsquo;<samp>foo@</samp>&rsquo; represents the symbol &lsquo;<samp>foo</samp>&rsquo; bound to the
  6801. unspecified base version of the symbol. The source file that contains this
  6802. example would define 4 C functions: &lsquo;<samp>original_foo</samp>&rsquo;, &lsquo;<samp>old_foo</samp>&rsquo;,
  6803. &lsquo;<samp>old_foo1</samp>&rsquo;, and &lsquo;<samp>new_foo</samp>&rsquo;.
  6804. </p>
  6805. <p>When you have multiple definitions of a given symbol, there needs to be
  6806. some way to specify a default version to which external references to
  6807. this symbol will be bound. You can do this with the
  6808. &lsquo;<samp>foo@@VERS_2.0</samp>&rsquo; type of &lsquo;<samp>.symver</samp>&rsquo; directive. You can only
  6809. declare one version of a symbol as the default in this manner; otherwise
  6810. you would effectively have multiple definitions of the same symbol.
  6811. </p>
  6812. <p>If you wish to bind a reference to a specific version of the symbol
  6813. within the shared library, you can use the aliases of convenience
  6814. (i.e., &lsquo;<samp>old_foo</samp>&rsquo;), or you can use the &lsquo;<samp>.symver</samp>&rsquo; directive to
  6815. specifically bind to an external version of the function in question.
  6816. </p>
  6817. <p>You can also specify the language in the version script:
  6818. </p>
  6819. <div class="example">
  6820. <pre class="example">VERSION extern &quot;lang&quot; { version-script-commands }
  6821. </pre></div>
  6822. <p>The supported &lsquo;<samp>lang</samp>&rsquo;s are &lsquo;<samp>C</samp>&rsquo;, &lsquo;<samp>C++</samp>&rsquo;, and &lsquo;<samp>Java</samp>&rsquo;.
  6823. The linker will iterate over the list of symbols at the link time and
  6824. demangle them according to &lsquo;<samp>lang</samp>&rsquo; before matching them to the
  6825. patterns specified in &lsquo;<samp>version-script-commands</samp>&rsquo;. The default
  6826. &lsquo;<samp>lang</samp>&rsquo; is &lsquo;<samp>C</samp>&rsquo;.
  6827. </p>
  6828. <p>Demangled names may contains spaces and other special characters. As
  6829. described above, you can use a glob pattern to match demangled names,
  6830. or you can use a double-quoted string to match the string exactly. In
  6831. the latter case, be aware that minor differences (such as differing
  6832. whitespace) between the version script and the demangler output will
  6833. cause a mismatch. As the exact string generated by the demangler
  6834. might change in the future, even if the mangled name does not, you
  6835. should check that all of your version directives are behaving as you
  6836. expect when you upgrade.
  6837. </p>
  6838. <hr>
  6839. <span id="Expressions"></span><div class="header">
  6840. <p>
  6841. Next: <a href="#Implicit-Linker-Scripts" accesskey="n" rel="next">Implicit Linker Scripts</a>, Previous: <a href="#VERSION" accesskey="p" rel="prev">VERSION</a>, Up: <a href="#Scripts" accesskey="u" rel="up">Scripts</a> &nbsp; [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#LD-Index" title="Index" rel="index">Index</a>]</p>
  6842. </div>
  6843. <span id="Expressions-in-Linker-Scripts"></span><h3 class="section">3.10 Expressions in Linker Scripts</h3>
  6844. <span id="index-expressions"></span>
  6845. <span id="index-arithmetic"></span>
  6846. <p>The syntax for expressions in the linker script language is identical to
  6847. that of C expressions, except that whitespace is required in some
  6848. places to resolve syntactic ambiguities. All expressions are
  6849. evaluated as integers. All expressions are evaluated in the same
  6850. size, which is 32 bits if both the host and target are 32 bits, and is
  6851. otherwise 64 bits.
  6852. </p>
  6853. <p>You can use and set symbol values in expressions.
  6854. </p>
  6855. <p>The linker defines several special purpose builtin functions for use in
  6856. expressions.
  6857. </p>
  6858. <table class="menu" border="0" cellspacing="0">
  6859. <tr><td align="left" valign="top">&bull; <a href="#Constants" accesskey="1">Constants</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">Constants
  6860. </td></tr>
  6861. <tr><td align="left" valign="top">&bull; <a href="#Symbolic-Constants" accesskey="2">Symbolic Constants</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">Symbolic constants
  6862. </td></tr>
  6863. <tr><td align="left" valign="top">&bull; <a href="#Symbols" accesskey="3">Symbols</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">Symbol Names
  6864. </td></tr>
  6865. <tr><td align="left" valign="top">&bull; <a href="#Orphan-Sections" accesskey="4">Orphan Sections</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">Orphan Sections
  6866. </td></tr>
  6867. <tr><td align="left" valign="top">&bull; <a href="#Location-Counter" accesskey="5">Location Counter</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">The Location Counter
  6868. </td></tr>
  6869. <tr><td align="left" valign="top">&bull; <a href="#Operators" accesskey="6">Operators</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">Operators
  6870. </td></tr>
  6871. <tr><td align="left" valign="top">&bull; <a href="#Evaluation" accesskey="7">Evaluation</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">Evaluation
  6872. </td></tr>
  6873. <tr><td align="left" valign="top">&bull; <a href="#Expression-Section" accesskey="8">Expression Section</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">The Section of an Expression
  6874. </td></tr>
  6875. <tr><td align="left" valign="top">&bull; <a href="#Builtin-Functions" accesskey="9">Builtin Functions</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">Builtin Functions
  6876. </td></tr>
  6877. </table>
  6878. <hr>
  6879. <span id="Constants"></span><div class="header">
  6880. <p>
  6881. Next: <a href="#Symbolic-Constants" accesskey="n" rel="next">Symbolic Constants</a>, Up: <a href="#Expressions" accesskey="u" rel="up">Expressions</a> &nbsp; [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#LD-Index" title="Index" rel="index">Index</a>]</p>
  6882. </div>
  6883. <span id="Constants-1"></span><h4 class="subsection">3.10.1 Constants</h4>
  6884. <span id="index-integer-notation"></span>
  6885. <span id="index-constants-in-linker-scripts"></span>
  6886. <p>All constants are integers.
  6887. </p>
  6888. <p>As in C, the linker considers an integer beginning with &lsquo;<samp>0</samp>&rsquo; to be
  6889. octal, and an integer beginning with &lsquo;<samp>0x</samp>&rsquo; or &lsquo;<samp>0X</samp>&rsquo; to be
  6890. hexadecimal. Alternatively the linker accepts suffixes of &lsquo;<samp>h</samp>&rsquo; or
  6891. &lsquo;<samp>H</samp>&rsquo; for hexadecimal, &lsquo;<samp>o</samp>&rsquo; or &lsquo;<samp>O</samp>&rsquo; for octal, &lsquo;<samp>b</samp>&rsquo; or
  6892. &lsquo;<samp>B</samp>&rsquo; for binary and &lsquo;<samp>d</samp>&rsquo; or &lsquo;<samp>D</samp>&rsquo; for decimal. Any integer
  6893. value without a prefix or a suffix is considered to be decimal.
  6894. </p>
  6895. <span id="index-scaled-integers"></span>
  6896. <span id="index-K-and-M-integer-suffixes"></span>
  6897. <span id="index-M-and-K-integer-suffixes"></span>
  6898. <span id="index-suffixes-for-integers"></span>
  6899. <span id="index-integer-suffixes"></span>
  6900. <p>In addition, you can use the suffixes <code>K</code> and <code>M</code> to scale a
  6901. constant by
  6902. <code>1024</code> or <code>1024*1024</code>
  6903. respectively. For example, the following
  6904. all refer to the same quantity:
  6905. </p>
  6906. <div class="example">
  6907. <pre class="example">_fourk_1 = 4K;
  6908. _fourk_2 = 4096;
  6909. _fourk_3 = 0x1000;
  6910. _fourk_4 = 10000o;
  6911. </pre></div>
  6912. <p>Note - the <code>K</code> and <code>M</code> suffixes cannot be used in
  6913. conjunction with the base suffixes mentioned above.
  6914. </p>
  6915. <hr>
  6916. <span id="Symbolic-Constants"></span><div class="header">
  6917. <p>
  6918. Next: <a href="#Symbols" accesskey="n" rel="next">Symbols</a>, Previous: <a href="#Constants" accesskey="p" rel="prev">Constants</a>, Up: <a href="#Expressions" accesskey="u" rel="up">Expressions</a> &nbsp; [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#LD-Index" title="Index" rel="index">Index</a>]</p>
  6919. </div>
  6920. <span id="Symbolic-Constants-1"></span><h4 class="subsection">3.10.2 Symbolic Constants</h4>
  6921. <span id="index-symbolic-constants"></span>
  6922. <span id="index-CONSTANT"></span>
  6923. <p>It is possible to refer to target-specific constants via the use of
  6924. the <code>CONSTANT(<var>name</var>)</code> operator, where <var>name</var> is one of:
  6925. </p>
  6926. <dl compact="compact">
  6927. <dt><code>MAXPAGESIZE</code></dt>
  6928. <dd><span id="index-MAXPAGESIZE"></span>
  6929. <p>The target&rsquo;s maximum page size.
  6930. </p>
  6931. </dd>
  6932. <dt><code>COMMONPAGESIZE</code></dt>
  6933. <dd><span id="index-COMMONPAGESIZE"></span>
  6934. <p>The target&rsquo;s default page size.
  6935. </p></dd>
  6936. </dl>
  6937. <p>So for example:
  6938. </p>
  6939. <div class="example">
  6940. <pre class="example"> .text ALIGN (CONSTANT (MAXPAGESIZE)) : { *(.text) }
  6941. </pre></div>
  6942. <p>will create a text section aligned to the largest page boundary
  6943. supported by the target.
  6944. </p>
  6945. <hr>
  6946. <span id="Symbols"></span><div class="header">
  6947. <p>
  6948. Next: <a href="#Orphan-Sections" accesskey="n" rel="next">Orphan Sections</a>, Previous: <a href="#Symbolic-Constants" accesskey="p" rel="prev">Symbolic Constants</a>, Up: <a href="#Expressions" accesskey="u" rel="up">Expressions</a> &nbsp; [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#LD-Index" title="Index" rel="index">Index</a>]</p>
  6949. </div>
  6950. <span id="Symbol-Names"></span><h4 class="subsection">3.10.3 Symbol Names</h4>
  6951. <span id="index-symbol-names"></span>
  6952. <span id="index-names"></span>
  6953. <span id="index-quoted-symbol-names"></span>
  6954. <span id="index-_0022"></span>
  6955. <p>Unless quoted, symbol names start with a letter, underscore, or period
  6956. and may include letters, digits, underscores, periods, and hyphens.
  6957. Unquoted symbol names must not conflict with any keywords. You can
  6958. specify a symbol which contains odd characters or has the same name as a
  6959. keyword by surrounding the symbol name in double quotes:
  6960. </p><div class="example">
  6961. <pre class="example">&quot;SECTION&quot; = 9;
  6962. &quot;with a space&quot; = &quot;also with a space&quot; + 10;
  6963. </pre></div>
  6964. <p>Since symbols can contain many non-alphabetic characters, it is safest
  6965. to delimit symbols with spaces. For example, &lsquo;<samp>A-B</samp>&rsquo; is one symbol,
  6966. whereas &lsquo;<samp>A - B</samp>&rsquo; is an expression involving subtraction.
  6967. </p>
  6968. <hr>
  6969. <span id="Orphan-Sections"></span><div class="header">
  6970. <p>
  6971. Next: <a href="#Location-Counter" accesskey="n" rel="next">Location Counter</a>, Previous: <a href="#Symbols" accesskey="p" rel="prev">Symbols</a>, Up: <a href="#Expressions" accesskey="u" rel="up">Expressions</a> &nbsp; [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#LD-Index" title="Index" rel="index">Index</a>]</p>
  6972. </div>
  6973. <span id="Orphan-Sections-1"></span><h4 class="subsection">3.10.4 Orphan Sections</h4>
  6974. <span id="index-orphan"></span>
  6975. <p>Orphan sections are sections present in the input files which
  6976. are not explicitly placed into the output file by the linker
  6977. script. The linker will still copy these sections into the
  6978. output file by either finding, or creating a suitable output section
  6979. in which to place the orphaned input section.
  6980. </p>
  6981. <p>If the name of an orphaned input section exactly matches the name of
  6982. an existing output section, then the orphaned input section will be
  6983. placed at the end of that output section.
  6984. </p>
  6985. <p>If there is no output section with a matching name then new output
  6986. sections will be created. Each new output section will have the same
  6987. name as the orphan section placed within it. If there are multiple
  6988. orphan sections with the same name, these will all be combined into
  6989. one new output section.
  6990. </p>
  6991. <p>If new output sections are created to hold orphaned input sections,
  6992. then the linker must decide where to place these new output sections
  6993. in relation to existing output sections. On most modern targets, the
  6994. linker attempts to place orphan sections after sections of the same
  6995. attribute, such as code vs data, loadable vs non-loadable, etc. If no
  6996. sections with matching attributes are found, or your target lacks this
  6997. support, the orphan section is placed at the end of the file.
  6998. </p>
  6999. <p>The command-line options &lsquo;<samp>--orphan-handling</samp>&rsquo; and &lsquo;<samp>--unique</samp>&rsquo;
  7000. (see <a href="#Options">Command-line Options</a>) can be used to control which
  7001. output sections an orphan is placed in.
  7002. </p>
  7003. <hr>
  7004. <span id="Location-Counter"></span><div class="header">
  7005. <p>
  7006. Next: <a href="#Operators" accesskey="n" rel="next">Operators</a>, Previous: <a href="#Orphan-Sections" accesskey="p" rel="prev">Orphan Sections</a>, Up: <a href="#Expressions" accesskey="u" rel="up">Expressions</a> &nbsp; [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#LD-Index" title="Index" rel="index">Index</a>]</p>
  7007. </div>
  7008. <span id="The-Location-Counter"></span><h4 class="subsection">3.10.5 The Location Counter</h4>
  7009. <span id="index-_002e"></span>
  7010. <span id="index-dot"></span>
  7011. <span id="index-location-counter"></span>
  7012. <span id="index-current-output-location"></span>
  7013. <p>The special linker variable <em>dot</em> &lsquo;<samp>.</samp>&rsquo; always contains the
  7014. current output location counter. Since the <code>.</code> always refers to a
  7015. location in an output section, it may only appear in an expression
  7016. within a <code>SECTIONS</code> command. The <code>.</code> symbol may appear
  7017. anywhere that an ordinary symbol is allowed in an expression.
  7018. </p>
  7019. <span id="index-holes"></span>
  7020. <p>Assigning a value to <code>.</code> will cause the location counter to be
  7021. moved. This may be used to create holes in the output section. The
  7022. location counter may not be moved backwards inside an output section,
  7023. and may not be moved backwards outside of an output section if so
  7024. doing creates areas with overlapping LMAs.
  7025. </p>
  7026. <div class="example">
  7027. <pre class="example">SECTIONS
  7028. {
  7029. output :
  7030. {
  7031. file1(.text)
  7032. . = . + 1000;
  7033. file2(.text)
  7034. . += 1000;
  7035. file3(.text)
  7036. } = 0x12345678;
  7037. }
  7038. </pre></div>
  7039. <p>In the previous example, the &lsquo;<samp>.text</samp>&rsquo; section from <samp>file1</samp> is
  7040. located at the beginning of the output section &lsquo;<samp>output</samp>&rsquo;. It is
  7041. followed by a 1000 byte gap. Then the &lsquo;<samp>.text</samp>&rsquo; section from
  7042. <samp>file2</samp> appears, also with a 1000 byte gap following before the
  7043. &lsquo;<samp>.text</samp>&rsquo; section from <samp>file3</samp>. The notation &lsquo;<samp>= 0x12345678</samp>&rsquo;
  7044. specifies what data to write in the gaps (see <a href="#Output-Section-Fill">Output Section Fill</a>).
  7045. </p>
  7046. <span id="index-dot-inside-sections"></span>
  7047. <p>Note: <code>.</code> actually refers to the byte offset from the start of the
  7048. current containing object. Normally this is the <code>SECTIONS</code>
  7049. statement, whose start address is 0, hence <code>.</code> can be used as an
  7050. absolute address. If <code>.</code> is used inside a section description
  7051. however, it refers to the byte offset from the start of that section,
  7052. not an absolute address. Thus in a script like this:
  7053. </p>
  7054. <div class="example">
  7055. <pre class="example">SECTIONS
  7056. {
  7057. . = 0x100
  7058. .text: {
  7059. *(.text)
  7060. . = 0x200
  7061. }
  7062. . = 0x500
  7063. .data: {
  7064. *(.data)
  7065. . += 0x600
  7066. }
  7067. }
  7068. </pre></div>
  7069. <p>The &lsquo;<samp>.text</samp>&rsquo; section will be assigned a starting address of 0x100
  7070. and a size of exactly 0x200 bytes, even if there is not enough data in
  7071. the &lsquo;<samp>.text</samp>&rsquo; input sections to fill this area. (If there is too
  7072. much data, an error will be produced because this would be an attempt to
  7073. move <code>.</code> backwards). The &lsquo;<samp>.data</samp>&rsquo; section will start at 0x500
  7074. and it will have an extra 0x600 bytes worth of space after the end of
  7075. the values from the &lsquo;<samp>.data</samp>&rsquo; input sections and before the end of
  7076. the &lsquo;<samp>.data</samp>&rsquo; output section itself.
  7077. </p>
  7078. <span id="index-dot-outside-sections"></span>
  7079. <p>Setting symbols to the value of the location counter outside of an
  7080. output section statement can result in unexpected values if the linker
  7081. needs to place orphan sections. For example, given the following:
  7082. </p>
  7083. <div class="example">
  7084. <pre class="example">SECTIONS
  7085. {
  7086. start_of_text = . ;
  7087. .text: { *(.text) }
  7088. end_of_text = . ;
  7089. start_of_data = . ;
  7090. .data: { *(.data) }
  7091. end_of_data = . ;
  7092. }
  7093. </pre></div>
  7094. <p>If the linker needs to place some input section, e.g. <code>.rodata</code>,
  7095. not mentioned in the script, it might choose to place that section
  7096. between <code>.text</code> and <code>.data</code>. You might think the linker
  7097. should place <code>.rodata</code> on the blank line in the above script, but
  7098. blank lines are of no particular significance to the linker. As well,
  7099. the linker doesn&rsquo;t associate the above symbol names with their
  7100. sections. Instead, it assumes that all assignments or other
  7101. statements belong to the previous output section, except for the
  7102. special case of an assignment to <code>.</code>. I.e., the linker will
  7103. place the orphan <code>.rodata</code> section as if the script was written
  7104. as follows:
  7105. </p>
  7106. <div class="example">
  7107. <pre class="example">SECTIONS
  7108. {
  7109. start_of_text = . ;
  7110. .text: { *(.text) }
  7111. end_of_text = . ;
  7112. start_of_data = . ;
  7113. .rodata: { *(.rodata) }
  7114. .data: { *(.data) }
  7115. end_of_data = . ;
  7116. }
  7117. </pre></div>
  7118. <p>This may or may not be the script author&rsquo;s intention for the value of
  7119. <code>start_of_data</code>. One way to influence the orphan section
  7120. placement is to assign the location counter to itself, as the linker
  7121. assumes that an assignment to <code>.</code> is setting the start address of
  7122. a following output section and thus should be grouped with that
  7123. section. So you could write:
  7124. </p>
  7125. <div class="example">
  7126. <pre class="example">SECTIONS
  7127. {
  7128. start_of_text = . ;
  7129. .text: { *(.text) }
  7130. end_of_text = . ;
  7131. . = . ;
  7132. start_of_data = . ;
  7133. .data: { *(.data) }
  7134. end_of_data = . ;
  7135. }
  7136. </pre></div>
  7137. <p>Now, the orphan <code>.rodata</code> section will be placed between
  7138. <code>end_of_text</code> and <code>start_of_data</code>.
  7139. </p>
  7140. <hr>
  7141. <span id="Operators"></span><div class="header">
  7142. <p>
  7143. Next: <a href="#Evaluation" accesskey="n" rel="next">Evaluation</a>, Previous: <a href="#Location-Counter" accesskey="p" rel="prev">Location Counter</a>, Up: <a href="#Expressions" accesskey="u" rel="up">Expressions</a> &nbsp; [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#LD-Index" title="Index" rel="index">Index</a>]</p>
  7144. </div>
  7145. <span id="Operators-1"></span><h4 class="subsection">3.10.6 Operators</h4>
  7146. <span id="index-operators-for-arithmetic"></span>
  7147. <span id="index-arithmetic-operators"></span>
  7148. <span id="index-precedence-in-expressions"></span>
  7149. <p>The linker recognizes the standard C set of arithmetic operators, with
  7150. the standard bindings and precedence levels:
  7151. </p><div class="example">
  7152. <pre class="example">precedence associativity Operators Notes
  7153. (highest)
  7154. 1 left ! - ~ (1)
  7155. 2 left * / %
  7156. 3 left + -
  7157. 4 left &gt;&gt; &lt;&lt;
  7158. 5 left &gt; &lt; &lt;= &gt;=
  7159. 6 left == !=
  7160. 7 left &amp;
  7161. 8 left ^
  7162. 9 left |
  7163. 10 left &amp;&amp;
  7164. 11 left ||
  7165. 12 right ? :
  7166. 13 right += -= *= /= &lt;&lt;= &gt;&gt;= &amp;= |= ^= (2)
  7167. (lowest)
  7168. </pre></div>
  7169. <p>Notes:
  7170. (1) Prefix operators
  7171. (2) See <a href="#Assignments">Assignments</a>.
  7172. </p>
  7173. <hr>
  7174. <span id="Evaluation"></span><div class="header">
  7175. <p>
  7176. Next: <a href="#Expression-Section" accesskey="n" rel="next">Expression Section</a>, Previous: <a href="#Operators" accesskey="p" rel="prev">Operators</a>, Up: <a href="#Expressions" accesskey="u" rel="up">Expressions</a> &nbsp; [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#LD-Index" title="Index" rel="index">Index</a>]</p>
  7177. </div>
  7178. <span id="Evaluation-1"></span><h4 class="subsection">3.10.7 Evaluation</h4>
  7179. <span id="index-lazy-evaluation"></span>
  7180. <span id="index-expression-evaluation-order"></span>
  7181. <p>The linker evaluates expressions lazily. It only computes the value of
  7182. an expression when absolutely necessary.
  7183. </p>
  7184. <p>The linker needs some information, such as the value of the start
  7185. address of the first section, and the origins and lengths of memory
  7186. regions, in order to do any linking at all. These values are computed
  7187. as soon as possible when the linker reads in the linker script.
  7188. </p>
  7189. <p>However, other values (such as symbol values) are not known or needed
  7190. until after storage allocation. Such values are evaluated later, when
  7191. other information (such as the sizes of output sections) is available
  7192. for use in the symbol assignment expression.
  7193. </p>
  7194. <p>The sizes of sections cannot be known until after allocation, so
  7195. assignments dependent upon these are not performed until after
  7196. allocation.
  7197. </p>
  7198. <p>Some expressions, such as those depending upon the location counter
  7199. &lsquo;<samp>.</samp>&rsquo;, must be evaluated during section allocation.
  7200. </p>
  7201. <p>If the result of an expression is required, but the value is not
  7202. available, then an error results. For example, a script like the
  7203. following
  7204. </p><div class="example">
  7205. <pre class="example">SECTIONS
  7206. {
  7207. .text 9+this_isnt_constant :
  7208. { *(.text) }
  7209. }
  7210. </pre></div>
  7211. <p>will cause the error message &lsquo;<samp>non constant expression for initial
  7212. address</samp>&rsquo;.
  7213. </p>
  7214. <hr>
  7215. <span id="Expression-Section"></span><div class="header">
  7216. <p>
  7217. Next: <a href="#Builtin-Functions" accesskey="n" rel="next">Builtin Functions</a>, Previous: <a href="#Evaluation" accesskey="p" rel="prev">Evaluation</a>, Up: <a href="#Expressions" accesskey="u" rel="up">Expressions</a> &nbsp; [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#LD-Index" title="Index" rel="index">Index</a>]</p>
  7218. </div>
  7219. <span id="The-Section-of-an-Expression"></span><h4 class="subsection">3.10.8 The Section of an Expression</h4>
  7220. <span id="index-expression-sections"></span>
  7221. <span id="index-absolute-expressions"></span>
  7222. <span id="index-relative-expressions"></span>
  7223. <span id="index-absolute-and-relocatable-symbols"></span>
  7224. <span id="index-relocatable-and-absolute-symbols"></span>
  7225. <span id="index-symbols_002c-relocatable-and-absolute"></span>
  7226. <p>Addresses and symbols may be section relative, or absolute. A section
  7227. relative symbol is relocatable. If you request relocatable output
  7228. using the &lsquo;<samp>-r</samp>&rsquo; option, a further link operation may change the
  7229. value of a section relative symbol. On the other hand, an absolute
  7230. symbol will retain the same value throughout any further link
  7231. operations.
  7232. </p>
  7233. <p>Some terms in linker expressions are addresses. This is true of
  7234. section relative symbols and for builtin functions that return an
  7235. address, such as <code>ADDR</code>, <code>LOADADDR</code>, <code>ORIGIN</code> and
  7236. <code>SEGMENT_START</code>. Other terms are simply numbers, or are builtin
  7237. functions that return a non-address value, such as <code>LENGTH</code>.
  7238. One complication is that unless you set <code>LD_FEATURE (&quot;SANE_EXPR&quot;)</code>
  7239. (see <a href="#Miscellaneous-Commands">Miscellaneous Commands</a>), numbers and absolute symbols are treated
  7240. differently depending on their location, for compatibility with older
  7241. versions of <code>ld</code>. Expressions appearing outside an output
  7242. section definition treat all numbers as absolute addresses.
  7243. Expressions appearing inside an output section definition treat
  7244. absolute symbols as numbers. If <code>LD_FEATURE (&quot;SANE_EXPR&quot;)</code> is
  7245. given, then absolute symbols and numbers are simply treated as numbers
  7246. everywhere.
  7247. </p>
  7248. <p>In the following simple example,
  7249. </p>
  7250. <div class="example">
  7251. <pre class="example">SECTIONS
  7252. {
  7253. . = 0x100;
  7254. __executable_start = 0x100;
  7255. .data :
  7256. {
  7257. . = 0x10;
  7258. __data_start = 0x10;
  7259. *(.data)
  7260. }
  7261. &hellip;
  7262. }
  7263. </pre></div>
  7264. <p>both <code>.</code> and <code>__executable_start</code> are set to the absolute
  7265. address 0x100 in the first two assignments, then both <code>.</code> and
  7266. <code>__data_start</code> are set to 0x10 relative to the <code>.data</code>
  7267. section in the second two assignments.
  7268. </p>
  7269. <p>For expressions involving numbers, relative addresses and absolute
  7270. addresses, ld follows these rules to evaluate terms:
  7271. </p>
  7272. <ul>
  7273. <li> Unary operations on an absolute address or number, and binary
  7274. operations on two absolute addresses or two numbers, or between one
  7275. absolute address and a number, apply the operator to the value(s).
  7276. </li><li> Unary operations on a relative address, and binary operations on two
  7277. relative addresses in the same section or between one relative address
  7278. and a number, apply the operator to the offset part of the address(es).
  7279. </li><li> Other binary operations, that is, between two relative addresses not
  7280. in the same section, or between a relative address and an absolute
  7281. address, first convert any non-absolute term to an absolute address
  7282. before applying the operator.
  7283. </li></ul>
  7284. <p>The result section of each sub-expression is as follows:
  7285. </p>
  7286. <ul>
  7287. <li> An operation involving only numbers results in a number.
  7288. </li><li> The result of comparisons, &lsquo;<samp>&amp;&amp;</samp>&rsquo; and &lsquo;<samp>||</samp>&rsquo; is also a number.
  7289. </li><li> The result of other binary arithmetic and logical operations on two
  7290. relative addresses in the same section or two absolute addresses
  7291. (after above conversions) is also a number when
  7292. <code>LD_FEATURE (&quot;SANE_EXPR&quot;)</code> or inside an output section definition
  7293. but an absolute address otherwise.
  7294. </li><li> The result of other operations on relative addresses or one
  7295. relative address and a number, is a relative address in the same
  7296. section as the relative operand(s).
  7297. </li><li> The result of other operations on absolute addresses (after above
  7298. conversions) is an absolute address.
  7299. </li></ul>
  7300. <p>You can use the builtin function <code>ABSOLUTE</code> to force an expression
  7301. to be absolute when it would otherwise be relative. For example, to
  7302. create an absolute symbol set to the address of the end of the output
  7303. section &lsquo;<samp>.data</samp>&rsquo;:
  7304. </p><div class="example">
  7305. <pre class="example">SECTIONS
  7306. {
  7307. .data : { *(.data) _edata = ABSOLUTE(.); }
  7308. }
  7309. </pre></div>
  7310. <p>If &lsquo;<samp>ABSOLUTE</samp>&rsquo; were not used, &lsquo;<samp>_edata</samp>&rsquo; would be relative to the
  7311. &lsquo;<samp>.data</samp>&rsquo; section.
  7312. </p>
  7313. <p>Using <code>LOADADDR</code> also forces an expression absolute, since this
  7314. particular builtin function returns an absolute address.
  7315. </p>
  7316. <hr>
  7317. <span id="Builtin-Functions"></span><div class="header">
  7318. <p>
  7319. Previous: <a href="#Expression-Section" accesskey="p" rel="prev">Expression Section</a>, Up: <a href="#Expressions" accesskey="u" rel="up">Expressions</a> &nbsp; [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#LD-Index" title="Index" rel="index">Index</a>]</p>
  7320. </div>
  7321. <span id="Builtin-Functions-1"></span><h4 class="subsection">3.10.9 Builtin Functions</h4>
  7322. <span id="index-functions-in-expressions"></span>
  7323. <p>The linker script language includes a number of builtin functions for
  7324. use in linker script expressions.
  7325. </p>
  7326. <dl compact="compact">
  7327. <dt><code>ABSOLUTE(<var>exp</var>)</code></dt>
  7328. <dd><span id="index-ABSOLUTE_0028exp_0029"></span>
  7329. <span id="index-expression_002c-absolute"></span>
  7330. <p>Return the absolute (non-relocatable, as opposed to non-negative) value
  7331. of the expression <var>exp</var>. Primarily useful to assign an absolute
  7332. value to a symbol within a section definition, where symbol values are
  7333. normally section relative. See <a href="#Expression-Section">Expression Section</a>.
  7334. </p>
  7335. </dd>
  7336. <dt><code>ADDR(<var>section</var>)</code></dt>
  7337. <dd><span id="index-ADDR_0028section_0029"></span>
  7338. <span id="index-section-address-in-expression"></span>
  7339. <p>Return the address (VMA) of the named <var>section</var>. Your
  7340. script must previously have defined the location of that section. In
  7341. the following example, <code>start_of_output_1</code>, <code>symbol_1</code> and
  7342. <code>symbol_2</code> are assigned equivalent values, except that
  7343. <code>symbol_1</code> will be relative to the <code>.output1</code> section while
  7344. the other two will be absolute:
  7345. </p><div class="example">
  7346. <pre class="example">SECTIONS { &hellip;
  7347. .output1 :
  7348. {
  7349. start_of_output_1 = ABSOLUTE(.);
  7350. &hellip;
  7351. }
  7352. .output :
  7353. {
  7354. symbol_1 = ADDR(.output1);
  7355. symbol_2 = start_of_output_1;
  7356. }
  7357. &hellip; }
  7358. </pre></div>
  7359. </dd>
  7360. <dt><code>ALIGN(<var>align</var>)</code></dt>
  7361. <dt><code>ALIGN(<var>exp</var>,<var>align</var>)</code></dt>
  7362. <dd><span id="index-ALIGN_0028align_0029"></span>
  7363. <span id="index-ALIGN_0028exp_002calign_0029"></span>
  7364. <span id="index-round-up-location-counter"></span>
  7365. <span id="index-align-location-counter"></span>
  7366. <span id="index-round-up-expression"></span>
  7367. <span id="index-align-expression"></span>
  7368. <p>Return the location counter (<code>.</code>) or arbitrary expression aligned
  7369. to the next <var>align</var> boundary. The single operand <code>ALIGN</code>
  7370. doesn&rsquo;t change the value of the location counter&mdash;it just does
  7371. arithmetic on it. The two operand <code>ALIGN</code> allows an arbitrary
  7372. expression to be aligned upwards (<code>ALIGN(<var>align</var>)</code> is
  7373. equivalent to <code>ALIGN(ABSOLUTE(.), <var>align</var>)</code>).
  7374. </p>
  7375. <p>Here is an example which aligns the output <code>.data</code> section to the
  7376. next <code>0x2000</code> byte boundary after the preceding section and sets a
  7377. variable within the section to the next <code>0x8000</code> boundary after the
  7378. input sections:
  7379. </p><div class="example">
  7380. <pre class="example">SECTIONS { &hellip;
  7381. .data ALIGN(0x2000): {
  7382. *(.data)
  7383. variable = ALIGN(0x8000);
  7384. }
  7385. &hellip; }
  7386. </pre></div>
  7387. <p>The first use of <code>ALIGN</code> in this example specifies the location of
  7388. a section because it is used as the optional <var>address</var> attribute of
  7389. a section definition (see <a href="#Output-Section-Address">Output Section Address</a>). The second use
  7390. of <code>ALIGN</code> is used to defines the value of a symbol.
  7391. </p>
  7392. <p>The builtin function <code>NEXT</code> is closely related to <code>ALIGN</code>.
  7393. </p>
  7394. </dd>
  7395. <dt><code>ALIGNOF(<var>section</var>)</code></dt>
  7396. <dd><span id="index-ALIGNOF_0028section_0029"></span>
  7397. <span id="index-section-alignment"></span>
  7398. <p>Return the alignment in bytes of the named <var>section</var>, if that section has
  7399. been allocated, or zero if the section has not been allocated. If the
  7400. section does not exist in the linker script the linker will report an
  7401. error. If <var>section</var> is <code>NEXT_SECTION</code> then <code>ALIGNOF</code> will
  7402. return the alignment of the next allocated section specified in the
  7403. linker script, or zero if there is no such section. In the following
  7404. example, the alignment of the <code>.output</code> section is stored as the
  7405. first value in that section.
  7406. </p><div class="example">
  7407. <pre class="example">SECTIONS{ &hellip;
  7408. .output {
  7409. LONG (ALIGNOF (.output))
  7410. &hellip;
  7411. }
  7412. &hellip; }
  7413. </pre></div>
  7414. </dd>
  7415. <dt><code>BLOCK(<var>exp</var>)</code></dt>
  7416. <dd><span id="index-BLOCK_0028exp_0029"></span>
  7417. <p>This is a synonym for <code>ALIGN</code>, for compatibility with older linker
  7418. scripts. It is most often seen when setting the address of an output
  7419. section.
  7420. </p>
  7421. </dd>
  7422. <dt><code>DATA_SEGMENT_ALIGN(<var>maxpagesize</var>, <var>commonpagesize</var>)</code></dt>
  7423. <dd><span id="index-DATA_005fSEGMENT_005fALIGN_0028maxpagesize_002c-commonpagesize_0029"></span>
  7424. <p>This is equivalent to either
  7425. </p><div class="example">
  7426. <pre class="example">(ALIGN(<var>maxpagesize</var>) + (. &amp; (<var>maxpagesize</var> - 1)))
  7427. </pre></div>
  7428. <p>or
  7429. </p><div class="example">
  7430. <pre class="example">(ALIGN(<var>maxpagesize</var>)
  7431. + ((. + <var>commonpagesize</var> - 1) &amp; (<var>maxpagesize</var> - <var>commonpagesize</var>)))
  7432. </pre></div>
  7433. <p>depending on whether the latter uses fewer <var>commonpagesize</var> sized pages
  7434. for the data segment (area between the result of this expression and
  7435. <code>DATA_SEGMENT_END</code>) than the former or not.
  7436. If the latter form is used, it means <var>commonpagesize</var> bytes of runtime
  7437. memory will be saved at the expense of up to <var>commonpagesize</var> wasted
  7438. bytes in the on-disk file.
  7439. </p>
  7440. <p>This expression can only be used directly in <code>SECTIONS</code> commands, not in
  7441. any output section descriptions and only once in the linker script.
  7442. <var>commonpagesize</var> should be less or equal to <var>maxpagesize</var> and should
  7443. be the system page size the object wants to be optimized for while still
  7444. running on system page sizes up to <var>maxpagesize</var>. Note however
  7445. that &lsquo;<samp>-z relro</samp>&rsquo; protection will not be effective if the system
  7446. page size is larger than <var>commonpagesize</var>.
  7447. </p>
  7448. <p>Example:
  7449. </p><div class="example">
  7450. <pre class="example"> . = DATA_SEGMENT_ALIGN(0x10000, 0x2000);
  7451. </pre></div>
  7452. </dd>
  7453. <dt><code>DATA_SEGMENT_END(<var>exp</var>)</code></dt>
  7454. <dd><span id="index-DATA_005fSEGMENT_005fEND_0028exp_0029"></span>
  7455. <p>This defines the end of data segment for <code>DATA_SEGMENT_ALIGN</code>
  7456. evaluation purposes.
  7457. </p>
  7458. <div class="example">
  7459. <pre class="example"> . = DATA_SEGMENT_END(.);
  7460. </pre></div>
  7461. </dd>
  7462. <dt><code>DATA_SEGMENT_RELRO_END(<var>offset</var>, <var>exp</var>)</code></dt>
  7463. <dd><span id="index-DATA_005fSEGMENT_005fRELRO_005fEND_0028offset_002c-exp_0029"></span>
  7464. <p>This defines the end of the <code>PT_GNU_RELRO</code> segment when
  7465. &lsquo;<samp>-z relro</samp>&rsquo; option is used.
  7466. When &lsquo;<samp>-z relro</samp>&rsquo; option is not present, <code>DATA_SEGMENT_RELRO_END</code>
  7467. does nothing, otherwise <code>DATA_SEGMENT_ALIGN</code> is padded so that
  7468. <var>exp</var> + <var>offset</var> is aligned to the <var>commonpagesize</var>
  7469. argument given to <code>DATA_SEGMENT_ALIGN</code>. If present in the linker
  7470. script, it must be placed between <code>DATA_SEGMENT_ALIGN</code> and
  7471. <code>DATA_SEGMENT_END</code>. Evaluates to the second argument plus any
  7472. padding needed at the end of the <code>PT_GNU_RELRO</code> segment due to
  7473. section alignment.
  7474. </p>
  7475. <div class="example">
  7476. <pre class="example"> . = DATA_SEGMENT_RELRO_END(24, .);
  7477. </pre></div>
  7478. </dd>
  7479. <dt><code>DEFINED(<var>symbol</var>)</code></dt>
  7480. <dd><span id="index-DEFINED_0028symbol_0029"></span>
  7481. <span id="index-symbol-defaults"></span>
  7482. <p>Return 1 if <var>symbol</var> is in the linker global symbol table and is
  7483. defined before the statement using DEFINED in the script, otherwise
  7484. return 0. You can use this function to provide
  7485. default values for symbols. For example, the following script fragment
  7486. shows how to set a global symbol &lsquo;<samp>begin</samp>&rsquo; to the first location in
  7487. the &lsquo;<samp>.text</samp>&rsquo; section&mdash;but if a symbol called &lsquo;<samp>begin</samp>&rsquo; already
  7488. existed, its value is preserved:
  7489. </p>
  7490. <div class="example">
  7491. <pre class="example">SECTIONS { &hellip;
  7492. .text : {
  7493. begin = DEFINED(begin) ? begin : . ;
  7494. &hellip;
  7495. }
  7496. &hellip;
  7497. }
  7498. </pre></div>
  7499. </dd>
  7500. <dt><code>LENGTH(<var>memory</var>)</code></dt>
  7501. <dd><span id="index-LENGTH_0028memory_0029"></span>
  7502. <p>Return the length of the memory region named <var>memory</var>.
  7503. </p>
  7504. </dd>
  7505. <dt><code>LOADADDR(<var>section</var>)</code></dt>
  7506. <dd><span id="index-LOADADDR_0028section_0029"></span>
  7507. <span id="index-section-load-address-in-expression"></span>
  7508. <p>Return the absolute LMA of the named <var>section</var>. (see <a href="#Output-Section-LMA">Output Section LMA</a>).
  7509. </p>
  7510. </dd>
  7511. <dt><code>LOG2CEIL(<var>exp</var>)</code></dt>
  7512. <dd><span id="index-LOG2CEIL_0028exp_0029"></span>
  7513. <p>Return the binary logarithm of <var>exp</var> rounded towards infinity.
  7514. <code>LOG2CEIL(0)</code> returns 0.
  7515. </p>
  7516. <span id="index-MAX"></span>
  7517. </dd>
  7518. <dt><code>MAX(<var>exp1</var>, <var>exp2</var>)</code></dt>
  7519. <dd><p>Returns the maximum of <var>exp1</var> and <var>exp2</var>.
  7520. </p>
  7521. <span id="index-MIN"></span>
  7522. </dd>
  7523. <dt><code>MIN(<var>exp1</var>, <var>exp2</var>)</code></dt>
  7524. <dd><p>Returns the minimum of <var>exp1</var> and <var>exp2</var>.
  7525. </p>
  7526. </dd>
  7527. <dt><code>NEXT(<var>exp</var>)</code></dt>
  7528. <dd><span id="index-NEXT_0028exp_0029"></span>
  7529. <span id="index-unallocated-address_002c-next"></span>
  7530. <p>Return the next unallocated address that is a multiple of <var>exp</var>.
  7531. This function is closely related to <code>ALIGN(<var>exp</var>)</code>; unless you
  7532. use the <code>MEMORY</code> command to define discontinuous memory for the
  7533. output file, the two functions are equivalent.
  7534. </p>
  7535. </dd>
  7536. <dt><code>ORIGIN(<var>memory</var>)</code></dt>
  7537. <dd><span id="index-ORIGIN_0028memory_0029"></span>
  7538. <p>Return the origin of the memory region named <var>memory</var>.
  7539. </p>
  7540. </dd>
  7541. <dt><code>SEGMENT_START(<var>segment</var>, <var>default</var>)</code></dt>
  7542. <dd><span id="index-SEGMENT_005fSTART_0028segment_002c-default_0029"></span>
  7543. <p>Return the base address of the named <var>segment</var>. If an explicit
  7544. value has already been given for this segment (with a command-line
  7545. &lsquo;<samp>-T</samp>&rsquo; option) then that value will be returned otherwise the value
  7546. will be <var>default</var>. At present, the &lsquo;<samp>-T</samp>&rsquo; command-line option
  7547. can only be used to set the base address for the &ldquo;text&rdquo;, &ldquo;data&rdquo;, and
  7548. &ldquo;bss&rdquo; sections, but you can use <code>SEGMENT_START</code> with any segment
  7549. name.
  7550. </p>
  7551. </dd>
  7552. <dt><code>SIZEOF(<var>section</var>)</code></dt>
  7553. <dd><span id="index-SIZEOF_0028section_0029"></span>
  7554. <span id="index-section-size"></span>
  7555. <p>Return the size in bytes of the named <var>section</var>, if that section has
  7556. been allocated, or zero if the section has not been allocated. If the
  7557. section does not exist in the linker script the linker will report an
  7558. error. If <var>section</var> is <code>NEXT_SECTION</code> then <code>SIZEOF</code> will
  7559. return the alignment of the next allocated section specified in the
  7560. linker script, or zero if there is no such section. In the following
  7561. example, <code>symbol_1</code> and <code>symbol_2</code> are assigned identical
  7562. values:
  7563. </p><div class="example">
  7564. <pre class="example">SECTIONS{ &hellip;
  7565. .output {
  7566. .start = . ;
  7567. &hellip;
  7568. .end = . ;
  7569. }
  7570. symbol_1 = .end - .start ;
  7571. symbol_2 = SIZEOF(.output);
  7572. &hellip; }
  7573. </pre></div>
  7574. </dd>
  7575. <dt><code>SIZEOF_HEADERS</code></dt>
  7576. <dd><span id="index-SIZEOF_005fHEADERS"></span>
  7577. <span id="index-header-size"></span>
  7578. <p>Return the size in bytes of the output file&rsquo;s headers. This is
  7579. information which appears at the start of the output file. You can use
  7580. this number when setting the start address of the first section, if you
  7581. choose, to facilitate paging.
  7582. </p>
  7583. <span id="index-not-enough-room-for-program-headers"></span>
  7584. <span id="index-program-headers_002c-not-enough-room"></span>
  7585. <p>When producing an ELF output file, if the linker script uses the
  7586. <code>SIZEOF_HEADERS</code> builtin function, the linker must compute the
  7587. number of program headers before it has determined all the section
  7588. addresses and sizes. If the linker later discovers that it needs
  7589. additional program headers, it will report an error &lsquo;<samp>not enough
  7590. room for program headers</samp>&rsquo;. To avoid this error, you must avoid using
  7591. the <code>SIZEOF_HEADERS</code> function, or you must rework your linker
  7592. script to avoid forcing the linker to use additional program headers, or
  7593. you must define the program headers yourself using the <code>PHDRS</code>
  7594. command (see <a href="#PHDRS">PHDRS</a>).
  7595. </p></dd>
  7596. </dl>
  7597. <hr>
  7598. <span id="Implicit-Linker-Scripts"></span><div class="header">
  7599. <p>
  7600. Previous: <a href="#Expressions" accesskey="p" rel="prev">Expressions</a>, Up: <a href="#Scripts" accesskey="u" rel="up">Scripts</a> &nbsp; [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#LD-Index" title="Index" rel="index">Index</a>]</p>
  7601. </div>
  7602. <span id="Implicit-Linker-Scripts-1"></span><h3 class="section">3.11 Implicit Linker Scripts</h3>
  7603. <span id="index-implicit-linker-scripts"></span>
  7604. <p>If you specify a linker input file which the linker can not recognize as
  7605. an object file or an archive file, it will try to read the file as a
  7606. linker script. If the file can not be parsed as a linker script, the
  7607. linker will report an error.
  7608. </p>
  7609. <p>An implicit linker script will not replace the default linker script.
  7610. </p>
  7611. <p>Typically an implicit linker script would contain only symbol
  7612. assignments, or the <code>INPUT</code>, <code>GROUP</code>, or <code>VERSION</code>
  7613. commands.
  7614. </p>
  7615. <p>Any input files read because of an implicit linker script will be read
  7616. at the position in the command line where the implicit linker script was
  7617. read. This can affect archive searching.
  7618. </p>
  7619. <hr>
  7620. <span id="Plugins"></span><div class="header">
  7621. <p>
  7622. Next: <a href="#Special-Sections" accesskey="n" rel="next">Special Sections</a>, Previous: <a href="#Scripts" accesskey="p" rel="prev">Scripts</a>, Up: <a href="#Top" accesskey="u" rel="up">Top</a> &nbsp; [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#LD-Index" title="Index" rel="index">Index</a>]</p>
  7623. </div>
  7624. <span id="Linker-Plugins"></span><h2 class="chapter">4 Linker Plugins</h2>
  7625. <span id="index-plugins"></span>
  7626. <span id="index-linker-plugins"></span>
  7627. <p>The linker can use dynamically loaded plugins to modify its behavior.
  7628. For example, the link-time optimization feature that some compilers
  7629. support is implemented with a linker plugin.
  7630. </p>
  7631. <p>Currently there is only one plugin shipped by default, but more may
  7632. be added here later.
  7633. </p>
  7634. <p>Plugins are enabled via the use of the <samp>-plugin <var>name</var></samp>
  7635. command line option. See <a href="#Options">Options</a>.
  7636. </p>
  7637. <table class="menu" border="0" cellspacing="0">
  7638. <tr><td align="left" valign="top">&bull; <a href="#libdep-Plugin" accesskey="1">libdep Plugin</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">Static Library Dependencies Plugin
  7639. </td></tr>
  7640. </table>
  7641. <hr>
  7642. <span id="libdep-Plugin"></span><div class="header">
  7643. <p>
  7644. Up: <a href="#Plugins" accesskey="u" rel="up">Plugins</a> &nbsp; [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#LD-Index" title="Index" rel="index">Index</a>]</p>
  7645. </div>
  7646. <span id="Static-Library-Dependencies-Plugin"></span><h3 class="section">4.1 Static Library Dependencies Plugin</h3>
  7647. <span id="index-static-library-dependencies"></span>
  7648. <p>Originally, static libraries were contained in an archive file consisting
  7649. just of a collection of relocatable object files. Later they evolved to
  7650. optionally include a symbol table, to assist in finding the needed objects
  7651. within a library. There their evolution ended, and dynamic libraries
  7652. rose to ascendance.
  7653. </p>
  7654. <p>One useful feature of dynamic libraries was that, more than just collecting
  7655. multiple objects into a single file, they also included a list of their
  7656. dependencies, such that one could specify just the name of a single dynamic
  7657. library at link time, and all of its dependencies would be implicitly
  7658. referenced as well. But static libraries lacked this feature, so if a
  7659. link invocation was switched from using dynamic libraries to static
  7660. libraries, the link command would usually fail unless it was rewritten to
  7661. explicitly list the dependencies of the static library.
  7662. </p>
  7663. <p>The GNU <code>ar</code> utility now supports a <samp>--record-libdeps</samp> option
  7664. to embed dependency lists into static libraries as well, and the <samp>libdep</samp>
  7665. plugin may be used to read this dependency information at link time. The
  7666. dependency information is stored as a single string, carrying <samp>-l</samp>
  7667. and <samp>-L</samp> arguments as they would normally appear in a linker
  7668. command line. As such, the information can be written with any text
  7669. utility and stored into any archive, even if GNU <code>ar</code> is not
  7670. being used to create the archive. The information is stored in an
  7671. archive member named &lsquo;<samp>__.LIBDEP</samp>&rsquo;.
  7672. </p>
  7673. <p>For example, given a library <samp>libssl.a</samp> that depends on another
  7674. library <samp>libcrypto.a</samp> which may be found in <samp>/usr/local/lib</samp>,
  7675. the &lsquo;<samp>__.LIBDEP</samp>&rsquo; member of <samp>libssl.a</samp> would contain
  7676. </p>
  7677. <div class="example">
  7678. <pre class="example">-L/usr/local/lib -lcrypto
  7679. </pre></div>
  7680. <hr>
  7681. <span id="Special-Sections"></span><div class="header">
  7682. <p>
  7683. Next: <a href="#Machine-Dependent" accesskey="n" rel="next">Machine Dependent</a>, Previous: <a href="#Plugins" accesskey="p" rel="prev">Plugins</a>, Up: <a href="#Top" accesskey="u" rel="up">Top</a> &nbsp; [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#LD-Index" title="Index" rel="index">Index</a>]</p>
  7684. </div>
  7685. <span id="Special-Sections-1"></span><h2 class="chapter">5 Special Sections</h2>
  7686. <p>When linking ELF format object files <code>ld</code> treats some sections
  7687. in a special, non standard manner. This part of the manual describes
  7688. these sections.
  7689. </p>
  7690. <dl compact="compact">
  7691. <dt><code>.gnu.warning</code></dt>
  7692. <dd><p>The contents of any section with this name are assumed to be an ascii
  7693. format warning message. The contents will be displayed to the user if
  7694. the sections appears in any input file, but the section will not be
  7695. copied into the output image. If the <samp>--fatal-warnings</samp> option
  7696. is enabled then the warnings - if any are encountered - will also stop
  7697. the link from completing.
  7698. </p>
  7699. <p>Note - the &lsquo;<samp>.gnu.warning</samp>&rsquo; section is not subject to linker
  7700. garbage collection or orphan handling.
  7701. </p>
  7702. </dd>
  7703. <dt><code>.gnu.warning.<var>SYM</var></code></dt>
  7704. <dd><p>The contents of any section whoes name starts with the prefix
  7705. &lsquo;<samp>.gnu.warning.</samp>&rsquo; and then finishes with the name of a symbol is
  7706. treated in a similar fashion to the &lsquo;<samp>.gnu.warning</samp>&rsquo; section, but
  7707. only if the named symbol is referenced. So for example the contents
  7708. of a section called &lsquo;<samp>.gnu.warning.foo</samp>&rsquo; will be displayed as
  7709. warning message if, and only if, the symbol &lsquo;<samp>foo</samp>&rsquo; is referenced
  7710. by one or more of the input files. This includes object files pulled
  7711. in from static libraries, shared objects needed to complete the link
  7712. and so on.
  7713. </p>
  7714. <p>Note - because these warning messages are generated before the linker
  7715. performs garbage collection (if enabled) it is possible for a warning
  7716. to be displayed for a symbol that is later removed and then never
  7717. appears in the final output.
  7718. </p>
  7719. </dd>
  7720. <dt><code>.note.gnu.property</code></dt>
  7721. <dd><p>When the linker combines sections of this name it will merge them
  7722. together according to various rules encoded into the notes
  7723. themselves. Therefore the contents of the output .note.gnu.property
  7724. section may not correspond to a simple concatenation of the input
  7725. sections. If the <samp>-Map</samp> option has been used to request a
  7726. linker map then details of any property merging will be included in
  7727. the map.
  7728. </p>
  7729. </dd>
  7730. </dl>
  7731. <hr>
  7732. <span id="Machine-Dependent"></span><div class="header">
  7733. <p>
  7734. Next: <a href="#BFD" accesskey="n" rel="next">BFD</a>, Previous: <a href="#Special-Sections" accesskey="p" rel="prev">Special Sections</a>, Up: <a href="#Top" accesskey="u" rel="up">Top</a> &nbsp; [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#LD-Index" title="Index" rel="index">Index</a>]</p>
  7735. </div>
  7736. <span id="Machine-Dependent-Features"></span><h2 class="chapter">6 Machine Dependent Features</h2>
  7737. <span id="index-machine-dependencies"></span>
  7738. <p><code>ld</code> has additional features on some platforms; the following
  7739. sections describe them. Machines where <code>ld</code> has no additional
  7740. functionality are not listed.
  7741. </p>
  7742. <table class="menu" border="0" cellspacing="0">
  7743. <tr><td align="left" valign="top">&bull; <a href="#H8_002f300" accesskey="1">H8/300</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top"><code>ld</code> and the H8/300
  7744. </td></tr>
  7745. <tr><td align="left" valign="top">&bull; <a href="#M68HC11_002f68HC12" accesskey="2">M68HC11/68HC12</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top"><code>ld</code> and the Motorola 68HC11 and 68HC12 families
  7746. </td></tr>
  7747. <tr><td align="left" valign="top">&bull; <a href="#ARM" accesskey="3">ARM</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top"><code>ld</code> and the ARM family
  7748. </td></tr>
  7749. <tr><td align="left" valign="top">&bull; <a href="#HPPA-ELF32" accesskey="4">HPPA ELF32</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top"><code>ld</code> and HPPA 32-bit ELF
  7750. </td></tr>
  7751. <tr><td align="left" valign="top">&bull; <a href="#M68K" accesskey="5">M68K</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top"><code>ld</code> and the Motorola 68K family
  7752. </td></tr>
  7753. <tr><td align="left" valign="top">&bull; <a href="#MIPS" accesskey="6">MIPS</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top"><code>ld</code> and the MIPS family
  7754. </td></tr>
  7755. <tr><td align="left" valign="top">&bull; <a href="#MMIX" accesskey="7">MMIX</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top"><code>ld</code> and MMIX
  7756. </td></tr>
  7757. <tr><td align="left" valign="top">&bull; <a href="#MSP430" accesskey="8">MSP430</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top"><code>ld</code> and MSP430
  7758. </td></tr>
  7759. <tr><td align="left" valign="top">&bull; <a href="#NDS32" accesskey="9">NDS32</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top"><code>ld</code> and NDS32
  7760. </td></tr>
  7761. <tr><td align="left" valign="top">&bull; <a href="#Nios-II">Nios II</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top"><code>ld</code> and the Altera Nios II
  7762. </td></tr>
  7763. <tr><td align="left" valign="top">&bull; <a href="#PowerPC-ELF32">PowerPC ELF32</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top"><code>ld</code> and PowerPC 32-bit ELF Support
  7764. </td></tr>
  7765. <tr><td align="left" valign="top">&bull; <a href="#PowerPC64-ELF64">PowerPC64 ELF64</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top"><code>ld</code> and PowerPC64 64-bit ELF Support
  7766. </td></tr>
  7767. <tr><td align="left" valign="top">&bull; <a href="#S_002f390-ELF">S/390 ELF</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top"><code>ld</code> and S/390 ELF Support
  7768. </td></tr>
  7769. <tr><td align="left" valign="top">&bull; <a href="#SPU-ELF">SPU ELF</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top"><code>ld</code> and SPU ELF Support
  7770. </td></tr>
  7771. <tr><td align="left" valign="top">&bull; <a href="#TI-COFF">TI COFF</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top"><code>ld</code> and TI COFF
  7772. </td></tr>
  7773. <tr><td align="left" valign="top">&bull; <a href="#WIN32">WIN32</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top"><code>ld</code> and WIN32 (cygwin/mingw)
  7774. </td></tr>
  7775. <tr><td align="left" valign="top">&bull; <a href="#Xtensa">Xtensa</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top"><code>ld</code> and Xtensa Processors
  7776. </td></tr>
  7777. </table>
  7778. <hr>
  7779. <span id="H8_002f300"></span><div class="header">
  7780. <p>
  7781. Next: <a href="#M68HC11_002f68HC12" accesskey="n" rel="next">M68HC11/68HC12</a>, Up: <a href="#Machine-Dependent" accesskey="u" rel="up">Machine Dependent</a> &nbsp; [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#LD-Index" title="Index" rel="index">Index</a>]</p>
  7782. </div>
  7783. <span id="ld-and-the-H8_002f300"></span><h3 class="section">6.1 <code>ld</code> and the H8/300</h3>
  7784. <span id="index-H8_002f300-support"></span>
  7785. <p>For the H8/300, <code>ld</code> can perform these global optimizations when
  7786. you specify the &lsquo;<samp>--relax</samp>&rsquo; command-line option.
  7787. </p>
  7788. <dl compact="compact">
  7789. <dd><span id="index-relaxing-on-H8_002f300"></span>
  7790. </dd>
  7791. <dt><em>relaxing address modes</em></dt>
  7792. <dd><p><code>ld</code> finds all <code>jsr</code> and <code>jmp</code> instructions whose
  7793. targets are within eight bits, and turns them into eight-bit
  7794. program-counter relative <code>bsr</code> and <code>bra</code> instructions,
  7795. respectively.
  7796. </p>
  7797. <span id="index-synthesizing-on-H8_002f300"></span>
  7798. </dd>
  7799. <dt><em>synthesizing instructions</em></dt>
  7800. <dd><p><code>ld</code> finds all <code>mov.b</code> instructions which use the
  7801. sixteen-bit absolute address form, but refer to the top
  7802. page of memory, and changes them to use the eight-bit address form.
  7803. (That is: the linker turns &lsquo;<samp>mov.b <code>@</code><var>aa</var>:16</samp>&rsquo; into
  7804. &lsquo;<samp>mov.b <code>@</code><var>aa</var>:8</samp>&rsquo; whenever the address <var>aa</var> is in the
  7805. top page of memory).
  7806. </p>
  7807. <p><code>ld</code> finds all <code>mov</code> instructions which use the register
  7808. indirect with 32-bit displacement addressing mode, but use a small
  7809. displacement inside 16-bit displacement range, and changes them to use
  7810. the 16-bit displacement form. (That is: the linker turns &lsquo;<samp>mov.b
  7811. <code>@</code><var>d</var>:32,ERx</samp>&rsquo; into &lsquo;<samp>mov.b <code>@</code><var>d</var>:16,ERx</samp>&rsquo;
  7812. whenever the displacement <var>d</var> is in the 16 bit signed integer
  7813. range. Only implemented in ELF-format ld).
  7814. </p>
  7815. </dd>
  7816. <dt><em>bit manipulation instructions</em></dt>
  7817. <dd><p><code>ld</code> finds all bit manipulation instructions like <code>band, bclr,
  7818. biand, bild, bior, bist, bixor, bld, bnot, bor, bset, bst, btst, bxor</code>
  7819. which use 32 bit and 16 bit absolute address form, but refer to the top
  7820. page of memory, and changes them to use the 8 bit address form.
  7821. (That is: the linker turns &lsquo;<samp>bset #xx:3,<code>@</code><var>aa</var>:32</samp>&rsquo; into
  7822. &lsquo;<samp>bset #xx:3,<code>@</code><var>aa</var>:8</samp>&rsquo; whenever the address <var>aa</var> is in
  7823. the top page of memory).
  7824. </p>
  7825. </dd>
  7826. <dt><em>system control instructions</em></dt>
  7827. <dd><p><code>ld</code> finds all <code>ldc.w, stc.w</code> instructions which use the
  7828. 32 bit absolute address form, but refer to the top page of memory, and
  7829. changes them to use 16 bit address form.
  7830. (That is: the linker turns &lsquo;<samp>ldc.w <code>@</code><var>aa</var>:32,ccr</samp>&rsquo; into
  7831. &lsquo;<samp>ldc.w <code>@</code><var>aa</var>:16,ccr</samp>&rsquo; whenever the address <var>aa</var> is in
  7832. the top page of memory).
  7833. </p></dd>
  7834. </dl>
  7835. <hr>
  7836. <span id="M68HC11_002f68HC12"></span><div class="header">
  7837. <p>
  7838. Next: <a href="#ARM" accesskey="n" rel="next">ARM</a>, Previous: <a href="#H8_002f300" accesskey="p" rel="prev">H8/300</a>, Up: <a href="#Machine-Dependent" accesskey="u" rel="up">Machine Dependent</a> &nbsp; [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#LD-Index" title="Index" rel="index">Index</a>]</p>
  7839. </div>
  7840. <span id="ld-and-the-Motorola-68HC11-and-68HC12-families"></span><h3 class="section">6.2 <code>ld</code> and the Motorola 68HC11 and 68HC12 families</h3>
  7841. <span id="index-M68HC11-and-68HC12-support"></span>
  7842. <span id="Linker-Relaxation"></span><h4 class="subsection">6.2.1 Linker Relaxation</h4>
  7843. <p>For the Motorola 68HC11, <code>ld</code> can perform these global
  7844. optimizations when you specify the &lsquo;<samp>--relax</samp>&rsquo; command-line option.
  7845. </p>
  7846. <dl compact="compact">
  7847. <dd><span id="index-relaxing-on-M68HC11"></span>
  7848. </dd>
  7849. <dt><em>relaxing address modes</em></dt>
  7850. <dd><p><code>ld</code> finds all <code>jsr</code> and <code>jmp</code> instructions whose
  7851. targets are within eight bits, and turns them into eight-bit
  7852. program-counter relative <code>bsr</code> and <code>bra</code> instructions,
  7853. respectively.
  7854. </p>
  7855. <p><code>ld</code> also looks at all 16-bit extended addressing modes and
  7856. transforms them in a direct addressing mode when the address is in
  7857. page 0 (between 0 and 0x0ff).
  7858. </p>
  7859. </dd>
  7860. <dt><em>relaxing gcc instruction group</em></dt>
  7861. <dd><p>When <code>gcc</code> is called with <samp>-mrelax</samp>, it can emit group
  7862. of instructions that the linker can optimize to use a 68HC11 direct
  7863. addressing mode. These instructions consists of <code>bclr</code> or
  7864. <code>bset</code> instructions.
  7865. </p>
  7866. </dd>
  7867. </dl>
  7868. <span id="Trampoline-Generation"></span><h4 class="subsection">6.2.2 Trampoline Generation</h4>
  7869. <span id="index-trampoline-generation-on-M68HC11"></span>
  7870. <span id="index-trampoline-generation-on-M68HC12"></span>
  7871. <p>For 68HC11 and 68HC12, <code>ld</code> can generate trampoline code to
  7872. call a far function using a normal <code>jsr</code> instruction. The linker
  7873. will also change the relocation to some far function to use the
  7874. trampoline address instead of the function address. This is typically the
  7875. case when a pointer to a function is taken. The pointer will in fact
  7876. point to the function trampoline.
  7877. </p>
  7878. <hr>
  7879. <span id="ARM"></span><div class="header">
  7880. <p>
  7881. Next: <a href="#HPPA-ELF32" accesskey="n" rel="next">HPPA ELF32</a>, Previous: <a href="#M68HC11_002f68HC12" accesskey="p" rel="prev">M68HC11/68HC12</a>, Up: <a href="#Machine-Dependent" accesskey="u" rel="up">Machine Dependent</a> &nbsp; [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#LD-Index" title="Index" rel="index">Index</a>]</p>
  7882. </div>
  7883. <span id="ld-and-the-ARM-family"></span><h3 class="section">6.3 <code>ld</code> and the ARM family</h3>
  7884. <span id="index-ARM-interworking-support"></span>
  7885. <span id="index-_002d_002dsupport_002dold_002dcode"></span>
  7886. <p>For the ARM, <code>ld</code> will generate code stubs to allow functions calls
  7887. between ARM and Thumb code. These stubs only work with code that has
  7888. been compiled and assembled with the &lsquo;<samp>-mthumb-interwork</samp>&rsquo; command
  7889. line option. If it is necessary to link with old ARM object files or
  7890. libraries, which have not been compiled with the -mthumb-interwork
  7891. option then the &lsquo;<samp>--support-old-code</samp>&rsquo; command-line switch should be
  7892. given to the linker. This will make it generate larger stub functions
  7893. which will work with non-interworking aware ARM code. Note, however,
  7894. the linker does not support generating stubs for function calls to
  7895. non-interworking aware Thumb code.
  7896. </p>
  7897. <span id="index-thumb-entry-point"></span>
  7898. <span id="index-entry-point_002c-thumb"></span>
  7899. <span id="index-_002d_002dthumb_002dentry_003dentry"></span>
  7900. <p>The &lsquo;<samp>--thumb-entry</samp>&rsquo; switch is a duplicate of the generic
  7901. &lsquo;<samp>--entry</samp>&rsquo; switch, in that it sets the program&rsquo;s starting address.
  7902. But it also sets the bottom bit of the address, so that it can be
  7903. branched to using a BX instruction, and the program will start
  7904. executing in Thumb mode straight away.
  7905. </p>
  7906. <span id="index-PE-import-table-prefixing"></span>
  7907. <span id="index-_002d_002duse_002dnul_002dprefixed_002dimport_002dtables"></span>
  7908. <p>The &lsquo;<samp>--use-nul-prefixed-import-tables</samp>&rsquo; switch is specifying, that
  7909. the import tables idata4 and idata5 have to be generated with a zero
  7910. element prefix for import libraries. This is the old style to generate
  7911. import tables. By default this option is turned off.
  7912. </p>
  7913. <span id="index-BE8"></span>
  7914. <span id="index-_002d_002dbe8"></span>
  7915. <p>The &lsquo;<samp>--be8</samp>&rsquo; switch instructs <code>ld</code> to generate BE8 format
  7916. executables. This option is only valid when linking big-endian
  7917. objects - ie ones which have been assembled with the <samp>-EB</samp>
  7918. option. The resulting image will contain big-endian data and
  7919. little-endian code.
  7920. </p>
  7921. <span id="index-TARGET1"></span>
  7922. <span id="index-_002d_002dtarget1_002drel"></span>
  7923. <span id="index-_002d_002dtarget1_002dabs"></span>
  7924. <p>The &lsquo;<samp>R_ARM_TARGET1</samp>&rsquo; relocation is typically used for entries in the
  7925. &lsquo;<samp>.init_array</samp>&rsquo; section. It is interpreted as either &lsquo;<samp>R_ARM_REL32</samp>&rsquo;
  7926. or &lsquo;<samp>R_ARM_ABS32</samp>&rsquo;, depending on the target. The &lsquo;<samp>--target1-rel</samp>&rsquo;
  7927. and &lsquo;<samp>--target1-abs</samp>&rsquo; switches override the default.
  7928. </p>
  7929. <span id="index-TARGET2"></span>
  7930. <span id="index-_002d_002dtarget2_003dtype"></span>
  7931. <p>The &lsquo;<samp>--target2=type</samp>&rsquo; switch overrides the default definition of the
  7932. &lsquo;<samp>R_ARM_TARGET2</samp>&rsquo; relocation. Valid values for &lsquo;<samp>type</samp>&rsquo;, their
  7933. meanings, and target defaults are as follows:
  7934. </p><dl compact="compact">
  7935. <dt>&lsquo;<samp>rel</samp>&rsquo;</dt>
  7936. <dd><p>&lsquo;<samp>R_ARM_REL32</samp>&rsquo; (arm*-*-elf, arm*-*-eabi)
  7937. </p></dd>
  7938. <dt>&lsquo;<samp>abs</samp>&rsquo;</dt>
  7939. <dd><p>&lsquo;<samp>R_ARM_ABS32</samp>&rsquo;
  7940. </p></dd>
  7941. <dt>&lsquo;<samp>got-rel</samp>&rsquo;</dt>
  7942. <dd><p>&lsquo;<samp>R_ARM_GOT_PREL</samp>&rsquo; (arm*-*-linux, arm*-*-*bsd)
  7943. </p></dd>
  7944. </dl>
  7945. <span id="index-FIX_005fV4BX"></span>
  7946. <span id="index-_002d_002dfix_002dv4bx"></span>
  7947. <p>The &lsquo;<samp>R_ARM_V4BX</samp>&rsquo; relocation (defined by the ARM AAELF
  7948. specification) enables objects compiled for the ARMv4 architecture to be
  7949. interworking-safe when linked with other objects compiled for ARMv4t, but
  7950. also allows pure ARMv4 binaries to be built from the same ARMv4 objects.
  7951. </p>
  7952. <p>In the latter case, the switch <samp>--fix-v4bx</samp> must be passed to the
  7953. linker, which causes v4t <code>BX rM</code> instructions to be rewritten as
  7954. <code>MOV PC,rM</code>, since v4 processors do not have a <code>BX</code> instruction.
  7955. </p>
  7956. <p>In the former case, the switch should not be used, and &lsquo;<samp>R_ARM_V4BX</samp>&rsquo;
  7957. relocations are ignored.
  7958. </p>
  7959. <span id="index-FIX_005fV4BX_005fINTERWORKING"></span>
  7960. <span id="index-_002d_002dfix_002dv4bx_002dinterworking"></span>
  7961. <p>Replace <code>BX rM</code> instructions identified by &lsquo;<samp>R_ARM_V4BX</samp>&rsquo;
  7962. relocations with a branch to the following veneer:
  7963. </p>
  7964. <div class="example">
  7965. <pre class="example">TST rM, #1
  7966. MOVEQ PC, rM
  7967. BX Rn
  7968. </pre></div>
  7969. <p>This allows generation of libraries/applications that work on ARMv4 cores
  7970. and are still interworking safe. Note that the above veneer clobbers the
  7971. condition flags, so may cause incorrect program behavior in rare cases.
  7972. </p>
  7973. <span id="index-USE_005fBLX"></span>
  7974. <span id="index-_002d_002duse_002dblx"></span>
  7975. <p>The &lsquo;<samp>--use-blx</samp>&rsquo; switch enables the linker to use ARM/Thumb
  7976. BLX instructions (available on ARMv5t and above) in various
  7977. situations. Currently it is used to perform calls via the PLT from Thumb
  7978. code using BLX rather than using BX and a mode-switching stub before
  7979. each PLT entry. This should lead to such calls executing slightly faster.
  7980. </p>
  7981. <span id="index-VFP11_005fDENORM_005fFIX"></span>
  7982. <span id="index-_002d_002dvfp11_002ddenorm_002dfix"></span>
  7983. <p>The &lsquo;<samp>--vfp11-denorm-fix</samp>&rsquo; switch enables a link-time workaround for a
  7984. bug in certain VFP11 coprocessor hardware, which sometimes allows
  7985. instructions with denorm operands (which must be handled by support code)
  7986. to have those operands overwritten by subsequent instructions before
  7987. the support code can read the intended values.
  7988. </p>
  7989. <p>The bug may be avoided in scalar mode if you allow at least one
  7990. intervening instruction between a VFP11 instruction which uses a register
  7991. and another instruction which writes to the same register, or at least two
  7992. intervening instructions if vector mode is in use. The bug only affects
  7993. full-compliance floating-point mode: you do not need this workaround if
  7994. you are using &quot;runfast&quot; mode. Please contact ARM for further details.
  7995. </p>
  7996. <p>If you know you are using buggy VFP11 hardware, you can
  7997. enable this workaround by specifying the linker option
  7998. &lsquo;<samp>--vfp-denorm-fix=scalar</samp>&rsquo; if you are using the VFP11 scalar
  7999. mode only, or &lsquo;<samp>--vfp-denorm-fix=vector</samp>&rsquo; if you are using
  8000. vector mode (the latter also works for scalar code). The default is
  8001. &lsquo;<samp>--vfp-denorm-fix=none</samp>&rsquo;.
  8002. </p>
  8003. <p>If the workaround is enabled, instructions are scanned for
  8004. potentially-troublesome sequences, and a veneer is created for each
  8005. such sequence which may trigger the erratum. The veneer consists of the
  8006. first instruction of the sequence and a branch back to the subsequent
  8007. instruction. The original instruction is then replaced with a branch to
  8008. the veneer. The extra cycles required to call and return from the veneer
  8009. are sufficient to avoid the erratum in both the scalar and vector cases.
  8010. </p>
  8011. <span id="index-ARM1176-erratum-workaround"></span>
  8012. <span id="index-_002d_002dfix_002darm1176"></span>
  8013. <span id="index-_002d_002dno_002dfix_002darm1176"></span>
  8014. <p>The &lsquo;<samp>--fix-arm1176</samp>&rsquo; switch enables a link-time workaround for an erratum
  8015. in certain ARM1176 processors. The workaround is enabled by default if you
  8016. are targeting ARM v6 (excluding ARM v6T2) or earlier. It can be disabled
  8017. unconditionally by specifying &lsquo;<samp>--no-fix-arm1176</samp>&rsquo;.
  8018. </p>
  8019. <p>Further information is available in the &ldquo;ARM1176JZ-S and ARM1176JZF-S
  8020. Programmer Advice Notice&rdquo; available on the ARM documentation website at:
  8021. http://infocenter.arm.com/.
  8022. </p>
  8023. <span id="index-STM32L4xx-erratum-workaround"></span>
  8024. <span id="index-_002d_002dfix_002dstm32l4xx_002d629360"></span>
  8025. <p>The &lsquo;<samp>--fix-stm32l4xx-629360</samp>&rsquo; switch enables a link-time
  8026. workaround for a bug in the bus matrix / memory controller for some of
  8027. the STM32 Cortex-M4 based products (STM32L4xx). When accessing
  8028. off-chip memory via the affected bus for bus reads of 9 words or more,
  8029. the bus can generate corrupt data and/or abort. These are only
  8030. core-initiated accesses (not DMA), and might affect any access:
  8031. integer loads such as LDM, POP and floating-point loads such as VLDM,
  8032. VPOP. Stores are not affected.
  8033. </p>
  8034. <p>The bug can be avoided by splitting memory accesses into the
  8035. necessary chunks to keep bus reads below 8 words.
  8036. </p>
  8037. <p>The workaround is not enabled by default, this is equivalent to use
  8038. &lsquo;<samp>--fix-stm32l4xx-629360=none</samp>&rsquo;. If you know you are using buggy
  8039. STM32L4xx hardware, you can enable the workaround by specifying the
  8040. linker option &lsquo;<samp>--fix-stm32l4xx-629360</samp>&rsquo;, or the equivalent
  8041. &lsquo;<samp>--fix-stm32l4xx-629360=default</samp>&rsquo;.
  8042. </p>
  8043. <p>If the workaround is enabled, instructions are scanned for
  8044. potentially-troublesome sequences, and a veneer is created for each
  8045. such sequence which may trigger the erratum. The veneer consists in a
  8046. replacement sequence emulating the behaviour of the original one and a
  8047. branch back to the subsequent instruction. The original instruction is
  8048. then replaced with a branch to the veneer.
  8049. </p>
  8050. <p>The workaround does not always preserve the memory access order for
  8051. the LDMDB instruction, when the instruction loads the PC.
  8052. </p>
  8053. <p>The workaround is not able to handle problematic instructions when
  8054. they are in the middle of an IT block, since a branch is not allowed
  8055. there. In that case, the linker reports a warning and no replacement
  8056. occurs.
  8057. </p>
  8058. <p>The workaround is not able to replace problematic instructions with a
  8059. PC-relative branch instruction if the &lsquo;<samp>.text</samp>&rsquo; section is too
  8060. large. In that case, when the branch that replaces the original code
  8061. cannot be encoded, the linker reports a warning and no replacement
  8062. occurs.
  8063. </p>
  8064. <span id="index-NO_005fENUM_005fSIZE_005fWARNING"></span>
  8065. <span id="index-_002d_002dno_002denum_002dsize_002dwarning"></span>
  8066. <p>The <samp>--no-enum-size-warning</samp> switch prevents the linker from
  8067. warning when linking object files that specify incompatible EABI
  8068. enumeration size attributes. For example, with this switch enabled,
  8069. linking of an object file using 32-bit enumeration values with another
  8070. using enumeration values fitted into the smallest possible space will
  8071. not be diagnosed.
  8072. </p>
  8073. <span id="index-NO_005fWCHAR_005fSIZE_005fWARNING"></span>
  8074. <span id="index-_002d_002dno_002dwchar_002dsize_002dwarning"></span>
  8075. <p>The <samp>--no-wchar-size-warning</samp> switch prevents the linker from
  8076. warning when linking object files that specify incompatible EABI
  8077. <code>wchar_t</code> size attributes. For example, with this switch enabled,
  8078. linking of an object file using 32-bit <code>wchar_t</code> values with another
  8079. using 16-bit <code>wchar_t</code> values will not be diagnosed.
  8080. </p>
  8081. <span id="index-PIC_005fVENEER"></span>
  8082. <span id="index-_002d_002dpic_002dveneer"></span>
  8083. <p>The &lsquo;<samp>--pic-veneer</samp>&rsquo; switch makes the linker use PIC sequences for
  8084. ARM/Thumb interworking veneers, even if the rest of the binary
  8085. is not PIC. This avoids problems on uClinux targets where
  8086. &lsquo;<samp>--emit-relocs</samp>&rsquo; is used to generate relocatable binaries.
  8087. </p>
  8088. <span id="index-STUB_005fGROUP_005fSIZE"></span>
  8089. <span id="index-_002d_002dstub_002dgroup_002dsize_003dN"></span>
  8090. <p>The linker will automatically generate and insert small sequences of
  8091. code into a linked ARM ELF executable whenever an attempt is made to
  8092. perform a function call to a symbol that is too far away. The
  8093. placement of these sequences of instructions - called stubs - is
  8094. controlled by the command-line option <samp>--stub-group-size=N</samp>.
  8095. The placement is important because a poor choice can create a need for
  8096. duplicate stubs, increasing the code size. The linker will try to
  8097. group stubs together in order to reduce interruptions to the flow of
  8098. code, but it needs guidance as to how big these groups should be and
  8099. where they should be placed.
  8100. </p>
  8101. <p>The value of &lsquo;<samp>N</samp>&rsquo;, the parameter to the
  8102. <samp>--stub-group-size=</samp> option controls where the stub groups are
  8103. placed. If it is negative then all stubs are placed after the first
  8104. branch that needs them. If it is positive then the stubs can be
  8105. placed either before or after the branches that need them. If the
  8106. value of &lsquo;<samp>N</samp>&rsquo; is 1 (either +1 or -1) then the linker will choose
  8107. exactly where to place groups of stubs, using its built in heuristics.
  8108. A value of &lsquo;<samp>N</samp>&rsquo; greater than 1 (or smaller than -1) tells the
  8109. linker that a single group of stubs can service at most &lsquo;<samp>N</samp>&rsquo; bytes
  8110. from the input sections.
  8111. </p>
  8112. <p>The default, if <samp>--stub-group-size=</samp> is not specified, is
  8113. &lsquo;<samp>N = +1</samp>&rsquo;.
  8114. </p>
  8115. <p>Farcalls stubs insertion is fully supported for the ARM-EABI target
  8116. only, because it relies on object files properties not present
  8117. otherwise.
  8118. </p>
  8119. <span id="index-Cortex_002dA8-erratum-workaround"></span>
  8120. <span id="index-_002d_002dfix_002dcortex_002da8"></span>
  8121. <span id="index-_002d_002dno_002dfix_002dcortex_002da8"></span>
  8122. <p>The &lsquo;<samp>--fix-cortex-a8</samp>&rsquo; switch enables a link-time workaround for an erratum in certain Cortex-A8 processors. The workaround is enabled by default if you are targeting the ARM v7-A architecture profile. It can be enabled otherwise by specifying &lsquo;<samp>--fix-cortex-a8</samp>&rsquo;, or disabled unconditionally by specifying &lsquo;<samp>--no-fix-cortex-a8</samp>&rsquo;.
  8123. </p>
  8124. <p>The erratum only affects Thumb-2 code. Please contact ARM for further details.
  8125. </p>
  8126. <span id="index-Cortex_002dA53-erratum-835769-workaround"></span>
  8127. <span id="index-_002d_002dfix_002dcortex_002da53_002d835769"></span>
  8128. <span id="index-_002d_002dno_002dfix_002dcortex_002da53_002d835769"></span>
  8129. <p>The &lsquo;<samp>--fix-cortex-a53-835769</samp>&rsquo; switch enables a link-time workaround for erratum 835769 present on certain early revisions of Cortex-A53 processors. The workaround is disabled by default. It can be enabled by specifying &lsquo;<samp>--fix-cortex-a53-835769</samp>&rsquo;, or disabled unconditionally by specifying &lsquo;<samp>--no-fix-cortex-a53-835769</samp>&rsquo;.
  8130. </p>
  8131. <p>Please contact ARM for further details.
  8132. </p>
  8133. <span id="index-_002d_002dmerge_002dexidx_002dentries"></span>
  8134. <span id="index-_002d_002dno_002dmerge_002dexidx_002dentries-1"></span>
  8135. <span id="index-Merging-exidx-entries"></span>
  8136. <p>The &lsquo;<samp>--no-merge-exidx-entries</samp>&rsquo; switch disables the merging of adjacent exidx entries in debuginfo.
  8137. </p>
  8138. <span id="index-_002d_002dlong_002dplt"></span>
  8139. <span id="index-32_002dbit-PLT-entries"></span>
  8140. <p>The &lsquo;<samp>--long-plt</samp>&rsquo; option enables the use of 16 byte PLT entries
  8141. which support up to 4Gb of code. The default is to use 12 byte PLT
  8142. entries which only support 512Mb of code.
  8143. </p>
  8144. <span id="index-_002d_002dno_002dapply_002ddynamic_002drelocs"></span>
  8145. <span id="index-AArch64-rela-addend"></span>
  8146. <p>The &lsquo;<samp>--no-apply-dynamic-relocs</samp>&rsquo; option makes AArch64 linker do not apply
  8147. link-time values for dynamic relocations.
  8148. </p>
  8149. <span id="index-Placement-of-SG-veneers"></span>
  8150. <p>All SG veneers are placed in the special output section <code>.gnu.sgstubs</code>.
  8151. Its start address must be set, either with the command-line option
  8152. &lsquo;<samp>--section-start</samp>&rsquo; or in a linker script, to indicate where to place these
  8153. veneers in memory.
  8154. </p>
  8155. <span id="index-_002d_002dcmse_002dimplib"></span>
  8156. <span id="index-Secure-gateway-import-library"></span>
  8157. <p>The &lsquo;<samp>--cmse-implib</samp>&rsquo; option requests that the import libraries
  8158. specified by the &lsquo;<samp>--out-implib</samp>&rsquo; and &lsquo;<samp>--in-implib</samp>&rsquo; options are
  8159. secure gateway import libraries, suitable for linking a non-secure
  8160. executable against secure code as per ARMv8-M Security Extensions.
  8161. </p>
  8162. <span id="index-_002d_002din_002dimplib_003dfile"></span>
  8163. <span id="index-Input-import-library"></span>
  8164. <p>The &lsquo;<samp>--in-implib=file</samp>&rsquo; specifies an input import library whose symbols
  8165. must keep the same address in the executable being produced. A warning is
  8166. given if no &lsquo;<samp>--out-implib</samp>&rsquo; is given but new symbols have been introduced
  8167. in the executable that should be listed in its import library. Otherwise, if
  8168. &lsquo;<samp>--out-implib</samp>&rsquo; is specified, the symbols are added to the output import
  8169. library. A warning is also given if some symbols present in the input import
  8170. library have disappeared from the executable. This option is only effective
  8171. for Secure Gateway import libraries, ie. when &lsquo;<samp>--cmse-implib</samp>&rsquo; is
  8172. specified.
  8173. </p>
  8174. <hr>
  8175. <span id="HPPA-ELF32"></span><div class="header">
  8176. <p>
  8177. Next: <a href="#M68K" accesskey="n" rel="next">M68K</a>, Previous: <a href="#ARM" accesskey="p" rel="prev">ARM</a>, Up: <a href="#Machine-Dependent" accesskey="u" rel="up">Machine Dependent</a> &nbsp; [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#LD-Index" title="Index" rel="index">Index</a>]</p>
  8178. </div>
  8179. <span id="ld-and-HPPA-32_002dbit-ELF-Support"></span><h3 class="section">6.4 <code>ld</code> and HPPA 32-bit ELF Support</h3>
  8180. <span id="index-HPPA-multiple-sub_002dspace-stubs"></span>
  8181. <span id="index-_002d_002dmulti_002dsubspace"></span>
  8182. <p>When generating a shared library, <code>ld</code> will by default generate
  8183. import stubs suitable for use with a single sub-space application.
  8184. The &lsquo;<samp>--multi-subspace</samp>&rsquo; switch causes <code>ld</code> to generate export
  8185. stubs, and different (larger) import stubs suitable for use with
  8186. multiple sub-spaces.
  8187. </p>
  8188. <span id="index-HPPA-stub-grouping"></span>
  8189. <span id="index-_002d_002dstub_002dgroup_002dsize_003dN-1"></span>
  8190. <p>Long branch stubs and import/export stubs are placed by <code>ld</code> in
  8191. stub sections located between groups of input sections.
  8192. &lsquo;<samp>--stub-group-size</samp>&rsquo; specifies the maximum size of a group of input
  8193. sections handled by one stub section. Since branch offsets are signed,
  8194. a stub section may serve two groups of input sections, one group before
  8195. the stub section, and one group after it. However, when using
  8196. conditional branches that require stubs, it may be better (for branch
  8197. prediction) that stub sections only serve one group of input sections.
  8198. A negative value for &lsquo;<samp>N</samp>&rsquo; chooses this scheme, ensuring that
  8199. branches to stubs always use a negative offset. Two special values of
  8200. &lsquo;<samp>N</samp>&rsquo; are recognized, &lsquo;<samp>1</samp>&rsquo; and &lsquo;<samp>-1</samp>&rsquo;. These both instruct
  8201. <code>ld</code> to automatically size input section groups for the branch types
  8202. detected, with the same behaviour regarding stub placement as other
  8203. positive or negative values of &lsquo;<samp>N</samp>&rsquo; respectively.
  8204. </p>
  8205. <p>Note that &lsquo;<samp>--stub-group-size</samp>&rsquo; does not split input sections. A
  8206. single input section larger than the group size specified will of course
  8207. create a larger group (of one section). If input sections are too
  8208. large, it may not be possible for a branch to reach its stub.
  8209. </p>
  8210. <hr>
  8211. <span id="M68K"></span><div class="header">
  8212. <p>
  8213. Next: <a href="#MIPS" accesskey="n" rel="next">MIPS</a>, Previous: <a href="#HPPA-ELF32" accesskey="p" rel="prev">HPPA ELF32</a>, Up: <a href="#Machine-Dependent" accesskey="u" rel="up">Machine Dependent</a> &nbsp; [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#LD-Index" title="Index" rel="index">Index</a>]</p>
  8214. </div>
  8215. <span id="ld-and-the-Motorola-68K-family"></span><h3 class="section">6.5 <code>ld</code> and the Motorola 68K family</h3>
  8216. <span id="index-Motorola-68K-GOT-generation"></span>
  8217. <span id="index-_002d_002dgot_003dtype"></span>
  8218. <p>The &lsquo;<samp>--got=<var>type</var></samp>&rsquo; option lets you choose the GOT generation scheme.
  8219. The choices are &lsquo;<samp>single</samp>&rsquo;, &lsquo;<samp>negative</samp>&rsquo;, &lsquo;<samp>multigot</samp>&rsquo; and
  8220. &lsquo;<samp>target</samp>&rsquo;. When &lsquo;<samp>target</samp>&rsquo; is selected the linker chooses
  8221. the default GOT generation scheme for the current target.
  8222. &lsquo;<samp>single</samp>&rsquo; tells the linker to generate a single GOT with
  8223. entries only at non-negative offsets.
  8224. &lsquo;<samp>negative</samp>&rsquo; instructs the linker to generate a single GOT with
  8225. entries at both negative and positive offsets. Not all environments
  8226. support such GOTs.
  8227. &lsquo;<samp>multigot</samp>&rsquo; allows the linker to generate several GOTs in the
  8228. output file. All GOT references from a single input object
  8229. file access the same GOT, but references from different input object
  8230. files might access different GOTs. Not all environments support such GOTs.
  8231. </p>
  8232. <hr>
  8233. <span id="MIPS"></span><div class="header">
  8234. <p>
  8235. Next: <a href="#MMIX" accesskey="n" rel="next">MMIX</a>, Previous: <a href="#M68K" accesskey="p" rel="prev">M68K</a>, Up: <a href="#Machine-Dependent" accesskey="u" rel="up">Machine Dependent</a> &nbsp; [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#LD-Index" title="Index" rel="index">Index</a>]</p>
  8236. </div>
  8237. <span id="ld-and-the-MIPS-family"></span><h3 class="section">6.6 <code>ld</code> and the MIPS family</h3>
  8238. <span id="index-MIPS-microMIPS-instruction-choice-selection"></span>
  8239. <span id="index-_002d_002dinsn32-1"></span>
  8240. <span id="index-_002d_002dno_002dinsn32-1"></span>
  8241. <p>The &lsquo;<samp>--insn32</samp>&rsquo; and &lsquo;<samp>--no-insn32</samp>&rsquo; options control the choice of
  8242. microMIPS instructions used in code generated by the linker, such as that
  8243. in the PLT or lazy binding stubs, or in relaxation. If &lsquo;<samp>--insn32</samp>&rsquo; is
  8244. used, then the linker only uses 32-bit instruction encodings. By default
  8245. or if &lsquo;<samp>--no-insn32</samp>&rsquo; is used, all instruction encodings are used,
  8246. including 16-bit ones where possible.
  8247. </p>
  8248. <span id="index-MIPS-branch-relocation-check-control"></span>
  8249. <span id="index-_002d_002dignore_002dbranch_002disa-1"></span>
  8250. <span id="index-_002d_002dno_002dignore_002dbranch_002disa-1"></span>
  8251. <p>The &lsquo;<samp>--ignore-branch-isa</samp>&rsquo; and &lsquo;<samp>--no-ignore-branch-isa</samp>&rsquo; options
  8252. control branch relocation checks for invalid ISA mode transitions. If
  8253. &lsquo;<samp>--ignore-branch-isa</samp>&rsquo; is used, then the linker accepts any branch
  8254. relocations and any ISA mode transition required is lost in relocation
  8255. calculation, except for some cases of <code>BAL</code> instructions which meet
  8256. relaxation conditions and are converted to equivalent <code>JALX</code>
  8257. instructions as the associated relocation is calculated. By default
  8258. or if &lsquo;<samp>--no-ignore-branch-isa</samp>&rsquo; is used a check is made causing
  8259. the loss of an ISA mode transition to produce an error.
  8260. </p>
  8261. <hr>
  8262. <span id="MMIX"></span><div class="header">
  8263. <p>
  8264. Next: <a href="#MSP430" accesskey="n" rel="next">MSP430</a>, Previous: <a href="#MIPS" accesskey="p" rel="prev">MIPS</a>, Up: <a href="#Machine-Dependent" accesskey="u" rel="up">Machine Dependent</a> &nbsp; [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#LD-Index" title="Index" rel="index">Index</a>]</p>
  8265. </div>
  8266. <span id="ld-and-MMIX"></span><h3 class="section">6.7 <code>ld</code> and MMIX</h3>
  8267. <p>For MMIX, there is a choice of generating <code>ELF</code> object files or
  8268. <code>mmo</code> object files when linking. The simulator <code>mmix</code>
  8269. understands the <code>mmo</code> format. The binutils <code>objcopy</code> utility
  8270. can translate between the two formats.
  8271. </p>
  8272. <p>There is one special section, the &lsquo;<samp>.MMIX.reg_contents</samp>&rsquo; section.
  8273. Contents in this section is assumed to correspond to that of global
  8274. registers, and symbols referring to it are translated to special symbols,
  8275. equal to registers. In a final link, the start address of the
  8276. &lsquo;<samp>.MMIX.reg_contents</samp>&rsquo; section corresponds to the first allocated
  8277. global register multiplied by 8. Register <code>$255</code> is not included in
  8278. this section; it is always set to the program entry, which is at the
  8279. symbol <code>Main</code> for <code>mmo</code> files.
  8280. </p>
  8281. <p>Global symbols with the prefix <code>__.MMIX.start.</code>, for example
  8282. <code>__.MMIX.start..text</code> and <code>__.MMIX.start..data</code> are special.
  8283. The default linker script uses these to set the default start address
  8284. of a section.
  8285. </p>
  8286. <p>Initial and trailing multiples of zero-valued 32-bit words in a section,
  8287. are left out from an mmo file.
  8288. </p>
  8289. <hr>
  8290. <span id="MSP430"></span><div class="header">
  8291. <p>
  8292. Next: <a href="#NDS32" accesskey="n" rel="next">NDS32</a>, Previous: <a href="#MMIX" accesskey="p" rel="prev">MMIX</a>, Up: <a href="#Machine-Dependent" accesskey="u" rel="up">Machine Dependent</a> &nbsp; [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#LD-Index" title="Index" rel="index">Index</a>]</p>
  8293. </div>
  8294. <span id="ld-and-MSP430"></span><h3 class="section">6.8 <code>ld</code> and MSP430</h3>
  8295. <p>For the MSP430 it is possible to select the MPU architecture. The flag &lsquo;<samp>-m [mpu type]</samp>&rsquo;
  8296. will select an appropriate linker script for selected MPU type. (To get a list of known MPUs
  8297. just pass &lsquo;<samp>-m help</samp>&rsquo; option to the linker).
  8298. </p>
  8299. <span id="index-MSP430-extra-sections"></span>
  8300. <p>The linker will recognize some extra sections which are MSP430 specific:
  8301. </p>
  8302. <dl compact="compact">
  8303. <dt><code>&lsquo;<samp>.vectors</samp>&rsquo;</code></dt>
  8304. <dd><p>Defines a portion of ROM where interrupt vectors located.
  8305. </p>
  8306. </dd>
  8307. <dt><code>&lsquo;<samp>.bootloader</samp>&rsquo;</code></dt>
  8308. <dd><p>Defines the bootloader portion of the ROM (if applicable). Any code
  8309. in this section will be uploaded to the MPU.
  8310. </p>
  8311. </dd>
  8312. <dt><code>&lsquo;<samp>.infomem</samp>&rsquo;</code></dt>
  8313. <dd><p>Defines an information memory section (if applicable). Any code in
  8314. this section will be uploaded to the MPU.
  8315. </p>
  8316. </dd>
  8317. <dt><code>&lsquo;<samp>.infomemnobits</samp>&rsquo;</code></dt>
  8318. <dd><p>This is the same as the &lsquo;<samp>.infomem</samp>&rsquo; section except that any code
  8319. in this section will not be uploaded to the MPU.
  8320. </p>
  8321. </dd>
  8322. <dt><code>&lsquo;<samp>.noinit</samp>&rsquo;</code></dt>
  8323. <dd><p>Denotes a portion of RAM located above &lsquo;<samp>.bss</samp>&rsquo; section.
  8324. </p>
  8325. <p>The last two sections are used by gcc.
  8326. </p></dd>
  8327. </dl>
  8328. <dl compact="compact">
  8329. <dd><span id="index-MSP430-Options"></span>
  8330. <span id="index-_002d_002dcode_002dregion"></span>
  8331. </dd>
  8332. <dt><samp>--code-region=[either,lower,upper,none]</samp></dt>
  8333. <dd><p>This will transform .text* sections to [either,lower,upper].text* sections. The
  8334. argument passed to GCC for -mcode-region is propagated to the linker
  8335. using this option.
  8336. </p>
  8337. <span id="index-_002d_002ddata_002dregion"></span>
  8338. </dd>
  8339. <dt><samp>--data-region=[either,lower,upper,none]</samp></dt>
  8340. <dd><p>This will transform .data*, .bss* and .rodata* sections to
  8341. [either,lower,upper].[data,bss,rodata]* sections. The argument passed to GCC
  8342. for -mdata-region is propagated to the linker using this option.
  8343. </p>
  8344. <span id="index-_002d_002ddisable_002dsec_002dtransformation"></span>
  8345. </dd>
  8346. <dt><samp>--disable-sec-transformation</samp></dt>
  8347. <dd><p>Prevent the transformation of sections as specified by the <code>--code-region</code>
  8348. and <code>--data-region</code> options.
  8349. This is useful if you are compiling and linking using a single call to the GCC
  8350. wrapper, and want to compile the source files using -m[code,data]-region but
  8351. not transform the sections for prebuilt libraries and objects.
  8352. </p></dd>
  8353. </dl>
  8354. <hr>
  8355. <span id="NDS32"></span><div class="header">
  8356. <p>
  8357. Next: <a href="#Nios-II" accesskey="n" rel="next">Nios II</a>, Previous: <a href="#MSP430" accesskey="p" rel="prev">MSP430</a>, Up: <a href="#Machine-Dependent" accesskey="u" rel="up">Machine Dependent</a> &nbsp; [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#LD-Index" title="Index" rel="index">Index</a>]</p>
  8358. </div>
  8359. <span id="ld-and-NDS32"></span><h3 class="section">6.9 <code>ld</code> and NDS32</h3>
  8360. <span id="index-relaxing-on-NDS32"></span>
  8361. <p>For NDS32, there are some options to select relaxation behavior. The linker
  8362. relaxes objects according to these options.
  8363. </p>
  8364. <dl compact="compact">
  8365. <dt><code>&lsquo;<samp>--m[no-]fp-as-gp</samp>&rsquo;</code></dt>
  8366. <dd><p>Disable/enable fp-as-gp relaxation.
  8367. </p>
  8368. </dd>
  8369. <dt><code>&lsquo;<samp>--mexport-symbols=FILE</samp>&rsquo;</code></dt>
  8370. <dd><p>Exporting symbols and their address into FILE as linker script.
  8371. </p>
  8372. </dd>
  8373. <dt><code>&lsquo;<samp>--m[no-]ex9</samp>&rsquo;</code></dt>
  8374. <dd><p>Disable/enable link-time EX9 relaxation.
  8375. </p>
  8376. </dd>
  8377. <dt><code>&lsquo;<samp>--mexport-ex9=FILE</samp>&rsquo;</code></dt>
  8378. <dd><p>Export the EX9 table after linking.
  8379. </p>
  8380. </dd>
  8381. <dt><code>&lsquo;<samp>--mimport-ex9=FILE</samp>&rsquo;</code></dt>
  8382. <dd><p>Import the Ex9 table for EX9 relaxation.
  8383. </p>
  8384. </dd>
  8385. <dt><code>&lsquo;<samp>--mupdate-ex9</samp>&rsquo;</code></dt>
  8386. <dd><p>Update the existing EX9 table.
  8387. </p>
  8388. </dd>
  8389. <dt><code>&lsquo;<samp>--mex9-limit=NUM</samp>&rsquo;</code></dt>
  8390. <dd><p>Maximum number of entries in the ex9 table.
  8391. </p>
  8392. </dd>
  8393. <dt><code>&lsquo;<samp>--mex9-loop-aware</samp>&rsquo;</code></dt>
  8394. <dd><p>Avoid generating the EX9 instruction inside the loop.
  8395. </p>
  8396. </dd>
  8397. <dt><code>&lsquo;<samp>--m[no-]ifc</samp>&rsquo;</code></dt>
  8398. <dd><p>Disable/enable the link-time IFC optimization.
  8399. </p>
  8400. </dd>
  8401. <dt><code>&lsquo;<samp>--mifc-loop-aware</samp>&rsquo;</code></dt>
  8402. <dd><p>Avoid generating the IFC instruction inside the loop.
  8403. </p></dd>
  8404. </dl>
  8405. <hr>
  8406. <span id="Nios-II"></span><div class="header">
  8407. <p>
  8408. Next: <a href="#PowerPC-ELF32" accesskey="n" rel="next">PowerPC ELF32</a>, Previous: <a href="#NDS32" accesskey="p" rel="prev">NDS32</a>, Up: <a href="#Machine-Dependent" accesskey="u" rel="up">Machine Dependent</a> &nbsp; [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#LD-Index" title="Index" rel="index">Index</a>]</p>
  8409. </div>
  8410. <span id="ld-and-the-Altera-Nios-II"></span><h3 class="section">6.10 <code>ld</code> and the Altera Nios II</h3>
  8411. <span id="index-Nios-II-call-relaxation"></span>
  8412. <span id="index-_002d_002drelax-on-Nios-II"></span>
  8413. <p>Call and immediate jump instructions on Nios II processors are limited to
  8414. transferring control to addresses in the same 256MB memory segment,
  8415. which may result in <code>ld</code> giving
  8416. &lsquo;<samp>relocation truncated to fit</samp>&rsquo; errors with very large programs.
  8417. The command-line option <samp>--relax</samp> enables the generation of
  8418. trampolines that can access the entire 32-bit address space for calls
  8419. outside the normal <code>call</code> and <code>jmpi</code> address range. These
  8420. trampolines are inserted at section boundaries, so may not themselves
  8421. be reachable if an input section and its associated call trampolines are
  8422. larger than 256MB.
  8423. </p>
  8424. <p>The <samp>--relax</samp> option is enabled by default unless <samp>-r</samp>
  8425. is also specified. You can disable trampoline generation by using the
  8426. <samp>--no-relax</samp> linker option. You can also disable this optimization
  8427. locally by using the &lsquo;<samp>set .noat</samp>&rsquo; directive in assembly-language
  8428. source files, as the linker-inserted trampolines use the <code>at</code>
  8429. register as a temporary.
  8430. </p>
  8431. <p>Note that the linker <samp>--relax</samp> option is independent of assembler
  8432. relaxation options, and that using the GNU assembler&rsquo;s <samp>-relax-all</samp>
  8433. option interferes with the linker&rsquo;s more selective call instruction relaxation.
  8434. </p>
  8435. <hr>
  8436. <span id="PowerPC-ELF32"></span><div class="header">
  8437. <p>
  8438. Next: <a href="#PowerPC64-ELF64" accesskey="n" rel="next">PowerPC64 ELF64</a>, Previous: <a href="#Nios-II" accesskey="p" rel="prev">Nios II</a>, Up: <a href="#Machine-Dependent" accesskey="u" rel="up">Machine Dependent</a> &nbsp; [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#LD-Index" title="Index" rel="index">Index</a>]</p>
  8439. </div>
  8440. <span id="ld-and-PowerPC-32_002dbit-ELF-Support"></span><h3 class="section">6.11 <code>ld</code> and PowerPC 32-bit ELF Support</h3>
  8441. <span id="index-PowerPC-long-branches"></span>
  8442. <span id="index-_002d_002drelax-on-PowerPC"></span>
  8443. <p>Branches on PowerPC processors are limited to a signed 26-bit
  8444. displacement, which may result in <code>ld</code> giving
  8445. &lsquo;<samp>relocation truncated to fit</samp>&rsquo; errors with very large programs.
  8446. &lsquo;<samp>--relax</samp>&rsquo; enables the generation of trampolines that can access
  8447. the entire 32-bit address space. These trampolines are inserted at
  8448. section boundaries, so may not themselves be reachable if an input
  8449. section exceeds 33M in size. You may combine &lsquo;<samp>-r</samp>&rsquo; and
  8450. &lsquo;<samp>--relax</samp>&rsquo; to add trampolines in a partial link. In that case
  8451. both branches to undefined symbols and inter-section branches are also
  8452. considered potentially out of range, and trampolines inserted.
  8453. </p>
  8454. <span id="index-PowerPC-ELF32-options"></span>
  8455. <dl compact="compact">
  8456. <dd><span id="index-PowerPC-PLT"></span>
  8457. <span id="index-_002d_002dbss_002dplt"></span>
  8458. </dd>
  8459. <dt><samp>--bss-plt</samp></dt>
  8460. <dd><p>Current PowerPC GCC accepts a &lsquo;<samp>-msecure-plt</samp>&rsquo; option that
  8461. generates code capable of using a newer PLT and GOT layout that has
  8462. the security advantage of no executable section ever needing to be
  8463. writable and no writable section ever being executable. PowerPC
  8464. <code>ld</code> will generate this layout, including stubs to access the
  8465. PLT, if all input files (including startup and static libraries) were
  8466. compiled with &lsquo;<samp>-msecure-plt</samp>&rsquo;. &lsquo;<samp>--bss-plt</samp>&rsquo; forces the old
  8467. BSS PLT (and GOT layout) which can give slightly better performance.
  8468. </p>
  8469. <span id="index-_002d_002dsecure_002dplt"></span>
  8470. </dd>
  8471. <dt><samp>--secure-plt</samp></dt>
  8472. <dd><p><code>ld</code> will use the new PLT and GOT layout if it is linking new
  8473. &lsquo;<samp>-fpic</samp>&rsquo; or &lsquo;<samp>-fPIC</samp>&rsquo; code, but does not do so automatically
  8474. when linking non-PIC code. This option requests the new PLT and GOT
  8475. layout. A warning will be given if some object file requires the old
  8476. style BSS PLT.
  8477. </p>
  8478. <span id="index-PowerPC-GOT"></span>
  8479. <span id="index-_002d_002dsdata_002dgot"></span>
  8480. </dd>
  8481. <dt><samp>--sdata-got</samp></dt>
  8482. <dd><p>The new secure PLT and GOT are placed differently relative to other
  8483. sections compared to older BSS PLT and GOT placement. The location of
  8484. <code>.plt</code> must change because the new secure PLT is an initialized
  8485. section while the old PLT is uninitialized. The reason for the
  8486. <code>.got</code> change is more subtle: The new placement allows
  8487. <code>.got</code> to be read-only in applications linked with
  8488. &lsquo;<samp>-z relro -z now</samp>&rsquo;. However, this placement means that
  8489. <code>.sdata</code> cannot always be used in shared libraries, because the
  8490. PowerPC ABI accesses <code>.sdata</code> in shared libraries from the GOT
  8491. pointer. &lsquo;<samp>--sdata-got</samp>&rsquo; forces the old GOT placement. PowerPC
  8492. GCC doesn&rsquo;t use <code>.sdata</code> in shared libraries, so this option is
  8493. really only useful for other compilers that may do so.
  8494. </p>
  8495. <span id="index-PowerPC-stub-symbols"></span>
  8496. <span id="index-_002d_002demit_002dstub_002dsyms"></span>
  8497. </dd>
  8498. <dt><samp>--emit-stub-syms</samp></dt>
  8499. <dd><p>This option causes <code>ld</code> to label linker stubs with a local
  8500. symbol that encodes the stub type and destination.
  8501. </p>
  8502. <span id="index-PowerPC-TLS-optimization"></span>
  8503. <span id="index-_002d_002dno_002dtls_002doptimize"></span>
  8504. </dd>
  8505. <dt><samp>--no-tls-optimize</samp></dt>
  8506. <dd><p>PowerPC <code>ld</code> normally performs some optimization of code
  8507. sequences used to access Thread-Local Storage. Use this option to
  8508. disable the optimization.
  8509. </p></dd>
  8510. </dl>
  8511. <hr>
  8512. <span id="PowerPC64-ELF64"></span><div class="header">
  8513. <p>
  8514. Next: <a href="#S_002f390-ELF" accesskey="n" rel="next">S/390 ELF</a>, Previous: <a href="#PowerPC-ELF32" accesskey="p" rel="prev">PowerPC ELF32</a>, Up: <a href="#Machine-Dependent" accesskey="u" rel="up">Machine Dependent</a> &nbsp; [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#LD-Index" title="Index" rel="index">Index</a>]</p>
  8515. </div>
  8516. <span id="ld-and-PowerPC64-64_002dbit-ELF-Support"></span><h3 class="section">6.12 <code>ld</code> and PowerPC64 64-bit ELF Support</h3>
  8517. <span id="index-PowerPC64-ELF64-options"></span>
  8518. <dl compact="compact">
  8519. <dd><span id="index-PowerPC64-stub-grouping"></span>
  8520. <span id="index-_002d_002dstub_002dgroup_002dsize"></span>
  8521. </dd>
  8522. <dt><samp>--stub-group-size</samp></dt>
  8523. <dd><p>Long branch stubs, PLT call stubs and TOC adjusting stubs are placed
  8524. by <code>ld</code> in stub sections located between groups of input sections.
  8525. &lsquo;<samp>--stub-group-size</samp>&rsquo; specifies the maximum size of a group of input
  8526. sections handled by one stub section. Since branch offsets are signed,
  8527. a stub section may serve two groups of input sections, one group before
  8528. the stub section, and one group after it. However, when using
  8529. conditional branches that require stubs, it may be better (for branch
  8530. prediction) that stub sections only serve one group of input sections.
  8531. A negative value for &lsquo;<samp>N</samp>&rsquo; chooses this scheme, ensuring that
  8532. branches to stubs always use a negative offset. Two special values of
  8533. &lsquo;<samp>N</samp>&rsquo; are recognized, &lsquo;<samp>1</samp>&rsquo; and &lsquo;<samp>-1</samp>&rsquo;. These both instruct
  8534. <code>ld</code> to automatically size input section groups for the branch types
  8535. detected, with the same behaviour regarding stub placement as other
  8536. positive or negative values of &lsquo;<samp>N</samp>&rsquo; respectively.
  8537. </p>
  8538. <p>Note that &lsquo;<samp>--stub-group-size</samp>&rsquo; does not split input sections. A
  8539. single input section larger than the group size specified will of course
  8540. create a larger group (of one section). If input sections are too
  8541. large, it may not be possible for a branch to reach its stub.
  8542. </p>
  8543. <span id="index-PowerPC64-stub-symbols"></span>
  8544. <span id="index-_002d_002demit_002dstub_002dsyms-1"></span>
  8545. </dd>
  8546. <dt><samp>--emit-stub-syms</samp></dt>
  8547. <dd><p>This option causes <code>ld</code> to label linker stubs with a local
  8548. symbol that encodes the stub type and destination.
  8549. </p>
  8550. <span id="index-PowerPC64-dot-symbols"></span>
  8551. <span id="index-_002d_002ddotsyms"></span>
  8552. <span id="index-_002d_002dno_002ddotsyms"></span>
  8553. </dd>
  8554. <dt><samp>--dotsyms</samp></dt>
  8555. <dt><samp>--no-dotsyms</samp></dt>
  8556. <dd><p>These two options control how <code>ld</code> interprets version patterns
  8557. in a version script. Older PowerPC64 compilers emitted both a
  8558. function descriptor symbol with the same name as the function, and a
  8559. code entry symbol with the name prefixed by a dot (&lsquo;<samp>.</samp>&rsquo;). To
  8560. properly version a function &lsquo;<samp>foo</samp>&rsquo;, the version script thus needs
  8561. to control both &lsquo;<samp>foo</samp>&rsquo; and &lsquo;<samp>.foo</samp>&rsquo;. The option
  8562. &lsquo;<samp>--dotsyms</samp>&rsquo;, on by default, automatically adds the required
  8563. dot-prefixed patterns. Use &lsquo;<samp>--no-dotsyms</samp>&rsquo; to disable this
  8564. feature.
  8565. </p>
  8566. <span id="index-PowerPC64-register-save_002frestore-functions"></span>
  8567. <span id="index-_002d_002dsave_002drestore_002dfuncs"></span>
  8568. <span id="index-_002d_002dno_002dsave_002drestore_002dfuncs"></span>
  8569. </dd>
  8570. <dt><samp>--save-restore-funcs</samp></dt>
  8571. <dt><samp>--no-save-restore-funcs</samp></dt>
  8572. <dd><p>These two options control whether PowerPC64 <code>ld</code> automatically
  8573. provides out-of-line register save and restore functions used by
  8574. &lsquo;<samp>-Os</samp>&rsquo; code. The default is to provide any such referenced
  8575. function for a normal final link, and to not do so for a relocatable
  8576. link.
  8577. </p>
  8578. <span id="index-PowerPC64-TLS-optimization"></span>
  8579. <span id="index-_002d_002dno_002dtls_002doptimize-1"></span>
  8580. </dd>
  8581. <dt><samp>--no-tls-optimize</samp></dt>
  8582. <dd><p>PowerPC64 <code>ld</code> normally performs some optimization of code
  8583. sequences used to access Thread-Local Storage. Use this option to
  8584. disable the optimization.
  8585. </p>
  8586. <span id="index-PowerPC64-_005f_005ftls_005fget_005faddr-optimization"></span>
  8587. <span id="index-_002d_002dtls_002dget_002daddr_002doptimize"></span>
  8588. <span id="index-_002d_002dno_002dtls_002dget_002daddr_002doptimize"></span>
  8589. <span id="index-_002d_002dtls_002dget_002daddr_002dregsave"></span>
  8590. <span id="index-_002d_002dno_002dtls_002dget_002daddr_002dregsave"></span>
  8591. </dd>
  8592. <dt><samp>--tls-get-addr-optimize</samp></dt>
  8593. <dt><samp>--no-tls-get-addr-optimize</samp></dt>
  8594. <dd><p>These options control how PowerPC64 <code>ld</code> uses a special
  8595. stub to call __tls_get_addr. PowerPC64 glibc 2.22 and later support
  8596. an optimization that allows the second and subsequent calls to
  8597. <code>__tls_get_addr</code> for a given symbol to be resolved by the special
  8598. stub without calling in to glibc. By default the linker enables
  8599. generation of the stub when glibc advertises the availability of
  8600. __tls_get_addr_opt.
  8601. Using <samp>--tls-get-addr-optimize</samp> with an older glibc won&rsquo;t do
  8602. much besides slow down your applications, but may be useful if linking
  8603. an application against an older glibc with the expectation that it
  8604. will normally be used on systems having a newer glibc.
  8605. <samp>--tls-get-addr-regsave</samp> forces generation of a stub that saves
  8606. and restores volatile registers around the call into glibc. Normally,
  8607. this is done when the linker detects a call to __tls_get_addr_desc.
  8608. Such calls then go via the register saving stub to __tls_get_addr_opt.
  8609. <samp>--no-tls-get-addr-regsave</samp> disables generation of the
  8610. register saves.
  8611. </p>
  8612. <span id="index-PowerPC64-OPD-optimization"></span>
  8613. <span id="index-_002d_002dno_002dopd_002doptimize"></span>
  8614. </dd>
  8615. <dt><samp>--no-opd-optimize</samp></dt>
  8616. <dd><p>PowerPC64 <code>ld</code> normally removes <code>.opd</code> section entries
  8617. corresponding to deleted link-once functions, or functions removed by
  8618. the action of &lsquo;<samp>--gc-sections</samp>&rsquo; or linker script <code>/DISCARD/</code>.
  8619. Use this option to disable <code>.opd</code> optimization.
  8620. </p>
  8621. <span id="index-PowerPC64-OPD-spacing"></span>
  8622. <span id="index-_002d_002dnon_002doverlapping_002dopd"></span>
  8623. </dd>
  8624. <dt><samp>--non-overlapping-opd</samp></dt>
  8625. <dd><p>Some PowerPC64 compilers have an option to generate compressed
  8626. <code>.opd</code> entries spaced 16 bytes apart, overlapping the third word,
  8627. the static chain pointer (unused in C) with the first word of the next
  8628. entry. This option expands such entries to the full 24 bytes.
  8629. </p>
  8630. <span id="index-PowerPC64-TOC-optimization"></span>
  8631. <span id="index-_002d_002dno_002dtoc_002doptimize"></span>
  8632. </dd>
  8633. <dt><samp>--no-toc-optimize</samp></dt>
  8634. <dd><p>PowerPC64 <code>ld</code> normally removes unused <code>.toc</code> section
  8635. entries. Such entries are detected by examining relocations that
  8636. reference the TOC in code sections. A reloc in a deleted code section
  8637. marks a TOC word as unneeded, while a reloc in a kept code section
  8638. marks a TOC word as needed. Since the TOC may reference itself, TOC
  8639. relocs are also examined. TOC words marked as both needed and
  8640. unneeded will of course be kept. TOC words without any referencing
  8641. reloc are assumed to be part of a multi-word entry, and are kept or
  8642. discarded as per the nearest marked preceding word. This works
  8643. reliably for compiler generated code, but may be incorrect if assembly
  8644. code is used to insert TOC entries. Use this option to disable the
  8645. optimization.
  8646. </p>
  8647. <span id="index-PowerPC64-inline-PLT-call-optimization"></span>
  8648. <span id="index-_002d_002dno_002dinline_002doptimize"></span>
  8649. </dd>
  8650. <dt><samp>--no-inline-optimize</samp></dt>
  8651. <dd><p>PowerPC64 <code>ld</code> normally replaces inline PLT call sequences
  8652. marked with <code>R_PPC64_PLTSEQ</code>, <code>R_PPC64_PLTCALL</code>,
  8653. <code>R_PPC64_PLT16_HA</code> and <code>R_PPC64_PLT16_LO_DS</code> relocations by
  8654. a number of <code>nop</code>s and a direct call when the function is defined
  8655. locally and can&rsquo;t be overridden by some other definition. This option
  8656. disables that optimization.
  8657. </p>
  8658. <span id="index-PowerPC64-multi_002dTOC"></span>
  8659. <span id="index-_002d_002dno_002dmulti_002dtoc"></span>
  8660. </dd>
  8661. <dt><samp>--no-multi-toc</samp></dt>
  8662. <dd><p>If given any toc option besides <code>-mcmodel=medium</code> or
  8663. <code>-mcmodel=large</code>, PowerPC64 GCC generates code for a TOC model
  8664. where TOC
  8665. entries are accessed with a 16-bit offset from r2. This limits the
  8666. total TOC size to 64K. PowerPC64 <code>ld</code> extends this limit by
  8667. grouping code sections such that each group uses less than 64K for its
  8668. TOC entries, then inserts r2 adjusting stubs between inter-group
  8669. calls. <code>ld</code> does not split apart input sections, so cannot
  8670. help if a single input file has a <code>.toc</code> section that exceeds
  8671. 64K, most likely from linking multiple files with <code>ld -r</code>.
  8672. Use this option to turn off this feature.
  8673. </p>
  8674. <span id="index-PowerPC64-TOC-sorting"></span>
  8675. <span id="index-_002d_002dno_002dtoc_002dsort"></span>
  8676. </dd>
  8677. <dt><samp>--no-toc-sort</samp></dt>
  8678. <dd><p>By default, <code>ld</code> sorts TOC sections so that those whose file
  8679. happens to have a section called <code>.init</code> or <code>.fini</code> are
  8680. placed first, followed by TOC sections referenced by code generated
  8681. with PowerPC64 gcc&rsquo;s <code>-mcmodel=small</code>, and lastly TOC sections
  8682. referenced only by code generated with PowerPC64 gcc&rsquo;s
  8683. <code>-mcmodel=medium</code> or <code>-mcmodel=large</code> options. Doing this
  8684. results in better TOC grouping for multi-TOC. Use this option to turn
  8685. off this feature.
  8686. </p>
  8687. <span id="index-PowerPC64-PLT-stub-alignment"></span>
  8688. <span id="index-_002d_002dplt_002dalign"></span>
  8689. <span id="index-_002d_002dno_002dplt_002dalign"></span>
  8690. </dd>
  8691. <dt><samp>--plt-align</samp></dt>
  8692. <dt><samp>--no-plt-align</samp></dt>
  8693. <dd><p>Use these options to control whether individual PLT call stubs are
  8694. aligned to a 32-byte boundary, or to the specified power of two
  8695. boundary when using <code>--plt-align=</code>. A negative value may be
  8696. specified to pad PLT call stubs so that they do not cross the
  8697. specified power of two boundary (or the minimum number of boundaries
  8698. if a PLT stub is so large that it must cross a boundary). By default
  8699. PLT call stubs are aligned to 32-byte boundaries.
  8700. </p>
  8701. <span id="index-PowerPC64-PLT-call-stub-static-chain"></span>
  8702. <span id="index-_002d_002dplt_002dstatic_002dchain"></span>
  8703. <span id="index-_002d_002dno_002dplt_002dstatic_002dchain"></span>
  8704. </dd>
  8705. <dt><samp>--plt-static-chain</samp></dt>
  8706. <dt><samp>--no-plt-static-chain</samp></dt>
  8707. <dd><p>Use these options to control whether PLT call stubs load the static
  8708. chain pointer (r11). <code>ld</code> defaults to not loading the static
  8709. chain since there is never any need to do so on a PLT call.
  8710. </p>
  8711. <span id="index-PowerPC64-PLT-call-stub-thread-safety"></span>
  8712. <span id="index-_002d_002dplt_002dthread_002dsafe"></span>
  8713. <span id="index-_002d_002dno_002dplt_002dthread_002dsafe"></span>
  8714. </dd>
  8715. <dt><samp>--plt-thread-safe</samp></dt>
  8716. <dt><samp>--no-plt-thread-safe</samp></dt>
  8717. <dd><p>With power7&rsquo;s weakly ordered memory model, it is possible when using
  8718. lazy binding for ld.so to update a plt entry in one thread and have
  8719. another thread see the individual plt entry words update in the wrong
  8720. order, despite ld.so carefully writing in the correct order and using
  8721. memory write barriers. To avoid this we need some sort of read
  8722. barrier in the call stub, or use LD_BIND_NOW=1. By default, <code>ld</code>
  8723. looks for calls to commonly used functions that create threads, and if
  8724. seen, adds the necessary barriers. Use these options to change the
  8725. default behaviour.
  8726. </p>
  8727. <span id="index-PowerPC64-ELFv2-PLT-localentry-optimization"></span>
  8728. <span id="index-_002d_002dplt_002dlocalentry"></span>
  8729. <span id="index-_002d_002dno_002dplt_002dlocalentry"></span>
  8730. </dd>
  8731. <dt><samp>--plt-localentry</samp></dt>
  8732. <dt><samp>--no-localentry</samp></dt>
  8733. <dd><p>ELFv2 functions with localentry:0 are those with a single entry point,
  8734. ie. global entry == local entry, and that have no requirement on r2
  8735. (the TOC/GOT pointer) or r12, and guarantee r2 is unchanged on return.
  8736. Such an external function can be called via the PLT without saving r2
  8737. or restoring it on return, avoiding a common load-hit-store for small
  8738. functions. The optimization is attractive, with up to 40% reduction
  8739. in execution time for a small function, but can result in symbol
  8740. interposition failures. Also, minor changes in a shared library,
  8741. including system libraries, can cause a function that was localentry:0
  8742. to become localentry:8. This will result in a dynamic loader
  8743. complaint and failure to run. The option is experimental, use with
  8744. care. <samp>--no-plt-localentry</samp> is the default.
  8745. </p>
  8746. <span id="index-PowerPC64-Power10-stubs"></span>
  8747. <span id="index-_002d_002dpower10_002dstubs"></span>
  8748. <span id="index-_002d_002dno_002dpower10_002dstubs"></span>
  8749. </dd>
  8750. <dt><samp>--power10-stubs</samp></dt>
  8751. <dt><samp>--no-power10-stubs</samp></dt>
  8752. <dd><p>When PowerPC64 <code>ld</code> links input object files containing
  8753. relocations used on power10 prefixed instructions it normally creates
  8754. linkage stubs (PLT call and long branch) using power10 instructions
  8755. for <code>@notoc</code> PLT calls where <code>r2</code> is not known. The
  8756. power10 notoc stubs are smaller and faster, so are preferred for
  8757. power10. <samp>--power10-stubs</samp> and <samp>--no-power10-stubs</samp>
  8758. allow you to override the linker&rsquo;s selection of stub instructions.
  8759. <samp>--power10-stubs=auto</samp> allows the user to select the default
  8760. auto mode.
  8761. </p></dd>
  8762. </dl>
  8763. <hr>
  8764. <span id="S_002f390-ELF"></span><div class="header">
  8765. <p>
  8766. Next: <a href="#SPU-ELF" accesskey="n" rel="next">SPU ELF</a>, Previous: <a href="#PowerPC64-ELF64" accesskey="p" rel="prev">PowerPC64 ELF64</a>, Up: <a href="#Machine-Dependent" accesskey="u" rel="up">Machine Dependent</a> &nbsp; [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#LD-Index" title="Index" rel="index">Index</a>]</p>
  8767. </div>
  8768. <span id="ld-and-S_002f390-ELF-Support"></span><h3 class="section">6.13 <code>ld</code> and S/390 ELF Support</h3>
  8769. <span id="index-S_002f390-ELF-options"></span>
  8770. <dl compact="compact">
  8771. <dd>
  8772. <span id="index-S_002f390"></span>
  8773. <span id="index-_002d_002ds390_002dpgste"></span>
  8774. </dd>
  8775. <dt><samp>--s390-pgste</samp></dt>
  8776. <dd><p>This option marks the result file with a <code>PT_S390_PGSTE</code>
  8777. segment. The Linux kernel is supposed to allocate 4k page tables for
  8778. binaries marked that way.
  8779. </p></dd>
  8780. </dl>
  8781. <hr>
  8782. <span id="SPU-ELF"></span><div class="header">
  8783. <p>
  8784. Next: <a href="#TI-COFF" accesskey="n" rel="next">TI COFF</a>, Previous: <a href="#S_002f390-ELF" accesskey="p" rel="prev">S/390 ELF</a>, Up: <a href="#Machine-Dependent" accesskey="u" rel="up">Machine Dependent</a> &nbsp; [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#LD-Index" title="Index" rel="index">Index</a>]</p>
  8785. </div>
  8786. <span id="ld-and-SPU-ELF-Support"></span><h3 class="section">6.14 <code>ld</code> and SPU ELF Support</h3>
  8787. <span id="index-SPU-ELF-options"></span>
  8788. <dl compact="compact">
  8789. <dd>
  8790. <span id="index-SPU-plugins"></span>
  8791. <span id="index-_002d_002dplugin"></span>
  8792. </dd>
  8793. <dt><samp>--plugin</samp></dt>
  8794. <dd><p>This option marks an executable as a PIC plugin module.
  8795. </p>
  8796. <span id="index-SPU-overlays"></span>
  8797. <span id="index-_002d_002dno_002doverlays"></span>
  8798. </dd>
  8799. <dt><samp>--no-overlays</samp></dt>
  8800. <dd><p>Normally, <code>ld</code> recognizes calls to functions within overlay
  8801. regions, and redirects such calls to an overlay manager via a stub.
  8802. <code>ld</code> also provides a built-in overlay manager. This option
  8803. turns off all this special overlay handling.
  8804. </p>
  8805. <span id="index-SPU-overlay-stub-symbols"></span>
  8806. <span id="index-_002d_002demit_002dstub_002dsyms-2"></span>
  8807. </dd>
  8808. <dt><samp>--emit-stub-syms</samp></dt>
  8809. <dd><p>This option causes <code>ld</code> to label overlay stubs with a local
  8810. symbol that encodes the stub type and destination.
  8811. </p>
  8812. <span id="index-SPU-extra-overlay-stubs"></span>
  8813. <span id="index-_002d_002dextra_002doverlay_002dstubs"></span>
  8814. </dd>
  8815. <dt><samp>--extra-overlay-stubs</samp></dt>
  8816. <dd><p>This option causes <code>ld</code> to add overlay call stubs on all
  8817. function calls out of overlay regions. Normally stubs are not added
  8818. on calls to non-overlay regions.
  8819. </p>
  8820. <span id="index-SPU-local-store-size"></span>
  8821. <span id="index-_002d_002dlocal_002dstore_003dlo_003ahi"></span>
  8822. </dd>
  8823. <dt><samp>--local-store=lo:hi</samp></dt>
  8824. <dd><p><code>ld</code> usually checks that a final executable for SPU fits in
  8825. the address range 0 to 256k. This option may be used to change the
  8826. range. Disable the check entirely with <samp>--local-store=0:0</samp>.
  8827. </p>
  8828. <span id="index-SPU"></span>
  8829. <span id="index-_002d_002dstack_002danalysis"></span>
  8830. </dd>
  8831. <dt><samp>--stack-analysis</samp></dt>
  8832. <dd><p>SPU local store space is limited. Over-allocation of stack space
  8833. unnecessarily limits space available for code and data, while
  8834. under-allocation results in runtime failures. If given this option,
  8835. <code>ld</code> will provide an estimate of maximum stack usage.
  8836. <code>ld</code> does this by examining symbols in code sections to
  8837. determine the extents of functions, and looking at function prologues
  8838. for stack adjusting instructions. A call-graph is created by looking
  8839. for relocations on branch instructions. The graph is then searched
  8840. for the maximum stack usage path. Note that this analysis does not
  8841. find calls made via function pointers, and does not handle recursion
  8842. and other cycles in the call graph. Stack usage may be
  8843. under-estimated if your code makes such calls. Also, stack usage for
  8844. dynamic allocation, e.g. alloca, will not be detected. If a link map
  8845. is requested, detailed information about each function&rsquo;s stack usage
  8846. and calls will be given.
  8847. </p>
  8848. <span id="index-SPU-1"></span>
  8849. <span id="index-_002d_002demit_002dstack_002dsyms"></span>
  8850. </dd>
  8851. <dt><samp>--emit-stack-syms</samp></dt>
  8852. <dd><p>This option, if given along with <samp>--stack-analysis</samp> will result
  8853. in <code>ld</code> emitting stack sizing symbols for each function.
  8854. These take the form <code>__stack_&lt;function_name&gt;</code> for global
  8855. functions, and <code>__stack_&lt;number&gt;_&lt;function_name&gt;</code> for static
  8856. functions. <code>&lt;number&gt;</code> is the section id in hex. The value of
  8857. such symbols is the stack requirement for the corresponding function.
  8858. The symbol size will be zero, type <code>STT_NOTYPE</code>, binding
  8859. <code>STB_LOCAL</code>, and section <code>SHN_ABS</code>.
  8860. </p></dd>
  8861. </dl>
  8862. <hr>
  8863. <span id="TI-COFF"></span><div class="header">
  8864. <p>
  8865. Next: <a href="#WIN32" accesskey="n" rel="next">WIN32</a>, Previous: <a href="#SPU-ELF" accesskey="p" rel="prev">SPU ELF</a>, Up: <a href="#Machine-Dependent" accesskey="u" rel="up">Machine Dependent</a> &nbsp; [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#LD-Index" title="Index" rel="index">Index</a>]</p>
  8866. </div>
  8867. <span id="ld_0027s-Support-for-Various-TI-COFF-Versions"></span><h3 class="section">6.15 <code>ld</code>&rsquo;s Support for Various TI COFF Versions</h3>
  8868. <span id="index-TI-COFF-versions"></span>
  8869. <span id="index-_002d_002dformat_003dversion"></span>
  8870. <p>The &lsquo;<samp>--format</samp>&rsquo; switch allows selection of one of the various
  8871. TI COFF versions. The latest of this writing is 2; versions 0 and 1 are
  8872. also supported. The TI COFF versions also vary in header byte-order
  8873. format; <code>ld</code> will read any version or byte order, but the output
  8874. header format depends on the default specified by the specific target.
  8875. </p>
  8876. <hr>
  8877. <span id="WIN32"></span><div class="header">
  8878. <p>
  8879. Next: <a href="#Xtensa" accesskey="n" rel="next">Xtensa</a>, Previous: <a href="#TI-COFF" accesskey="p" rel="prev">TI COFF</a>, Up: <a href="#Machine-Dependent" accesskey="u" rel="up">Machine Dependent</a> &nbsp; [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#LD-Index" title="Index" rel="index">Index</a>]</p>
  8880. </div>
  8881. <span id="ld-and-WIN32-_0028cygwin_002fmingw_0029"></span><h3 class="section">6.16 <code>ld</code> and WIN32 (cygwin/mingw)</h3>
  8882. <p>This section describes some of the win32 specific <code>ld</code> issues.
  8883. See <a href="#Options">Command-line Options</a> for detailed description of the
  8884. command-line options mentioned here.
  8885. </p>
  8886. <dl compact="compact">
  8887. <dd><span id="index-import-libraries"></span>
  8888. </dd>
  8889. <dt><em>import libraries</em></dt>
  8890. <dd><p>The standard Windows linker creates and uses so-called import
  8891. libraries, which contains information for linking to dll&rsquo;s. They are
  8892. regular static archives and are handled as any other static
  8893. archive. The cygwin and mingw ports of <code>ld</code> have specific
  8894. support for creating such libraries provided with the
  8895. &lsquo;<samp>--out-implib</samp>&rsquo; command-line option.
  8896. </p>
  8897. </dd>
  8898. <dt><em>Resource only DLLs</em></dt>
  8899. <dd><p>It is possible to create a DLL that only contains resources, ie just a
  8900. &lsquo;<samp>.rsrc</samp>&rsquo; section, but in order to do so a custom linker script
  8901. must be used. This is because the built-in default linker scripts
  8902. will always create &lsquo;<samp>.text</samp>&rsquo; and &lsquo;<samp>.idata</samp>&rsquo; sections, even if
  8903. there is no input to go into them.
  8904. </p>
  8905. <p>The script should look like this, although the <code>OUTPUT_FORMAT</code>
  8906. should be changed to match the desired format.
  8907. </p>
  8908. <div class="example">
  8909. <pre class="example">OUTPUT_FORMAT(pei-i386)
  8910. SECTIONS
  8911. {
  8912. . = SIZEOF_HEADERS;
  8913. . = ALIGN(__section_alignment__);
  8914. .rsrc __image_base__ + __section_alignment__ : ALIGN(4)
  8915. {
  8916. KEEP (*(.rsrc))
  8917. KEEP (*(.rsrc$*))
  8918. }
  8919. /DISCARD/ : { *(*) }
  8920. }
  8921. </pre></div>
  8922. <p>With this script saved to a file called, eg <samp>rsrc.ld</samp>, a command
  8923. line like this can be used to create the resource only DLL
  8924. <samp>rsrc.dll</samp> from an input file called <samp>rsrc.o</samp>:
  8925. </p>
  8926. <div class="example">
  8927. <pre class="example">ld -dll --subsystem windows -e 0 -s rsrc.o -o rsrc.dll -T rsrc.ld
  8928. </pre></div>
  8929. </dd>
  8930. <dt><em>exporting DLL symbols</em></dt>
  8931. <dd><span id="index-exporting-DLL-symbols"></span>
  8932. <p>The cygwin/mingw <code>ld</code> has several ways to export symbols for dll&rsquo;s.
  8933. </p>
  8934. <dl compact="compact">
  8935. <dt><em>using auto-export functionality</em></dt>
  8936. <dd><span id="index-using-auto_002dexport-functionality"></span>
  8937. <p>By default <code>ld</code> exports symbols with the auto-export functionality,
  8938. which is controlled by the following command-line options:
  8939. </p>
  8940. <ul>
  8941. <li> &ndash;export-all-symbols [This is the default]
  8942. </li><li> &ndash;exclude-symbols
  8943. </li><li> &ndash;exclude-libs
  8944. </li><li> &ndash;exclude-modules-for-implib
  8945. </li><li> &ndash;version-script
  8946. </li></ul>
  8947. <p>When auto-export is in operation, <code>ld</code> will export all the non-local
  8948. (global and common) symbols it finds in a DLL, with the exception of a few
  8949. symbols known to belong to the system&rsquo;s runtime and libraries. As it will
  8950. often not be desirable to export all of a DLL&rsquo;s symbols, which may include
  8951. private functions that are not part of any public interface, the command-line
  8952. options listed above may be used to filter symbols out from the list for
  8953. exporting. The &lsquo;<samp>--output-def</samp>&rsquo; option can be used in order to see the
  8954. final list of exported symbols with all exclusions taken into effect.
  8955. </p>
  8956. <p>If &lsquo;<samp>--export-all-symbols</samp>&rsquo; is not given explicitly on the
  8957. command line, then the default auto-export behavior will be <em>disabled</em>
  8958. if either of the following are true:
  8959. </p>
  8960. <ul>
  8961. <li> A DEF file is used.
  8962. </li><li> Any symbol in any object file was marked with the __declspec(dllexport) attribute.
  8963. </li></ul>
  8964. </dd>
  8965. <dt><em>using a DEF file</em></dt>
  8966. <dd><span id="index-using-a-DEF-file"></span>
  8967. <p>Another way of exporting symbols is using a DEF file. A DEF file is
  8968. an ASCII file containing definitions of symbols which should be
  8969. exported when a dll is created. Usually it is named &lsquo;<samp>&lt;dll
  8970. name&gt;.def</samp>&rsquo; and is added as any other object file to the linker&rsquo;s
  8971. command line. The file&rsquo;s name must end in &lsquo;<samp>.def</samp>&rsquo; or &lsquo;<samp>.DEF</samp>&rsquo;.
  8972. </p>
  8973. <div class="example">
  8974. <pre class="example">gcc -o &lt;output&gt; &lt;objectfiles&gt; &lt;dll name&gt;.def
  8975. </pre></div>
  8976. <p>Using a DEF file turns off the normal auto-export behavior, unless the
  8977. &lsquo;<samp>--export-all-symbols</samp>&rsquo; option is also used.
  8978. </p>
  8979. <p>Here is an example of a DEF file for a shared library called &lsquo;<samp>xyz.dll</samp>&rsquo;:
  8980. </p>
  8981. <div class="example">
  8982. <pre class="example">LIBRARY &quot;xyz.dll&quot; BASE=0x20000000
  8983. EXPORTS
  8984. foo
  8985. bar
  8986. _bar = bar
  8987. another_foo = abc.dll.afoo
  8988. var1 DATA
  8989. doo = foo == foo2
  8990. eoo DATA == var1
  8991. </pre></div>
  8992. <p>This example defines a DLL with a non-default base address and seven
  8993. symbols in the export table. The third exported symbol <code>_bar</code> is an
  8994. alias for the second. The fourth symbol, <code>another_foo</code> is resolved
  8995. by &quot;forwarding&quot; to another module and treating it as an alias for
  8996. <code>afoo</code> exported from the DLL &lsquo;<samp>abc.dll</samp>&rsquo;. The final symbol
  8997. <code>var1</code> is declared to be a data object. The &lsquo;<samp>doo</samp>&rsquo; symbol in
  8998. export library is an alias of &lsquo;<samp>foo</samp>&rsquo;, which gets the string name
  8999. in export table &lsquo;<samp>foo2</samp>&rsquo;. The &lsquo;<samp>eoo</samp>&rsquo; symbol is an data export
  9000. symbol, which gets in export table the name &lsquo;<samp>var1</samp>&rsquo;.
  9001. </p>
  9002. <p>The optional <code>LIBRARY &lt;name&gt;</code> command indicates the <em>internal</em>
  9003. name of the output DLL. If &lsquo;<samp>&lt;name&gt;</samp>&rsquo; does not include a suffix,
  9004. the default library suffix, &lsquo;<samp>.DLL</samp>&rsquo; is appended.
  9005. </p>
  9006. <p>When the .DEF file is used to build an application, rather than a
  9007. library, the <code>NAME &lt;name&gt;</code> command should be used instead of
  9008. <code>LIBRARY</code>. If &lsquo;<samp>&lt;name&gt;</samp>&rsquo; does not include a suffix, the default
  9009. executable suffix, &lsquo;<samp>.EXE</samp>&rsquo; is appended.
  9010. </p>
  9011. <p>With either <code>LIBRARY &lt;name&gt;</code> or <code>NAME &lt;name&gt;</code> the optional
  9012. specification <code>BASE = &lt;number&gt;</code> may be used to specify a
  9013. non-default base address for the image.
  9014. </p>
  9015. <p>If neither <code>LIBRARY &lt;name&gt;</code> nor <code>NAME &lt;name&gt;</code> is specified,
  9016. or they specify an empty string, the internal name is the same as the
  9017. filename specified on the command line.
  9018. </p>
  9019. <p>The complete specification of an export symbol is:
  9020. </p>
  9021. <div class="example">
  9022. <pre class="example">EXPORTS
  9023. ( ( ( &lt;name1&gt; [ = &lt;name2&gt; ] )
  9024. | ( &lt;name1&gt; = &lt;module-name&gt; . &lt;external-name&gt;))
  9025. [ @ &lt;integer&gt; ] [NONAME] [DATA] [CONSTANT] [PRIVATE] [== &lt;name3&gt;] ) *
  9026. </pre></div>
  9027. <p>Declares &lsquo;<samp>&lt;name1&gt;</samp>&rsquo; as an exported symbol from the DLL, or declares
  9028. &lsquo;<samp>&lt;name1&gt;</samp>&rsquo; as an exported alias for &lsquo;<samp>&lt;name2&gt;</samp>&rsquo;; or declares
  9029. &lsquo;<samp>&lt;name1&gt;</samp>&rsquo; as a &quot;forward&quot; alias for the symbol
  9030. &lsquo;<samp>&lt;external-name&gt;</samp>&rsquo; in the DLL &lsquo;<samp>&lt;module-name&gt;</samp>&rsquo;.
  9031. Optionally, the symbol may be exported by the specified ordinal
  9032. &lsquo;<samp>&lt;integer&gt;</samp>&rsquo; alias. The optional &lsquo;<samp>&lt;name3&gt;</samp>&rsquo; is the to be used
  9033. string in import/export table for the symbol.
  9034. </p>
  9035. <p>The optional keywords that follow the declaration indicate:
  9036. </p>
  9037. <p><code>NONAME</code>: Do not put the symbol name in the DLL&rsquo;s export table. It
  9038. will still be exported by its ordinal alias (either the value specified
  9039. by the .def specification or, otherwise, the value assigned by the
  9040. linker). The symbol name, however, does remain visible in the import
  9041. library (if any), unless <code>PRIVATE</code> is also specified.
  9042. </p>
  9043. <p><code>DATA</code>: The symbol is a variable or object, rather than a function.
  9044. The import lib will export only an indirect reference to <code>foo</code> as
  9045. the symbol <code>_imp__foo</code> (ie, <code>foo</code> must be resolved as
  9046. <code>*_imp__foo</code>).
  9047. </p>
  9048. <p><code>CONSTANT</code>: Like <code>DATA</code>, but put the undecorated <code>foo</code> as
  9049. well as <code>_imp__foo</code> into the import library. Both refer to the
  9050. read-only import address table&rsquo;s pointer to the variable, not to the
  9051. variable itself. This can be dangerous. If the user code fails to add
  9052. the <code>dllimport</code> attribute and also fails to explicitly add the
  9053. extra indirection that the use of the attribute enforces, the
  9054. application will behave unexpectedly.
  9055. </p>
  9056. <p><code>PRIVATE</code>: Put the symbol in the DLL&rsquo;s export table, but do not put
  9057. it into the static import library used to resolve imports at link time. The
  9058. symbol can still be imported using the <code>LoadLibrary/GetProcAddress</code>
  9059. API at runtime or by using the GNU ld extension of linking directly to
  9060. the DLL without an import library.
  9061. </p>
  9062. <p>See ld/deffilep.y in the binutils sources for the full specification of
  9063. other DEF file statements
  9064. </p>
  9065. <span id="index-creating-a-DEF-file"></span>
  9066. <p>While linking a shared dll, <code>ld</code> is able to create a DEF file
  9067. with the &lsquo;<samp>--output-def &lt;file&gt;</samp>&rsquo; command-line option.
  9068. </p>
  9069. </dd>
  9070. <dt><em>Using decorations</em></dt>
  9071. <dd><span id="index-Using-decorations"></span>
  9072. <p>Another way of marking symbols for export is to modify the source code
  9073. itself, so that when building the DLL each symbol to be exported is
  9074. declared as:
  9075. </p>
  9076. <div class="example">
  9077. <pre class="example">__declspec(dllexport) int a_variable
  9078. __declspec(dllexport) void a_function(int with_args)
  9079. </pre></div>
  9080. <p>All such symbols will be exported from the DLL. If, however,
  9081. any of the object files in the DLL contain symbols decorated in
  9082. this way, then the normal auto-export behavior is disabled, unless
  9083. the &lsquo;<samp>--export-all-symbols</samp>&rsquo; option is also used.
  9084. </p>
  9085. <p>Note that object files that wish to access these symbols must <em>not</em>
  9086. decorate them with dllexport. Instead, they should use dllimport,
  9087. instead:
  9088. </p>
  9089. <div class="example">
  9090. <pre class="example">__declspec(dllimport) int a_variable
  9091. __declspec(dllimport) void a_function(int with_args)
  9092. </pre></div>
  9093. <p>This complicates the structure of library header files, because
  9094. when included by the library itself the header must declare the
  9095. variables and functions as dllexport, but when included by client
  9096. code the header must declare them as dllimport. There are a number
  9097. of idioms that are typically used to do this; often client code can
  9098. omit the __declspec() declaration completely. See
  9099. &lsquo;<samp>--enable-auto-import</samp>&rsquo; and &lsquo;<samp>automatic data imports</samp>&rsquo; for more
  9100. information.
  9101. </p></dd>
  9102. </dl>
  9103. <span id="index-automatic-data-imports"></span>
  9104. </dd>
  9105. <dt><em>automatic data imports</em></dt>
  9106. <dd><p>The standard Windows dll format supports data imports from dlls only
  9107. by adding special decorations (dllimport/dllexport), which let the
  9108. compiler produce specific assembler instructions to deal with this
  9109. issue. This increases the effort necessary to port existing Un*x
  9110. code to these platforms, especially for large
  9111. c++ libraries and applications. The auto-import feature, which was
  9112. initially provided by Paul Sokolovsky, allows one to omit the
  9113. decorations to achieve a behavior that conforms to that on POSIX/Un*x
  9114. platforms. This feature is enabled with the &lsquo;<samp>--enable-auto-import</samp>&rsquo;
  9115. command-line option, although it is enabled by default on cygwin/mingw.
  9116. The &lsquo;<samp>--enable-auto-import</samp>&rsquo; option itself now serves mainly to
  9117. suppress any warnings that are ordinarily emitted when linked objects
  9118. trigger the feature&rsquo;s use.
  9119. </p>
  9120. <p>auto-import of variables does not always work flawlessly without
  9121. additional assistance. Sometimes, you will see this message
  9122. </p>
  9123. <p>&quot;variable &rsquo;&lt;var&gt;&rsquo; can&rsquo;t be auto-imported. Please read the
  9124. documentation for ld&rsquo;s <code>--enable-auto-import</code> for details.&quot;
  9125. </p>
  9126. <p>The &lsquo;<samp>--enable-auto-import</samp>&rsquo; documentation explains why this error
  9127. occurs, and several methods that can be used to overcome this difficulty.
  9128. One of these methods is the <em>runtime pseudo-relocs</em> feature, described
  9129. below.
  9130. </p>
  9131. <span id="index-runtime-pseudo_002drelocation"></span>
  9132. <p>For complex variables imported from DLLs (such as structs or classes),
  9133. object files typically contain a base address for the variable and an
  9134. offset (<em>addend</em>) within the variable&ndash;to specify a particular
  9135. field or public member, for instance. Unfortunately, the runtime loader used
  9136. in win32 environments is incapable of fixing these references at runtime
  9137. without the additional information supplied by dllimport/dllexport decorations.
  9138. The standard auto-import feature described above is unable to resolve these
  9139. references.
  9140. </p>
  9141. <p>The &lsquo;<samp>--enable-runtime-pseudo-relocs</samp>&rsquo; switch allows these references to
  9142. be resolved without error, while leaving the task of adjusting the references
  9143. themselves (with their non-zero addends) to specialized code provided by the
  9144. runtime environment. Recent versions of the cygwin and mingw environments and
  9145. compilers provide this runtime support; older versions do not. However, the
  9146. support is only necessary on the developer&rsquo;s platform; the compiled result will
  9147. run without error on an older system.
  9148. </p>
  9149. <p>&lsquo;<samp>--enable-runtime-pseudo-relocs</samp>&rsquo; is not the default; it must be explicitly
  9150. enabled as needed.
  9151. </p>
  9152. <span id="index-direct-linking-to-a-dll"></span>
  9153. </dd>
  9154. <dt><em>direct linking to a dll</em></dt>
  9155. <dd><p>The cygwin/mingw ports of <code>ld</code> support the direct linking,
  9156. including data symbols, to a dll without the usage of any import
  9157. libraries. This is much faster and uses much less memory than does the
  9158. traditional import library method, especially when linking large
  9159. libraries or applications. When <code>ld</code> creates an import lib, each
  9160. function or variable exported from the dll is stored in its own bfd, even
  9161. though a single bfd could contain many exports. The overhead involved in
  9162. storing, loading, and processing so many bfd&rsquo;s is quite large, and explains the
  9163. tremendous time, memory, and storage needed to link against particularly
  9164. large or complex libraries when using import libs.
  9165. </p>
  9166. <p>Linking directly to a dll uses no extra command-line switches other than
  9167. &lsquo;<samp>-L</samp>&rsquo; and &lsquo;<samp>-l</samp>&rsquo;, because <code>ld</code> already searches for a number
  9168. of names to match each library. All that is needed from the developer&rsquo;s
  9169. perspective is an understanding of this search, in order to force ld to
  9170. select the dll instead of an import library.
  9171. </p>
  9172. <p>For instance, when ld is called with the argument &lsquo;<samp>-lxxx</samp>&rsquo; it will attempt
  9173. to find, in the first directory of its search path,
  9174. </p>
  9175. <div class="example">
  9176. <pre class="example">libxxx.dll.a
  9177. xxx.dll.a
  9178. libxxx.a
  9179. xxx.lib
  9180. libxxx.lib
  9181. cygxxx.dll (*)
  9182. libxxx.dll
  9183. xxx.dll
  9184. </pre></div>
  9185. <p>before moving on to the next directory in the search path.
  9186. </p>
  9187. <p>(*) Actually, this is not &lsquo;<samp>cygxxx.dll</samp>&rsquo; but in fact is &lsquo;<samp>&lt;prefix&gt;xxx.dll</samp>&rsquo;,
  9188. where &lsquo;<samp>&lt;prefix&gt;</samp>&rsquo; is set by the <code>ld</code> option
  9189. &lsquo;<samp>--dll-search-prefix=&lt;prefix&gt;</samp>&rsquo;. In the case of cygwin, the standard gcc spec
  9190. file includes &lsquo;<samp>--dll-search-prefix=cyg</samp>&rsquo;, so in effect we actually search for
  9191. &lsquo;<samp>cygxxx.dll</samp>&rsquo;.
  9192. </p>
  9193. <p>Other win32-based unix environments, such as mingw or pw32, may use other
  9194. &lsquo;<samp>&lt;prefix&gt;</samp>&rsquo;es, although at present only cygwin makes use of this feature. It
  9195. was originally intended to help avoid name conflicts among dll&rsquo;s built for the
  9196. various win32/un*x environments, so that (for example) two versions of a zlib dll
  9197. could coexist on the same machine.
  9198. </p>
  9199. <p>The generic cygwin/mingw path layout uses a &lsquo;<samp>bin</samp>&rsquo; directory for
  9200. applications and dll&rsquo;s and a &lsquo;<samp>lib</samp>&rsquo; directory for the import
  9201. libraries (using cygwin nomenclature):
  9202. </p>
  9203. <div class="example">
  9204. <pre class="example">bin/
  9205. cygxxx.dll
  9206. lib/
  9207. libxxx.dll.a (in case of dll's)
  9208. libxxx.a (in case of static archive)
  9209. </pre></div>
  9210. <p>Linking directly to a dll without using the import library can be
  9211. done two ways:
  9212. </p>
  9213. <p>1. Use the dll directly by adding the &lsquo;<samp>bin</samp>&rsquo; path to the link line
  9214. </p><div class="example">
  9215. <pre class="example">gcc -Wl,-verbose -o a.exe -L../bin/ -lxxx
  9216. </pre></div>
  9217. <p>However, as the dll&rsquo;s often have version numbers appended to their names
  9218. (&lsquo;<samp>cygncurses-5.dll</samp>&rsquo;) this will often fail, unless one specifies
  9219. &lsquo;<samp>-L../bin -lncurses-5</samp>&rsquo; to include the version. Import libs are generally
  9220. not versioned, and do not have this difficulty.
  9221. </p>
  9222. <p>2. Create a symbolic link from the dll to a file in the &lsquo;<samp>lib</samp>&rsquo;
  9223. directory according to the above mentioned search pattern. This
  9224. should be used to avoid unwanted changes in the tools needed for
  9225. making the app/dll.
  9226. </p>
  9227. <div class="example">
  9228. <pre class="example">ln -s bin/cygxxx.dll lib/[cyg|lib|]xxx.dll[.a]
  9229. </pre></div>
  9230. <p>Then you can link without any make environment changes.
  9231. </p>
  9232. <div class="example">
  9233. <pre class="example">gcc -Wl,-verbose -o a.exe -L../lib/ -lxxx
  9234. </pre></div>
  9235. <p>This technique also avoids the version number problems, because the following is
  9236. perfectly legal
  9237. </p>
  9238. <div class="example">
  9239. <pre class="example">bin/
  9240. cygxxx-5.dll
  9241. lib/
  9242. libxxx.dll.a -&gt; ../bin/cygxxx-5.dll
  9243. </pre></div>
  9244. <p>Linking directly to a dll without using an import lib will work
  9245. even when auto-import features are exercised, and even when
  9246. &lsquo;<samp>--enable-runtime-pseudo-relocs</samp>&rsquo; is used.
  9247. </p>
  9248. <p>Given the improvements in speed and memory usage, one might justifiably
  9249. wonder why import libraries are used at all. There are three reasons:
  9250. </p>
  9251. <p>1. Until recently, the link-directly-to-dll functionality did <em>not</em>
  9252. work with auto-imported data.
  9253. </p>
  9254. <p>2. Sometimes it is necessary to include pure static objects within the
  9255. import library (which otherwise contains only bfd&rsquo;s for indirection
  9256. symbols that point to the exports of a dll). Again, the import lib
  9257. for the cygwin kernel makes use of this ability, and it is not
  9258. possible to do this without an import lib.
  9259. </p>
  9260. <p>3. Symbol aliases can only be resolved using an import lib. This is
  9261. critical when linking against OS-supplied dll&rsquo;s (eg, the win32 API)
  9262. in which symbols are usually exported as undecorated aliases of their
  9263. stdcall-decorated assembly names.
  9264. </p>
  9265. <p>So, import libs are not going away. But the ability to replace
  9266. true import libs with a simple symbolic link to (or a copy of)
  9267. a dll, in many cases, is a useful addition to the suite of tools
  9268. binutils makes available to the win32 developer. Given the
  9269. massive improvements in memory requirements during linking, storage
  9270. requirements, and linking speed, we expect that many developers
  9271. will soon begin to use this feature whenever possible.
  9272. </p>
  9273. </dd>
  9274. <dt><em>symbol aliasing</em></dt>
  9275. <dd><dl compact="compact">
  9276. <dt><em>adding additional names</em></dt>
  9277. <dd><p>Sometimes, it is useful to export symbols with additional names.
  9278. A symbol &lsquo;<samp>foo</samp>&rsquo; will be exported as &lsquo;<samp>foo</samp>&rsquo;, but it can also be
  9279. exported as &lsquo;<samp>_foo</samp>&rsquo; by using special directives in the DEF file
  9280. when creating the dll. This will affect also the optional created
  9281. import library. Consider the following DEF file:
  9282. </p>
  9283. <div class="example">
  9284. <pre class="example">LIBRARY &quot;xyz.dll&quot; BASE=0x61000000
  9285. EXPORTS
  9286. foo
  9287. _foo = foo
  9288. </pre></div>
  9289. <p>The line &lsquo;<samp>_foo = foo</samp>&rsquo; maps the symbol &lsquo;<samp>foo</samp>&rsquo; to &lsquo;<samp>_foo</samp>&rsquo;.
  9290. </p>
  9291. <p>Another method for creating a symbol alias is to create it in the
  9292. source code using the &quot;weak&quot; attribute:
  9293. </p>
  9294. <div class="example">
  9295. <pre class="example">void foo () { /* Do something. */; }
  9296. void _foo () __attribute__ ((weak, alias (&quot;foo&quot;)));
  9297. </pre></div>
  9298. <p>See the gcc manual for more information about attributes and weak
  9299. symbols.
  9300. </p>
  9301. </dd>
  9302. <dt><em>renaming symbols</em></dt>
  9303. <dd><p>Sometimes it is useful to rename exports. For instance, the cygwin
  9304. kernel does this regularly. A symbol &lsquo;<samp>_foo</samp>&rsquo; can be exported as
  9305. &lsquo;<samp>foo</samp>&rsquo; but not as &lsquo;<samp>_foo</samp>&rsquo; by using special directives in the
  9306. DEF file. (This will also affect the import library, if it is
  9307. created). In the following example:
  9308. </p>
  9309. <div class="example">
  9310. <pre class="example">LIBRARY &quot;xyz.dll&quot; BASE=0x61000000
  9311. EXPORTS
  9312. _foo = foo
  9313. </pre></div>
  9314. <p>The line &lsquo;<samp>_foo = foo</samp>&rsquo; maps the exported symbol &lsquo;<samp>foo</samp>&rsquo; to
  9315. &lsquo;<samp>_foo</samp>&rsquo;.
  9316. </p></dd>
  9317. </dl>
  9318. <p>Note: using a DEF file disables the default auto-export behavior,
  9319. unless the &lsquo;<samp>--export-all-symbols</samp>&rsquo; command-line option is used.
  9320. If, however, you are trying to rename symbols, then you should list
  9321. <em>all</em> desired exports in the DEF file, including the symbols
  9322. that are not being renamed, and do <em>not</em> use the
  9323. &lsquo;<samp>--export-all-symbols</samp>&rsquo; option. If you list only the
  9324. renamed symbols in the DEF file, and use &lsquo;<samp>--export-all-symbols</samp>&rsquo;
  9325. to handle the other symbols, then the both the new names <em>and</em>
  9326. the original names for the renamed symbols will be exported.
  9327. In effect, you&rsquo;d be aliasing those symbols, not renaming them,
  9328. which is probably not what you wanted.
  9329. </p>
  9330. <span id="index-weak-externals"></span>
  9331. </dd>
  9332. <dt><em>weak externals</em></dt>
  9333. <dd><p>The Windows object format, PE, specifies a form of weak symbols called
  9334. weak externals. When a weak symbol is linked and the symbol is not
  9335. defined, the weak symbol becomes an alias for some other symbol. There
  9336. are three variants of weak externals:
  9337. </p><ul>
  9338. <li> Definition is searched for in objects and libraries, historically
  9339. called lazy externals.
  9340. </li><li> Definition is searched for only in other objects, not in libraries.
  9341. This form is not presently implemented.
  9342. </li><li> No search; the symbol is an alias. This form is not presently
  9343. implemented.
  9344. </li></ul>
  9345. <p>As a GNU extension, weak symbols that do not specify an alternate symbol
  9346. are supported. If the symbol is undefined when linking, the symbol
  9347. uses a default value.
  9348. </p>
  9349. <span id="index-aligned-common-symbols"></span>
  9350. </dd>
  9351. <dt><em>aligned common symbols</em></dt>
  9352. <dd><p>As a GNU extension to the PE file format, it is possible to specify the
  9353. desired alignment for a common symbol. This information is conveyed from
  9354. the assembler or compiler to the linker by means of GNU-specific commands
  9355. carried in the object file&rsquo;s &lsquo;<samp>.drectve</samp>&rsquo; section, which are recognized
  9356. by <code>ld</code> and respected when laying out the common symbols. Native
  9357. tools will be able to process object files employing this GNU extension,
  9358. but will fail to respect the alignment instructions, and may issue noisy
  9359. warnings about unknown linker directives.
  9360. </p>
  9361. </dd>
  9362. </dl>
  9363. <hr>
  9364. <span id="Xtensa"></span><div class="header">
  9365. <p>
  9366. Previous: <a href="#WIN32" accesskey="p" rel="prev">WIN32</a>, Up: <a href="#Machine-Dependent" accesskey="u" rel="up">Machine Dependent</a> &nbsp; [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#LD-Index" title="Index" rel="index">Index</a>]</p>
  9367. </div>
  9368. <span id="ld-and-Xtensa-Processors"></span><h3 class="section">6.17 <code>ld</code> and Xtensa Processors</h3>
  9369. <span id="index-Xtensa-processors"></span>
  9370. <p>The default <code>ld</code> behavior for Xtensa processors is to interpret
  9371. <code>SECTIONS</code> commands so that lists of explicitly named sections in a
  9372. specification with a wildcard file will be interleaved when necessary to
  9373. keep literal pools within the range of PC-relative load offsets. For
  9374. example, with the command:
  9375. </p>
  9376. <div class="example">
  9377. <pre class="example">SECTIONS
  9378. {
  9379. .text : {
  9380. *(.literal .text)
  9381. }
  9382. }
  9383. </pre></div>
  9384. <p><code>ld</code> may interleave some of the <code>.literal</code>
  9385. and <code>.text</code> sections from different object files to ensure that the
  9386. literal pools are within the range of PC-relative load offsets. A valid
  9387. interleaving might place the <code>.literal</code> sections from an initial
  9388. group of files followed by the <code>.text</code> sections of that group of
  9389. files. Then, the <code>.literal</code> sections from the rest of the files
  9390. and the <code>.text</code> sections from the rest of the files would follow.
  9391. </p>
  9392. <span id="index-_002d_002drelax-on-Xtensa"></span>
  9393. <span id="index-relaxing-on-Xtensa"></span>
  9394. <p>Relaxation is enabled by default for the Xtensa version of <code>ld</code> and
  9395. provides two important link-time optimizations. The first optimization
  9396. is to combine identical literal values to reduce code size. A redundant
  9397. literal will be removed and all the <code>L32R</code> instructions that use it
  9398. will be changed to reference an identical literal, as long as the
  9399. location of the replacement literal is within the offset range of all
  9400. the <code>L32R</code> instructions. The second optimization is to remove
  9401. unnecessary overhead from assembler-generated &ldquo;longcall&rdquo; sequences of
  9402. <code>L32R</code>/<code>CALLX<var>n</var></code> when the target functions are within
  9403. range of direct <code>CALL<var>n</var></code> instructions.
  9404. </p>
  9405. <p>For each of these cases where an indirect call sequence can be optimized
  9406. to a direct call, the linker will change the <code>CALLX<var>n</var></code>
  9407. instruction to a <code>CALL<var>n</var></code> instruction, remove the <code>L32R</code>
  9408. instruction, and remove the literal referenced by the <code>L32R</code>
  9409. instruction if it is not used for anything else. Removing the
  9410. <code>L32R</code> instruction always reduces code size but can potentially
  9411. hurt performance by changing the alignment of subsequent branch targets.
  9412. By default, the linker will always preserve alignments, either by
  9413. switching some instructions between 24-bit encodings and the equivalent
  9414. density instructions or by inserting a no-op in place of the <code>L32R</code>
  9415. instruction that was removed. If code size is more important than
  9416. performance, the <samp>--size-opt</samp> option can be used to prevent the
  9417. linker from widening density instructions or inserting no-ops, except in
  9418. a few cases where no-ops are required for correctness.
  9419. </p>
  9420. <p>The following Xtensa-specific command-line options can be used to
  9421. control the linker:
  9422. </p>
  9423. <span id="index-Xtensa-options"></span>
  9424. <dl compact="compact">
  9425. <dt><samp>--size-opt</samp></dt>
  9426. <dd><p>When optimizing indirect calls to direct calls, optimize for code size
  9427. more than performance. With this option, the linker will not insert
  9428. no-ops or widen density instructions to preserve branch target
  9429. alignment. There may still be some cases where no-ops are required to
  9430. preserve the correctness of the code.
  9431. </p>
  9432. </dd>
  9433. <dt><samp>--abi-windowed</samp></dt>
  9434. <dt><samp>--abi-call0</samp></dt>
  9435. <dd><p>Choose ABI for the output object and for the generated PLT code.
  9436. PLT code inserted by the linker must match ABI of the output object
  9437. because windowed and call0 ABI use incompatible function call
  9438. conventions.
  9439. Default ABI is chosen by the ABI tag in the <code>.xtensa.info</code> section
  9440. of the first input object.
  9441. A warning is issued if ABI tags of input objects do not match each other
  9442. or the chosen output object ABI.
  9443. </p></dd>
  9444. </dl>
  9445. <hr>
  9446. <span id="BFD"></span><div class="header">
  9447. <p>
  9448. Next: <a href="#Reporting-Bugs" accesskey="n" rel="next">Reporting Bugs</a>, Previous: <a href="#Machine-Dependent" accesskey="p" rel="prev">Machine Dependent</a>, Up: <a href="#Top" accesskey="u" rel="up">Top</a> &nbsp; [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#LD-Index" title="Index" rel="index">Index</a>]</p>
  9449. </div>
  9450. <span id="BFD-1"></span><h2 class="chapter">7 BFD</h2>
  9451. <span id="index-back-end"></span>
  9452. <span id="index-object-file-management"></span>
  9453. <span id="index-object-formats-available"></span>
  9454. <span id="index-objdump-_002di"></span>
  9455. <p>The linker accesses object and archive files using the BFD libraries.
  9456. These libraries allow the linker to use the same routines to operate on
  9457. object files whatever the object file format. A different object file
  9458. format can be supported simply by creating a new BFD back end and adding
  9459. it to the library. To conserve runtime memory, however, the linker and
  9460. associated tools are usually configured to support only a subset of the
  9461. object file formats available. You can use <code>objdump -i</code>
  9462. (see <a href="https://sourceware.org/binutils/docs/binutils/objdump.html#objdump">objdump</a> in <cite>The GNU Binary Utilities</cite>) to
  9463. list all the formats available for your configuration.
  9464. </p>
  9465. <span id="index-BFD-requirements"></span>
  9466. <span id="index-requirements-for-BFD"></span>
  9467. <p>As with most implementations, BFD is a compromise between
  9468. several conflicting requirements. The major factor influencing
  9469. BFD design was efficiency: any time used converting between
  9470. formats is time which would not have been spent had BFD not
  9471. been involved. This is partly offset by abstraction payback; since
  9472. BFD simplifies applications and back ends, more time and care
  9473. may be spent optimizing algorithms for a greater speed.
  9474. </p>
  9475. <p>One minor artifact of the BFD solution which you should bear in
  9476. mind is the potential for information loss. There are two places where
  9477. useful information can be lost using the BFD mechanism: during
  9478. conversion and during output. See <a href="#BFD-information-loss">BFD information loss</a>.
  9479. </p>
  9480. <table class="menu" border="0" cellspacing="0">
  9481. <tr><td align="left" valign="top">&bull; <a href="#BFD-outline" accesskey="1">BFD outline</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">How it works: an outline of BFD
  9482. </td></tr>
  9483. </table>
  9484. <hr>
  9485. <span id="BFD-outline"></span><div class="header">
  9486. <p>
  9487. Up: <a href="#BFD" accesskey="u" rel="up">BFD</a> &nbsp; [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#LD-Index" title="Index" rel="index">Index</a>]</p>
  9488. </div>
  9489. <span id="How-It-Works_003a-An-Outline-of-BFD"></span><h3 class="section">7.1 How It Works: An Outline of BFD</h3>
  9490. <span id="index-opening-object-files"></span>
  9491. <p>When an object file is opened, BFD subroutines automatically determine
  9492. the format of the input object file. They then build a descriptor in
  9493. memory with pointers to routines that will be used to access elements of
  9494. the object file&rsquo;s data structures.
  9495. </p>
  9496. <p>As different information from the object files is required,
  9497. BFD reads from different sections of the file and processes them.
  9498. For example, a very common operation for the linker is processing symbol
  9499. tables. Each BFD back end provides a routine for converting
  9500. between the object file&rsquo;s representation of symbols and an internal
  9501. canonical format. When the linker asks for the symbol table of an object
  9502. file, it calls through a memory pointer to the routine from the
  9503. relevant BFD back end which reads and converts the table into a canonical
  9504. form. The linker then operates upon the canonical form. When the link is
  9505. finished and the linker writes the output file&rsquo;s symbol table,
  9506. another BFD back end routine is called to take the newly
  9507. created symbol table and convert it into the chosen output format.
  9508. </p>
  9509. <table class="menu" border="0" cellspacing="0">
  9510. <tr><td align="left" valign="top">&bull; <a href="#BFD-information-loss" accesskey="1">BFD information loss</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">Information Loss
  9511. </td></tr>
  9512. <tr><td align="left" valign="top">&bull; <a href="#Canonical-format" accesskey="2">Canonical format</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">The BFD canonical object-file format
  9513. </td></tr>
  9514. </table>
  9515. <hr>
  9516. <span id="BFD-information-loss"></span><div class="header">
  9517. <p>
  9518. Next: <a href="#Canonical-format" accesskey="n" rel="next">Canonical format</a>, Up: <a href="#BFD-outline" accesskey="u" rel="up">BFD outline</a> &nbsp; [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#LD-Index" title="Index" rel="index">Index</a>]</p>
  9519. </div>
  9520. <span id="Information-Loss"></span><h4 class="subsection">7.1.1 Information Loss</h4>
  9521. <p><em>Information can be lost during output.</em> The output formats
  9522. supported by BFD do not provide identical facilities, and
  9523. information which can be described in one form has nowhere to go in
  9524. another format. One example of this is alignment information in
  9525. <code>b.out</code>. There is nowhere in an <code>a.out</code> format file to store
  9526. alignment information on the contained data, so when a file is linked
  9527. from <code>b.out</code> and an <code>a.out</code> image is produced, alignment
  9528. information will not propagate to the output file. (The linker will
  9529. still use the alignment information internally, so the link is performed
  9530. correctly).
  9531. </p>
  9532. <p>Another example is COFF section names. COFF files may contain an
  9533. unlimited number of sections, each one with a textual section name. If
  9534. the target of the link is a format which does not have many sections (e.g.,
  9535. <code>a.out</code>) or has sections without names (e.g., the Oasys format), the
  9536. link cannot be done simply. You can circumvent this problem by
  9537. describing the desired input-to-output section mapping with the linker command
  9538. language.
  9539. </p>
  9540. <p><em>Information can be lost during canonicalization.</em> The BFD
  9541. internal canonical form of the external formats is not exhaustive; there
  9542. are structures in input formats for which there is no direct
  9543. representation internally. This means that the BFD back ends
  9544. cannot maintain all possible data richness through the transformation
  9545. between external to internal and back to external formats.
  9546. </p>
  9547. <p>This limitation is only a problem when an application reads one
  9548. format and writes another. Each BFD back end is responsible for
  9549. maintaining as much data as possible, and the internal BFD
  9550. canonical form has structures which are opaque to the BFD core,
  9551. and exported only to the back ends. When a file is read in one format,
  9552. the canonical form is generated for BFD and the application. At the
  9553. same time, the back end saves away any information which may otherwise
  9554. be lost. If the data is then written back in the same format, the back
  9555. end routine will be able to use the canonical form provided by the
  9556. BFD core as well as the information it prepared earlier. Since
  9557. there is a great deal of commonality between back ends,
  9558. there is no information lost when
  9559. linking or copying big endian COFF to little endian COFF, or <code>a.out</code> to
  9560. <code>b.out</code>. When a mixture of formats is linked, the information is
  9561. only lost from the files whose format differs from the destination.
  9562. </p>
  9563. <hr>
  9564. <span id="Canonical-format"></span><div class="header">
  9565. <p>
  9566. Previous: <a href="#BFD-information-loss" accesskey="p" rel="prev">BFD information loss</a>, Up: <a href="#BFD-outline" accesskey="u" rel="up">BFD outline</a> &nbsp; [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#LD-Index" title="Index" rel="index">Index</a>]</p>
  9567. </div>
  9568. <span id="The-BFD-canonical-object_002dfile-format"></span><h4 class="subsection">7.1.2 The BFD canonical object-file format</h4>
  9569. <p>The greatest potential for loss of information occurs when there is the least
  9570. overlap between the information provided by the source format, that
  9571. stored by the canonical format, and that needed by the
  9572. destination format. A brief description of the canonical form may help
  9573. you understand which kinds of data you can count on preserving across
  9574. conversions.
  9575. <span id="index-BFD-canonical-format"></span>
  9576. <span id="index-internal-object_002dfile-format"></span>
  9577. </p>
  9578. <dl compact="compact">
  9579. <dt><em>files</em></dt>
  9580. <dd><p>Information stored on a per-file basis includes target machine
  9581. architecture, particular implementation format type, a demand pageable
  9582. bit, and a write protected bit. Information like Unix magic numbers is
  9583. not stored here&mdash;only the magic numbers&rsquo; meaning, so a <code>ZMAGIC</code>
  9584. file would have both the demand pageable bit and the write protected
  9585. text bit set. The byte order of the target is stored on a per-file
  9586. basis, so that big- and little-endian object files may be used with one
  9587. another.
  9588. </p>
  9589. </dd>
  9590. <dt><em>sections</em></dt>
  9591. <dd><p>Each section in the input file contains the name of the section, the
  9592. section&rsquo;s original address in the object file, size and alignment
  9593. information, various flags, and pointers into other BFD data
  9594. structures.
  9595. </p>
  9596. </dd>
  9597. <dt><em>symbols</em></dt>
  9598. <dd><p>Each symbol contains a pointer to the information for the object file
  9599. which originally defined it, its name, its value, and various flag
  9600. bits. When a BFD back end reads in a symbol table, it relocates all
  9601. symbols to make them relative to the base of the section where they were
  9602. defined. Doing this ensures that each symbol points to its containing
  9603. section. Each symbol also has a varying amount of hidden private data
  9604. for the BFD back end. Since the symbol points to the original file, the
  9605. private data format for that symbol is accessible. <code>ld</code> can
  9606. operate on a collection of symbols of wildly different formats without
  9607. problems.
  9608. </p>
  9609. <p>Normal global and simple local symbols are maintained on output, so an
  9610. output file (no matter its format) will retain symbols pointing to
  9611. functions and to global, static, and common variables. Some symbol
  9612. information is not worth retaining; in <code>a.out</code>, type information is
  9613. stored in the symbol table as long symbol names. This information would
  9614. be useless to most COFF debuggers; the linker has command-line switches
  9615. to allow users to throw it away.
  9616. </p>
  9617. <p>There is one word of type information within the symbol, so if the
  9618. format supports symbol type information within symbols (for example, COFF,
  9619. Oasys) and the type is simple enough to fit within one word
  9620. (nearly everything but aggregates), the information will be preserved.
  9621. </p>
  9622. </dd>
  9623. <dt><em>relocation level</em></dt>
  9624. <dd><p>Each canonical BFD relocation record contains a pointer to the symbol to
  9625. relocate to, the offset of the data to relocate, the section the data
  9626. is in, and a pointer to a relocation type descriptor. Relocation is
  9627. performed by passing messages through the relocation type
  9628. descriptor and the symbol pointer. Therefore, relocations can be performed
  9629. on output data using a relocation method that is only available in one of the
  9630. input formats. For instance, Oasys provides a byte relocation format.
  9631. A relocation record requesting this relocation type would point
  9632. indirectly to a routine to perform this, so the relocation may be
  9633. performed on a byte being written to a 68k COFF file, even though 68k COFF
  9634. has no such relocation type.
  9635. </p>
  9636. </dd>
  9637. <dt><em>line numbers</em></dt>
  9638. <dd><p>Object formats can contain, for debugging purposes, some form of mapping
  9639. between symbols, source line numbers, and addresses in the output file.
  9640. These addresses have to be relocated along with the symbol information.
  9641. Each symbol with an associated list of line number records points to the
  9642. first record of the list. The head of a line number list consists of a
  9643. pointer to the symbol, which allows finding out the address of the
  9644. function whose line number is being described. The rest of the list is
  9645. made up of pairs: offsets into the section and line numbers. Any format
  9646. which can simply derive this information can pass it successfully
  9647. between formats.
  9648. </p></dd>
  9649. </dl>
  9650. <hr>
  9651. <span id="Reporting-Bugs"></span><div class="header">
  9652. <p>
  9653. Next: <a href="#MRI" accesskey="n" rel="next">MRI</a>, Previous: <a href="#BFD" accesskey="p" rel="prev">BFD</a>, Up: <a href="#Top" accesskey="u" rel="up">Top</a> &nbsp; [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#LD-Index" title="Index" rel="index">Index</a>]</p>
  9654. </div>
  9655. <span id="Reporting-Bugs-1"></span><h2 class="chapter">8 Reporting Bugs</h2>
  9656. <span id="index-bugs-in-ld"></span>
  9657. <span id="index-reporting-bugs-in-ld"></span>
  9658. <p>Your bug reports play an essential role in making <code>ld</code> reliable.
  9659. </p>
  9660. <p>Reporting a bug may help you by bringing a solution to your problem, or
  9661. it may not. But in any case the principal function of a bug report is
  9662. to help the entire community by making the next version of <code>ld</code>
  9663. work better. Bug reports are your contribution to the maintenance of
  9664. <code>ld</code>.
  9665. </p>
  9666. <p>In order for a bug report to serve its purpose, you must include the
  9667. information that enables us to fix the bug.
  9668. </p>
  9669. <table class="menu" border="0" cellspacing="0">
  9670. <tr><td align="left" valign="top">&bull; <a href="#Bug-Criteria" accesskey="1">Bug Criteria</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">Have you found a bug?
  9671. </td></tr>
  9672. <tr><td align="left" valign="top">&bull; <a href="#Bug-Reporting" accesskey="2">Bug Reporting</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">How to report bugs
  9673. </td></tr>
  9674. </table>
  9675. <hr>
  9676. <span id="Bug-Criteria"></span><div class="header">
  9677. <p>
  9678. Next: <a href="#Bug-Reporting" accesskey="n" rel="next">Bug Reporting</a>, Up: <a href="#Reporting-Bugs" accesskey="u" rel="up">Reporting Bugs</a> &nbsp; [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#LD-Index" title="Index" rel="index">Index</a>]</p>
  9679. </div>
  9680. <span id="Have-You-Found-a-Bug_003f"></span><h3 class="section">8.1 Have You Found a Bug?</h3>
  9681. <span id="index-bug-criteria"></span>
  9682. <p>If you are not sure whether you have found a bug, here are some guidelines:
  9683. </p>
  9684. <ul>
  9685. <li> <span id="index-fatal-signal"></span>
  9686. <span id="index-linker-crash"></span>
  9687. <span id="index-crash-of-linker"></span>
  9688. If the linker gets a fatal signal, for any input whatever, that is a
  9689. <code>ld</code> bug. Reliable linkers never crash.
  9690. </li><li> <span id="index-error-on-valid-input"></span>
  9691. If <code>ld</code> produces an error message for valid input, that is a bug.
  9692. </li><li> <span id="index-invalid-input"></span>
  9693. If <code>ld</code> does not produce an error message for invalid input, that
  9694. may be a bug. In the general case, the linker can not verify that
  9695. object files are correct.
  9696. </li><li> If you are an experienced user of linkers, your suggestions for
  9697. improvement of <code>ld</code> are welcome in any case.
  9698. </li></ul>
  9699. <hr>
  9700. <span id="Bug-Reporting"></span><div class="header">
  9701. <p>
  9702. Previous: <a href="#Bug-Criteria" accesskey="p" rel="prev">Bug Criteria</a>, Up: <a href="#Reporting-Bugs" accesskey="u" rel="up">Reporting Bugs</a> &nbsp; [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#LD-Index" title="Index" rel="index">Index</a>]</p>
  9703. </div>
  9704. <span id="How-to-Report-Bugs"></span><h3 class="section">8.2 How to Report Bugs</h3>
  9705. <span id="index-bug-reports"></span>
  9706. <span id="index-ld-bugs_002c-reporting"></span>
  9707. <p>A number of companies and individuals offer support for <small>GNU</small>
  9708. products. If you obtained <code>ld</code> from a support organization, we
  9709. recommend you contact that organization first.
  9710. </p>
  9711. <p>You can find contact information for many support companies and
  9712. individuals in the file <samp>etc/SERVICE</samp> in the <small>GNU</small> Emacs
  9713. distribution.
  9714. </p>
  9715. <p>Otherwise, send bug reports for <code>ld</code> to
  9716. <a href="https://bugs.linaro.org/">https://bugs.linaro.org/</a>.
  9717. </p>
  9718. <p>The fundamental principle of reporting bugs usefully is this:
  9719. <strong>report all the facts</strong>. If you are not sure whether to state a
  9720. fact or leave it out, state it!
  9721. </p>
  9722. <p>Often people omit facts because they think they know what causes the
  9723. problem and assume that some details do not matter. Thus, you might
  9724. assume that the name of a symbol you use in an example does not
  9725. matter. Well, probably it does not, but one cannot be sure. Perhaps
  9726. the bug is a stray memory reference which happens to fetch from the
  9727. location where that name is stored in memory; perhaps, if the name
  9728. were different, the contents of that location would fool the linker
  9729. into doing the right thing despite the bug. Play it safe and give a
  9730. specific, complete example. That is the easiest thing for you to do,
  9731. and the most helpful.
  9732. </p>
  9733. <p>Keep in mind that the purpose of a bug report is to enable us to fix
  9734. the bug if it is new to us. Therefore, always write your bug reports
  9735. on the assumption that the bug has not been reported previously.
  9736. </p>
  9737. <p>Sometimes people give a few sketchy facts and ask, &ldquo;Does this ring a
  9738. bell?&rdquo; This cannot help us fix a bug, so it is basically useless. We
  9739. respond by asking for enough details to enable us to investigate.
  9740. You might as well expedite matters by sending them to begin with.
  9741. </p>
  9742. <p>To enable us to fix the bug, you should include all these things:
  9743. </p>
  9744. <ul>
  9745. <li> The version of <code>ld</code>. <code>ld</code> announces it if you start it with
  9746. the &lsquo;<samp>--version</samp>&rsquo; argument.
  9747. <p>Without this, we will not know whether there is any point in looking for
  9748. the bug in the current version of <code>ld</code>.
  9749. </p>
  9750. </li><li> Any patches you may have applied to the <code>ld</code> source, including any
  9751. patches made to the <code>BFD</code> library.
  9752. </li><li> The type of machine you are using, and the operating system name and
  9753. version number.
  9754. </li><li> What compiler (and its version) was used to compile <code>ld</code>&mdash;e.g.
  9755. &ldquo;<code>gcc-2.7</code>&rdquo;.
  9756. </li><li> The command arguments you gave the linker to link your example and
  9757. observe the bug. To guarantee you will not omit something important,
  9758. list them all. A copy of the Makefile (or the output from make) is
  9759. sufficient.
  9760. <p>If we were to try to guess the arguments, we would probably guess wrong
  9761. and then we might not encounter the bug.
  9762. </p>
  9763. </li><li> A complete input file, or set of input files, that will reproduce the
  9764. bug. It is generally most helpful to send the actual object files
  9765. provided that they are reasonably small. Say no more than 10K. For
  9766. bigger files you can either make them available by FTP or HTTP or else
  9767. state that you are willing to send the object file(s) to whomever
  9768. requests them. (Note - your email will be going to a mailing list, so
  9769. we do not want to clog it up with large attachments). But small
  9770. attachments are best.
  9771. <p>If the source files were assembled using <code>gas</code> or compiled using
  9772. <code>gcc</code>, then it may be OK to send the source files rather than the
  9773. object files. In this case, be sure to say exactly what version of
  9774. <code>gas</code> or <code>gcc</code> was used to produce the object files. Also say
  9775. how <code>gas</code> or <code>gcc</code> were configured.
  9776. </p>
  9777. </li><li> A description of what behavior you observe that you believe is
  9778. incorrect. For example, &ldquo;It gets a fatal signal.&rdquo;
  9779. <p>Of course, if the bug is that <code>ld</code> gets a fatal signal, then we
  9780. will certainly notice it. But if the bug is incorrect output, we might
  9781. not notice unless it is glaringly wrong. You might as well not give us
  9782. a chance to make a mistake.
  9783. </p>
  9784. <p>Even if the problem you experience is a fatal signal, you should still
  9785. say so explicitly. Suppose something strange is going on, such as, your
  9786. copy of <code>ld</code> is out of sync, or you have encountered a bug in the
  9787. C library on your system. (This has happened!) Your copy might crash
  9788. and ours would not. If you told us to expect a crash, then when ours
  9789. fails to crash, we would know that the bug was not happening for us. If
  9790. you had not told us to expect a crash, then we would not be able to draw
  9791. any conclusion from our observations.
  9792. </p>
  9793. </li><li> If you wish to suggest changes to the <code>ld</code> source, send us context
  9794. diffs, as generated by <code>diff</code> with the &lsquo;<samp>-u</samp>&rsquo;, &lsquo;<samp>-c</samp>&rsquo;, or
  9795. &lsquo;<samp>-p</samp>&rsquo; option. Always send diffs from the old file to the new file.
  9796. If you even discuss something in the <code>ld</code> source, refer to it by
  9797. context, not by line number.
  9798. <p>The line numbers in our development sources will not match those in your
  9799. sources. Your line numbers would convey no useful information to us.
  9800. </p></li></ul>
  9801. <p>Here are some things that are not necessary:
  9802. </p>
  9803. <ul>
  9804. <li> A description of the envelope of the bug.
  9805. <p>Often people who encounter a bug spend a lot of time investigating
  9806. which changes to the input file will make the bug go away and which
  9807. changes will not affect it.
  9808. </p>
  9809. <p>This is often time consuming and not very useful, because the way we
  9810. will find the bug is by running a single example under the debugger
  9811. with breakpoints, not by pure deduction from a series of examples.
  9812. We recommend that you save your time for something else.
  9813. </p>
  9814. <p>Of course, if you can find a simpler example to report <em>instead</em>
  9815. of the original one, that is a convenience for us. Errors in the
  9816. output will be easier to spot, running under the debugger will take
  9817. less time, and so on.
  9818. </p>
  9819. <p>However, simplification is not vital; if you do not want to do this,
  9820. report the bug anyway and send us the entire test case you used.
  9821. </p>
  9822. </li><li> A patch for the bug.
  9823. <p>A patch for the bug does help us if it is a good one. But do not omit
  9824. the necessary information, such as the test case, on the assumption that
  9825. a patch is all we need. We might see problems with your patch and decide
  9826. to fix the problem another way, or we might not understand it at all.
  9827. </p>
  9828. <p>Sometimes with a program as complicated as <code>ld</code> it is very hard to
  9829. construct an example that will make the program follow a certain path
  9830. through the code. If you do not send us the example, we will not be
  9831. able to construct one, so we will not be able to verify that the bug is
  9832. fixed.
  9833. </p>
  9834. <p>And if we cannot understand what bug you are trying to fix, or why your
  9835. patch should be an improvement, we will not install it. A test case will
  9836. help us to understand.
  9837. </p>
  9838. </li><li> A guess about what the bug is or what it depends on.
  9839. <p>Such guesses are usually wrong. Even we cannot guess right about such
  9840. things without first using the debugger to find the facts.
  9841. </p></li></ul>
  9842. <hr>
  9843. <span id="MRI"></span><div class="header">
  9844. <p>
  9845. Next: <a href="#GNU-Free-Documentation-License" accesskey="n" rel="next">GNU Free Documentation License</a>, Previous: <a href="#Reporting-Bugs" accesskey="p" rel="prev">Reporting Bugs</a>, Up: <a href="#Top" accesskey="u" rel="up">Top</a> &nbsp; [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#LD-Index" title="Index" rel="index">Index</a>]</p>
  9846. </div>
  9847. <span id="MRI-Compatible-Script-Files"></span><h2 class="appendix">Appendix A MRI Compatible Script Files</h2>
  9848. <span id="index-MRI-compatibility"></span>
  9849. <p>To aid users making the transition to <small>GNU</small> <code>ld</code> from the MRI
  9850. linker, <code>ld</code> can use MRI compatible linker scripts as an
  9851. alternative to the more general-purpose linker scripting language
  9852. described in <a href="#Scripts">Scripts</a>. MRI compatible linker scripts have a much
  9853. simpler command set than the scripting language otherwise used with
  9854. <code>ld</code>. <small>GNU</small> <code>ld</code> supports the most commonly used MRI
  9855. linker commands; these commands are described here.
  9856. </p>
  9857. <p>In general, MRI scripts aren&rsquo;t of much use with the <code>a.out</code> object
  9858. file format, since it only has three sections and MRI scripts lack some
  9859. features to make use of them.
  9860. </p>
  9861. <p>You can specify a file containing an MRI-compatible script using the
  9862. &lsquo;<samp>-c</samp>&rsquo; command-line option.
  9863. </p>
  9864. <p>Each command in an MRI-compatible script occupies its own line; each
  9865. command line starts with the keyword that identifies the command (though
  9866. blank lines are also allowed for punctuation). If a line of an
  9867. MRI-compatible script begins with an unrecognized keyword, <code>ld</code>
  9868. issues a warning message, but continues processing the script.
  9869. </p>
  9870. <p>Lines beginning with &lsquo;<samp>*</samp>&rsquo; are comments.
  9871. </p>
  9872. <p>You can write these commands using all upper-case letters, or all
  9873. lower case; for example, &lsquo;<samp>chip</samp>&rsquo; is the same as &lsquo;<samp>CHIP</samp>&rsquo;.
  9874. The following list shows only the upper-case form of each command.
  9875. </p>
  9876. <dl compact="compact">
  9877. <dd><span id="index-ABSOLUTE-_0028MRI_0029"></span>
  9878. </dd>
  9879. <dt><code>ABSOLUTE <var>secname</var></code></dt>
  9880. <dt><code>ABSOLUTE <var>secname</var>, <var>secname</var>, &hellip; <var>secname</var></code></dt>
  9881. <dd><p>Normally, <code>ld</code> includes in the output file all sections from all
  9882. the input files. However, in an MRI-compatible script, you can use the
  9883. <code>ABSOLUTE</code> command to restrict the sections that will be present in
  9884. your output program. If the <code>ABSOLUTE</code> command is used at all in a
  9885. script, then only the sections named explicitly in <code>ABSOLUTE</code>
  9886. commands will appear in the linker output. You can still use other
  9887. input sections (whatever you select on the command line, or using
  9888. <code>LOAD</code>) to resolve addresses in the output file.
  9889. </p>
  9890. <span id="index-ALIAS-_0028MRI_0029"></span>
  9891. </dd>
  9892. <dt><code>ALIAS <var>out-secname</var>, <var>in-secname</var></code></dt>
  9893. <dd><p>Use this command to place the data from input section <var>in-secname</var>
  9894. in a section called <var>out-secname</var> in the linker output file.
  9895. </p>
  9896. <p><var>in-secname</var> may be an integer.
  9897. </p>
  9898. <span id="index-ALIGN-_0028MRI_0029"></span>
  9899. </dd>
  9900. <dt><code>ALIGN <var>secname</var> = <var>expression</var></code></dt>
  9901. <dd><p>Align the section called <var>secname</var> to <var>expression</var>. The
  9902. <var>expression</var> should be a power of two.
  9903. </p>
  9904. <span id="index-BASE-_0028MRI_0029"></span>
  9905. </dd>
  9906. <dt><code>BASE <var>expression</var></code></dt>
  9907. <dd><p>Use the value of <var>expression</var> as the lowest address (other than
  9908. absolute addresses) in the output file.
  9909. </p>
  9910. <span id="index-CHIP-_0028MRI_0029"></span>
  9911. </dd>
  9912. <dt><code>CHIP <var>expression</var></code></dt>
  9913. <dt><code>CHIP <var>expression</var>, <var>expression</var></code></dt>
  9914. <dd><p>This command does nothing; it is accepted only for compatibility.
  9915. </p>
  9916. <span id="index-END-_0028MRI_0029"></span>
  9917. </dd>
  9918. <dt><code>END</code></dt>
  9919. <dd><p>This command does nothing whatever; it&rsquo;s only accepted for compatibility.
  9920. </p>
  9921. <span id="index-FORMAT-_0028MRI_0029"></span>
  9922. </dd>
  9923. <dt><code>FORMAT <var>output-format</var></code></dt>
  9924. <dd><p>Similar to the <code>OUTPUT_FORMAT</code> command in the more general linker
  9925. language, but restricted to S-records, if <var>output-format</var> is &lsquo;<samp>S</samp>&rsquo;
  9926. </p>
  9927. <span id="index-LIST-_0028MRI_0029"></span>
  9928. </dd>
  9929. <dt><code>LIST <var>anything</var>&hellip;</code></dt>
  9930. <dd><p>Print (to the standard output file) a link map, as produced by the
  9931. <code>ld</code> command-line option &lsquo;<samp>-M</samp>&rsquo;.
  9932. </p>
  9933. <p>The keyword <code>LIST</code> may be followed by anything on the
  9934. same line, with no change in its effect.
  9935. </p>
  9936. <span id="index-LOAD-_0028MRI_0029"></span>
  9937. </dd>
  9938. <dt><code>LOAD <var>filename</var></code></dt>
  9939. <dt><code>LOAD <var>filename</var>, <var>filename</var>, &hellip; <var>filename</var></code></dt>
  9940. <dd><p>Include one or more object file <var>filename</var> in the link; this has the
  9941. same effect as specifying <var>filename</var> directly on the <code>ld</code>
  9942. command line.
  9943. </p>
  9944. <span id="index-NAME-_0028MRI_0029"></span>
  9945. </dd>
  9946. <dt><code>NAME <var>output-name</var></code></dt>
  9947. <dd><p><var>output-name</var> is the name for the program produced by <code>ld</code>; the
  9948. MRI-compatible command <code>NAME</code> is equivalent to the command-line
  9949. option &lsquo;<samp>-o</samp>&rsquo; or the general script language command <code>OUTPUT</code>.
  9950. </p>
  9951. <span id="index-ORDER-_0028MRI_0029"></span>
  9952. </dd>
  9953. <dt><code>ORDER <var>secname</var>, <var>secname</var>, &hellip; <var>secname</var></code></dt>
  9954. <dt><code>ORDER <var>secname</var> <var>secname</var> <var>secname</var></code></dt>
  9955. <dd><p>Normally, <code>ld</code> orders the sections in its output file in the
  9956. order in which they first appear in the input files. In an MRI-compatible
  9957. script, you can override this ordering with the <code>ORDER</code> command. The
  9958. sections you list with <code>ORDER</code> will appear first in your output
  9959. file, in the order specified.
  9960. </p>
  9961. <span id="index-PUBLIC-_0028MRI_0029"></span>
  9962. </dd>
  9963. <dt><code>PUBLIC <var>name</var>=<var>expression</var></code></dt>
  9964. <dt><code>PUBLIC <var>name</var>,<var>expression</var></code></dt>
  9965. <dt><code>PUBLIC <var>name</var> <var>expression</var></code></dt>
  9966. <dd><p>Supply a value (<var>expression</var>) for external symbol
  9967. <var>name</var> used in the linker input files.
  9968. </p>
  9969. <span id="index-SECT-_0028MRI_0029"></span>
  9970. </dd>
  9971. <dt><code>SECT <var>secname</var>, <var>expression</var></code></dt>
  9972. <dt><code>SECT <var>secname</var>=<var>expression</var></code></dt>
  9973. <dt><code>SECT <var>secname</var> <var>expression</var></code></dt>
  9974. <dd><p>You can use any of these three forms of the <code>SECT</code> command to
  9975. specify the start address (<var>expression</var>) for section <var>secname</var>.
  9976. If you have more than one <code>SECT</code> statement for the same
  9977. <var>secname</var>, only the <em>first</em> sets the start address.
  9978. </p></dd>
  9979. </dl>
  9980. <hr>
  9981. <span id="GNU-Free-Documentation-License"></span><div class="header">
  9982. <p>
  9983. Next: <a href="#LD-Index" accesskey="n" rel="next">LD Index</a>, Previous: <a href="#MRI" accesskey="p" rel="prev">MRI</a>, Up: <a href="#Top" accesskey="u" rel="up">Top</a> &nbsp; [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#LD-Index" title="Index" rel="index">Index</a>]</p>
  9984. </div>
  9985. <span id="GNU-Free-Documentation-License-1"></span><h2 class="appendix">Appendix B GNU Free Documentation License</h2>
  9986. <div align="center">Version 1.3, 3 November 2008
  9987. </div>
  9988. <div class="display">
  9989. <pre class="display">Copyright &copy; 2000, 2001, 2002, 2007, 2008 Free Software Foundation, Inc.
  9990. <a href="http://fsf.org/">http://fsf.org/</a>
  9991. Everyone is permitted to copy and distribute verbatim copies
  9992. of this license document, but changing it is not allowed.
  9993. </pre></div>
  9994. <ol start="0">
  9995. <li> PREAMBLE
  9996. <p>The purpose of this License is to make a manual, textbook, or other
  9997. functional and useful document <em>free</em> in the sense of freedom: to
  9998. assure everyone the effective freedom to copy and redistribute it,
  9999. with or without modifying it, either commercially or noncommercially.
  10000. Secondarily, this License preserves for the author and publisher a way
  10001. to get credit for their work, while not being considered responsible
  10002. for modifications made by others.
  10003. </p>
  10004. <p>This License is a kind of &ldquo;copyleft&rdquo;, which means that derivative
  10005. works of the document must themselves be free in the same sense. It
  10006. complements the GNU General Public License, which is a copyleft
  10007. license designed for free software.
  10008. </p>
  10009. <p>We have designed this License in order to use it for manuals for free
  10010. software, because free software needs free documentation: a free
  10011. program should come with manuals providing the same freedoms that the
  10012. software does. But this License is not limited to software manuals;
  10013. it can be used for any textual work, regardless of subject matter or
  10014. whether it is published as a printed book. We recommend this License
  10015. principally for works whose purpose is instruction or reference.
  10016. </p>
  10017. </li><li> APPLICABILITY AND DEFINITIONS
  10018. <p>This License applies to any manual or other work, in any medium, that
  10019. contains a notice placed by the copyright holder saying it can be
  10020. distributed under the terms of this License. Such a notice grants a
  10021. world-wide, royalty-free license, unlimited in duration, to use that
  10022. work under the conditions stated herein. The &ldquo;Document&rdquo;, below,
  10023. refers to any such manual or work. Any member of the public is a
  10024. licensee, and is addressed as &ldquo;you&rdquo;. You accept the license if you
  10025. copy, modify or distribute the work in a way requiring permission
  10026. under copyright law.
  10027. </p>
  10028. <p>A &ldquo;Modified Version&rdquo; of the Document means any work containing the
  10029. Document or a portion of it, either copied verbatim, or with
  10030. modifications and/or translated into another language.
  10031. </p>
  10032. <p>A &ldquo;Secondary Section&rdquo; is a named appendix or a front-matter section
  10033. of the Document that deals exclusively with the relationship of the
  10034. publishers or authors of the Document to the Document&rsquo;s overall
  10035. subject (or to related matters) and contains nothing that could fall
  10036. directly within that overall subject. (Thus, if the Document is in
  10037. part a textbook of mathematics, a Secondary Section may not explain
  10038. any mathematics.) The relationship could be a matter of historical
  10039. connection with the subject or with related matters, or of legal,
  10040. commercial, philosophical, ethical or political position regarding
  10041. them.
  10042. </p>
  10043. <p>The &ldquo;Invariant Sections&rdquo; are certain Secondary Sections whose titles
  10044. are designated, as being those of Invariant Sections, in the notice
  10045. that says that the Document is released under this License. If a
  10046. section does not fit the above definition of Secondary then it is not
  10047. allowed to be designated as Invariant. The Document may contain zero
  10048. Invariant Sections. If the Document does not identify any Invariant
  10049. Sections then there are none.
  10050. </p>
  10051. <p>The &ldquo;Cover Texts&rdquo; are certain short passages of text that are listed,
  10052. as Front-Cover Texts or Back-Cover Texts, in the notice that says that
  10053. the Document is released under this License. A Front-Cover Text may
  10054. be at most 5 words, and a Back-Cover Text may be at most 25 words.
  10055. </p>
  10056. <p>A &ldquo;Transparent&rdquo; copy of the Document means a machine-readable copy,
  10057. represented in a format whose specification is available to the
  10058. general public, that is suitable for revising the document
  10059. straightforwardly with generic text editors or (for images composed of
  10060. pixels) generic paint programs or (for drawings) some widely available
  10061. drawing editor, and that is suitable for input to text formatters or
  10062. for automatic translation to a variety of formats suitable for input
  10063. to text formatters. A copy made in an otherwise Transparent file
  10064. format whose markup, or absence of markup, has been arranged to thwart
  10065. or discourage subsequent modification by readers is not Transparent.
  10066. An image format is not Transparent if used for any substantial amount
  10067. of text. A copy that is not &ldquo;Transparent&rdquo; is called &ldquo;Opaque&rdquo;.
  10068. </p>
  10069. <p>Examples of suitable formats for Transparent copies include plain
  10070. <small>ASCII</small> without markup, Texinfo input format, LaTeX input
  10071. format, <acronym>SGML</acronym> or <acronym>XML</acronym> using a publicly available
  10072. <acronym>DTD</acronym>, and standard-conforming simple <acronym>HTML</acronym>,
  10073. PostScript or <acronym>PDF</acronym> designed for human modification. Examples
  10074. of transparent image formats include <acronym>PNG</acronym>, <acronym>XCF</acronym> and
  10075. <acronym>JPG</acronym>. Opaque formats include proprietary formats that can be
  10076. read and edited only by proprietary word processors, <acronym>SGML</acronym> or
  10077. <acronym>XML</acronym> for which the <acronym>DTD</acronym> and/or processing tools are
  10078. not generally available, and the machine-generated <acronym>HTML</acronym>,
  10079. PostScript or <acronym>PDF</acronym> produced by some word processors for
  10080. output purposes only.
  10081. </p>
  10082. <p>The &ldquo;Title Page&rdquo; means, for a printed book, the title page itself,
  10083. plus such following pages as are needed to hold, legibly, the material
  10084. this License requires to appear in the title page. For works in
  10085. formats which do not have any title page as such, &ldquo;Title Page&rdquo; means
  10086. the text near the most prominent appearance of the work&rsquo;s title,
  10087. preceding the beginning of the body of the text.
  10088. </p>
  10089. <p>The &ldquo;publisher&rdquo; means any person or entity that distributes copies
  10090. of the Document to the public.
  10091. </p>
  10092. <p>A section &ldquo;Entitled XYZ&rdquo; means a named subunit of the Document whose
  10093. title either is precisely XYZ or contains XYZ in parentheses following
  10094. text that translates XYZ in another language. (Here XYZ stands for a
  10095. specific section name mentioned below, such as &ldquo;Acknowledgements&rdquo;,
  10096. &ldquo;Dedications&rdquo;, &ldquo;Endorsements&rdquo;, or &ldquo;History&rdquo;.) To &ldquo;Preserve the Title&rdquo;
  10097. of such a section when you modify the Document means that it remains a
  10098. section &ldquo;Entitled XYZ&rdquo; according to this definition.
  10099. </p>
  10100. <p>The Document may include Warranty Disclaimers next to the notice which
  10101. states that this License applies to the Document. These Warranty
  10102. Disclaimers are considered to be included by reference in this
  10103. License, but only as regards disclaiming warranties: any other
  10104. implication that these Warranty Disclaimers may have is void and has
  10105. no effect on the meaning of this License.
  10106. </p>
  10107. </li><li> VERBATIM COPYING
  10108. <p>You may copy and distribute the Document in any medium, either
  10109. commercially or noncommercially, provided that this License, the
  10110. copyright notices, and the license notice saying this License applies
  10111. to the Document are reproduced in all copies, and that you add no other
  10112. conditions whatsoever to those of this License. You may not use
  10113. technical measures to obstruct or control the reading or further
  10114. copying of the copies you make or distribute. However, you may accept
  10115. compensation in exchange for copies. If you distribute a large enough
  10116. number of copies you must also follow the conditions in section 3.
  10117. </p>
  10118. <p>You may also lend copies, under the same conditions stated above, and
  10119. you may publicly display copies.
  10120. </p>
  10121. </li><li> COPYING IN QUANTITY
  10122. <p>If you publish printed copies (or copies in media that commonly have
  10123. printed covers) of the Document, numbering more than 100, and the
  10124. Document&rsquo;s license notice requires Cover Texts, you must enclose the
  10125. copies in covers that carry, clearly and legibly, all these Cover
  10126. Texts: Front-Cover Texts on the front cover, and Back-Cover Texts on
  10127. the back cover. Both covers must also clearly and legibly identify
  10128. you as the publisher of these copies. The front cover must present
  10129. the full title with all words of the title equally prominent and
  10130. visible. You may add other material on the covers in addition.
  10131. Copying with changes limited to the covers, as long as they preserve
  10132. the title of the Document and satisfy these conditions, can be treated
  10133. as verbatim copying in other respects.
  10134. </p>
  10135. <p>If the required texts for either cover are too voluminous to fit
  10136. legibly, you should put the first ones listed (as many as fit
  10137. reasonably) on the actual cover, and continue the rest onto adjacent
  10138. pages.
  10139. </p>
  10140. <p>If you publish or distribute Opaque copies of the Document numbering
  10141. more than 100, you must either include a machine-readable Transparent
  10142. copy along with each Opaque copy, or state in or with each Opaque copy
  10143. a computer-network location from which the general network-using
  10144. public has access to download using public-standard network protocols
  10145. a complete Transparent copy of the Document, free of added material.
  10146. If you use the latter option, you must take reasonably prudent steps,
  10147. when you begin distribution of Opaque copies in quantity, to ensure
  10148. that this Transparent copy will remain thus accessible at the stated
  10149. location until at least one year after the last time you distribute an
  10150. Opaque copy (directly or through your agents or retailers) of that
  10151. edition to the public.
  10152. </p>
  10153. <p>It is requested, but not required, that you contact the authors of the
  10154. Document well before redistributing any large number of copies, to give
  10155. them a chance to provide you with an updated version of the Document.
  10156. </p>
  10157. </li><li> MODIFICATIONS
  10158. <p>You may copy and distribute a Modified Version of the Document under
  10159. the conditions of sections 2 and 3 above, provided that you release
  10160. the Modified Version under precisely this License, with the Modified
  10161. Version filling the role of the Document, thus licensing distribution
  10162. and modification of the Modified Version to whoever possesses a copy
  10163. of it. In addition, you must do these things in the Modified Version:
  10164. </p>
  10165. <ol type="A" start="1">
  10166. <li> Use in the Title Page (and on the covers, if any) a title distinct
  10167. from that of the Document, and from those of previous versions
  10168. (which should, if there were any, be listed in the History section
  10169. of the Document). You may use the same title as a previous version
  10170. if the original publisher of that version gives permission.
  10171. </li><li> List on the Title Page, as authors, one or more persons or entities
  10172. responsible for authorship of the modifications in the Modified
  10173. Version, together with at least five of the principal authors of the
  10174. Document (all of its principal authors, if it has fewer than five),
  10175. unless they release you from this requirement.
  10176. </li><li> State on the Title page the name of the publisher of the
  10177. Modified Version, as the publisher.
  10178. </li><li> Preserve all the copyright notices of the Document.
  10179. </li><li> Add an appropriate copyright notice for your modifications
  10180. adjacent to the other copyright notices.
  10181. </li><li> Include, immediately after the copyright notices, a license notice
  10182. giving the public permission to use the Modified Version under the
  10183. terms of this License, in the form shown in the Addendum below.
  10184. </li><li> Preserve in that license notice the full lists of Invariant Sections
  10185. and required Cover Texts given in the Document&rsquo;s license notice.
  10186. </li><li> Include an unaltered copy of this License.
  10187. </li><li> Preserve the section Entitled &ldquo;History&rdquo;, Preserve its Title, and add
  10188. to it an item stating at least the title, year, new authors, and
  10189. publisher of the Modified Version as given on the Title Page. If
  10190. there is no section Entitled &ldquo;History&rdquo; in the Document, create one
  10191. stating the title, year, authors, and publisher of the Document as
  10192. given on its Title Page, then add an item describing the Modified
  10193. Version as stated in the previous sentence.
  10194. </li><li> Preserve the network location, if any, given in the Document for
  10195. public access to a Transparent copy of the Document, and likewise
  10196. the network locations given in the Document for previous versions
  10197. it was based on. These may be placed in the &ldquo;History&rdquo; section.
  10198. You may omit a network location for a work that was published at
  10199. least four years before the Document itself, or if the original
  10200. publisher of the version it refers to gives permission.
  10201. </li><li> For any section Entitled &ldquo;Acknowledgements&rdquo; or &ldquo;Dedications&rdquo;, Preserve
  10202. the Title of the section, and preserve in the section all the
  10203. substance and tone of each of the contributor acknowledgements and/or
  10204. dedications given therein.
  10205. </li><li> Preserve all the Invariant Sections of the Document,
  10206. unaltered in their text and in their titles. Section numbers
  10207. or the equivalent are not considered part of the section titles.
  10208. </li><li> Delete any section Entitled &ldquo;Endorsements&rdquo;. Such a section
  10209. may not be included in the Modified Version.
  10210. </li><li> Do not retitle any existing section to be Entitled &ldquo;Endorsements&rdquo; or
  10211. to conflict in title with any Invariant Section.
  10212. </li><li> Preserve any Warranty Disclaimers.
  10213. </li></ol>
  10214. <p>If the Modified Version includes new front-matter sections or
  10215. appendices that qualify as Secondary Sections and contain no material
  10216. copied from the Document, you may at your option designate some or all
  10217. of these sections as invariant. To do this, add their titles to the
  10218. list of Invariant Sections in the Modified Version&rsquo;s license notice.
  10219. These titles must be distinct from any other section titles.
  10220. </p>
  10221. <p>You may add a section Entitled &ldquo;Endorsements&rdquo;, provided it contains
  10222. nothing but endorsements of your Modified Version by various
  10223. parties&mdash;for example, statements of peer review or that the text has
  10224. been approved by an organization as the authoritative definition of a
  10225. standard.
  10226. </p>
  10227. <p>You may add a passage of up to five words as a Front-Cover Text, and a
  10228. passage of up to 25 words as a Back-Cover Text, to the end of the list
  10229. of Cover Texts in the Modified Version. Only one passage of
  10230. Front-Cover Text and one of Back-Cover Text may be added by (or
  10231. through arrangements made by) any one entity. If the Document already
  10232. includes a cover text for the same cover, previously added by you or
  10233. by arrangement made by the same entity you are acting on behalf of,
  10234. you may not add another; but you may replace the old one, on explicit
  10235. permission from the previous publisher that added the old one.
  10236. </p>
  10237. <p>The author(s) and publisher(s) of the Document do not by this License
  10238. give permission to use their names for publicity for or to assert or
  10239. imply endorsement of any Modified Version.
  10240. </p>
  10241. </li><li> COMBINING DOCUMENTS
  10242. <p>You may combine the Document with other documents released under this
  10243. License, under the terms defined in section 4 above for modified
  10244. versions, provided that you include in the combination all of the
  10245. Invariant Sections of all of the original documents, unmodified, and
  10246. list them all as Invariant Sections of your combined work in its
  10247. license notice, and that you preserve all their Warranty Disclaimers.
  10248. </p>
  10249. <p>The combined work need only contain one copy of this License, and
  10250. multiple identical Invariant Sections may be replaced with a single
  10251. copy. If there are multiple Invariant Sections with the same name but
  10252. different contents, make the title of each such section unique by
  10253. adding at the end of it, in parentheses, the name of the original
  10254. author or publisher of that section if known, or else a unique number.
  10255. Make the same adjustment to the section titles in the list of
  10256. Invariant Sections in the license notice of the combined work.
  10257. </p>
  10258. <p>In the combination, you must combine any sections Entitled &ldquo;History&rdquo;
  10259. in the various original documents, forming one section Entitled
  10260. &ldquo;History&rdquo;; likewise combine any sections Entitled &ldquo;Acknowledgements&rdquo;,
  10261. and any sections Entitled &ldquo;Dedications&rdquo;. You must delete all
  10262. sections Entitled &ldquo;Endorsements.&rdquo;
  10263. </p>
  10264. </li><li> COLLECTIONS OF DOCUMENTS
  10265. <p>You may make a collection consisting of the Document and other documents
  10266. released under this License, and replace the individual copies of this
  10267. License in the various documents with a single copy that is included in
  10268. the collection, provided that you follow the rules of this License for
  10269. verbatim copying of each of the documents in all other respects.
  10270. </p>
  10271. <p>You may extract a single document from such a collection, and distribute
  10272. it individually under this License, provided you insert a copy of this
  10273. License into the extracted document, and follow this License in all
  10274. other respects regarding verbatim copying of that document.
  10275. </p>
  10276. </li><li> AGGREGATION WITH INDEPENDENT WORKS
  10277. <p>A compilation of the Document or its derivatives with other separate
  10278. and independent documents or works, in or on a volume of a storage or
  10279. distribution medium, is called an &ldquo;aggregate&rdquo; if the copyright
  10280. resulting from the compilation is not used to limit the legal rights
  10281. of the compilation&rsquo;s users beyond what the individual works permit.
  10282. When the Document is included in an aggregate, this License does not
  10283. apply to the other works in the aggregate which are not themselves
  10284. derivative works of the Document.
  10285. </p>
  10286. <p>If the Cover Text requirement of section 3 is applicable to these
  10287. copies of the Document, then if the Document is less than one half of
  10288. the entire aggregate, the Document&rsquo;s Cover Texts may be placed on
  10289. covers that bracket the Document within the aggregate, or the
  10290. electronic equivalent of covers if the Document is in electronic form.
  10291. Otherwise they must appear on printed covers that bracket the whole
  10292. aggregate.
  10293. </p>
  10294. </li><li> TRANSLATION
  10295. <p>Translation is considered a kind of modification, so you may
  10296. distribute translations of the Document under the terms of section 4.
  10297. Replacing Invariant Sections with translations requires special
  10298. permission from their copyright holders, but you may include
  10299. translations of some or all Invariant Sections in addition to the
  10300. original versions of these Invariant Sections. You may include a
  10301. translation of this License, and all the license notices in the
  10302. Document, and any Warranty Disclaimers, provided that you also include
  10303. the original English version of this License and the original versions
  10304. of those notices and disclaimers. In case of a disagreement between
  10305. the translation and the original version of this License or a notice
  10306. or disclaimer, the original version will prevail.
  10307. </p>
  10308. <p>If a section in the Document is Entitled &ldquo;Acknowledgements&rdquo;,
  10309. &ldquo;Dedications&rdquo;, or &ldquo;History&rdquo;, the requirement (section 4) to Preserve
  10310. its Title (section 1) will typically require changing the actual
  10311. title.
  10312. </p>
  10313. </li><li> TERMINATION
  10314. <p>You may not copy, modify, sublicense, or distribute the Document
  10315. except as expressly provided under this License. Any attempt
  10316. otherwise to copy, modify, sublicense, or distribute it is void, and
  10317. will automatically terminate your rights under this License.
  10318. </p>
  10319. <p>However, if you cease all violation of this License, then your license
  10320. from a particular copyright holder is reinstated (a) provisionally,
  10321. unless and until the copyright holder explicitly and finally
  10322. terminates your license, and (b) permanently, if the copyright holder
  10323. fails to notify you of the violation by some reasonable means prior to
  10324. 60 days after the cessation.
  10325. </p>
  10326. <p>Moreover, your license from a particular copyright holder is
  10327. reinstated permanently if the copyright holder notifies you of the
  10328. violation by some reasonable means, this is the first time you have
  10329. received notice of violation of this License (for any work) from that
  10330. copyright holder, and you cure the violation prior to 30 days after
  10331. your receipt of the notice.
  10332. </p>
  10333. <p>Termination of your rights under this section does not terminate the
  10334. licenses of parties who have received copies or rights from you under
  10335. this License. If your rights have been terminated and not permanently
  10336. reinstated, receipt of a copy of some or all of the same material does
  10337. not give you any rights to use it.
  10338. </p>
  10339. </li><li> FUTURE REVISIONS OF THIS LICENSE
  10340. <p>The Free Software Foundation may publish new, revised versions
  10341. of the GNU Free Documentation License from time to time. Such new
  10342. versions will be similar in spirit to the present version, but may
  10343. differ in detail to address new problems or concerns. See
  10344. <a href="http://www.gnu.org/copyleft/">http://www.gnu.org/copyleft/</a>.
  10345. </p>
  10346. <p>Each version of the License is given a distinguishing version number.
  10347. If the Document specifies that a particular numbered version of this
  10348. License &ldquo;or any later version&rdquo; applies to it, you have the option of
  10349. following the terms and conditions either of that specified version or
  10350. of any later version that has been published (not as a draft) by the
  10351. Free Software Foundation. If the Document does not specify a version
  10352. number of this License, you may choose any version ever published (not
  10353. as a draft) by the Free Software Foundation. If the Document
  10354. specifies that a proxy can decide which future versions of this
  10355. License can be used, that proxy&rsquo;s public statement of acceptance of a
  10356. version permanently authorizes you to choose that version for the
  10357. Document.
  10358. </p>
  10359. </li><li> RELICENSING
  10360. <p>&ldquo;Massive Multiauthor Collaboration Site&rdquo; (or &ldquo;MMC Site&rdquo;) means any
  10361. World Wide Web server that publishes copyrightable works and also
  10362. provides prominent facilities for anybody to edit those works. A
  10363. public wiki that anybody can edit is an example of such a server. A
  10364. &ldquo;Massive Multiauthor Collaboration&rdquo; (or &ldquo;MMC&rdquo;) contained in the
  10365. site means any set of copyrightable works thus published on the MMC
  10366. site.
  10367. </p>
  10368. <p>&ldquo;CC-BY-SA&rdquo; means the Creative Commons Attribution-Share Alike 3.0
  10369. license published by Creative Commons Corporation, a not-for-profit
  10370. corporation with a principal place of business in San Francisco,
  10371. California, as well as future copyleft versions of that license
  10372. published by that same organization.
  10373. </p>
  10374. <p>&ldquo;Incorporate&rdquo; means to publish or republish a Document, in whole or
  10375. in part, as part of another Document.
  10376. </p>
  10377. <p>An MMC is &ldquo;eligible for relicensing&rdquo; if it is licensed under this
  10378. License, and if all works that were first published under this License
  10379. somewhere other than this MMC, and subsequently incorporated in whole
  10380. or in part into the MMC, (1) had no cover texts or invariant sections,
  10381. and (2) were thus incorporated prior to November 1, 2008.
  10382. </p>
  10383. <p>The operator of an MMC Site may republish an MMC contained in the site
  10384. under CC-BY-SA on the same site at any time before August 1, 2009,
  10385. provided the MMC is eligible for relicensing.
  10386. </p>
  10387. </li></ol>
  10388. <span id="ADDENDUM_003a-How-to-use-this-License-for-your-documents"></span><h3 class="heading">ADDENDUM: How to use this License for your documents</h3>
  10389. <p>To use this License in a document you have written, include a copy of
  10390. the License in the document and put the following copyright and
  10391. license notices just after the title page:
  10392. </p>
  10393. <div class="example">
  10394. <pre class="example"> Copyright (C) <var>year</var> <var>your name</var>.
  10395. Permission is granted to copy, distribute and/or modify this document
  10396. under the terms of the GNU Free Documentation License, Version 1.3
  10397. or any later version published by the Free Software Foundation;
  10398. with no Invariant Sections, no Front-Cover Texts, and no Back-Cover
  10399. Texts. A copy of the license is included in the section entitled ``GNU
  10400. Free Documentation License''.
  10401. </pre></div>
  10402. <p>If you have Invariant Sections, Front-Cover Texts and Back-Cover Texts,
  10403. replace the &ldquo;with&hellip;Texts.&rdquo; line with this:
  10404. </p>
  10405. <div class="example">
  10406. <pre class="example"> with the Invariant Sections being <var>list their titles</var>, with
  10407. the Front-Cover Texts being <var>list</var>, and with the Back-Cover Texts
  10408. being <var>list</var>.
  10409. </pre></div>
  10410. <p>If you have Invariant Sections without Cover Texts, or some other
  10411. combination of the three, merge those two alternatives to suit the
  10412. situation.
  10413. </p>
  10414. <p>If your document contains nontrivial examples of program code, we
  10415. recommend releasing these examples in parallel under your choice of
  10416. free software license, such as the GNU General Public License,
  10417. to permit their use in free software.
  10418. </p>
  10419. <hr>
  10420. <span id="LD-Index"></span><div class="header">
  10421. <p>
  10422. Previous: <a href="#GNU-Free-Documentation-License" accesskey="p" rel="prev">GNU Free Documentation License</a>, Up: <a href="#Top" accesskey="u" rel="up">Top</a> &nbsp; [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#LD-Index" title="Index" rel="index">Index</a>]</p>
  10423. </div>
  10424. <span id="LD-Index-1"></span><h2 class="unnumbered">LD Index</h2>
  10425. <table><tr><th valign="top">Jump to: &nbsp; </th><td><a class="summary-letter" href="#LD-Index_cp_symbol-1"><b>&quot;</b></a>
  10426. &nbsp;
  10427. <a class="summary-letter" href="#LD-Index_cp_symbol-2"><b>-</b></a>
  10428. &nbsp;
  10429. <a class="summary-letter" href="#LD-Index_cp_symbol-3"><b>.</b></a>
  10430. &nbsp;
  10431. <a class="summary-letter" href="#LD-Index_cp_symbol-4"><b>/</b></a>
  10432. &nbsp;
  10433. <a class="summary-letter" href="#LD-Index_cp_symbol-5"><b>3</b></a>
  10434. &nbsp;
  10435. <a class="summary-letter" href="#LD-Index_cp_symbol-6"><b>:</b></a>
  10436. &nbsp;
  10437. <a class="summary-letter" href="#LD-Index_cp_symbol-7"><b>=</b></a>
  10438. &nbsp;
  10439. <a class="summary-letter" href="#LD-Index_cp_symbol-8"><b>&gt;</b></a>
  10440. &nbsp;
  10441. <a class="summary-letter" href="#LD-Index_cp_symbol-9"><b>[</b></a>
  10442. &nbsp;
  10443. <br>
  10444. <a class="summary-letter" href="#LD-Index_cp_letter-A"><b>A</b></a>
  10445. &nbsp;
  10446. <a class="summary-letter" href="#LD-Index_cp_letter-B"><b>B</b></a>
  10447. &nbsp;
  10448. <a class="summary-letter" href="#LD-Index_cp_letter-C"><b>C</b></a>
  10449. &nbsp;
  10450. <a class="summary-letter" href="#LD-Index_cp_letter-D"><b>D</b></a>
  10451. &nbsp;
  10452. <a class="summary-letter" href="#LD-Index_cp_letter-E"><b>E</b></a>
  10453. &nbsp;
  10454. <a class="summary-letter" href="#LD-Index_cp_letter-F"><b>F</b></a>
  10455. &nbsp;
  10456. <a class="summary-letter" href="#LD-Index_cp_letter-G"><b>G</b></a>
  10457. &nbsp;
  10458. <a class="summary-letter" href="#LD-Index_cp_letter-H"><b>H</b></a>
  10459. &nbsp;
  10460. <a class="summary-letter" href="#LD-Index_cp_letter-I"><b>I</b></a>
  10461. &nbsp;
  10462. <a class="summary-letter" href="#LD-Index_cp_letter-K"><b>K</b></a>
  10463. &nbsp;
  10464. <a class="summary-letter" href="#LD-Index_cp_letter-L"><b>L</b></a>
  10465. &nbsp;
  10466. <a class="summary-letter" href="#LD-Index_cp_letter-M"><b>M</b></a>
  10467. &nbsp;
  10468. <a class="summary-letter" href="#LD-Index_cp_letter-N"><b>N</b></a>
  10469. &nbsp;
  10470. <a class="summary-letter" href="#LD-Index_cp_letter-O"><b>O</b></a>
  10471. &nbsp;
  10472. <a class="summary-letter" href="#LD-Index_cp_letter-P"><b>P</b></a>
  10473. &nbsp;
  10474. <a class="summary-letter" href="#LD-Index_cp_letter-Q"><b>Q</b></a>
  10475. &nbsp;
  10476. <a class="summary-letter" href="#LD-Index_cp_letter-R"><b>R</b></a>
  10477. &nbsp;
  10478. <a class="summary-letter" href="#LD-Index_cp_letter-S"><b>S</b></a>
  10479. &nbsp;
  10480. <a class="summary-letter" href="#LD-Index_cp_letter-T"><b>T</b></a>
  10481. &nbsp;
  10482. <a class="summary-letter" href="#LD-Index_cp_letter-U"><b>U</b></a>
  10483. &nbsp;
  10484. <a class="summary-letter" href="#LD-Index_cp_letter-V"><b>V</b></a>
  10485. &nbsp;
  10486. <a class="summary-letter" href="#LD-Index_cp_letter-W"><b>W</b></a>
  10487. &nbsp;
  10488. <a class="summary-letter" href="#LD-Index_cp_letter-X"><b>X</b></a>
  10489. &nbsp;
  10490. </td></tr></table>
  10491. <table class="index-cp" border="0">
  10492. <tr><td></td><th align="left">Index Entry</th><td>&nbsp;</td><th align="left"> Section</th></tr>
  10493. <tr><td colspan="4"> <hr></td></tr>
  10494. <tr><th id="LD-Index_cp_symbol-1">&quot;</th><td></td><td></td></tr>
  10495. <tr><td></td><td valign="top"><a href="#index-_0022"><code>&quot;</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Symbols">Symbols</a></td></tr>
  10496. <tr><td colspan="4"> <hr></td></tr>
  10497. <tr><th id="LD-Index_cp_symbol-2">-</th><td></td><td></td></tr>
  10498. <tr><td></td><td valign="top"><a href="#index-_002d_0028"><code>-(</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Options">Options</a></td></tr>
  10499. <tr><td></td><td valign="top"><a href="#index-_002d_002daccept_002dunknown_002dinput_002darch"><code>--accept-unknown-input-arch</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Options">Options</a></td></tr>
  10500. <tr><td></td><td valign="top"><a href="#index-_002d_002dadd_002dneeded"><code>--add-needed</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Options">Options</a></td></tr>
  10501. <tr><td></td><td valign="top"><a href="#index-_002d_002dadd_002dstdcall_002dalias"><code>--add-stdcall-alias</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Options">Options</a></td></tr>
  10502. <tr><td></td><td valign="top"><a href="#index-_002d_002dallow_002dmultiple_002ddefinition"><code>--allow-multiple-definition</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Options">Options</a></td></tr>
  10503. <tr><td></td><td valign="top"><a href="#index-_002d_002dallow_002dshlib_002dundefined"><code>--allow-shlib-undefined</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Options">Options</a></td></tr>
  10504. <tr><td></td><td valign="top"><a href="#index-_002d_002das_002dneeded"><code>--as-needed</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Options">Options</a></td></tr>
  10505. <tr><td></td><td valign="top"><a href="#index-_002d_002daudit-AUDITLIB"><code>--audit <var>AUDITLIB</var></code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Options">Options</a></td></tr>
  10506. <tr><td></td><td valign="top"><a href="#index-_002d_002dauxiliary_003dname"><code>--auxiliary=<var>name</var></code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Options">Options</a></td></tr>
  10507. <tr><td></td><td valign="top"><a href="#index-_002d_002dbank_002dwindow"><code>--bank-window</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Options">Options</a></td></tr>
  10508. <tr><td></td><td valign="top"><a href="#index-_002d_002dbase_002dfile"><code>--base-file</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Options">Options</a></td></tr>
  10509. <tr><td></td><td valign="top"><a href="#index-_002d_002dbe8"><code>--be8</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#ARM">ARM</a></td></tr>
  10510. <tr><td></td><td valign="top"><a href="#index-_002d_002dbranch_002dstub-on-C_002dSKY"><code>--branch-stub on C-SKY</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Options">Options</a></td></tr>
  10511. <tr><td></td><td valign="top"><a href="#index-_002d_002dbss_002dplt"><code>--bss-plt</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#PowerPC-ELF32">PowerPC ELF32</a></td></tr>
  10512. <tr><td></td><td valign="top"><a href="#index-_002d_002dbuild_002did"><code>--build-id</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Options">Options</a></td></tr>
  10513. <tr><td></td><td valign="top"><a href="#index-_002d_002dbuild_002did_003dstyle"><code>--build-id=<var>style</var></code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Options">Options</a></td></tr>
  10514. <tr><td></td><td valign="top"><a href="#index-_002d_002dcheck_002dsections"><code>--check-sections</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Options">Options</a></td></tr>
  10515. <tr><td></td><td valign="top"><a href="#index-_002d_002dcmse_002dimplib"><code>--cmse-implib</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#ARM">ARM</a></td></tr>
  10516. <tr><td></td><td valign="top"><a href="#index-_002d_002dcode_002dregion"><code>--code-region</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#MSP430">MSP430</a></td></tr>
  10517. <tr><td></td><td valign="top"><a href="#index-_002d_002dcompact_002dbranches"><code>--compact-branches</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Options">Options</a></td></tr>
  10518. <tr><td></td><td valign="top"><a href="#index-_002d_002dcompress_002ddebug_002dsections_003dnone"><code>--compress-debug-sections=none</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Options">Options</a></td></tr>
  10519. <tr><td></td><td valign="top"><a href="#index-_002d_002dcompress_002ddebug_002dsections_003dzlib"><code>--compress-debug-sections=zlib</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Options">Options</a></td></tr>
  10520. <tr><td></td><td valign="top"><a href="#index-_002d_002dcompress_002ddebug_002dsections_003dzlib_002dgabi"><code>--compress-debug-sections=zlib-gabi</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Options">Options</a></td></tr>
  10521. <tr><td></td><td valign="top"><a href="#index-_002d_002dcompress_002ddebug_002dsections_003dzlib_002dgnu"><code>--compress-debug-sections=zlib-gnu</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Options">Options</a></td></tr>
  10522. <tr><td></td><td valign="top"><a href="#index-_002d_002dcompress_002ddebug_002dsections_003dzstd"><code>--compress-debug-sections=zstd</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Options">Options</a></td></tr>
  10523. <tr><td></td><td valign="top"><a href="#index-_002d_002dcopy_002ddt_002dneeded_002dentries"><code>--copy-dt-needed-entries</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Options">Options</a></td></tr>
  10524. <tr><td></td><td valign="top"><a href="#index-_002d_002dcref"><code>--cref</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Options">Options</a></td></tr>
  10525. <tr><td></td><td valign="top"><a href="#index-_002d_002dctf_002dshare_002dtypes"><code>--ctf-share-types</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Options">Options</a></td></tr>
  10526. <tr><td></td><td valign="top"><a href="#index-_002d_002dctf_002dvariables"><code>--ctf-variables</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Options">Options</a></td></tr>
  10527. <tr><td></td><td valign="top"><a href="#index-_002d_002ddata_002dregion"><code>--data-region</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#MSP430">MSP430</a></td></tr>
  10528. <tr><td></td><td valign="top"><a href="#index-_002d_002ddefault_002dimported_002dsymver"><code>--default-imported-symver</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Options">Options</a></td></tr>
  10529. <tr><td></td><td valign="top"><a href="#index-_002d_002ddefault_002dscript_003dscript"><code>--default-script=<var>script</var></code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Options">Options</a></td></tr>
  10530. <tr><td></td><td valign="top"><a href="#index-_002d_002ddefault_002dsymver"><code>--default-symver</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Options">Options</a></td></tr>
  10531. <tr><td></td><td valign="top"><a href="#index-_002d_002ddefsym_003dsymbol_003dexp"><code>--defsym=<var>symbol</var>=<var>exp</var></code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Options">Options</a></td></tr>
  10532. <tr><td></td><td valign="top"><a href="#index-_002d_002ddemangle_005b_003dstyle_005d"><code>--demangle[=<var>style</var>]</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Options">Options</a></td></tr>
  10533. <tr><td></td><td valign="top"><a href="#index-_002d_002ddepaudit-AUDITLIB"><code>--depaudit <var>AUDITLIB</var></code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Options">Options</a></td></tr>
  10534. <tr><td></td><td valign="top"><a href="#index-_002d_002ddependency_002dfile_003ddepfile"><code>--dependency-file=<var>depfile</var></code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Options">Options</a></td></tr>
  10535. <tr><td></td><td valign="top"><a href="#index-_002d_002ddisable_002dauto_002dimage_002dbase"><code>--disable-auto-image-base</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Options">Options</a></td></tr>
  10536. <tr><td></td><td valign="top"><a href="#index-_002d_002ddisable_002dauto_002dimport"><code>--disable-auto-import</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Options">Options</a></td></tr>
  10537. <tr><td></td><td valign="top"><a href="#index-_002d_002ddisable_002dlarge_002daddress_002daware"><code>--disable-large-address-aware</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Options">Options</a></td></tr>
  10538. <tr><td></td><td valign="top"><a href="#index-_002d_002ddisable_002dlinker_002dversion"><code>--disable-linker-version</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Options">Options</a></td></tr>
  10539. <tr><td></td><td valign="top"><a href="#index-_002d_002ddisable_002dlong_002dsection_002dnames"><code>--disable-long-section-names</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Options">Options</a></td></tr>
  10540. <tr><td></td><td valign="top"><a href="#index-_002d_002ddisable_002dmultiple_002dabs_002ddefs"><code>--disable-multiple-abs-defs</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Options">Options</a></td></tr>
  10541. <tr><td></td><td valign="top"><a href="#index-_002d_002ddisable_002dnew_002ddtags"><code>--disable-new-dtags</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Options">Options</a></td></tr>
  10542. <tr><td></td><td valign="top"><a href="#index-_002d_002ddisable_002druntime_002dpseudo_002dreloc"><code>--disable-runtime-pseudo-reloc</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Options">Options</a></td></tr>
  10543. <tr><td></td><td valign="top"><a href="#index-_002d_002ddisable_002dsec_002dtransformation"><code>--disable-sec-transformation</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#MSP430">MSP430</a></td></tr>
  10544. <tr><td></td><td valign="top"><a href="#index-_002d_002ddisable_002dstdcall_002dfixup"><code>--disable-stdcall-fixup</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Options">Options</a></td></tr>
  10545. <tr><td></td><td valign="top"><a href="#index-_002d_002ddiscard_002dall"><code>--discard-all</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Options">Options</a></td></tr>
  10546. <tr><td></td><td valign="top"><a href="#index-_002d_002ddiscard_002dlocals"><code>--discard-locals</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Options">Options</a></td></tr>
  10547. <tr><td></td><td valign="top"><a href="#index-_002d_002ddll"><code>--dll</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Options">Options</a></td></tr>
  10548. <tr><td></td><td valign="top"><a href="#index-_002d_002ddll_002dsearch_002dprefix"><code>--dll-search-prefix</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Options">Options</a></td></tr>
  10549. <tr><td></td><td valign="top"><a href="#index-_002d_002ddotsyms"><code>--dotsyms</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#PowerPC64-ELF64">PowerPC64 ELF64</a></td></tr>
  10550. <tr><td></td><td valign="top"><a href="#index-_002d_002ddsbt_002dindex"><code>--dsbt-index</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Options">Options</a></td></tr>
  10551. <tr><td></td><td valign="top"><a href="#index-_002d_002ddsbt_002dsize"><code>--dsbt-size</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Options">Options</a></td></tr>
  10552. <tr><td></td><td valign="top"><a href="#index-_002d_002ddynamic_002dlinker_003dfile"><code>--dynamic-linker=<var>file</var></code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Options">Options</a></td></tr>
  10553. <tr><td></td><td valign="top"><a href="#index-_002d_002ddynamic_002dlist_002dcpp_002dnew"><code>--dynamic-list-cpp-new</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Options">Options</a></td></tr>
  10554. <tr><td></td><td valign="top"><a href="#index-_002d_002ddynamic_002dlist_002dcpp_002dtypeinfo"><code>--dynamic-list-cpp-typeinfo</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Options">Options</a></td></tr>
  10555. <tr><td></td><td valign="top"><a href="#index-_002d_002ddynamic_002dlist_002ddata"><code>--dynamic-list-data</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Options">Options</a></td></tr>
  10556. <tr><td></td><td valign="top"><a href="#index-_002d_002ddynamic_002dlist_003ddynamic_002dlist_002dfile"><code>--dynamic-list=<var>dynamic-list-file</var></code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Options">Options</a></td></tr>
  10557. <tr><td></td><td valign="top"><a href="#index-_002d_002ddynamicbase"><code>--dynamicbase</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Options">Options</a></td></tr>
  10558. <tr><td></td><td valign="top"><a href="#index-_002d_002deh_002dframe_002dhdr"><code>--eh-frame-hdr</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Options">Options</a></td></tr>
  10559. <tr><td></td><td valign="top"><a href="#index-_002d_002dembedded_002drelocs"><code>--embedded-relocs</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Options">Options</a></td></tr>
  10560. <tr><td></td><td valign="top"><a href="#index-_002d_002demit_002drelocs"><code>--emit-relocs</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Options">Options</a></td></tr>
  10561. <tr><td></td><td valign="top"><a href="#index-_002d_002demit_002dstack_002dsyms"><code>--emit-stack-syms</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#SPU-ELF">SPU ELF</a></td></tr>
  10562. <tr><td></td><td valign="top"><a href="#index-_002d_002demit_002dstub_002dsyms"><code>--emit-stub-syms</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#PowerPC-ELF32">PowerPC ELF32</a></td></tr>
  10563. <tr><td></td><td valign="top"><a href="#index-_002d_002demit_002dstub_002dsyms-1"><code>--emit-stub-syms</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#PowerPC64-ELF64">PowerPC64 ELF64</a></td></tr>
  10564. <tr><td></td><td valign="top"><a href="#index-_002d_002demit_002dstub_002dsyms-2"><code>--emit-stub-syms</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#SPU-ELF">SPU ELF</a></td></tr>
  10565. <tr><td></td><td valign="top"><a href="#index-_002d_002denable_002dauto_002dimage_002dbase"><code>--enable-auto-image-base</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Options">Options</a></td></tr>
  10566. <tr><td></td><td valign="top"><a href="#index-_002d_002denable_002dauto_002dimport"><code>--enable-auto-import</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Options">Options</a></td></tr>
  10567. <tr><td></td><td valign="top"><a href="#index-_002d_002denable_002dextra_002dpe_002ddebug"><code>--enable-extra-pe-debug</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Options">Options</a></td></tr>
  10568. <tr><td></td><td valign="top"><a href="#index-_002d_002denable_002dlinker_002dversion"><code>--enable-linker-version</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Options">Options</a></td></tr>
  10569. <tr><td></td><td valign="top"><a href="#index-_002d_002denable_002dlong_002dsection_002dnames"><code>--enable-long-section-names</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Options">Options</a></td></tr>
  10570. <tr><td></td><td valign="top"><a href="#index-_002d_002denable_002dnew_002ddtags"><code>--enable-new-dtags</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Options">Options</a></td></tr>
  10571. <tr><td></td><td valign="top"><a href="#index-_002d_002denable_002dnon_002dcontiguous_002dregions"><code>--enable-non-contiguous-regions</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Options">Options</a></td></tr>
  10572. <tr><td></td><td valign="top"><a href="#index-_002d_002denable_002dnon_002dcontiguous_002dregions_002dwarnings"><code>--enable-non-contiguous-regions-warnings</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Options">Options</a></td></tr>
  10573. <tr><td></td><td valign="top"><a href="#index-_002d_002denable_002dreloc_002dsection"><code>--enable-reloc-section</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Options">Options</a></td></tr>
  10574. <tr><td></td><td valign="top"><a href="#index-_002d_002denable_002druntime_002dpseudo_002dreloc"><code>--enable-runtime-pseudo-reloc</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Options">Options</a></td></tr>
  10575. <tr><td></td><td valign="top"><a href="#index-_002d_002denable_002dstdcall_002dfixup"><code>--enable-stdcall-fixup</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Options">Options</a></td></tr>
  10576. <tr><td></td><td valign="top"><a href="#index-_002d_002dentry_003dentry"><code>--entry=<var>entry</var></code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Options">Options</a></td></tr>
  10577. <tr><td></td><td valign="top"><a href="#index-_002d_002derror_002dexecstack"><code>--error-execstack</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Options">Options</a></td></tr>
  10578. <tr><td></td><td valign="top"><a href="#index-_002d_002derror_002dhandling_002dscript_003dscriptname"><code>--error-handling-script=<var>scriptname</var></code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Options">Options</a></td></tr>
  10579. <tr><td></td><td valign="top"><a href="#index-_002d_002derror_002drwx_002dsegments"><code>--error-rwx-segments</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Options">Options</a></td></tr>
  10580. <tr><td></td><td valign="top"><a href="#index-_002d_002derror_002dunresolved_002dsymbols"><code>--error-unresolved-symbols</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Options">Options</a></td></tr>
  10581. <tr><td></td><td valign="top"><a href="#index-_002d_002dexclude_002dall_002dsymbols"><code>--exclude-all-symbols</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Options">Options</a></td></tr>
  10582. <tr><td></td><td valign="top"><a href="#index-_002d_002dexclude_002dlibs"><code>--exclude-libs</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Options">Options</a></td></tr>
  10583. <tr><td></td><td valign="top"><a href="#index-_002d_002dexclude_002dmodules_002dfor_002dimplib"><code>--exclude-modules-for-implib</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Options">Options</a></td></tr>
  10584. <tr><td></td><td valign="top"><a href="#index-_002d_002dexclude_002dsymbols"><code>--exclude-symbols</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Options">Options</a></td></tr>
  10585. <tr><td></td><td valign="top"><a href="#index-_002d_002dexport_002dall_002dsymbols"><code>--export-all-symbols</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Options">Options</a></td></tr>
  10586. <tr><td></td><td valign="top"><a href="#index-_002d_002dexport_002ddynamic"><code>--export-dynamic</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Options">Options</a></td></tr>
  10587. <tr><td></td><td valign="top"><a href="#index-_002d_002dexport_002ddynamic_002dsymbol_002dlist_003dfile"><code>--export-dynamic-symbol-list=<var>file</var></code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Options">Options</a></td></tr>
  10588. <tr><td></td><td valign="top"><a href="#index-_002d_002dexport_002ddynamic_002dsymbol_003dglob"><code>--export-dynamic-symbol=<var>glob</var></code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Options">Options</a></td></tr>
  10589. <tr><td></td><td valign="top"><a href="#index-_002d_002dextra_002doverlay_002dstubs"><code>--extra-overlay-stubs</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#SPU-ELF">SPU ELF</a></td></tr>
  10590. <tr><td></td><td valign="top"><a href="#index-_002d_002dfatal_002dwarnings"><code>--fatal-warnings</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Options">Options</a></td></tr>
  10591. <tr><td></td><td valign="top"><a href="#index-_002d_002dfile_002dalignment"><code>--file-alignment</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Options">Options</a></td></tr>
  10592. <tr><td></td><td valign="top"><a href="#index-_002d_002dfilter_003dname"><code>--filter=<var>name</var></code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Options">Options</a></td></tr>
  10593. <tr><td></td><td valign="top"><a href="#index-_002d_002dfix_002darm1176"><code>--fix-arm1176</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#ARM">ARM</a></td></tr>
  10594. <tr><td></td><td valign="top"><a href="#index-_002d_002dfix_002dcortex_002da53_002d835769"><code>--fix-cortex-a53-835769</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#ARM">ARM</a></td></tr>
  10595. <tr><td></td><td valign="top"><a href="#index-_002d_002dfix_002dcortex_002da8"><code>--fix-cortex-a8</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#ARM">ARM</a></td></tr>
  10596. <tr><td></td><td valign="top"><a href="#index-_002d_002dfix_002dstm32l4xx_002d629360"><code>--fix-stm32l4xx-629360</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#ARM">ARM</a></td></tr>
  10597. <tr><td></td><td valign="top"><a href="#index-_002d_002dfix_002dv4bx"><code>--fix-v4bx</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#ARM">ARM</a></td></tr>
  10598. <tr><td></td><td valign="top"><a href="#index-_002d_002dfix_002dv4bx_002dinterworking"><code>--fix-v4bx-interworking</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#ARM">ARM</a></td></tr>
  10599. <tr><td></td><td valign="top"><a href="#index-_002d_002dforce_002ddynamic"><code>--force-dynamic</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Options">Options</a></td></tr>
  10600. <tr><td></td><td valign="top"><a href="#index-_002d_002dforce_002dexe_002dsuffix"><code>--force-exe-suffix</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Options">Options</a></td></tr>
  10601. <tr><td></td><td valign="top"><a href="#index-_002d_002dforce_002dgroup_002dallocation"><code>--force-group-allocation</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Options">Options</a></td></tr>
  10602. <tr><td></td><td valign="top"><a href="#index-_002d_002dforceinteg"><code>--forceinteg</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Options">Options</a></td></tr>
  10603. <tr><td></td><td valign="top"><a href="#index-_002d_002dformat_003dformat"><code>--format=<var>format</var></code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Options">Options</a></td></tr>
  10604. <tr><td></td><td valign="top"><a href="#index-_002d_002dformat_003dversion"><code>--format=<var>version</var></code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#TI-COFF">TI COFF</a></td></tr>
  10605. <tr><td></td><td valign="top"><a href="#index-_002d_002dgc_002dkeep_002dexported"><code>--gc-keep-exported</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Options">Options</a></td></tr>
  10606. <tr><td></td><td valign="top"><a href="#index-_002d_002dgc_002dsections"><code>--gc-sections</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Options">Options</a></td></tr>
  10607. <tr><td></td><td valign="top"><a href="#index-_002d_002dgot"><code>--got</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Options">Options</a></td></tr>
  10608. <tr><td></td><td valign="top"><a href="#index-_002d_002dgot_003dtype"><code>--got=<var>type</var></code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#M68K">M68K</a></td></tr>
  10609. <tr><td></td><td valign="top"><a href="#index-_002d_002dgpsize_003dvalue"><code>--gpsize=<var>value</var></code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Options">Options</a></td></tr>
  10610. <tr><td></td><td valign="top"><a href="#index-_002d_002dhash_002dsize_003dnumber"><code>--hash-size=<var>number</var></code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Options">Options</a></td></tr>
  10611. <tr><td></td><td valign="top"><a href="#index-_002d_002dhash_002dstyle_003dstyle"><code>--hash-style=<var>style</var></code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Options">Options</a></td></tr>
  10612. <tr><td></td><td valign="top"><a href="#index-_002d_002dheap"><code>--heap</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Options">Options</a></td></tr>
  10613. <tr><td></td><td valign="top"><a href="#index-_002d_002dhelp"><code>--help</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Options">Options</a></td></tr>
  10614. <tr><td></td><td valign="top"><a href="#index-_002d_002dhigh_002dentropy_002dva"><code>--high-entropy-va</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Options">Options</a></td></tr>
  10615. <tr><td></td><td valign="top"><a href="#index-_002d_002dignore_002dbranch_002disa"><code>--ignore-branch-isa</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Options">Options</a></td></tr>
  10616. <tr><td></td><td valign="top"><a href="#index-_002d_002dignore_002dbranch_002disa-1"><code>--ignore-branch-isa</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#MIPS">MIPS</a></td></tr>
  10617. <tr><td></td><td valign="top"><a href="#index-_002d_002dimage_002dbase"><code>--image-base</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Options">Options</a></td></tr>
  10618. <tr><td></td><td valign="top"><a href="#index-_002d_002dimagic"><code>--imagic</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Options">Options</a></td></tr>
  10619. <tr><td></td><td valign="top"><a href="#index-_002d_002din_002dimplib_003dfile"><code>--in-implib=<var>file</var></code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#ARM">ARM</a></td></tr>
  10620. <tr><td></td><td valign="top"><a href="#index-_002d_002dinsert_002dtimestamp"><code>--insert-timestamp</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Options">Options</a></td></tr>
  10621. <tr><td></td><td valign="top"><a href="#index-_002d_002dinsn32"><code>--insn32</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Options">Options</a></td></tr>
  10622. <tr><td></td><td valign="top"><a href="#index-_002d_002dinsn32-1"><code>--insn32</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#MIPS">MIPS</a></td></tr>
  10623. <tr><td></td><td valign="top"><a href="#index-_002d_002djust_002dsymbols_003dfile"><code>--just-symbols=<var>file</var></code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Options">Options</a></td></tr>
  10624. <tr><td></td><td valign="top"><a href="#index-_002d_002dkill_002dat"><code>--kill-at</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Options">Options</a></td></tr>
  10625. <tr><td></td><td valign="top"><a href="#index-_002d_002dlarge_002daddress_002daware"><code>--large-address-aware</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Options">Options</a></td></tr>
  10626. <tr><td></td><td valign="top"><a href="#index-_002d_002dld_002dgenerated_002dunwind_002dinfo"><code>--ld-generated-unwind-info</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Options">Options</a></td></tr>
  10627. <tr><td></td><td valign="top"><a href="#index-_002d_002dleading_002dunderscore"><code>--leading-underscore</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Options">Options</a></td></tr>
  10628. <tr><td></td><td valign="top"><a href="#index-_002d_002dlibrary_002dpath_003ddir"><code>--library-path=<var>dir</var></code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Options">Options</a></td></tr>
  10629. <tr><td></td><td valign="top"><a href="#index-_002d_002dlibrary_003dnamespec"><code>--library=<var>namespec</var></code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Options">Options</a></td></tr>
  10630. <tr><td></td><td valign="top"><a href="#index-_002d_002dlocal_002dstore_003dlo_003ahi"><code>--local-store=lo:hi</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#SPU-ELF">SPU ELF</a></td></tr>
  10631. <tr><td></td><td valign="top"><a href="#index-_002d_002dlong_002dplt"><code>--long-plt</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#ARM">ARM</a></td></tr>
  10632. <tr><td></td><td valign="top"><a href="#index-_002d_002dmajor_002dimage_002dversion"><code>--major-image-version</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Options">Options</a></td></tr>
  10633. <tr><td></td><td valign="top"><a href="#index-_002d_002dmajor_002dos_002dversion"><code>--major-os-version</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Options">Options</a></td></tr>
  10634. <tr><td></td><td valign="top"><a href="#index-_002d_002dmajor_002dsubsystem_002dversion"><code>--major-subsystem-version</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Options">Options</a></td></tr>
  10635. <tr><td></td><td valign="top"><a href="#index-_002d_002dmax_002dcache_002dsize_003dsize"><code>--max-cache-size=<var>size</var></code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Options">Options</a></td></tr>
  10636. <tr><td></td><td valign="top"><a href="#index-_002d_002dmerge_002dexidx_002dentries"><code>--merge-exidx-entries</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#ARM">ARM</a></td></tr>
  10637. <tr><td></td><td valign="top"><a href="#index-_002d_002dminor_002dimage_002dversion"><code>--minor-image-version</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Options">Options</a></td></tr>
  10638. <tr><td></td><td valign="top"><a href="#index-_002d_002dminor_002dos_002dversion"><code>--minor-os-version</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Options">Options</a></td></tr>
  10639. <tr><td></td><td valign="top"><a href="#index-_002d_002dminor_002dsubsystem_002dversion"><code>--minor-subsystem-version</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Options">Options</a></td></tr>
  10640. <tr><td></td><td valign="top"><a href="#index-_002d_002dmri_002dscript_003dMRI_002dcmdfile"><code>--mri-script=<var>MRI-cmdfile</var></code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Options">Options</a></td></tr>
  10641. <tr><td></td><td valign="top"><a href="#index-_002d_002dmulti_002dsubspace"><code>--multi-subspace</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#HPPA-ELF32">HPPA ELF32</a></td></tr>
  10642. <tr><td></td><td valign="top"><a href="#index-_002d_002dnmagic"><code>--nmagic</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Options">Options</a></td></tr>
  10643. <tr><td></td><td valign="top"><a href="#index-_002d_002dnmagic-1"><code>--nmagic</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Options">Options</a></td></tr>
  10644. <tr><td></td><td valign="top"><a href="#index-_002d_002dno_002daccept_002dunknown_002dinput_002darch"><code>--no-accept-unknown-input-arch</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Options">Options</a></td></tr>
  10645. <tr><td></td><td valign="top"><a href="#index-_002d_002dno_002dadd_002dneeded"><code>--no-add-needed</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Options">Options</a></td></tr>
  10646. <tr><td></td><td valign="top"><a href="#index-_002d_002dno_002dallow_002dshlib_002dundefined"><code>--no-allow-shlib-undefined</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Options">Options</a></td></tr>
  10647. <tr><td></td><td valign="top"><a href="#index-_002d_002dno_002dapply_002ddynamic_002drelocs"><code>--no-apply-dynamic-relocs</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#ARM">ARM</a></td></tr>
  10648. <tr><td></td><td valign="top"><a href="#index-_002d_002dno_002das_002dneeded"><code>--no-as-needed</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Options">Options</a></td></tr>
  10649. <tr><td></td><td valign="top"><a href="#index-_002d_002dno_002dbind"><code>--no-bind</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Options">Options</a></td></tr>
  10650. <tr><td></td><td valign="top"><a href="#index-_002d_002dno_002dcheck_002dsections"><code>--no-check-sections</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Options">Options</a></td></tr>
  10651. <tr><td></td><td valign="top"><a href="#index-_002d_002dno_002dcompact_002dbranches"><code>--no-compact-branches</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Options">Options</a></td></tr>
  10652. <tr><td></td><td valign="top"><a href="#index-_002d_002dno_002dcopy_002ddt_002dneeded_002dentries"><code>--no-copy-dt-needed-entries</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Options">Options</a></td></tr>
  10653. <tr><td></td><td valign="top"><a href="#index-_002d_002dno_002dctf_002dvariables"><code>--no-ctf-variables</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Options">Options</a></td></tr>
  10654. <tr><td></td><td valign="top"><a href="#index-_002d_002dno_002ddefine_002dcommon"><code>--no-define-common</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Options">Options</a></td></tr>
  10655. <tr><td></td><td valign="top"><a href="#index-_002d_002dno_002ddemangle"><code>--no-demangle</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Options">Options</a></td></tr>
  10656. <tr><td></td><td valign="top"><a href="#index-_002d_002dno_002ddotsyms"><code>--no-dotsyms</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#PowerPC64-ELF64">PowerPC64 ELF64</a></td></tr>
  10657. <tr><td></td><td valign="top"><a href="#index-_002d_002dno_002ddynamic_002dlinker"><code>--no-dynamic-linker</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Options">Options</a></td></tr>
  10658. <tr><td></td><td valign="top"><a href="#index-_002d_002dno_002deh_002dframe_002dhdr"><code>--no-eh-frame-hdr</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Options">Options</a></td></tr>
  10659. <tr><td></td><td valign="top"><a href="#index-_002d_002dno_002denum_002dsize_002dwarning"><code>--no-enum-size-warning</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#ARM">ARM</a></td></tr>
  10660. <tr><td></td><td valign="top"><a href="#index-_002d_002dno_002dexport_002ddynamic"><code>--no-export-dynamic</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Options">Options</a></td></tr>
  10661. <tr><td></td><td valign="top"><a href="#index-_002d_002dno_002dfatal_002dwarnings"><code>--no-fatal-warnings</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Options">Options</a></td></tr>
  10662. <tr><td></td><td valign="top"><a href="#index-_002d_002dno_002dfix_002darm1176"><code>--no-fix-arm1176</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#ARM">ARM</a></td></tr>
  10663. <tr><td></td><td valign="top"><a href="#index-_002d_002dno_002dfix_002dcortex_002da53_002d835769"><code>--no-fix-cortex-a53-835769</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#ARM">ARM</a></td></tr>
  10664. <tr><td></td><td valign="top"><a href="#index-_002d_002dno_002dfix_002dcortex_002da8"><code>--no-fix-cortex-a8</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#ARM">ARM</a></td></tr>
  10665. <tr><td></td><td valign="top"><a href="#index-_002d_002dno_002dgc_002dsections"><code>--no-gc-sections</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Options">Options</a></td></tr>
  10666. <tr><td></td><td valign="top"><a href="#index-_002d_002dno_002dignore_002dbranch_002disa"><code>--no-ignore-branch-isa</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Options">Options</a></td></tr>
  10667. <tr><td></td><td valign="top"><a href="#index-_002d_002dno_002dignore_002dbranch_002disa-1"><code>--no-ignore-branch-isa</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#MIPS">MIPS</a></td></tr>
  10668. <tr><td></td><td valign="top"><a href="#index-_002d_002dno_002dinline_002doptimize"><code>--no-inline-optimize</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#PowerPC64-ELF64">PowerPC64 ELF64</a></td></tr>
  10669. <tr><td></td><td valign="top"><a href="#index-_002d_002dno_002dinsn32"><code>--no-insn32</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Options">Options</a></td></tr>
  10670. <tr><td></td><td valign="top"><a href="#index-_002d_002dno_002dinsn32-1"><code>--no-insn32</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#MIPS">MIPS</a></td></tr>
  10671. <tr><td></td><td valign="top"><a href="#index-_002d_002dno_002disolation"><code>--no-isolation</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Options">Options</a></td></tr>
  10672. <tr><td></td><td valign="top"><a href="#index-_002d_002dno_002dkeep_002dmemory"><code>--no-keep-memory</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Options">Options</a></td></tr>
  10673. <tr><td></td><td valign="top"><a href="#index-_002d_002dno_002dleading_002dunderscore"><code>--no-leading-underscore</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Options">Options</a></td></tr>
  10674. <tr><td></td><td valign="top"><a href="#index-_002d_002dno_002dmerge_002dexidx_002dentries"><code>--no-merge-exidx-entries</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Options">Options</a></td></tr>
  10675. <tr><td></td><td valign="top"><a href="#index-_002d_002dno_002dmerge_002dexidx_002dentries-1"><code>--no-merge-exidx-entries</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#ARM">ARM</a></td></tr>
  10676. <tr><td></td><td valign="top"><a href="#index-_002d_002dno_002dmulti_002dtoc"><code>--no-multi-toc</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#PowerPC64-ELF64">PowerPC64 ELF64</a></td></tr>
  10677. <tr><td></td><td valign="top"><a href="#index-_002d_002dno_002domagic"><code>--no-omagic</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Options">Options</a></td></tr>
  10678. <tr><td></td><td valign="top"><a href="#index-_002d_002dno_002domagic-1"><code>--no-omagic</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Options">Options</a></td></tr>
  10679. <tr><td></td><td valign="top"><a href="#index-_002d_002dno_002dopd_002doptimize"><code>--no-opd-optimize</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#PowerPC64-ELF64">PowerPC64 ELF64</a></td></tr>
  10680. <tr><td></td><td valign="top"><a href="#index-_002d_002dno_002doverlays"><code>--no-overlays</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#SPU-ELF">SPU ELF</a></td></tr>
  10681. <tr><td></td><td valign="top"><a href="#index-_002d_002dno_002dplt_002dalign"><code>--no-plt-align</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#PowerPC64-ELF64">PowerPC64 ELF64</a></td></tr>
  10682. <tr><td></td><td valign="top"><a href="#index-_002d_002dno_002dplt_002dlocalentry"><code>--no-plt-localentry</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#PowerPC64-ELF64">PowerPC64 ELF64</a></td></tr>
  10683. <tr><td></td><td valign="top"><a href="#index-_002d_002dno_002dplt_002dstatic_002dchain"><code>--no-plt-static-chain</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#PowerPC64-ELF64">PowerPC64 ELF64</a></td></tr>
  10684. <tr><td></td><td valign="top"><a href="#index-_002d_002dno_002dplt_002dthread_002dsafe"><code>--no-plt-thread-safe</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#PowerPC64-ELF64">PowerPC64 ELF64</a></td></tr>
  10685. <tr><td></td><td valign="top"><a href="#index-_002d_002dno_002dpower10_002dstubs"><code>--no-power10-stubs</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#PowerPC64-ELF64">PowerPC64 ELF64</a></td></tr>
  10686. <tr><td></td><td valign="top"><a href="#index-_002d_002dno_002dprint_002dgc_002dsections"><code>--no-print-gc-sections</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Options">Options</a></td></tr>
  10687. <tr><td></td><td valign="top"><a href="#index-_002d_002dno_002dprint_002dmap_002ddiscarded"><code>--no-print-map-discarded</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Options">Options</a></td></tr>
  10688. <tr><td></td><td valign="top"><a href="#index-_002d_002dno_002dprint_002dmap_002dlocals"><code>--no-print-map-locals</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Options">Options</a></td></tr>
  10689. <tr><td></td><td valign="top"><a href="#index-_002d_002dno_002dsave_002drestore_002dfuncs"><code>--no-save-restore-funcs</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#PowerPC64-ELF64">PowerPC64 ELF64</a></td></tr>
  10690. <tr><td></td><td valign="top"><a href="#index-_002d_002dno_002dseh"><code>--no-seh</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Options">Options</a></td></tr>
  10691. <tr><td></td><td valign="top"><a href="#index-_002d_002dno_002dstrip_002ddiscarded"><code>--no-strip-discarded</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Options">Options</a></td></tr>
  10692. <tr><td></td><td valign="top"><a href="#index-_002d_002dno_002dtls_002dget_002daddr_002doptimize"><code>--no-tls-get-addr-optimize</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#PowerPC64-ELF64">PowerPC64 ELF64</a></td></tr>
  10693. <tr><td></td><td valign="top"><a href="#index-_002d_002dno_002dtls_002dget_002daddr_002dregsave"><code>--no-tls-get-addr-regsave</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#PowerPC64-ELF64">PowerPC64 ELF64</a></td></tr>
  10694. <tr><td></td><td valign="top"><a href="#index-_002d_002dno_002dtls_002doptimize"><code>--no-tls-optimize</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#PowerPC-ELF32">PowerPC ELF32</a></td></tr>
  10695. <tr><td></td><td valign="top"><a href="#index-_002d_002dno_002dtls_002doptimize-1"><code>--no-tls-optimize</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#PowerPC64-ELF64">PowerPC64 ELF64</a></td></tr>
  10696. <tr><td></td><td valign="top"><a href="#index-_002d_002dno_002dtoc_002doptimize"><code>--no-toc-optimize</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#PowerPC64-ELF64">PowerPC64 ELF64</a></td></tr>
  10697. <tr><td></td><td valign="top"><a href="#index-_002d_002dno_002dtoc_002dsort"><code>--no-toc-sort</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#PowerPC64-ELF64">PowerPC64 ELF64</a></td></tr>
  10698. <tr><td></td><td valign="top"><a href="#index-_002d_002dno_002dtrampoline"><code>--no-trampoline</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Options">Options</a></td></tr>
  10699. <tr><td></td><td valign="top"><a href="#index-_002d_002dno_002dundefined"><code>--no-undefined</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Options">Options</a></td></tr>
  10700. <tr><td></td><td valign="top"><a href="#index-_002d_002dno_002dundefined_002dversion"><code>--no-undefined-version</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Options">Options</a></td></tr>
  10701. <tr><td></td><td valign="top"><a href="#index-_002d_002dno_002dwarn_002dmismatch"><code>--no-warn-mismatch</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Options">Options</a></td></tr>
  10702. <tr><td></td><td valign="top"><a href="#index-_002d_002dno_002dwarn_002dsearch_002dmismatch"><code>--no-warn-search-mismatch</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Options">Options</a></td></tr>
  10703. <tr><td></td><td valign="top"><a href="#index-_002d_002dno_002dwarnings"><code>--no-warnings</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Options">Options</a></td></tr>
  10704. <tr><td></td><td valign="top"><a href="#index-_002d_002dno_002dwchar_002dsize_002dwarning"><code>--no-wchar-size-warning</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#ARM">ARM</a></td></tr>
  10705. <tr><td></td><td valign="top"><a href="#index-_002d_002dno_002dwhole_002darchive"><code>--no-whole-archive</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Options">Options</a></td></tr>
  10706. <tr><td></td><td valign="top"><a href="#index-_002d_002dnoinhibit_002dexec"><code>--noinhibit-exec</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Options">Options</a></td></tr>
  10707. <tr><td></td><td valign="top"><a href="#index-_002d_002dnon_002doverlapping_002dopd"><code>--non-overlapping-opd</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#PowerPC64-ELF64">PowerPC64 ELF64</a></td></tr>
  10708. <tr><td></td><td valign="top"><a href="#index-_002d_002dnxcompat"><code>--nxcompat</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Options">Options</a></td></tr>
  10709. <tr><td></td><td valign="top"><a href="#index-_002d_002doformat_003doutput_002dformat"><code>--oformat=<var>output-format</var></code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Options">Options</a></td></tr>
  10710. <tr><td></td><td valign="top"><a href="#index-_002d_002domagic"><code>--omagic</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Options">Options</a></td></tr>
  10711. <tr><td></td><td valign="top"><a href="#index-_002d_002domagic-1"><code>--omagic</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Options">Options</a></td></tr>
  10712. <tr><td></td><td valign="top"><a href="#index-_002d_002dorphan_002dhandling_003dMODE"><code>--orphan-handling=<var>MODE</var></code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Options">Options</a></td></tr>
  10713. <tr><td></td><td valign="top"><a href="#index-_002d_002dout_002dimplib"><code>--out-implib</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Options">Options</a></td></tr>
  10714. <tr><td></td><td valign="top"><a href="#index-_002d_002doutput_002ddef"><code>--output-def</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Options">Options</a></td></tr>
  10715. <tr><td></td><td valign="top"><a href="#index-_002d_002doutput_003doutput"><code>--output=<var>output</var></code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Options">Options</a></td></tr>
  10716. <tr><td></td><td valign="top"><a href="#index-_002d_002dpackage_002dmetadata_003dJSON"><code>--package-metadata=<var>JSON</var></code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Options">Options</a></td></tr>
  10717. <tr><td></td><td valign="top"><a href="#index-_002d_002dpic_002dexecutable"><code>--pic-executable</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Options">Options</a></td></tr>
  10718. <tr><td></td><td valign="top"><a href="#index-_002d_002dpic_002dveneer"><code>--pic-veneer</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#ARM">ARM</a></td></tr>
  10719. <tr><td></td><td valign="top"><a href="#index-_002d_002dplt_002dalign"><code>--plt-align</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#PowerPC64-ELF64">PowerPC64 ELF64</a></td></tr>
  10720. <tr><td></td><td valign="top"><a href="#index-_002d_002dplt_002dlocalentry"><code>--plt-localentry</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#PowerPC64-ELF64">PowerPC64 ELF64</a></td></tr>
  10721. <tr><td></td><td valign="top"><a href="#index-_002d_002dplt_002dstatic_002dchain"><code>--plt-static-chain</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#PowerPC64-ELF64">PowerPC64 ELF64</a></td></tr>
  10722. <tr><td></td><td valign="top"><a href="#index-_002d_002dplt_002dthread_002dsafe"><code>--plt-thread-safe</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#PowerPC64-ELF64">PowerPC64 ELF64</a></td></tr>
  10723. <tr><td></td><td valign="top"><a href="#index-_002d_002dplugin"><code>--plugin</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#SPU-ELF">SPU ELF</a></td></tr>
  10724. <tr><td></td><td valign="top"><a href="#index-_002d_002dpop_002dstate"><code>--pop-state</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Options">Options</a></td></tr>
  10725. <tr><td></td><td valign="top"><a href="#index-_002d_002dpower10_002dstubs"><code>--power10-stubs</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#PowerPC64-ELF64">PowerPC64 ELF64</a></td></tr>
  10726. <tr><td></td><td valign="top"><a href="#index-_002d_002dprint_002dgc_002dsections"><code>--print-gc-sections</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Options">Options</a></td></tr>
  10727. <tr><td></td><td valign="top"><a href="#index-_002d_002dprint_002dmap"><code>--print-map</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Options">Options</a></td></tr>
  10728. <tr><td></td><td valign="top"><a href="#index-_002d_002dprint_002dmap_002ddiscarded"><code>--print-map-discarded</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Options">Options</a></td></tr>
  10729. <tr><td></td><td valign="top"><a href="#index-_002d_002dprint_002dmap_002dlocals"><code>--print-map-locals</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Options">Options</a></td></tr>
  10730. <tr><td></td><td valign="top"><a href="#index-_002d_002dprint_002dmemory_002dusage"><code>--print-memory-usage</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Options">Options</a></td></tr>
  10731. <tr><td></td><td valign="top"><a href="#index-_002d_002dprint_002doutput_002dformat"><code>--print-output-format</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Options">Options</a></td></tr>
  10732. <tr><td></td><td valign="top"><a href="#index-_002d_002dpush_002dstate"><code>--push-state</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Options">Options</a></td></tr>
  10733. <tr><td></td><td valign="top"><a href="#index-_002d_002dreduce_002dmemory_002doverheads"><code>--reduce-memory-overheads</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Options">Options</a></td></tr>
  10734. <tr><td></td><td valign="top"><a href="#index-_002d_002drelax"><code>--relax</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Options">Options</a></td></tr>
  10735. <tr><td></td><td valign="top"><a href="#index-_002d_002drelax-on-Nios-II"><code>--relax on Nios II</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Nios-II">Nios II</a></td></tr>
  10736. <tr><td></td><td valign="top"><a href="#index-_002d_002drelax-on-PowerPC"><code>--relax on PowerPC</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#PowerPC-ELF32">PowerPC ELF32</a></td></tr>
  10737. <tr><td></td><td valign="top"><a href="#index-_002d_002drelax-on-Xtensa"><samp>--relax</samp> on Xtensa</a>:</td><td>&nbsp;</td><td valign="top"><a href="#Xtensa">Xtensa</a></td></tr>
  10738. <tr><td></td><td valign="top"><a href="#index-_002d_002drelocatable"><code>--relocatable</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Options">Options</a></td></tr>
  10739. <tr><td></td><td valign="top"><a href="#index-_002d_002dremap_002dinputs_002dfile_003dfile"><code>--remap-inputs-file=<samp>file</samp></code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Options">Options</a></td></tr>
  10740. <tr><td></td><td valign="top"><a href="#index-_002d_002dremap_002dinputs_003dpattern_003dfilename"><code>--remap-inputs=<samp>pattern</samp>=<samp>filename</samp></code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Options">Options</a></td></tr>
  10741. <tr><td></td><td valign="top"><a href="#index-_002d_002drequire_002ddefined_003dsymbol"><code>--require-defined=<var>symbol</var></code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Options">Options</a></td></tr>
  10742. <tr><td></td><td valign="top"><a href="#index-_002d_002dretain_002dsymbols_002dfile_003dfilename"><code>--retain-symbols-file=<var>filename</var></code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Options">Options</a></td></tr>
  10743. <tr><td></td><td valign="top"><a href="#index-_002d_002ds390_002dpgste"><code>--s390-pgste</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#S_002f390-ELF">S/390 ELF</a></td></tr>
  10744. <tr><td></td><td valign="top"><a href="#index-_002d_002dsave_002drestore_002dfuncs"><code>--save-restore-funcs</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#PowerPC64-ELF64">PowerPC64 ELF64</a></td></tr>
  10745. <tr><td></td><td valign="top"><a href="#index-_002d_002dscript_003dscript"><code>--script=<var>script</var></code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Options">Options</a></td></tr>
  10746. <tr><td></td><td valign="top"><a href="#index-_002d_002dsdata_002dgot"><code>--sdata-got</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#PowerPC-ELF32">PowerPC ELF32</a></td></tr>
  10747. <tr><td></td><td valign="top"><a href="#index-_002d_002dsection_002dalignment"><code>--section-alignment</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Options">Options</a></td></tr>
  10748. <tr><td></td><td valign="top"><a href="#index-_002d_002dsection_002dstart_003dsectionname_003dorg"><code>--section-start=<var>sectionname</var>=<var>org</var></code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Options">Options</a></td></tr>
  10749. <tr><td></td><td valign="top"><a href="#index-_002d_002dsecure_002dplt"><code>--secure-plt</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#PowerPC-ELF32">PowerPC ELF32</a></td></tr>
  10750. <tr><td></td><td valign="top"><a href="#index-_002d_002dsort_002dcommon"><code>--sort-common</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Options">Options</a></td></tr>
  10751. <tr><td></td><td valign="top"><a href="#index-_002d_002dsort_002dsection_003dalignment"><code>--sort-section=alignment</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Options">Options</a></td></tr>
  10752. <tr><td></td><td valign="top"><a href="#index-_002d_002dsort_002dsection_003dname"><code>--sort-section=name</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Options">Options</a></td></tr>
  10753. <tr><td></td><td valign="top"><a href="#index-_002d_002dspare_002ddynamic_002dtags"><code>--spare-dynamic-tags</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Options">Options</a></td></tr>
  10754. <tr><td></td><td valign="top"><a href="#index-_002d_002dsplit_002dby_002dfile"><code>--split-by-file</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Options">Options</a></td></tr>
  10755. <tr><td></td><td valign="top"><a href="#index-_002d_002dsplit_002dby_002dreloc"><code>--split-by-reloc</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Options">Options</a></td></tr>
  10756. <tr><td></td><td valign="top"><a href="#index-_002d_002dstack"><code>--stack</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Options">Options</a></td></tr>
  10757. <tr><td></td><td valign="top"><a href="#index-_002d_002dstack_002danalysis"><code>--stack-analysis</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#SPU-ELF">SPU ELF</a></td></tr>
  10758. <tr><td></td><td valign="top"><a href="#index-_002d_002dstats"><code>--stats</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Options">Options</a></td></tr>
  10759. <tr><td></td><td valign="top"><a href="#index-_002d_002dstrip_002dall"><code>--strip-all</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Options">Options</a></td></tr>
  10760. <tr><td></td><td valign="top"><a href="#index-_002d_002dstrip_002ddebug"><code>--strip-debug</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Options">Options</a></td></tr>
  10761. <tr><td></td><td valign="top"><a href="#index-_002d_002dstrip_002ddiscarded"><code>--strip-discarded</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Options">Options</a></td></tr>
  10762. <tr><td></td><td valign="top"><a href="#index-_002d_002dstub_002dgroup_002dsize"><code>--stub-group-size</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#PowerPC64-ELF64">PowerPC64 ELF64</a></td></tr>
  10763. <tr><td></td><td valign="top"><a href="#index-_002d_002dstub_002dgroup_002dsize-on-C_002dSKY"><code>--stub-group-size on C-SKY</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Options">Options</a></td></tr>
  10764. <tr><td></td><td valign="top"><a href="#index-_002d_002dstub_002dgroup_002dsize_003dN"><code>--stub-group-size=<var>N</var></code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#ARM">ARM</a></td></tr>
  10765. <tr><td></td><td valign="top"><a href="#index-_002d_002dstub_002dgroup_002dsize_003dN-1"><code>--stub-group-size=<var>N</var></code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#HPPA-ELF32">HPPA ELF32</a></td></tr>
  10766. <tr><td></td><td valign="top"><a href="#index-_002d_002dsubsystem"><code>--subsystem</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Options">Options</a></td></tr>
  10767. <tr><td></td><td valign="top"><a href="#index-_002d_002dsupport_002dold_002dcode"><code>--support-old-code</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#ARM">ARM</a></td></tr>
  10768. <tr><td></td><td valign="top"><a href="#index-_002d_002dsysroot_003ddirectory"><code>--sysroot=<var>directory</var></code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Options">Options</a></td></tr>
  10769. <tr><td></td><td valign="top"><a href="#index-_002d_002dtarget_002dhelp"><code>--target-help</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Options">Options</a></td></tr>
  10770. <tr><td></td><td valign="top"><a href="#index-_002d_002dtarget1_002dabs"><code>--target1-abs</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#ARM">ARM</a></td></tr>
  10771. <tr><td></td><td valign="top"><a href="#index-_002d_002dtarget1_002drel"><code>--target1-rel</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#ARM">ARM</a></td></tr>
  10772. <tr><td></td><td valign="top"><a href="#index-_002d_002dtarget2_003dtype"><code>--target2=<var>type</var></code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#ARM">ARM</a></td></tr>
  10773. <tr><td></td><td valign="top"><a href="#index-_002d_002dtask_002dlink"><code>--task-link</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Options">Options</a></td></tr>
  10774. <tr><td></td><td valign="top"><a href="#index-_002d_002dthumb_002dentry_003dentry"><code>--thumb-entry=<var>entry</var></code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#ARM">ARM</a></td></tr>
  10775. <tr><td></td><td valign="top"><a href="#index-_002d_002dtls_002dget_002daddr_002doptimize"><code>--tls-get-addr-optimize</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#PowerPC64-ELF64">PowerPC64 ELF64</a></td></tr>
  10776. <tr><td></td><td valign="top"><a href="#index-_002d_002dtls_002dget_002daddr_002dregsave"><code>--tls-get-addr-regsave</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#PowerPC64-ELF64">PowerPC64 ELF64</a></td></tr>
  10777. <tr><td></td><td valign="top"><a href="#index-_002d_002dtrace"><code>--trace</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Options">Options</a></td></tr>
  10778. <tr><td></td><td valign="top"><a href="#index-_002d_002dtrace_002dsymbol_003dsymbol"><code>--trace-symbol=<var>symbol</var></code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Options">Options</a></td></tr>
  10779. <tr><td></td><td valign="top"><a href="#index-_002d_002dtraditional_002dformat"><code>--traditional-format</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Options">Options</a></td></tr>
  10780. <tr><td></td><td valign="top"><a href="#index-_002d_002dtsaware"><code>--tsaware</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Options">Options</a></td></tr>
  10781. <tr><td></td><td valign="top"><a href="#index-_002d_002dundefined_003dsymbol"><code>--undefined=<var>symbol</var></code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Options">Options</a></td></tr>
  10782. <tr><td></td><td valign="top"><a href="#index-_002d_002dunique_005b_003dSECTION_005d"><code>--unique[=<var>SECTION</var>]</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Options">Options</a></td></tr>
  10783. <tr><td></td><td valign="top"><a href="#index-_002d_002dunresolved_002dsymbols"><code>--unresolved-symbols</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Options">Options</a></td></tr>
  10784. <tr><td></td><td valign="top"><a href="#index-_002d_002duse_002dblx"><code>--use-blx</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#ARM">ARM</a></td></tr>
  10785. <tr><td></td><td valign="top"><a href="#index-_002d_002duse_002dnul_002dprefixed_002dimport_002dtables"><code>--use-nul-prefixed-import-tables</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#ARM">ARM</a></td></tr>
  10786. <tr><td></td><td valign="top"><a href="#index-_002d_002dverbose_005b_003dNUMBER_005d"><code>--verbose[=<var>NUMBER</var>]</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Options">Options</a></td></tr>
  10787. <tr><td></td><td valign="top"><a href="#index-_002d_002dversion"><code>--version</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Options">Options</a></td></tr>
  10788. <tr><td></td><td valign="top"><a href="#index-_002d_002dversion_002dscript_003dversion_002dscriptfile"><code>--version-script=<var>version-scriptfile</var></code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Options">Options</a></td></tr>
  10789. <tr><td></td><td valign="top"><a href="#index-_002d_002dvfp11_002ddenorm_002dfix"><code>--vfp11-denorm-fix</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#ARM">ARM</a></td></tr>
  10790. <tr><td></td><td valign="top"><a href="#index-_002d_002dwarn_002dalternate_002dem"><code>--warn-alternate-em</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Options">Options</a></td></tr>
  10791. <tr><td></td><td valign="top"><a href="#index-_002d_002dwarn_002dcommon"><code>--warn-common</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Options">Options</a></td></tr>
  10792. <tr><td></td><td valign="top"><a href="#index-_002d_002dwarn_002dconstructors"><code>--warn-constructors</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Options">Options</a></td></tr>
  10793. <tr><td></td><td valign="top"><a href="#index-_002d_002dwarn_002dexecstack"><code>--warn-execstack</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Options">Options</a></td></tr>
  10794. <tr><td></td><td valign="top"><a href="#index-_002d_002dwarn_002dmultiple_002dgp"><code>--warn-multiple-gp</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Options">Options</a></td></tr>
  10795. <tr><td></td><td valign="top"><a href="#index-_002d_002dwarn_002donce"><code>--warn-once</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Options">Options</a></td></tr>
  10796. <tr><td></td><td valign="top"><a href="#index-_002d_002dwarn_002drwx_002dsegments"><code>--warn-rwx-segments</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Options">Options</a></td></tr>
  10797. <tr><td></td><td valign="top"><a href="#index-_002d_002dwarn_002dsection_002dalign"><code>--warn-section-align</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Options">Options</a></td></tr>
  10798. <tr><td></td><td valign="top"><a href="#index-_002d_002dwarn_002dtextrel"><code>--warn-textrel</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Options">Options</a></td></tr>
  10799. <tr><td></td><td valign="top"><a href="#index-_002d_002dwarn_002dunresolved_002dsymbols"><code>--warn-unresolved-symbols</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Options">Options</a></td></tr>
  10800. <tr><td></td><td valign="top"><a href="#index-_002d_002dwdmdriver"><code>--wdmdriver</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Options">Options</a></td></tr>
  10801. <tr><td></td><td valign="top"><a href="#index-_002d_002dwhole_002darchive"><code>--whole-archive</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Options">Options</a></td></tr>
  10802. <tr><td></td><td valign="top"><a href="#index-_002d_002dwrap_003dsymbol"><code>--wrap=<var>symbol</var></code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Options">Options</a></td></tr>
  10803. <tr><td></td><td valign="top"><a href="#index-_002da-keyword"><code>-a <var>keyword</var></code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Options">Options</a></td></tr>
  10804. <tr><td></td><td valign="top"><a href="#index-_002dassert-keyword"><code>-assert <var>keyword</var></code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Options">Options</a></td></tr>
  10805. <tr><td></td><td valign="top"><a href="#index-_002db-format"><code>-b <var>format</var></code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Options">Options</a></td></tr>
  10806. <tr><td></td><td valign="top"><a href="#index-_002dBdynamic"><code>-Bdynamic</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Options">Options</a></td></tr>
  10807. <tr><td></td><td valign="top"><a href="#index-_002dBgroup"><code>-Bgroup</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Options">Options</a></td></tr>
  10808. <tr><td></td><td valign="top"><a href="#index-_002dBno_002dsymbolic"><code>-Bno-symbolic</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Options">Options</a></td></tr>
  10809. <tr><td></td><td valign="top"><a href="#index-_002dBshareable"><code>-Bshareable</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Options">Options</a></td></tr>
  10810. <tr><td></td><td valign="top"><a href="#index-_002dBstatic"><code>-Bstatic</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Options">Options</a></td></tr>
  10811. <tr><td></td><td valign="top"><a href="#index-_002dBsymbolic"><code>-Bsymbolic</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Options">Options</a></td></tr>
  10812. <tr><td></td><td valign="top"><a href="#index-_002dBsymbolic_002dfunctions"><code>-Bsymbolic-functions</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Options">Options</a></td></tr>
  10813. <tr><td></td><td valign="top"><a href="#index-_002dc-MRI_002dcmdfile"><code>-c <var>MRI-cmdfile</var></code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Options">Options</a></td></tr>
  10814. <tr><td></td><td valign="top"><a href="#index-_002dcall_005fshared"><code>-call_shared</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Options">Options</a></td></tr>
  10815. <tr><td></td><td valign="top"><a href="#index-_002dd"><code>-d</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Options">Options</a></td></tr>
  10816. <tr><td></td><td valign="top"><a href="#index-_002ddc"><code>-dc</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Options">Options</a></td></tr>
  10817. <tr><td></td><td valign="top"><a href="#index-_002ddn"><code>-dn</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Options">Options</a></td></tr>
  10818. <tr><td></td><td valign="top"><a href="#index-_002ddp"><code>-dp</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Options">Options</a></td></tr>
  10819. <tr><td></td><td valign="top"><a href="#index-_002ddT-script"><code>-dT <var>script</var></code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Options">Options</a></td></tr>
  10820. <tr><td></td><td valign="top"><a href="#index-_002ddy"><code>-dy</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Options">Options</a></td></tr>
  10821. <tr><td></td><td valign="top"><a href="#index-_002dE"><code>-E</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Options">Options</a></td></tr>
  10822. <tr><td></td><td valign="top"><a href="#index-_002de-entry"><code>-e <var>entry</var></code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Options">Options</a></td></tr>
  10823. <tr><td></td><td valign="top"><a href="#index-_002dEB"><code>-EB</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Options">Options</a></td></tr>
  10824. <tr><td></td><td valign="top"><a href="#index-_002dEL"><code>-EL</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Options">Options</a></td></tr>
  10825. <tr><td></td><td valign="top"><a href="#index-_002df-name"><code>-f <var>name</var></code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Options">Options</a></td></tr>
  10826. <tr><td></td><td valign="top"><a href="#index-_002dF-name"><code>-F <var>name</var></code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Options">Options</a></td></tr>
  10827. <tr><td></td><td valign="top"><a href="#index-_002dfini_003dname"><code>-fini=<var>name</var></code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Options">Options</a></td></tr>
  10828. <tr><td></td><td valign="top"><a href="#index-_002dg"><code>-g</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Options">Options</a></td></tr>
  10829. <tr><td></td><td valign="top"><a href="#index-_002dG-value"><code>-G <var>value</var></code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Options">Options</a></td></tr>
  10830. <tr><td></td><td valign="top"><a href="#index-_002dh-name"><code>-h <var>name</var></code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Options">Options</a></td></tr>
  10831. <tr><td></td><td valign="top"><a href="#index-_002di"><code>-i</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Options">Options</a></td></tr>
  10832. <tr><td></td><td valign="top"><a href="#index-_002dIfile"><code>-I<var>file</var></code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Options">Options</a></td></tr>
  10833. <tr><td></td><td valign="top"><a href="#index-_002dinit_003dname"><code>-init=<var>name</var></code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Options">Options</a></td></tr>
  10834. <tr><td></td><td valign="top"><a href="#index-_002dL-dir"><code>-L <var>dir</var></code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Options">Options</a></td></tr>
  10835. <tr><td></td><td valign="top"><a href="#index-_002dl-namespec"><code>-l <var>namespec</var></code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Options">Options</a></td></tr>
  10836. <tr><td></td><td valign="top"><a href="#index-_002dM"><code>-M</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Options">Options</a></td></tr>
  10837. <tr><td></td><td valign="top"><a href="#index-_002dm-emulation"><code>-m <var>emulation</var></code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Options">Options</a></td></tr>
  10838. <tr><td></td><td valign="top"><a href="#index-_002dMap_003dmapfile"><code>-Map=<var>mapfile</var></code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Options">Options</a></td></tr>
  10839. <tr><td></td><td valign="top"><a href="#index-_002dn"><code>-n</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Options">Options</a></td></tr>
  10840. <tr><td></td><td valign="top"><a href="#index-_002dN"><code>-N</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Options">Options</a></td></tr>
  10841. <tr><td></td><td valign="top"><a href="#index-_002dN-1"><code>-N</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Options">Options</a></td></tr>
  10842. <tr><td></td><td valign="top"><a href="#index-_002dn-1"><code>-n</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Options">Options</a></td></tr>
  10843. <tr><td></td><td valign="top"><a href="#index-_002dno_002dpie"><code>-no-pie</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Options">Options</a></td></tr>
  10844. <tr><td></td><td valign="top"><a href="#index-_002d_002dno_002drelax">&ndash;no-relax</a>:</td><td>&nbsp;</td><td valign="top"><a href="#Options">Options</a></td></tr>
  10845. <tr><td></td><td valign="top"><a href="#index-_002dnon_005fshared"><code>-non_shared</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Options">Options</a></td></tr>
  10846. <tr><td></td><td valign="top"><a href="#index-_002dnostdlib"><code>-nostdlib</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Options">Options</a></td></tr>
  10847. <tr><td></td><td valign="top"><a href="#index-_002dO-level"><code>-O <var>level</var></code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Options">Options</a></td></tr>
  10848. <tr><td></td><td valign="top"><a href="#index-_002do-output"><code>-o <var>output</var></code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Options">Options</a></td></tr>
  10849. <tr><td></td><td valign="top"><a href="#index-_002dP-AUDITLIB"><code>-P <var>AUDITLIB</var></code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Options">Options</a></td></tr>
  10850. <tr><td></td><td valign="top"><a href="#index-_002dpie"><code>-pie</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Options">Options</a></td></tr>
  10851. <tr><td></td><td valign="top"><a href="#index-_002dplugin-name"><code>-plugin <var>name</var></code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Options">Options</a></td></tr>
  10852. <tr><td></td><td valign="top"><a href="#index-_002dq"><code>-q</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Options">Options</a></td></tr>
  10853. <tr><td></td><td valign="top"><a href="#index-_002dqmagic"><code>-qmagic</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Options">Options</a></td></tr>
  10854. <tr><td></td><td valign="top"><a href="#index-_002dQy"><code>-Qy</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Options">Options</a></td></tr>
  10855. <tr><td></td><td valign="top"><a href="#index-_002dr"><code>-r</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Options">Options</a></td></tr>
  10856. <tr><td></td><td valign="top"><a href="#index-_002dR-file"><code>-R <var>file</var></code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Options">Options</a></td></tr>
  10857. <tr><td></td><td valign="top"><a href="#index-_002drpath_002dlink_003ddir"><code>-rpath-link=<var>dir</var></code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Options">Options</a></td></tr>
  10858. <tr><td></td><td valign="top"><a href="#index-_002drpath_003ddir"><code>-rpath=<var>dir</var></code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Options">Options</a></td></tr>
  10859. <tr><td></td><td valign="top"><a href="#index-_002ds"><code>-s</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Options">Options</a></td></tr>
  10860. <tr><td></td><td valign="top"><a href="#index-_002dS"><code>-S</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Options">Options</a></td></tr>
  10861. <tr><td></td><td valign="top"><a href="#index-_002dshared"><code>-shared</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Options">Options</a></td></tr>
  10862. <tr><td></td><td valign="top"><a href="#index-_002dsoname_003dname"><code>-soname=<var>name</var></code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Options">Options</a></td></tr>
  10863. <tr><td></td><td valign="top"><a href="#index-_002dstatic"><code>-static</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Options">Options</a></td></tr>
  10864. <tr><td></td><td valign="top"><a href="#index-_002dt"><code>-t</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Options">Options</a></td></tr>
  10865. <tr><td></td><td valign="top"><a href="#index-_002dT-script"><code>-T <var>script</var></code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Options">Options</a></td></tr>
  10866. <tr><td></td><td valign="top"><a href="#index-_002dTbss_003dorg"><code>-Tbss=<var>org</var></code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Options">Options</a></td></tr>
  10867. <tr><td></td><td valign="top"><a href="#index-_002dTdata_003dorg"><code>-Tdata=<var>org</var></code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Options">Options</a></td></tr>
  10868. <tr><td></td><td valign="top"><a href="#index-_002dTldata_002dsegment_003dorg"><code>-Tldata-segment=<var>org</var></code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Options">Options</a></td></tr>
  10869. <tr><td></td><td valign="top"><a href="#index-_002dTrodata_002dsegment_003dorg"><code>-Trodata-segment=<var>org</var></code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Options">Options</a></td></tr>
  10870. <tr><td></td><td valign="top"><a href="#index-_002dTtext_002dsegment_003dorg"><code>-Ttext-segment=<var>org</var></code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Options">Options</a></td></tr>
  10871. <tr><td></td><td valign="top"><a href="#index-_002dTtext_003dorg"><code>-Ttext=<var>org</var></code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Options">Options</a></td></tr>
  10872. <tr><td></td><td valign="top"><a href="#index-_002du-symbol"><code>-u <var>symbol</var></code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Options">Options</a></td></tr>
  10873. <tr><td></td><td valign="top"><a href="#index-_002dUr"><code>-Ur</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Options">Options</a></td></tr>
  10874. <tr><td></td><td valign="top"><a href="#index-_002dv"><code>-v</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Options">Options</a></td></tr>
  10875. <tr><td></td><td valign="top"><a href="#index-_002dV"><code>-V</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Options">Options</a></td></tr>
  10876. <tr><td></td><td valign="top"><a href="#index-_002dw"><code>-w</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Options">Options</a></td></tr>
  10877. <tr><td></td><td valign="top"><a href="#index-_002dx"><code>-x</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Options">Options</a></td></tr>
  10878. <tr><td></td><td valign="top"><a href="#index-_002dX"><code>-X</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Options">Options</a></td></tr>
  10879. <tr><td></td><td valign="top"><a href="#index-_002dY-path"><code>-Y <var>path</var></code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Options">Options</a></td></tr>
  10880. <tr><td></td><td valign="top"><a href="#index-_002dy-symbol"><code>-y <var>symbol</var></code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Options">Options</a></td></tr>
  10881. <tr><td></td><td valign="top"><a href="#index-_002dz"><code>-z</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Options">Options</a></td></tr>
  10882. <tr><td></td><td valign="top"><a href="#index-_002dz-defs"><code>-z defs</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Options">Options</a></td></tr>
  10883. <tr><td></td><td valign="top"><a href="#index-_002dz-keyword"><code>-z <var>keyword</var></code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Options">Options</a></td></tr>
  10884. <tr><td></td><td valign="top"><a href="#index-_002dz-muldefs"><code>-z muldefs</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Options">Options</a></td></tr>
  10885. <tr><td></td><td valign="top"><a href="#index-_002dz-undefs"><code>-z undefs</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Options">Options</a></td></tr>
  10886. <tr><td colspan="4"> <hr></td></tr>
  10887. <tr><th id="LD-Index_cp_symbol-3">.</th><td></td><td></td></tr>
  10888. <tr><td></td><td valign="top"><a href="#index-_002e"><code>.</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Location-Counter">Location Counter</a></td></tr>
  10889. <tr><td colspan="4"> <hr></td></tr>
  10890. <tr><th id="LD-Index_cp_symbol-4">/</th><td></td><td></td></tr>
  10891. <tr><td></td><td valign="top"><a href="#index-_002fDISCARD_002f">/DISCARD/</a>:</td><td>&nbsp;</td><td valign="top"><a href="#Output-Section-Discarding">Output Section Discarding</a></td></tr>
  10892. <tr><td colspan="4"> <hr></td></tr>
  10893. <tr><th id="LD-Index_cp_symbol-5">3</th><td></td><td></td></tr>
  10894. <tr><td></td><td valign="top"><a href="#index-32_002dbit-PLT-entries">32-bit PLT entries</a>:</td><td>&nbsp;</td><td valign="top"><a href="#ARM">ARM</a></td></tr>
  10895. <tr><td colspan="4"> <hr></td></tr>
  10896. <tr><th id="LD-Index_cp_symbol-6">:</th><td></td><td></td></tr>
  10897. <tr><td></td><td valign="top"><a href="#index-_003aphdr"><code>:<var>phdr</var></code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Output-Section-Phdr">Output Section Phdr</a></td></tr>
  10898. <tr><td colspan="4"> <hr></td></tr>
  10899. <tr><th id="LD-Index_cp_symbol-7">=</th><td></td><td></td></tr>
  10900. <tr><td></td><td valign="top"><a href="#index-_003dfillexp"><code>=<var>fillexp</var></code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Output-Section-Fill">Output Section Fill</a></td></tr>
  10901. <tr><td colspan="4"> <hr></td></tr>
  10902. <tr><th id="LD-Index_cp_symbol-8">&gt;</th><td></td><td></td></tr>
  10903. <tr><td></td><td valign="top"><a href="#index-_003eregion"><code>&gt;<var>region</var></code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Output-Section-Region">Output Section Region</a></td></tr>
  10904. <tr><td colspan="4"> <hr></td></tr>
  10905. <tr><th id="LD-Index_cp_symbol-9">[</th><td></td><td></td></tr>
  10906. <tr><td></td><td valign="top"><a href="#index-_005bCOMMON_005d">[COMMON]</a>:</td><td>&nbsp;</td><td valign="top"><a href="#Input-Section-Common">Input Section Common</a></td></tr>
  10907. <tr><td colspan="4"> <hr></td></tr>
  10908. <tr><th id="LD-Index_cp_letter-A">A</th><td></td><td></td></tr>
  10909. <tr><td></td><td valign="top"><a href="#index-AArch64-rela-addend">AArch64 rela addend</a>:</td><td>&nbsp;</td><td valign="top"><a href="#ARM">ARM</a></td></tr>
  10910. <tr><td></td><td valign="top"><a href="#index-ABSOLUTE-_0028MRI_0029"><code>ABSOLUTE</code> (MRI)</a>:</td><td>&nbsp;</td><td valign="top"><a href="#MRI">MRI</a></td></tr>
  10911. <tr><td></td><td valign="top"><a href="#index-absolute-and-relocatable-symbols">absolute and relocatable symbols</a>:</td><td>&nbsp;</td><td valign="top"><a href="#Expression-Section">Expression Section</a></td></tr>
  10912. <tr><td></td><td valign="top"><a href="#index-absolute-expressions">absolute expressions</a>:</td><td>&nbsp;</td><td valign="top"><a href="#Expression-Section">Expression Section</a></td></tr>
  10913. <tr><td></td><td valign="top"><a href="#index-ABSOLUTE_0028exp_0029"><code>ABSOLUTE(<var>exp</var>)</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Builtin-Functions">Builtin Functions</a></td></tr>
  10914. <tr><td></td><td valign="top"><a href="#index-ADDR_0028section_0029"><code>ADDR(<var>section</var>)</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Builtin-Functions">Builtin Functions</a></td></tr>
  10915. <tr><td></td><td valign="top"><a href="#index-address_002c-section">address, section</a>:</td><td>&nbsp;</td><td valign="top"><a href="#Output-Section-Address">Output Section Address</a></td></tr>
  10916. <tr><td></td><td valign="top"><a href="#index-ALIAS-_0028MRI_0029"><code>ALIAS</code> (MRI)</a>:</td><td>&nbsp;</td><td valign="top"><a href="#MRI">MRI</a></td></tr>
  10917. <tr><td></td><td valign="top"><a href="#index-ALIGN-_0028MRI_0029"><code>ALIGN</code> (MRI)</a>:</td><td>&nbsp;</td><td valign="top"><a href="#MRI">MRI</a></td></tr>
  10918. <tr><td></td><td valign="top"><a href="#index-align-expression">align expression</a>:</td><td>&nbsp;</td><td valign="top"><a href="#Builtin-Functions">Builtin Functions</a></td></tr>
  10919. <tr><td></td><td valign="top"><a href="#index-align-location-counter">align location counter</a>:</td><td>&nbsp;</td><td valign="top"><a href="#Builtin-Functions">Builtin Functions</a></td></tr>
  10920. <tr><td></td><td valign="top"><a href="#index-ALIGN_0028align_0029"><code>ALIGN(<var>align</var>)</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Builtin-Functions">Builtin Functions</a></td></tr>
  10921. <tr><td></td><td valign="top"><a href="#index-ALIGN_0028exp_002calign_0029"><code>ALIGN(<var>exp</var>,<var>align</var>)</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Builtin-Functions">Builtin Functions</a></td></tr>
  10922. <tr><td></td><td valign="top"><a href="#index-ALIGN_0028section_005falign_0029"><code>ALIGN(<var>section_align</var>)</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Forced-Output-Alignment">Forced Output Alignment</a></td></tr>
  10923. <tr><td></td><td valign="top"><a href="#index-aligned-common-symbols">aligned common symbols</a>:</td><td>&nbsp;</td><td valign="top"><a href="#WIN32">WIN32</a></td></tr>
  10924. <tr><td></td><td valign="top"><a href="#index-ALIGNOF_0028section_0029"><code>ALIGNOF(<var>section</var>)</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Builtin-Functions">Builtin Functions</a></td></tr>
  10925. <tr><td></td><td valign="top"><a href="#index-allocating-memory">allocating memory</a>:</td><td>&nbsp;</td><td valign="top"><a href="#MEMORY">MEMORY</a></td></tr>
  10926. <tr><td></td><td valign="top"><a href="#index-architecture">architecture</a>:</td><td>&nbsp;</td><td valign="top"><a href="#Miscellaneous-Commands">Miscellaneous Commands</a></td></tr>
  10927. <tr><td></td><td valign="top"><a href="#index-archive-files_002c-from-cmd-line">archive files, from cmd line</a>:</td><td>&nbsp;</td><td valign="top"><a href="#Options">Options</a></td></tr>
  10928. <tr><td></td><td valign="top"><a href="#index-archive-search-path-in-linker-script">archive search path in linker script</a>:</td><td>&nbsp;</td><td valign="top"><a href="#File-Commands">File Commands</a></td></tr>
  10929. <tr><td></td><td valign="top"><a href="#index-arithmetic">arithmetic</a>:</td><td>&nbsp;</td><td valign="top"><a href="#Expressions">Expressions</a></td></tr>
  10930. <tr><td></td><td valign="top"><a href="#index-arithmetic-operators">arithmetic operators</a>:</td><td>&nbsp;</td><td valign="top"><a href="#Operators">Operators</a></td></tr>
  10931. <tr><td></td><td valign="top"><a href="#index-ARM-interworking-support">ARM interworking support</a>:</td><td>&nbsp;</td><td valign="top"><a href="#ARM">ARM</a></td></tr>
  10932. <tr><td></td><td valign="top"><a href="#index-ARM1176-erratum-workaround">ARM1176 erratum workaround</a>:</td><td>&nbsp;</td><td valign="top"><a href="#ARM">ARM</a></td></tr>
  10933. <tr><td></td><td valign="top"><a href="#index-ASCIZ-_0060_0060string_0027_0027"><code>ASCIZ ``<var>string</var>''</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Output-Section-Data">Output Section Data</a></td></tr>
  10934. <tr><td></td><td valign="top"><a href="#index-ASSERT"><code>ASSERT</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Miscellaneous-Commands">Miscellaneous Commands</a></td></tr>
  10935. <tr><td></td><td valign="top"><a href="#index-assertion-in-linker-script">assertion in linker script</a>:</td><td>&nbsp;</td><td valign="top"><a href="#Miscellaneous-Commands">Miscellaneous Commands</a></td></tr>
  10936. <tr><td></td><td valign="top"><a href="#index-assignment-in-scripts">assignment in scripts</a>:</td><td>&nbsp;</td><td valign="top"><a href="#Assignments">Assignments</a></td></tr>
  10937. <tr><td></td><td valign="top"><a href="#index-AS_005fNEEDED_0028files_0029"><code>AS_NEEDED(<var>files</var>)</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#File-Commands">File Commands</a></td></tr>
  10938. <tr><td></td><td valign="top"><a href="#index-AT_0028lma_0029"><code>AT(<var>lma</var>)</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Output-Section-LMA">Output Section LMA</a></td></tr>
  10939. <tr><td></td><td valign="top"><a href="#index-AT_003elma_005fregion"><code>AT&gt;<var>lma_region</var></code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Output-Section-LMA">Output Section LMA</a></td></tr>
  10940. <tr><td></td><td valign="top"><a href="#index-automatic-data-imports">automatic data imports</a>:</td><td>&nbsp;</td><td valign="top"><a href="#WIN32">WIN32</a></td></tr>
  10941. <tr><td colspan="4"> <hr></td></tr>
  10942. <tr><th id="LD-Index_cp_letter-B">B</th><td></td><td></td></tr>
  10943. <tr><td></td><td valign="top"><a href="#index-back-end">back end</a>:</td><td>&nbsp;</td><td valign="top"><a href="#BFD">BFD</a></td></tr>
  10944. <tr><td></td><td valign="top"><a href="#index-BASE-_0028MRI_0029"><code>BASE</code> (MRI)</a>:</td><td>&nbsp;</td><td valign="top"><a href="#MRI">MRI</a></td></tr>
  10945. <tr><td></td><td valign="top"><a href="#index-BE8">BE8</a>:</td><td>&nbsp;</td><td valign="top"><a href="#ARM">ARM</a></td></tr>
  10946. <tr><td></td><td valign="top"><a href="#index-BFD-canonical-format">BFD canonical format</a>:</td><td>&nbsp;</td><td valign="top"><a href="#Canonical-format">Canonical format</a></td></tr>
  10947. <tr><td></td><td valign="top"><a href="#index-BFD-requirements">BFD requirements</a>:</td><td>&nbsp;</td><td valign="top"><a href="#BFD">BFD</a></td></tr>
  10948. <tr><td></td><td valign="top"><a href="#index-big_002dendian-objects">big-endian objects</a>:</td><td>&nbsp;</td><td valign="top"><a href="#Options">Options</a></td></tr>
  10949. <tr><td></td><td valign="top"><a href="#index-binary-input-format">binary input format</a>:</td><td>&nbsp;</td><td valign="top"><a href="#Options">Options</a></td></tr>
  10950. <tr><td></td><td valign="top"><a href="#index-BLOCK_0028exp_0029"><code>BLOCK(<var>exp</var>)</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Builtin-Functions">Builtin Functions</a></td></tr>
  10951. <tr><td></td><td valign="top"><a href="#index-bug-criteria">bug criteria</a>:</td><td>&nbsp;</td><td valign="top"><a href="#Bug-Criteria">Bug Criteria</a></td></tr>
  10952. <tr><td></td><td valign="top"><a href="#index-bug-reports">bug reports</a>:</td><td>&nbsp;</td><td valign="top"><a href="#Bug-Reporting">Bug Reporting</a></td></tr>
  10953. <tr><td></td><td valign="top"><a href="#index-bugs-in-ld">bugs in <code>ld</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Reporting-Bugs">Reporting Bugs</a></td></tr>
  10954. <tr><td></td><td valign="top"><a href="#index-BYTE_0028expression_0029"><code>BYTE(<var>expression</var>)</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Output-Section-Data">Output Section Data</a></td></tr>
  10955. <tr><td colspan="4"> <hr></td></tr>
  10956. <tr><th id="LD-Index_cp_letter-C">C</th><td></td><td></td></tr>
  10957. <tr><td></td><td valign="top"><a href="#index-C_002b_002b-constructors_002c-arranging-in-link">C++ constructors, arranging in link</a>:</td><td>&nbsp;</td><td valign="top"><a href="#Output-Section-Keywords">Output Section Keywords</a></td></tr>
  10958. <tr><td></td><td valign="top"><a href="#index-CHIP-_0028MRI_0029"><code>CHIP</code> (MRI)</a>:</td><td>&nbsp;</td><td valign="top"><a href="#MRI">MRI</a></td></tr>
  10959. <tr><td></td><td valign="top"><a href="#index-COLLECT_005fNO_005fDEMANGLE"><code>COLLECT_NO_DEMANGLE</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Environment">Environment</a></td></tr>
  10960. <tr><td></td><td valign="top"><a href="#index-combining-symbols_002c-warnings-on">combining symbols, warnings on</a>:</td><td>&nbsp;</td><td valign="top"><a href="#Options">Options</a></td></tr>
  10961. <tr><td></td><td valign="top"><a href="#index-COMDAT">COMDAT</a>:</td><td>&nbsp;</td><td valign="top"><a href="#Options">Options</a></td></tr>
  10962. <tr><td></td><td valign="top"><a href="#index-COMDAT-1">COMDAT</a>:</td><td>&nbsp;</td><td valign="top"><a href="#Miscellaneous-Commands">Miscellaneous Commands</a></td></tr>
  10963. <tr><td></td><td valign="top"><a href="#index-command-files">command files</a>:</td><td>&nbsp;</td><td valign="top"><a href="#Scripts">Scripts</a></td></tr>
  10964. <tr><td></td><td valign="top"><a href="#index-command-line">command line</a>:</td><td>&nbsp;</td><td valign="top"><a href="#Options">Options</a></td></tr>
  10965. <tr><td></td><td valign="top"><a href="#index-common-allocation">common allocation</a>:</td><td>&nbsp;</td><td valign="top"><a href="#Options">Options</a></td></tr>
  10966. <tr><td></td><td valign="top"><a href="#index-common-allocation-1">common allocation</a>:</td><td>&nbsp;</td><td valign="top"><a href="#Options">Options</a></td></tr>
  10967. <tr><td></td><td valign="top"><a href="#index-common-allocation-in-linker-script">common allocation in linker script</a>:</td><td>&nbsp;</td><td valign="top"><a href="#Miscellaneous-Commands">Miscellaneous Commands</a></td></tr>
  10968. <tr><td></td><td valign="top"><a href="#index-common-allocation-in-linker-script-1">common allocation in linker script</a>:</td><td>&nbsp;</td><td valign="top"><a href="#Miscellaneous-Commands">Miscellaneous Commands</a></td></tr>
  10969. <tr><td></td><td valign="top"><a href="#index-common-symbol-placement">common symbol placement</a>:</td><td>&nbsp;</td><td valign="top"><a href="#Input-Section-Common">Input Section Common</a></td></tr>
  10970. <tr><td></td><td valign="top"><a href="#index-COMMONPAGESIZE"><code>COMMONPAGESIZE</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Symbolic-Constants">Symbolic Constants</a></td></tr>
  10971. <tr><td></td><td valign="top"><a href="#index-compatibility_002c-MRI">compatibility, MRI</a>:</td><td>&nbsp;</td><td valign="top"><a href="#Options">Options</a></td></tr>
  10972. <tr><td></td><td valign="top"><a href="#index-CONSTANT"><code>CONSTANT</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Symbolic-Constants">Symbolic Constants</a></td></tr>
  10973. <tr><td></td><td valign="top"><a href="#index-constants-in-linker-scripts">constants in linker scripts</a>:</td><td>&nbsp;</td><td valign="top"><a href="#Constants">Constants</a></td></tr>
  10974. <tr><td></td><td valign="top"><a href="#index-constraints-on-output-sections">constraints on output sections</a>:</td><td>&nbsp;</td><td valign="top"><a href="#Output-Section-Constraint">Output Section Constraint</a></td></tr>
  10975. <tr><td></td><td valign="top"><a href="#index-constructors">constructors</a>:</td><td>&nbsp;</td><td valign="top"><a href="#Options">Options</a></td></tr>
  10976. <tr><td></td><td valign="top"><a href="#index-CONSTRUCTORS"><code>CONSTRUCTORS</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Output-Section-Keywords">Output Section Keywords</a></td></tr>
  10977. <tr><td></td><td valign="top"><a href="#index-constructors_002c-arranging-in-link">constructors, arranging in link</a>:</td><td>&nbsp;</td><td valign="top"><a href="#Output-Section-Keywords">Output Section Keywords</a></td></tr>
  10978. <tr><td></td><td valign="top"><a href="#index-Cortex_002dA53-erratum-835769-workaround">Cortex-A53 erratum 835769 workaround</a>:</td><td>&nbsp;</td><td valign="top"><a href="#ARM">ARM</a></td></tr>
  10979. <tr><td></td><td valign="top"><a href="#index-Cortex_002dA8-erratum-workaround">Cortex-A8 erratum workaround</a>:</td><td>&nbsp;</td><td valign="top"><a href="#ARM">ARM</a></td></tr>
  10980. <tr><td></td><td valign="top"><a href="#index-crash-of-linker">crash of linker</a>:</td><td>&nbsp;</td><td valign="top"><a href="#Bug-Criteria">Bug Criteria</a></td></tr>
  10981. <tr><td></td><td valign="top"><a href="#index-CREATE_005fOBJECT_005fSYMBOLS"><code>CREATE_OBJECT_SYMBOLS</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Output-Section-Keywords">Output Section Keywords</a></td></tr>
  10982. <tr><td></td><td valign="top"><a href="#index-creating-a-DEF-file">creating a DEF file</a>:</td><td>&nbsp;</td><td valign="top"><a href="#WIN32">WIN32</a></td></tr>
  10983. <tr><td></td><td valign="top"><a href="#index-cross-reference-table">cross reference table</a>:</td><td>&nbsp;</td><td valign="top"><a href="#Options">Options</a></td></tr>
  10984. <tr><td></td><td valign="top"><a href="#index-cross-references">cross references</a>:</td><td>&nbsp;</td><td valign="top"><a href="#Miscellaneous-Commands">Miscellaneous Commands</a></td></tr>
  10985. <tr><td></td><td valign="top"><a href="#index-cross-references-1">cross references</a>:</td><td>&nbsp;</td><td valign="top"><a href="#Miscellaneous-Commands">Miscellaneous Commands</a></td></tr>
  10986. <tr><td></td><td valign="top"><a href="#index-ctf-type-sharing">ctf type sharing</a>:</td><td>&nbsp;</td><td valign="top"><a href="#Options">Options</a></td></tr>
  10987. <tr><td></td><td valign="top"><a href="#index-ctf-variables">ctf variables</a>:</td><td>&nbsp;</td><td valign="top"><a href="#Options">Options</a></td></tr>
  10988. <tr><td></td><td valign="top"><a href="#index-current-output-location">current output location</a>:</td><td>&nbsp;</td><td valign="top"><a href="#Location-Counter">Location Counter</a></td></tr>
  10989. <tr><td colspan="4"> <hr></td></tr>
  10990. <tr><th id="LD-Index_cp_letter-D">D</th><td></td><td></td></tr>
  10991. <tr><td></td><td valign="top"><a href="#index-data">data</a>:</td><td>&nbsp;</td><td valign="top"><a href="#Output-Section-Data">Output Section Data</a></td></tr>
  10992. <tr><td></td><td valign="top"><a href="#index-DATA_005fSEGMENT_005fALIGN_0028maxpagesize_002c-commonpagesize_0029"><code>DATA_SEGMENT_ALIGN(<var>maxpagesize</var>, <var>commonpagesize</var>)</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Builtin-Functions">Builtin Functions</a></td></tr>
  10993. <tr><td></td><td valign="top"><a href="#index-DATA_005fSEGMENT_005fEND_0028exp_0029"><code>DATA_SEGMENT_END(<var>exp</var>)</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Builtin-Functions">Builtin Functions</a></td></tr>
  10994. <tr><td></td><td valign="top"><a href="#index-DATA_005fSEGMENT_005fRELRO_005fEND_0028offset_002c-exp_0029"><code>DATA_SEGMENT_RELRO_END(<var>offset</var>, <var>exp</var>)</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Builtin-Functions">Builtin Functions</a></td></tr>
  10995. <tr><td></td><td valign="top"><a href="#index-dbx">dbx</a>:</td><td>&nbsp;</td><td valign="top"><a href="#Options">Options</a></td></tr>
  10996. <tr><td></td><td valign="top"><a href="#index-DEF-files_002c-creating">DEF files, creating</a>:</td><td>&nbsp;</td><td valign="top"><a href="#Options">Options</a></td></tr>
  10997. <tr><td></td><td valign="top"><a href="#index-default-emulation">default emulation</a>:</td><td>&nbsp;</td><td valign="top"><a href="#Environment">Environment</a></td></tr>
  10998. <tr><td></td><td valign="top"><a href="#index-default-input-format">default input format</a>:</td><td>&nbsp;</td><td valign="top"><a href="#Environment">Environment</a></td></tr>
  10999. <tr><td></td><td valign="top"><a href="#index-defined-symbol">defined symbol</a>:</td><td>&nbsp;</td><td valign="top"><a href="#Options">Options</a></td></tr>
  11000. <tr><td></td><td valign="top"><a href="#index-DEFINED_0028symbol_0029"><code>DEFINED(<var>symbol</var>)</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Builtin-Functions">Builtin Functions</a></td></tr>
  11001. <tr><td></td><td valign="top"><a href="#index-deleting-local-symbols">deleting local symbols</a>:</td><td>&nbsp;</td><td valign="top"><a href="#Options">Options</a></td></tr>
  11002. <tr><td></td><td valign="top"><a href="#index-demangling_002c-default">demangling, default</a>:</td><td>&nbsp;</td><td valign="top"><a href="#Environment">Environment</a></td></tr>
  11003. <tr><td></td><td valign="top"><a href="#index-demangling_002c-from-command-line">demangling, from command line</a>:</td><td>&nbsp;</td><td valign="top"><a href="#Options">Options</a></td></tr>
  11004. <tr><td></td><td valign="top"><a href="#index-dependency-file">dependency file</a>:</td><td>&nbsp;</td><td valign="top"><a href="#Options">Options</a></td></tr>
  11005. <tr><td></td><td valign="top"><a href="#index-direct-linking-to-a-dll">direct linking to a dll</a>:</td><td>&nbsp;</td><td valign="top"><a href="#WIN32">WIN32</a></td></tr>
  11006. <tr><td></td><td valign="top"><a href="#index-discarding-sections">discarding sections</a>:</td><td>&nbsp;</td><td valign="top"><a href="#Output-Section-Discarding">Output Section Discarding</a></td></tr>
  11007. <tr><td></td><td valign="top"><a href="#index-discontinuous-memory">discontinuous memory</a>:</td><td>&nbsp;</td><td valign="top"><a href="#MEMORY">MEMORY</a></td></tr>
  11008. <tr><td></td><td valign="top"><a href="#index-DLLs_002c-creating">DLLs, creating</a>:</td><td>&nbsp;</td><td valign="top"><a href="#Options">Options</a></td></tr>
  11009. <tr><td></td><td valign="top"><a href="#index-DLLs_002c-creating-1">DLLs, creating</a>:</td><td>&nbsp;</td><td valign="top"><a href="#Options">Options</a></td></tr>
  11010. <tr><td></td><td valign="top"><a href="#index-DLLs_002c-creating-2">DLLs, creating</a>:</td><td>&nbsp;</td><td valign="top"><a href="#Options">Options</a></td></tr>
  11011. <tr><td></td><td valign="top"><a href="#index-DLLs_002c-linking-to">DLLs, linking to</a>:</td><td>&nbsp;</td><td valign="top"><a href="#Options">Options</a></td></tr>
  11012. <tr><td></td><td valign="top"><a href="#index-dot">dot</a>:</td><td>&nbsp;</td><td valign="top"><a href="#Location-Counter">Location Counter</a></td></tr>
  11013. <tr><td></td><td valign="top"><a href="#index-dot-inside-sections">dot inside sections</a>:</td><td>&nbsp;</td><td valign="top"><a href="#Location-Counter">Location Counter</a></td></tr>
  11014. <tr><td></td><td valign="top"><a href="#index-dot-outside-sections">dot outside sections</a>:</td><td>&nbsp;</td><td valign="top"><a href="#Location-Counter">Location Counter</a></td></tr>
  11015. <tr><td></td><td valign="top"><a href="#index-dynamic-linker_002c-from-command-line">dynamic linker, from command line</a>:</td><td>&nbsp;</td><td valign="top"><a href="#Options">Options</a></td></tr>
  11016. <tr><td></td><td valign="top"><a href="#index-dynamic-symbol-table">dynamic symbol table</a>:</td><td>&nbsp;</td><td valign="top"><a href="#Options">Options</a></td></tr>
  11017. <tr><td colspan="4"> <hr></td></tr>
  11018. <tr><th id="LD-Index_cp_letter-E">E</th><td></td><td></td></tr>
  11019. <tr><td></td><td valign="top"><a href="#index-ELF-program-headers">ELF program headers</a>:</td><td>&nbsp;</td><td valign="top"><a href="#PHDRS">PHDRS</a></td></tr>
  11020. <tr><td></td><td valign="top"><a href="#index-ELF-symbol-visibility">ELF symbol visibility</a>:</td><td>&nbsp;</td><td valign="top"><a href="#Options">Options</a></td></tr>
  11021. <tr><td></td><td valign="top"><a href="#index-emulation">emulation</a>:</td><td>&nbsp;</td><td valign="top"><a href="#Options">Options</a></td></tr>
  11022. <tr><td></td><td valign="top"><a href="#index-emulation_002c-default">emulation, default</a>:</td><td>&nbsp;</td><td valign="top"><a href="#Environment">Environment</a></td></tr>
  11023. <tr><td></td><td valign="top"><a href="#index-END-_0028MRI_0029"><code>END</code> (MRI)</a>:</td><td>&nbsp;</td><td valign="top"><a href="#MRI">MRI</a></td></tr>
  11024. <tr><td></td><td valign="top"><a href="#index-endianness">endianness</a>:</td><td>&nbsp;</td><td valign="top"><a href="#Options">Options</a></td></tr>
  11025. <tr><td></td><td valign="top"><a href="#index-entry-point">entry point</a>:</td><td>&nbsp;</td><td valign="top"><a href="#Entry-Point">Entry Point</a></td></tr>
  11026. <tr><td></td><td valign="top"><a href="#index-entry-point_002c-from-command-line">entry point, from command line</a>:</td><td>&nbsp;</td><td valign="top"><a href="#Options">Options</a></td></tr>
  11027. <tr><td></td><td valign="top"><a href="#index-entry-point_002c-thumb">entry point, thumb</a>:</td><td>&nbsp;</td><td valign="top"><a href="#ARM">ARM</a></td></tr>
  11028. <tr><td></td><td valign="top"><a href="#index-ENTRY_0028symbol_0029"><code>ENTRY(<var>symbol</var>)</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Entry-Point">Entry Point</a></td></tr>
  11029. <tr><td></td><td valign="top"><a href="#index-error-on-valid-input">error on valid input</a>:</td><td>&nbsp;</td><td valign="top"><a href="#Bug-Criteria">Bug Criteria</a></td></tr>
  11030. <tr><td></td><td valign="top"><a href="#index-example-of-linker-script">example of linker script</a>:</td><td>&nbsp;</td><td valign="top"><a href="#Simple-Example">Simple Example</a></td></tr>
  11031. <tr><td></td><td valign="top"><a href="#index-EXCLUDE_005fFILE">EXCLUDE_FILE</a>:</td><td>&nbsp;</td><td valign="top"><a href="#Input-Section-Basics">Input Section Basics</a></td></tr>
  11032. <tr><td></td><td valign="top"><a href="#index-executable-segments_002c-warnings-on">executable segments, warnings on</a>:</td><td>&nbsp;</td><td valign="top"><a href="#Options">Options</a></td></tr>
  11033. <tr><td></td><td valign="top"><a href="#index-executable-stack_002c-warnings-on">executable stack, warnings on</a>:</td><td>&nbsp;</td><td valign="top"><a href="#Options">Options</a></td></tr>
  11034. <tr><td></td><td valign="top"><a href="#index-export-dynamic-symbol">export dynamic symbol</a>:</td><td>&nbsp;</td><td valign="top"><a href="#Options">Options</a></td></tr>
  11035. <tr><td></td><td valign="top"><a href="#index-export-dynamic-symbol-list">export dynamic symbol list</a>:</td><td>&nbsp;</td><td valign="top"><a href="#Options">Options</a></td></tr>
  11036. <tr><td></td><td valign="top"><a href="#index-exporting-DLL-symbols">exporting DLL symbols</a>:</td><td>&nbsp;</td><td valign="top"><a href="#WIN32">WIN32</a></td></tr>
  11037. <tr><td></td><td valign="top"><a href="#index-expression-evaluation-order">expression evaluation order</a>:</td><td>&nbsp;</td><td valign="top"><a href="#Evaluation">Evaluation</a></td></tr>
  11038. <tr><td></td><td valign="top"><a href="#index-expression-sections">expression sections</a>:</td><td>&nbsp;</td><td valign="top"><a href="#Expression-Section">Expression Section</a></td></tr>
  11039. <tr><td></td><td valign="top"><a href="#index-expression_002c-absolute">expression, absolute</a>:</td><td>&nbsp;</td><td valign="top"><a href="#Builtin-Functions">Builtin Functions</a></td></tr>
  11040. <tr><td></td><td valign="top"><a href="#index-expressions">expressions</a>:</td><td>&nbsp;</td><td valign="top"><a href="#Expressions">Expressions</a></td></tr>
  11041. <tr><td></td><td valign="top"><a href="#index-EXTERN"><code>EXTERN</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Miscellaneous-Commands">Miscellaneous Commands</a></td></tr>
  11042. <tr><td colspan="4"> <hr></td></tr>
  11043. <tr><th id="LD-Index_cp_letter-F">F</th><td></td><td></td></tr>
  11044. <tr><td></td><td valign="top"><a href="#index-fatal-signal">fatal signal</a>:</td><td>&nbsp;</td><td valign="top"><a href="#Bug-Criteria">Bug Criteria</a></td></tr>
  11045. <tr><td></td><td valign="top"><a href="#index-file-name-wildcard-patterns">file name wildcard patterns</a>:</td><td>&nbsp;</td><td valign="top"><a href="#Input-Section-Wildcards">Input Section Wildcards</a></td></tr>
  11046. <tr><td></td><td valign="top"><a href="#index-FILEHDR"><code>FILEHDR</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#PHDRS">PHDRS</a></td></tr>
  11047. <tr><td></td><td valign="top"><a href="#index-filename-symbols">filename symbols</a>:</td><td>&nbsp;</td><td valign="top"><a href="#Output-Section-Keywords">Output Section Keywords</a></td></tr>
  11048. <tr><td></td><td valign="top"><a href="#index-fill-pattern_002c-entire-section">fill pattern, entire section</a>:</td><td>&nbsp;</td><td valign="top"><a href="#Output-Section-Fill">Output Section Fill</a></td></tr>
  11049. <tr><td></td><td valign="top"><a href="#index-FILL_0028expression_0029"><code>FILL(<var>expression</var>)</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Output-Section-Data">Output Section Data</a></td></tr>
  11050. <tr><td></td><td valign="top"><a href="#index-finalization-function">finalization function</a>:</td><td>&nbsp;</td><td valign="top"><a href="#Options">Options</a></td></tr>
  11051. <tr><td></td><td valign="top"><a href="#index-first-input-file">first input file</a>:</td><td>&nbsp;</td><td valign="top"><a href="#File-Commands">File Commands</a></td></tr>
  11052. <tr><td></td><td valign="top"><a href="#index-first-instruction">first instruction</a>:</td><td>&nbsp;</td><td valign="top"><a href="#Entry-Point">Entry Point</a></td></tr>
  11053. <tr><td></td><td valign="top"><a href="#index-FIX_005fV4BX">FIX_V4BX</a>:</td><td>&nbsp;</td><td valign="top"><a href="#ARM">ARM</a></td></tr>
  11054. <tr><td></td><td valign="top"><a href="#index-FIX_005fV4BX_005fINTERWORKING">FIX_V4BX_INTERWORKING</a>:</td><td>&nbsp;</td><td valign="top"><a href="#ARM">ARM</a></td></tr>
  11055. <tr><td></td><td valign="top"><a href="#index-FORCE_005fCOMMON_005fALLOCATION"><code>FORCE_COMMON_ALLOCATION</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Miscellaneous-Commands">Miscellaneous Commands</a></td></tr>
  11056. <tr><td></td><td valign="top"><a href="#index-FORCE_005fGROUP_005fALLOCATION"><code>FORCE_GROUP_ALLOCATION</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Miscellaneous-Commands">Miscellaneous Commands</a></td></tr>
  11057. <tr><td></td><td valign="top"><a href="#index-forcing-input-section-alignment">forcing input section alignment</a>:</td><td>&nbsp;</td><td valign="top"><a href="#Forced-Input-Alignment">Forced Input Alignment</a></td></tr>
  11058. <tr><td></td><td valign="top"><a href="#index-forcing-output-section-alignment">forcing output section alignment</a>:</td><td>&nbsp;</td><td valign="top"><a href="#Forced-Output-Alignment">Forced Output Alignment</a></td></tr>
  11059. <tr><td></td><td valign="top"><a href="#index-forcing-the-creation-of-dynamic-sections">forcing the creation of dynamic sections</a>:</td><td>&nbsp;</td><td valign="top"><a href="#Options">Options</a></td></tr>
  11060. <tr><td></td><td valign="top"><a href="#index-FORMAT-_0028MRI_0029"><code>FORMAT</code> (MRI)</a>:</td><td>&nbsp;</td><td valign="top"><a href="#MRI">MRI</a></td></tr>
  11061. <tr><td></td><td valign="top"><a href="#index-functions-in-expressions">functions in expressions</a>:</td><td>&nbsp;</td><td valign="top"><a href="#Builtin-Functions">Builtin Functions</a></td></tr>
  11062. <tr><td colspan="4"> <hr></td></tr>
  11063. <tr><th id="LD-Index_cp_letter-G">G</th><td></td><td></td></tr>
  11064. <tr><td></td><td valign="top"><a href="#index-garbage-collection">garbage collection</a>:</td><td>&nbsp;</td><td valign="top"><a href="#Options">Options</a></td></tr>
  11065. <tr><td></td><td valign="top"><a href="#index-garbage-collection-1">garbage collection</a>:</td><td>&nbsp;</td><td valign="top"><a href="#Options">Options</a></td></tr>
  11066. <tr><td></td><td valign="top"><a href="#index-garbage-collection-2">garbage collection</a>:</td><td>&nbsp;</td><td valign="top"><a href="#Options">Options</a></td></tr>
  11067. <tr><td></td><td valign="top"><a href="#index-garbage-collection-3">garbage collection</a>:</td><td>&nbsp;</td><td valign="top"><a href="#Input-Section-Keep">Input Section Keep</a></td></tr>
  11068. <tr><td></td><td valign="top"><a href="#index-generating-optimized-output">generating optimized output</a>:</td><td>&nbsp;</td><td valign="top"><a href="#Options">Options</a></td></tr>
  11069. <tr><td></td><td valign="top"><a href="#index-GNU-linker"><small>GNU</small> linker</a>:</td><td>&nbsp;</td><td valign="top"><a href="#Overview">Overview</a></td></tr>
  11070. <tr><td></td><td valign="top"><a href="#index-GNUTARGET"><code>GNUTARGET</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Environment">Environment</a></td></tr>
  11071. <tr><td></td><td valign="top"><a href="#index-group-allocation-in-linker-script">group allocation in linker script</a>:</td><td>&nbsp;</td><td valign="top"><a href="#Options">Options</a></td></tr>
  11072. <tr><td></td><td valign="top"><a href="#index-group-allocation-in-linker-script-1">group allocation in linker script</a>:</td><td>&nbsp;</td><td valign="top"><a href="#Miscellaneous-Commands">Miscellaneous Commands</a></td></tr>
  11073. <tr><td></td><td valign="top"><a href="#index-GROUP_0028files_0029"><code>GROUP(<var>files</var>)</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#File-Commands">File Commands</a></td></tr>
  11074. <tr><td></td><td valign="top"><a href="#index-grouping-input-files">grouping input files</a>:</td><td>&nbsp;</td><td valign="top"><a href="#File-Commands">File Commands</a></td></tr>
  11075. <tr><td></td><td valign="top"><a href="#index-groups-of-archives">groups of archives</a>:</td><td>&nbsp;</td><td valign="top"><a href="#Options">Options</a></td></tr>
  11076. <tr><td colspan="4"> <hr></td></tr>
  11077. <tr><th id="LD-Index_cp_letter-H">H</th><td></td><td></td></tr>
  11078. <tr><td></td><td valign="top"><a href="#index-H8_002f300-support">H8/300 support</a>:</td><td>&nbsp;</td><td valign="top"><a href="#H8_002f300">H8/300</a></td></tr>
  11079. <tr><td></td><td valign="top"><a href="#index-header-size">header size</a>:</td><td>&nbsp;</td><td valign="top"><a href="#Builtin-Functions">Builtin Functions</a></td></tr>
  11080. <tr><td></td><td valign="top"><a href="#index-heap-size">heap size</a>:</td><td>&nbsp;</td><td valign="top"><a href="#Options">Options</a></td></tr>
  11081. <tr><td></td><td valign="top"><a href="#index-help">help</a>:</td><td>&nbsp;</td><td valign="top"><a href="#Options">Options</a></td></tr>
  11082. <tr><td></td><td valign="top"><a href="#index-HIDDEN">HIDDEN</a>:</td><td>&nbsp;</td><td valign="top"><a href="#HIDDEN">HIDDEN</a></td></tr>
  11083. <tr><td></td><td valign="top"><a href="#index-holes">holes</a>:</td><td>&nbsp;</td><td valign="top"><a href="#Location-Counter">Location Counter</a></td></tr>
  11084. <tr><td></td><td valign="top"><a href="#index-holes_002c-filling">holes, filling</a>:</td><td>&nbsp;</td><td valign="top"><a href="#Output-Section-Data">Output Section Data</a></td></tr>
  11085. <tr><td></td><td valign="top"><a href="#index-HPPA-multiple-sub_002dspace-stubs">HPPA multiple sub-space stubs</a>:</td><td>&nbsp;</td><td valign="top"><a href="#HPPA-ELF32">HPPA ELF32</a></td></tr>
  11086. <tr><td></td><td valign="top"><a href="#index-HPPA-stub-grouping">HPPA stub grouping</a>:</td><td>&nbsp;</td><td valign="top"><a href="#HPPA-ELF32">HPPA ELF32</a></td></tr>
  11087. <tr><td colspan="4"> <hr></td></tr>
  11088. <tr><th id="LD-Index_cp_letter-I">I</th><td></td><td></td></tr>
  11089. <tr><td></td><td valign="top"><a href="#index-image-base">image base</a>:</td><td>&nbsp;</td><td valign="top"><a href="#Options">Options</a></td></tr>
  11090. <tr><td></td><td valign="top"><a href="#index-implicit-linker-scripts">implicit linker scripts</a>:</td><td>&nbsp;</td><td valign="top"><a href="#Implicit-Linker-Scripts">Implicit Linker Scripts</a></td></tr>
  11091. <tr><td></td><td valign="top"><a href="#index-import-libraries">import libraries</a>:</td><td>&nbsp;</td><td valign="top"><a href="#WIN32">WIN32</a></td></tr>
  11092. <tr><td></td><td valign="top"><a href="#index-INCLUDE-filename"><code>INCLUDE <var>filename</var></code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#File-Commands">File Commands</a></td></tr>
  11093. <tr><td></td><td valign="top"><a href="#index-including-a-linker-script">including a linker script</a>:</td><td>&nbsp;</td><td valign="top"><a href="#File-Commands">File Commands</a></td></tr>
  11094. <tr><td></td><td valign="top"><a href="#index-including-an-entire-archive">including an entire archive</a>:</td><td>&nbsp;</td><td valign="top"><a href="#Options">Options</a></td></tr>
  11095. <tr><td></td><td valign="top"><a href="#index-incremental-link">incremental link</a>:</td><td>&nbsp;</td><td valign="top"><a href="#Options">Options</a></td></tr>
  11096. <tr><td></td><td valign="top"><a href="#index-INHIBIT_005fCOMMON_005fALLOCATION"><code>INHIBIT_COMMON_ALLOCATION</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Miscellaneous-Commands">Miscellaneous Commands</a></td></tr>
  11097. <tr><td></td><td valign="top"><a href="#index-initialization-function">initialization function</a>:</td><td>&nbsp;</td><td valign="top"><a href="#Options">Options</a></td></tr>
  11098. <tr><td></td><td valign="top"><a href="#index-initialized-data-in-ROM">initialized data in ROM</a>:</td><td>&nbsp;</td><td valign="top"><a href="#Output-Section-LMA">Output Section LMA</a></td></tr>
  11099. <tr><td></td><td valign="top"><a href="#index-input-file-format-in-linker-script">input file format in linker script</a>:</td><td>&nbsp;</td><td valign="top"><a href="#Format-Commands">Format Commands</a></td></tr>
  11100. <tr><td></td><td valign="top"><a href="#index-input-filename-symbols">input filename symbols</a>:</td><td>&nbsp;</td><td valign="top"><a href="#Output-Section-Keywords">Output Section Keywords</a></td></tr>
  11101. <tr><td></td><td valign="top"><a href="#index-input-files-in-linker-scripts">input files in linker scripts</a>:</td><td>&nbsp;</td><td valign="top"><a href="#File-Commands">File Commands</a></td></tr>
  11102. <tr><td></td><td valign="top"><a href="#index-input-files_002c-displaying">input files, displaying</a>:</td><td>&nbsp;</td><td valign="top"><a href="#Options">Options</a></td></tr>
  11103. <tr><td></td><td valign="top"><a href="#index-input-format">input format</a>:</td><td>&nbsp;</td><td valign="top"><a href="#Options">Options</a></td></tr>
  11104. <tr><td></td><td valign="top"><a href="#index-input-format-1">input format</a>:</td><td>&nbsp;</td><td valign="top"><a href="#Options">Options</a></td></tr>
  11105. <tr><td></td><td valign="top"><a href="#index-Input-import-library">Input import library</a>:</td><td>&nbsp;</td><td valign="top"><a href="#ARM">ARM</a></td></tr>
  11106. <tr><td></td><td valign="top"><a href="#index-input-object-files-in-linker-scripts">input object files in linker scripts</a>:</td><td>&nbsp;</td><td valign="top"><a href="#File-Commands">File Commands</a></td></tr>
  11107. <tr><td></td><td valign="top"><a href="#index-input-section-alignment">input section alignment</a>:</td><td>&nbsp;</td><td valign="top"><a href="#Forced-Input-Alignment">Forced Input Alignment</a></td></tr>
  11108. <tr><td></td><td valign="top"><a href="#index-input-section-basics">input section basics</a>:</td><td>&nbsp;</td><td valign="top"><a href="#Input-Section-Basics">Input Section Basics</a></td></tr>
  11109. <tr><td></td><td valign="top"><a href="#index-input-section-wildcards">input section wildcards</a>:</td><td>&nbsp;</td><td valign="top"><a href="#Input-Section-Wildcards">Input Section Wildcards</a></td></tr>
  11110. <tr><td></td><td valign="top"><a href="#index-input-sections">input sections</a>:</td><td>&nbsp;</td><td valign="top"><a href="#Input-Section">Input Section</a></td></tr>
  11111. <tr><td></td><td valign="top"><a href="#index-INPUT_0028files_0029"><code>INPUT(<var>files</var>)</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#File-Commands">File Commands</a></td></tr>
  11112. <tr><td></td><td valign="top"><a href="#index-INSERT"><code>INSERT</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Miscellaneous-Commands">Miscellaneous Commands</a></td></tr>
  11113. <tr><td></td><td valign="top"><a href="#index-insert-user-script-into-default-script">insert user script into default script</a>:</td><td>&nbsp;</td><td valign="top"><a href="#Miscellaneous-Commands">Miscellaneous Commands</a></td></tr>
  11114. <tr><td></td><td valign="top"><a href="#index-integer-notation">integer notation</a>:</td><td>&nbsp;</td><td valign="top"><a href="#Constants">Constants</a></td></tr>
  11115. <tr><td></td><td valign="top"><a href="#index-integer-suffixes">integer suffixes</a>:</td><td>&nbsp;</td><td valign="top"><a href="#Constants">Constants</a></td></tr>
  11116. <tr><td></td><td valign="top"><a href="#index-internal-object_002dfile-format">internal object-file format</a>:</td><td>&nbsp;</td><td valign="top"><a href="#Canonical-format">Canonical format</a></td></tr>
  11117. <tr><td></td><td valign="top"><a href="#index-invalid-input">invalid input</a>:</td><td>&nbsp;</td><td valign="top"><a href="#Bug-Criteria">Bug Criteria</a></td></tr>
  11118. <tr><td colspan="4"> <hr></td></tr>
  11119. <tr><th id="LD-Index_cp_letter-K">K</th><td></td><td></td></tr>
  11120. <tr><td></td><td valign="top"><a href="#index-K-and-M-integer-suffixes">K and M integer suffixes</a>:</td><td>&nbsp;</td><td valign="top"><a href="#Constants">Constants</a></td></tr>
  11121. <tr><td></td><td valign="top"><a href="#index-KEEP">KEEP</a>:</td><td>&nbsp;</td><td valign="top"><a href="#Input-Section-Keep">Input Section Keep</a></td></tr>
  11122. <tr><td colspan="4"> <hr></td></tr>
  11123. <tr><th id="LD-Index_cp_letter-L">L</th><td></td><td></td></tr>
  11124. <tr><td></td><td valign="top"><a href="#index-l-_003d"><code>l =</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#MEMORY">MEMORY</a></td></tr>
  11125. <tr><td></td><td valign="top"><a href="#index-lazy-evaluation">lazy evaluation</a>:</td><td>&nbsp;</td><td valign="top"><a href="#Evaluation">Evaluation</a></td></tr>
  11126. <tr><td></td><td valign="top"><a href="#index-ld-bugs_002c-reporting"><code>ld</code> bugs, reporting</a>:</td><td>&nbsp;</td><td valign="top"><a href="#Bug-Reporting">Bug Reporting</a></td></tr>
  11127. <tr><td></td><td valign="top"><a href="#index-ldata-segment-origin_002c-cmd-line">ldata segment origin, cmd line</a>:</td><td>&nbsp;</td><td valign="top"><a href="#Options">Options</a></td></tr>
  11128. <tr><td></td><td valign="top"><a href="#index-LDEMULATION"><code>LDEMULATION</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Environment">Environment</a></td></tr>
  11129. <tr><td></td><td valign="top"><a href="#index-LD_005fFEATURE_0028string_0029"><code>LD_FEATURE(<var>string</var>)</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Miscellaneous-Commands">Miscellaneous Commands</a></td></tr>
  11130. <tr><td></td><td valign="top"><a href="#index-len-_003d"><code>len =</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#MEMORY">MEMORY</a></td></tr>
  11131. <tr><td></td><td valign="top"><a href="#index-LENGTH-_003d"><code>LENGTH =</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#MEMORY">MEMORY</a></td></tr>
  11132. <tr><td></td><td valign="top"><a href="#index-LENGTH_0028memory_0029"><code>LENGTH(<var>memory</var>)</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Builtin-Functions">Builtin Functions</a></td></tr>
  11133. <tr><td></td><td valign="top"><a href="#index-library-search-path-in-linker-script">library search path in linker script</a>:</td><td>&nbsp;</td><td valign="top"><a href="#File-Commands">File Commands</a></td></tr>
  11134. <tr><td></td><td valign="top"><a href="#index-link-map">link map</a>:</td><td>&nbsp;</td><td valign="top"><a href="#Options">Options</a></td></tr>
  11135. <tr><td></td><td valign="top"><a href="#index-link-map-discarded">link map discarded</a>:</td><td>&nbsp;</td><td valign="top"><a href="#Options">Options</a></td></tr>
  11136. <tr><td></td><td valign="top"><a href="#index-link_002dtime-runtime-library-search-path">link-time runtime library search path</a>:</td><td>&nbsp;</td><td valign="top"><a href="#Options">Options</a></td></tr>
  11137. <tr><td></td><td valign="top"><a href="#index-linker-crash">linker crash</a>:</td><td>&nbsp;</td><td valign="top"><a href="#Bug-Criteria">Bug Criteria</a></td></tr>
  11138. <tr><td></td><td valign="top"><a href="#index-linker-plugins">linker plugins</a>:</td><td>&nbsp;</td><td valign="top"><a href="#Plugins">Plugins</a></td></tr>
  11139. <tr><td></td><td valign="top"><a href="#index-linker-script-concepts">linker script concepts</a>:</td><td>&nbsp;</td><td valign="top"><a href="#Basic-Script-Concepts">Basic Script Concepts</a></td></tr>
  11140. <tr><td></td><td valign="top"><a href="#index-linker-script-example">linker script example</a>:</td><td>&nbsp;</td><td valign="top"><a href="#Simple-Example">Simple Example</a></td></tr>
  11141. <tr><td></td><td valign="top"><a href="#index-linker-script-file-commands">linker script file commands</a>:</td><td>&nbsp;</td><td valign="top"><a href="#File-Commands">File Commands</a></td></tr>
  11142. <tr><td></td><td valign="top"><a href="#index-linker-script-format">linker script format</a>:</td><td>&nbsp;</td><td valign="top"><a href="#Script-Format">Script Format</a></td></tr>
  11143. <tr><td></td><td valign="top"><a href="#index-linker-script-input-object-files">linker script input object files</a>:</td><td>&nbsp;</td><td valign="top"><a href="#File-Commands">File Commands</a></td></tr>
  11144. <tr><td></td><td valign="top"><a href="#index-linker-script-simple-commands">linker script simple commands</a>:</td><td>&nbsp;</td><td valign="top"><a href="#Simple-Commands">Simple Commands</a></td></tr>
  11145. <tr><td></td><td valign="top"><a href="#index-linker-scripts">linker scripts</a>:</td><td>&nbsp;</td><td valign="top"><a href="#Scripts">Scripts</a></td></tr>
  11146. <tr><td></td><td valign="top"><a href="#index-LINKER_005fVERSION">LINKER_VERSION</a>:</td><td>&nbsp;</td><td valign="top"><a href="#Output-Section-Data">Output Section Data</a></td></tr>
  11147. <tr><td></td><td valign="top"><a href="#index-LINKER_005fVERSION-1"><code>LINKER_VERSION</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Output-Section-Data">Output Section Data</a></td></tr>
  11148. <tr><td></td><td valign="top"><a href="#index-LIST-_0028MRI_0029"><code>LIST</code> (MRI)</a>:</td><td>&nbsp;</td><td valign="top"><a href="#MRI">MRI</a></td></tr>
  11149. <tr><td></td><td valign="top"><a href="#index-little_002dendian-objects">little-endian objects</a>:</td><td>&nbsp;</td><td valign="top"><a href="#Options">Options</a></td></tr>
  11150. <tr><td></td><td valign="top"><a href="#index-LOAD-_0028MRI_0029"><code>LOAD</code> (MRI)</a>:</td><td>&nbsp;</td><td valign="top"><a href="#MRI">MRI</a></td></tr>
  11151. <tr><td></td><td valign="top"><a href="#index-load-address">load address</a>:</td><td>&nbsp;</td><td valign="top"><a href="#Output-Section-LMA">Output Section LMA</a></td></tr>
  11152. <tr><td></td><td valign="top"><a href="#index-LOADADDR_0028section_0029"><code>LOADADDR(<var>section</var>)</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Builtin-Functions">Builtin Functions</a></td></tr>
  11153. <tr><td></td><td valign="top"><a href="#index-loading_002c-preventing">loading, preventing</a>:</td><td>&nbsp;</td><td valign="top"><a href="#Output-Section-Type">Output Section Type</a></td></tr>
  11154. <tr><td></td><td valign="top"><a href="#index-local-symbols_002c-deleting">local symbols, deleting</a>:</td><td>&nbsp;</td><td valign="top"><a href="#Options">Options</a></td></tr>
  11155. <tr><td></td><td valign="top"><a href="#index-location-counter">location counter</a>:</td><td>&nbsp;</td><td valign="top"><a href="#Location-Counter">Location Counter</a></td></tr>
  11156. <tr><td></td><td valign="top"><a href="#index-LOG2CEIL_0028exp_0029"><code>LOG2CEIL(<var>exp</var>)</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Builtin-Functions">Builtin Functions</a></td></tr>
  11157. <tr><td></td><td valign="top"><a href="#index-LONG_0028expression_0029"><code>LONG(<var>expression</var>)</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Output-Section-Data">Output Section Data</a></td></tr>
  11158. <tr><td colspan="4"> <hr></td></tr>
  11159. <tr><th id="LD-Index_cp_letter-M">M</th><td></td><td></td></tr>
  11160. <tr><td></td><td valign="top"><a href="#index-M-and-K-integer-suffixes">M and K integer suffixes</a>:</td><td>&nbsp;</td><td valign="top"><a href="#Constants">Constants</a></td></tr>
  11161. <tr><td></td><td valign="top"><a href="#index-M68HC11-and-68HC12-support">M68HC11 and 68HC12 support</a>:</td><td>&nbsp;</td><td valign="top"><a href="#M68HC11_002f68HC12">M68HC11/68HC12</a></td></tr>
  11162. <tr><td></td><td valign="top"><a href="#index-machine-architecture">machine architecture</a>:</td><td>&nbsp;</td><td valign="top"><a href="#Miscellaneous-Commands">Miscellaneous Commands</a></td></tr>
  11163. <tr><td></td><td valign="top"><a href="#index-machine-dependencies">machine dependencies</a>:</td><td>&nbsp;</td><td valign="top"><a href="#Machine-Dependent">Machine Dependent</a></td></tr>
  11164. <tr><td></td><td valign="top"><a href="#index-mapping-input-sections-to-output-sections">mapping input sections to output sections</a>:</td><td>&nbsp;</td><td valign="top"><a href="#Input-Section">Input Section</a></td></tr>
  11165. <tr><td></td><td valign="top"><a href="#index-MAX"><code>MAX</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Builtin-Functions">Builtin Functions</a></td></tr>
  11166. <tr><td></td><td valign="top"><a href="#index-MAXPAGESIZE"><code>MAXPAGESIZE</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Symbolic-Constants">Symbolic Constants</a></td></tr>
  11167. <tr><td></td><td valign="top"><a href="#index-MEMORY"><code>MEMORY</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#MEMORY">MEMORY</a></td></tr>
  11168. <tr><td></td><td valign="top"><a href="#index-memory-region-attributes">memory region attributes</a>:</td><td>&nbsp;</td><td valign="top"><a href="#MEMORY">MEMORY</a></td></tr>
  11169. <tr><td></td><td valign="top"><a href="#index-memory-regions">memory regions</a>:</td><td>&nbsp;</td><td valign="top"><a href="#MEMORY">MEMORY</a></td></tr>
  11170. <tr><td></td><td valign="top"><a href="#index-memory-regions-and-sections">memory regions and sections</a>:</td><td>&nbsp;</td><td valign="top"><a href="#Output-Section-Region">Output Section Region</a></td></tr>
  11171. <tr><td></td><td valign="top"><a href="#index-memory-usage">memory usage</a>:</td><td>&nbsp;</td><td valign="top"><a href="#Options">Options</a></td></tr>
  11172. <tr><td></td><td valign="top"><a href="#index-memory-usage-1">memory usage</a>:</td><td>&nbsp;</td><td valign="top"><a href="#Options">Options</a></td></tr>
  11173. <tr><td></td><td valign="top"><a href="#index-Merging-exidx-entries">Merging exidx entries</a>:</td><td>&nbsp;</td><td valign="top"><a href="#ARM">ARM</a></td></tr>
  11174. <tr><td></td><td valign="top"><a href="#index-MIN"><code>MIN</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Builtin-Functions">Builtin Functions</a></td></tr>
  11175. <tr><td></td><td valign="top"><a href="#index-MIPS-branch-relocation-check-control">MIPS branch relocation check control</a>:</td><td>&nbsp;</td><td valign="top"><a href="#MIPS">MIPS</a></td></tr>
  11176. <tr><td></td><td valign="top"><a href="#index-MIPS-microMIPS-instruction-choice-selection">MIPS microMIPS instruction choice selection</a>:</td><td>&nbsp;</td><td valign="top"><a href="#MIPS">MIPS</a></td></tr>
  11177. <tr><td></td><td valign="top"><a href="#index-Motorola-68K-GOT-generation">Motorola 68K GOT generation</a>:</td><td>&nbsp;</td><td valign="top"><a href="#M68K">M68K</a></td></tr>
  11178. <tr><td></td><td valign="top"><a href="#index-MRI-compatibility">MRI compatibility</a>:</td><td>&nbsp;</td><td valign="top"><a href="#MRI">MRI</a></td></tr>
  11179. <tr><td></td><td valign="top"><a href="#index-MSP430-extra-sections">MSP430 extra sections</a>:</td><td>&nbsp;</td><td valign="top"><a href="#MSP430">MSP430</a></td></tr>
  11180. <tr><td></td><td valign="top"><a href="#index-MSP430-Options">MSP430 Options</a>:</td><td>&nbsp;</td><td valign="top"><a href="#MSP430">MSP430</a></td></tr>
  11181. <tr><td colspan="4"> <hr></td></tr>
  11182. <tr><th id="LD-Index_cp_letter-N">N</th><td></td><td></td></tr>
  11183. <tr><td></td><td valign="top"><a href="#index-NAME-_0028MRI_0029"><code>NAME</code> (MRI)</a>:</td><td>&nbsp;</td><td valign="top"><a href="#MRI">MRI</a></td></tr>
  11184. <tr><td></td><td valign="top"><a href="#index-name_002c-section">name, section</a>:</td><td>&nbsp;</td><td valign="top"><a href="#Output-Section-Name">Output Section Name</a></td></tr>
  11185. <tr><td></td><td valign="top"><a href="#index-names">names</a>:</td><td>&nbsp;</td><td valign="top"><a href="#Symbols">Symbols</a></td></tr>
  11186. <tr><td></td><td valign="top"><a href="#index-naming-the-output-file">naming the output file</a>:</td><td>&nbsp;</td><td valign="top"><a href="#Options">Options</a></td></tr>
  11187. <tr><td></td><td valign="top"><a href="#index-NEXT_0028exp_0029"><code>NEXT(<var>exp</var>)</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Builtin-Functions">Builtin Functions</a></td></tr>
  11188. <tr><td></td><td valign="top"><a href="#index-Nios-II-call-relaxation">Nios II call relaxation</a>:</td><td>&nbsp;</td><td valign="top"><a href="#Nios-II">Nios II</a></td></tr>
  11189. <tr><td></td><td valign="top"><a href="#index-NMAGIC">NMAGIC</a>:</td><td>&nbsp;</td><td valign="top"><a href="#Options">Options</a></td></tr>
  11190. <tr><td></td><td valign="top"><a href="#index-NOCROSSREFS_0028sections_0029"><code>NOCROSSREFS(<var>sections</var>)</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Miscellaneous-Commands">Miscellaneous Commands</a></td></tr>
  11191. <tr><td></td><td valign="top"><a href="#index-NOCROSSREFS_005fTO_0028tosection-fromsections_0029"><code>NOCROSSREFS_TO(<var>tosection</var> <var>fromsections</var>)</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Miscellaneous-Commands">Miscellaneous Commands</a></td></tr>
  11192. <tr><td></td><td valign="top"><a href="#index-NOLOAD"><code>NOLOAD</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Output-Section-Type">Output Section Type</a></td></tr>
  11193. <tr><td></td><td valign="top"><a href="#index-not-enough-room-for-program-headers">not enough room for program headers</a>:</td><td>&nbsp;</td><td valign="top"><a href="#Builtin-Functions">Builtin Functions</a></td></tr>
  11194. <tr><td></td><td valign="top"><a href="#index-NO_005fENUM_005fSIZE_005fWARNING">NO_ENUM_SIZE_WARNING</a>:</td><td>&nbsp;</td><td valign="top"><a href="#ARM">ARM</a></td></tr>
  11195. <tr><td></td><td valign="top"><a href="#index-NO_005fWCHAR_005fSIZE_005fWARNING">NO_WCHAR_SIZE_WARNING</a>:</td><td>&nbsp;</td><td valign="top"><a href="#ARM">ARM</a></td></tr>
  11196. <tr><td colspan="4"> <hr></td></tr>
  11197. <tr><th id="LD-Index_cp_letter-O">O</th><td></td><td></td></tr>
  11198. <tr><td></td><td valign="top"><a href="#index-o-_003d"><code>o =</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#MEMORY">MEMORY</a></td></tr>
  11199. <tr><td></td><td valign="top"><a href="#index-objdump-_002di"><code>objdump -i</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#BFD">BFD</a></td></tr>
  11200. <tr><td></td><td valign="top"><a href="#index-object-file-management">object file management</a>:</td><td>&nbsp;</td><td valign="top"><a href="#BFD">BFD</a></td></tr>
  11201. <tr><td></td><td valign="top"><a href="#index-object-files">object files</a>:</td><td>&nbsp;</td><td valign="top"><a href="#Options">Options</a></td></tr>
  11202. <tr><td></td><td valign="top"><a href="#index-object-formats-available">object formats available</a>:</td><td>&nbsp;</td><td valign="top"><a href="#BFD">BFD</a></td></tr>
  11203. <tr><td></td><td valign="top"><a href="#index-object-size">object size</a>:</td><td>&nbsp;</td><td valign="top"><a href="#Options">Options</a></td></tr>
  11204. <tr><td></td><td valign="top"><a href="#index-OMAGIC">OMAGIC</a>:</td><td>&nbsp;</td><td valign="top"><a href="#Options">Options</a></td></tr>
  11205. <tr><td></td><td valign="top"><a href="#index-OMAGIC-1">OMAGIC</a>:</td><td>&nbsp;</td><td valign="top"><a href="#Options">Options</a></td></tr>
  11206. <tr><td></td><td valign="top"><a href="#index-ONLY_005fIF_005fRO"><code>ONLY_IF_RO</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Output-Section-Constraint">Output Section Constraint</a></td></tr>
  11207. <tr><td></td><td valign="top"><a href="#index-ONLY_005fIF_005fRW"><code>ONLY_IF_RW</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Output-Section-Constraint">Output Section Constraint</a></td></tr>
  11208. <tr><td></td><td valign="top"><a href="#index-opening-object-files">opening object files</a>:</td><td>&nbsp;</td><td valign="top"><a href="#BFD-outline">BFD outline</a></td></tr>
  11209. <tr><td></td><td valign="top"><a href="#index-operators-for-arithmetic">operators for arithmetic</a>:</td><td>&nbsp;</td><td valign="top"><a href="#Operators">Operators</a></td></tr>
  11210. <tr><td></td><td valign="top"><a href="#index-options">options</a>:</td><td>&nbsp;</td><td valign="top"><a href="#Options">Options</a></td></tr>
  11211. <tr><td></td><td valign="top"><a href="#index-ORDER-_0028MRI_0029"><code>ORDER</code> (MRI)</a>:</td><td>&nbsp;</td><td valign="top"><a href="#MRI">MRI</a></td></tr>
  11212. <tr><td></td><td valign="top"><a href="#index-org-_003d"><code>org =</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#MEMORY">MEMORY</a></td></tr>
  11213. <tr><td></td><td valign="top"><a href="#index-ORIGIN-_003d"><code>ORIGIN =</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#MEMORY">MEMORY</a></td></tr>
  11214. <tr><td></td><td valign="top"><a href="#index-ORIGIN_0028memory_0029"><code>ORIGIN(<var>memory</var>)</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Builtin-Functions">Builtin Functions</a></td></tr>
  11215. <tr><td></td><td valign="top"><a href="#index-orphan">orphan</a>:</td><td>&nbsp;</td><td valign="top"><a href="#Orphan-Sections">Orphan Sections</a></td></tr>
  11216. <tr><td></td><td valign="top"><a href="#index-orphan-sections">orphan sections</a>:</td><td>&nbsp;</td><td valign="top"><a href="#Options">Options</a></td></tr>
  11217. <tr><td></td><td valign="top"><a href="#index-output-file-after-errors">output file after errors</a>:</td><td>&nbsp;</td><td valign="top"><a href="#Options">Options</a></td></tr>
  11218. <tr><td></td><td valign="top"><a href="#index-output-file-format-in-linker-script">output file format in linker script</a>:</td><td>&nbsp;</td><td valign="top"><a href="#Format-Commands">Format Commands</a></td></tr>
  11219. <tr><td></td><td valign="top"><a href="#index-output-file-name-in-linker-script">output file name in linker script</a>:</td><td>&nbsp;</td><td valign="top"><a href="#File-Commands">File Commands</a></td></tr>
  11220. <tr><td></td><td valign="top"><a href="#index-output-format">output format</a>:</td><td>&nbsp;</td><td valign="top"><a href="#Options">Options</a></td></tr>
  11221. <tr><td></td><td valign="top"><a href="#index-output-section-alignment">output section alignment</a>:</td><td>&nbsp;</td><td valign="top"><a href="#Forced-Output-Alignment">Forced Output Alignment</a></td></tr>
  11222. <tr><td></td><td valign="top"><a href="#index-output-section-attributes">output section attributes</a>:</td><td>&nbsp;</td><td valign="top"><a href="#Output-Section-Attributes">Output Section Attributes</a></td></tr>
  11223. <tr><td></td><td valign="top"><a href="#index-output-section-data">output section data</a>:</td><td>&nbsp;</td><td valign="top"><a href="#Output-Section-Data">Output Section Data</a></td></tr>
  11224. <tr><td></td><td valign="top"><a href="#index-OUTPUT_0028filename_0029"><code>OUTPUT(<var>filename</var>)</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#File-Commands">File Commands</a></td></tr>
  11225. <tr><td></td><td valign="top"><a href="#index-OUTPUT_005fARCH_0028bfdarch_0029"><code>OUTPUT_ARCH(<var>bfdarch</var>)</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Miscellaneous-Commands">Miscellaneous Commands</a></td></tr>
  11226. <tr><td></td><td valign="top"><a href="#index-OUTPUT_005fFORMAT_0028bfdname_0029"><code>OUTPUT_FORMAT(<var>bfdname</var>)</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Format-Commands">Format Commands</a></td></tr>
  11227. <tr><td></td><td valign="top"><a href="#index-OVERLAY"><code>OVERLAY</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Overlay-Description">Overlay Description</a></td></tr>
  11228. <tr><td></td><td valign="top"><a href="#index-overlays">overlays</a>:</td><td>&nbsp;</td><td valign="top"><a href="#Overlay-Description">Overlay Description</a></td></tr>
  11229. <tr><td colspan="4"> <hr></td></tr>
  11230. <tr><th id="LD-Index_cp_letter-P">P</th><td></td><td></td></tr>
  11231. <tr><td></td><td valign="top"><a href="#index-partial-link">partial link</a>:</td><td>&nbsp;</td><td valign="top"><a href="#Options">Options</a></td></tr>
  11232. <tr><td></td><td valign="top"><a href="#index-PE-import-table-prefixing">PE import table prefixing</a>:</td><td>&nbsp;</td><td valign="top"><a href="#ARM">ARM</a></td></tr>
  11233. <tr><td></td><td valign="top"><a href="#index-PHDRS"><code>PHDRS</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#PHDRS">PHDRS</a></td></tr>
  11234. <tr><td></td><td valign="top"><a href="#index-PHDRS-1"><code>PHDRS</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#PHDRS">PHDRS</a></td></tr>
  11235. <tr><td></td><td valign="top"><a href="#index-PIC_005fVENEER">PIC_VENEER</a>:</td><td>&nbsp;</td><td valign="top"><a href="#ARM">ARM</a></td></tr>
  11236. <tr><td></td><td valign="top"><a href="#index-Placement-of-SG-veneers">Placement of SG veneers</a>:</td><td>&nbsp;</td><td valign="top"><a href="#ARM">ARM</a></td></tr>
  11237. <tr><td></td><td valign="top"><a href="#index-plugins">plugins</a>:</td><td>&nbsp;</td><td valign="top"><a href="#Plugins">Plugins</a></td></tr>
  11238. <tr><td></td><td valign="top"><a href="#index-pop-state-governing-input-file-handling">pop state governing input file handling</a>:</td><td>&nbsp;</td><td valign="top"><a href="#Options">Options</a></td></tr>
  11239. <tr><td></td><td valign="top"><a href="#index-position-dependent-executables">position dependent executables</a>:</td><td>&nbsp;</td><td valign="top"><a href="#Options">Options</a></td></tr>
  11240. <tr><td></td><td valign="top"><a href="#index-position-independent-executables">position independent executables</a>:</td><td>&nbsp;</td><td valign="top"><a href="#Options">Options</a></td></tr>
  11241. <tr><td></td><td valign="top"><a href="#index-PowerPC-ELF32-options">PowerPC ELF32 options</a>:</td><td>&nbsp;</td><td valign="top"><a href="#PowerPC-ELF32">PowerPC ELF32</a></td></tr>
  11242. <tr><td></td><td valign="top"><a href="#index-PowerPC-GOT">PowerPC GOT</a>:</td><td>&nbsp;</td><td valign="top"><a href="#PowerPC-ELF32">PowerPC ELF32</a></td></tr>
  11243. <tr><td></td><td valign="top"><a href="#index-PowerPC-long-branches">PowerPC long branches</a>:</td><td>&nbsp;</td><td valign="top"><a href="#PowerPC-ELF32">PowerPC ELF32</a></td></tr>
  11244. <tr><td></td><td valign="top"><a href="#index-PowerPC-PLT">PowerPC PLT</a>:</td><td>&nbsp;</td><td valign="top"><a href="#PowerPC-ELF32">PowerPC ELF32</a></td></tr>
  11245. <tr><td></td><td valign="top"><a href="#index-PowerPC-stub-symbols">PowerPC stub symbols</a>:</td><td>&nbsp;</td><td valign="top"><a href="#PowerPC-ELF32">PowerPC ELF32</a></td></tr>
  11246. <tr><td></td><td valign="top"><a href="#index-PowerPC-TLS-optimization">PowerPC TLS optimization</a>:</td><td>&nbsp;</td><td valign="top"><a href="#PowerPC-ELF32">PowerPC ELF32</a></td></tr>
  11247. <tr><td></td><td valign="top"><a href="#index-PowerPC64-dot-symbols">PowerPC64 dot symbols</a>:</td><td>&nbsp;</td><td valign="top"><a href="#PowerPC64-ELF64">PowerPC64 ELF64</a></td></tr>
  11248. <tr><td></td><td valign="top"><a href="#index-PowerPC64-ELF64-options">PowerPC64 ELF64 options</a>:</td><td>&nbsp;</td><td valign="top"><a href="#PowerPC64-ELF64">PowerPC64 ELF64</a></td></tr>
  11249. <tr><td></td><td valign="top"><a href="#index-PowerPC64-ELFv2-PLT-localentry-optimization">PowerPC64 ELFv2 PLT localentry optimization</a>:</td><td>&nbsp;</td><td valign="top"><a href="#PowerPC64-ELF64">PowerPC64 ELF64</a></td></tr>
  11250. <tr><td></td><td valign="top"><a href="#index-PowerPC64-inline-PLT-call-optimization">PowerPC64 inline PLT call optimization</a>:</td><td>&nbsp;</td><td valign="top"><a href="#PowerPC64-ELF64">PowerPC64 ELF64</a></td></tr>
  11251. <tr><td></td><td valign="top"><a href="#index-PowerPC64-multi_002dTOC">PowerPC64 multi-TOC</a>:</td><td>&nbsp;</td><td valign="top"><a href="#PowerPC64-ELF64">PowerPC64 ELF64</a></td></tr>
  11252. <tr><td></td><td valign="top"><a href="#index-PowerPC64-OPD-optimization">PowerPC64 OPD optimization</a>:</td><td>&nbsp;</td><td valign="top"><a href="#PowerPC64-ELF64">PowerPC64 ELF64</a></td></tr>
  11253. <tr><td></td><td valign="top"><a href="#index-PowerPC64-OPD-spacing">PowerPC64 OPD spacing</a>:</td><td>&nbsp;</td><td valign="top"><a href="#PowerPC64-ELF64">PowerPC64 ELF64</a></td></tr>
  11254. <tr><td></td><td valign="top"><a href="#index-PowerPC64-PLT-call-stub-static-chain">PowerPC64 PLT call stub static chain</a>:</td><td>&nbsp;</td><td valign="top"><a href="#PowerPC64-ELF64">PowerPC64 ELF64</a></td></tr>
  11255. <tr><td></td><td valign="top"><a href="#index-PowerPC64-PLT-call-stub-thread-safety">PowerPC64 PLT call stub thread safety</a>:</td><td>&nbsp;</td><td valign="top"><a href="#PowerPC64-ELF64">PowerPC64 ELF64</a></td></tr>
  11256. <tr><td></td><td valign="top"><a href="#index-PowerPC64-PLT-stub-alignment">PowerPC64 PLT stub alignment</a>:</td><td>&nbsp;</td><td valign="top"><a href="#PowerPC64-ELF64">PowerPC64 ELF64</a></td></tr>
  11257. <tr><td></td><td valign="top"><a href="#index-PowerPC64-Power10-stubs">PowerPC64 Power10 stubs</a>:</td><td>&nbsp;</td><td valign="top"><a href="#PowerPC64-ELF64">PowerPC64 ELF64</a></td></tr>
  11258. <tr><td></td><td valign="top"><a href="#index-PowerPC64-register-save_002frestore-functions">PowerPC64 register save/restore functions</a>:</td><td>&nbsp;</td><td valign="top"><a href="#PowerPC64-ELF64">PowerPC64 ELF64</a></td></tr>
  11259. <tr><td></td><td valign="top"><a href="#index-PowerPC64-stub-grouping">PowerPC64 stub grouping</a>:</td><td>&nbsp;</td><td valign="top"><a href="#PowerPC64-ELF64">PowerPC64 ELF64</a></td></tr>
  11260. <tr><td></td><td valign="top"><a href="#index-PowerPC64-stub-symbols">PowerPC64 stub symbols</a>:</td><td>&nbsp;</td><td valign="top"><a href="#PowerPC64-ELF64">PowerPC64 ELF64</a></td></tr>
  11261. <tr><td></td><td valign="top"><a href="#index-PowerPC64-TLS-optimization">PowerPC64 TLS optimization</a>:</td><td>&nbsp;</td><td valign="top"><a href="#PowerPC64-ELF64">PowerPC64 ELF64</a></td></tr>
  11262. <tr><td></td><td valign="top"><a href="#index-PowerPC64-TOC-optimization">PowerPC64 TOC optimization</a>:</td><td>&nbsp;</td><td valign="top"><a href="#PowerPC64-ELF64">PowerPC64 ELF64</a></td></tr>
  11263. <tr><td></td><td valign="top"><a href="#index-PowerPC64-TOC-sorting">PowerPC64 TOC sorting</a>:</td><td>&nbsp;</td><td valign="top"><a href="#PowerPC64-ELF64">PowerPC64 ELF64</a></td></tr>
  11264. <tr><td></td><td valign="top"><a href="#index-PowerPC64-_005f_005ftls_005fget_005faddr-optimization">PowerPC64 __tls_get_addr optimization</a>:</td><td>&nbsp;</td><td valign="top"><a href="#PowerPC64-ELF64">PowerPC64 ELF64</a></td></tr>
  11265. <tr><td></td><td valign="top"><a href="#index-precedence-in-expressions">precedence in expressions</a>:</td><td>&nbsp;</td><td valign="top"><a href="#Operators">Operators</a></td></tr>
  11266. <tr><td></td><td valign="top"><a href="#index-prevent-unnecessary-loading">prevent unnecessary loading</a>:</td><td>&nbsp;</td><td valign="top"><a href="#Output-Section-Type">Output Section Type</a></td></tr>
  11267. <tr><td></td><td valign="top"><a href="#index-program-headers">program headers</a>:</td><td>&nbsp;</td><td valign="top"><a href="#PHDRS">PHDRS</a></td></tr>
  11268. <tr><td></td><td valign="top"><a href="#index-program-headers-and-sections">program headers and sections</a>:</td><td>&nbsp;</td><td valign="top"><a href="#Output-Section-Phdr">Output Section Phdr</a></td></tr>
  11269. <tr><td></td><td valign="top"><a href="#index-program-headers_002c-not-enough-room">program headers, not enough room</a>:</td><td>&nbsp;</td><td valign="top"><a href="#Builtin-Functions">Builtin Functions</a></td></tr>
  11270. <tr><td></td><td valign="top"><a href="#index-program-segments">program segments</a>:</td><td>&nbsp;</td><td valign="top"><a href="#PHDRS">PHDRS</a></td></tr>
  11271. <tr><td></td><td valign="top"><a href="#index-PROVIDE">PROVIDE</a>:</td><td>&nbsp;</td><td valign="top"><a href="#PROVIDE">PROVIDE</a></td></tr>
  11272. <tr><td></td><td valign="top"><a href="#index-PROVIDE_005fHIDDEN">PROVIDE_HIDDEN</a>:</td><td>&nbsp;</td><td valign="top"><a href="#PROVIDE_005fHIDDEN">PROVIDE_HIDDEN</a></td></tr>
  11273. <tr><td></td><td valign="top"><a href="#index-PUBLIC-_0028MRI_0029"><code>PUBLIC</code> (MRI)</a>:</td><td>&nbsp;</td><td valign="top"><a href="#MRI">MRI</a></td></tr>
  11274. <tr><td></td><td valign="top"><a href="#index-push-state-governing-input-file-handling">push state governing input file handling</a>:</td><td>&nbsp;</td><td valign="top"><a href="#Options">Options</a></td></tr>
  11275. <tr><td colspan="4"> <hr></td></tr>
  11276. <tr><th id="LD-Index_cp_letter-Q">Q</th><td></td><td></td></tr>
  11277. <tr><td></td><td valign="top"><a href="#index-QUAD_0028expression_0029"><code>QUAD(<var>expression</var>)</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Output-Section-Data">Output Section Data</a></td></tr>
  11278. <tr><td></td><td valign="top"><a href="#index-quoted-symbol-names">quoted symbol names</a>:</td><td>&nbsp;</td><td valign="top"><a href="#Symbols">Symbols</a></td></tr>
  11279. <tr><td colspan="4"> <hr></td></tr>
  11280. <tr><th id="LD-Index_cp_letter-R">R</th><td></td><td></td></tr>
  11281. <tr><td></td><td valign="top"><a href="#index-read_002donly-text">read-only text</a>:</td><td>&nbsp;</td><td valign="top"><a href="#Options">Options</a></td></tr>
  11282. <tr><td></td><td valign="top"><a href="#index-read_002fwrite-from-cmd-line">read/write from cmd line</a>:</td><td>&nbsp;</td><td valign="top"><a href="#Options">Options</a></td></tr>
  11283. <tr><td></td><td valign="top"><a href="#index-region-alias">region alias</a>:</td><td>&nbsp;</td><td valign="top"><a href="#REGION_005fALIAS">REGION_ALIAS</a></td></tr>
  11284. <tr><td></td><td valign="top"><a href="#index-region-names">region names</a>:</td><td>&nbsp;</td><td valign="top"><a href="#REGION_005fALIAS">REGION_ALIAS</a></td></tr>
  11285. <tr><td></td><td valign="top"><a href="#index-regions-of-memory">regions of memory</a>:</td><td>&nbsp;</td><td valign="top"><a href="#MEMORY">MEMORY</a></td></tr>
  11286. <tr><td></td><td valign="top"><a href="#index-REGION_005fALIAS_0028alias_002c-region_0029"><code>REGION_ALIAS(<var>alias</var>, <var>region</var>)</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#REGION_005fALIAS">REGION_ALIAS</a></td></tr>
  11287. <tr><td></td><td valign="top"><a href="#index-relative-expressions">relative expressions</a>:</td><td>&nbsp;</td><td valign="top"><a href="#Expression-Section">Expression Section</a></td></tr>
  11288. <tr><td></td><td valign="top"><a href="#index-relaxing-addressing-modes">relaxing addressing modes</a>:</td><td>&nbsp;</td><td valign="top"><a href="#Options">Options</a></td></tr>
  11289. <tr><td></td><td valign="top"><a href="#index-relaxing-on-H8_002f300">relaxing on H8/300</a>:</td><td>&nbsp;</td><td valign="top"><a href="#H8_002f300">H8/300</a></td></tr>
  11290. <tr><td></td><td valign="top"><a href="#index-relaxing-on-M68HC11">relaxing on M68HC11</a>:</td><td>&nbsp;</td><td valign="top"><a href="#M68HC11_002f68HC12">M68HC11/68HC12</a></td></tr>
  11291. <tr><td></td><td valign="top"><a href="#index-relaxing-on-NDS32"><code>relaxing on NDS32</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#NDS32">NDS32</a></td></tr>
  11292. <tr><td></td><td valign="top"><a href="#index-relaxing-on-Xtensa">relaxing on Xtensa</a>:</td><td>&nbsp;</td><td valign="top"><a href="#Xtensa">Xtensa</a></td></tr>
  11293. <tr><td></td><td valign="top"><a href="#index-relocatable-and-absolute-symbols">relocatable and absolute symbols</a>:</td><td>&nbsp;</td><td valign="top"><a href="#Expression-Section">Expression Section</a></td></tr>
  11294. <tr><td></td><td valign="top"><a href="#index-relocatable-output">relocatable output</a>:</td><td>&nbsp;</td><td valign="top"><a href="#Options">Options</a></td></tr>
  11295. <tr><td></td><td valign="top"><a href="#index-remapping-inputs">remapping inputs</a>:</td><td>&nbsp;</td><td valign="top"><a href="#Options">Options</a></td></tr>
  11296. <tr><td></td><td valign="top"><a href="#index-removing-sections">removing sections</a>:</td><td>&nbsp;</td><td valign="top"><a href="#Output-Section-Discarding">Output Section Discarding</a></td></tr>
  11297. <tr><td></td><td valign="top"><a href="#index-reporting-bugs-in-ld">reporting bugs in <code>ld</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Reporting-Bugs">Reporting Bugs</a></td></tr>
  11298. <tr><td></td><td valign="top"><a href="#index-requirements-for-BFD">requirements for BFD</a>:</td><td>&nbsp;</td><td valign="top"><a href="#BFD">BFD</a></td></tr>
  11299. <tr><td></td><td valign="top"><a href="#index-retain-relocations-in-final-executable">retain relocations in final executable</a>:</td><td>&nbsp;</td><td valign="top"><a href="#Options">Options</a></td></tr>
  11300. <tr><td></td><td valign="top"><a href="#index-retaining-specified-symbols">retaining specified symbols</a>:</td><td>&nbsp;</td><td valign="top"><a href="#Options">Options</a></td></tr>
  11301. <tr><td></td><td valign="top"><a href="#index-REVERSE">REVERSE</a>:</td><td>&nbsp;</td><td valign="top"><a href="#Input-Section-Wildcards">Input Section Wildcards</a></td></tr>
  11302. <tr><td></td><td valign="top"><a href="#index-rodata-segment-origin_002c-cmd-line">rodata segment origin, cmd line</a>:</td><td>&nbsp;</td><td valign="top"><a href="#Options">Options</a></td></tr>
  11303. <tr><td></td><td valign="top"><a href="#index-ROM-initialized-data">ROM initialized data</a>:</td><td>&nbsp;</td><td valign="top"><a href="#Output-Section-LMA">Output Section LMA</a></td></tr>
  11304. <tr><td></td><td valign="top"><a href="#index-round-up-expression">round up expression</a>:</td><td>&nbsp;</td><td valign="top"><a href="#Builtin-Functions">Builtin Functions</a></td></tr>
  11305. <tr><td></td><td valign="top"><a href="#index-round-up-location-counter">round up location counter</a>:</td><td>&nbsp;</td><td valign="top"><a href="#Builtin-Functions">Builtin Functions</a></td></tr>
  11306. <tr><td></td><td valign="top"><a href="#index-runtime-library-name">runtime library name</a>:</td><td>&nbsp;</td><td valign="top"><a href="#Options">Options</a></td></tr>
  11307. <tr><td></td><td valign="top"><a href="#index-runtime-library-search-path">runtime library search path</a>:</td><td>&nbsp;</td><td valign="top"><a href="#Options">Options</a></td></tr>
  11308. <tr><td></td><td valign="top"><a href="#index-runtime-pseudo_002drelocation">runtime pseudo-relocation</a>:</td><td>&nbsp;</td><td valign="top"><a href="#WIN32">WIN32</a></td></tr>
  11309. <tr><td colspan="4"> <hr></td></tr>
  11310. <tr><th id="LD-Index_cp_letter-S">S</th><td></td><td></td></tr>
  11311. <tr><td></td><td valign="top"><a href="#index-S_002f390">S/390</a>:</td><td>&nbsp;</td><td valign="top"><a href="#S_002f390-ELF">S/390 ELF</a></td></tr>
  11312. <tr><td></td><td valign="top"><a href="#index-S_002f390-ELF-options">S/390 ELF options</a>:</td><td>&nbsp;</td><td valign="top"><a href="#S_002f390-ELF">S/390 ELF</a></td></tr>
  11313. <tr><td></td><td valign="top"><a href="#index-scaled-integers">scaled integers</a>:</td><td>&nbsp;</td><td valign="top"><a href="#Constants">Constants</a></td></tr>
  11314. <tr><td></td><td valign="top"><a href="#index-scommon-section">scommon section</a>:</td><td>&nbsp;</td><td valign="top"><a href="#Input-Section-Common">Input Section Common</a></td></tr>
  11315. <tr><td></td><td valign="top"><a href="#index-script-files">script files</a>:</td><td>&nbsp;</td><td valign="top"><a href="#Options">Options</a></td></tr>
  11316. <tr><td></td><td valign="top"><a href="#index-script-files-1">script files</a>:</td><td>&nbsp;</td><td valign="top"><a href="#Options">Options</a></td></tr>
  11317. <tr><td></td><td valign="top"><a href="#index-scripts">scripts</a>:</td><td>&nbsp;</td><td valign="top"><a href="#Scripts">Scripts</a></td></tr>
  11318. <tr><td></td><td valign="top"><a href="#index-search-directory_002c-from-cmd-line">search directory, from cmd line</a>:</td><td>&nbsp;</td><td valign="top"><a href="#Options">Options</a></td></tr>
  11319. <tr><td></td><td valign="top"><a href="#index-search-path-in-linker-script">search path in linker script</a>:</td><td>&nbsp;</td><td valign="top"><a href="#File-Commands">File Commands</a></td></tr>
  11320. <tr><td></td><td valign="top"><a href="#index-SEARCH_005fDIR_0028path_0029"><code>SEARCH_DIR(<var>path</var>)</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#File-Commands">File Commands</a></td></tr>
  11321. <tr><td></td><td valign="top"><a href="#index-SECT-_0028MRI_0029"><code>SECT</code> (MRI)</a>:</td><td>&nbsp;</td><td valign="top"><a href="#MRI">MRI</a></td></tr>
  11322. <tr><td></td><td valign="top"><a href="#index-section-address">section address</a>:</td><td>&nbsp;</td><td valign="top"><a href="#Output-Section-Address">Output Section Address</a></td></tr>
  11323. <tr><td></td><td valign="top"><a href="#index-section-address-in-expression">section address in expression</a>:</td><td>&nbsp;</td><td valign="top"><a href="#Builtin-Functions">Builtin Functions</a></td></tr>
  11324. <tr><td></td><td valign="top"><a href="#index-section-alignment">section alignment</a>:</td><td>&nbsp;</td><td valign="top"><a href="#Builtin-Functions">Builtin Functions</a></td></tr>
  11325. <tr><td></td><td valign="top"><a href="#index-section-alignment_002c-warnings-on">section alignment, warnings on</a>:</td><td>&nbsp;</td><td valign="top"><a href="#Options">Options</a></td></tr>
  11326. <tr><td></td><td valign="top"><a href="#index-section-data">section data</a>:</td><td>&nbsp;</td><td valign="top"><a href="#Output-Section-Data">Output Section Data</a></td></tr>
  11327. <tr><td></td><td valign="top"><a href="#index-section-fill-pattern">section fill pattern</a>:</td><td>&nbsp;</td><td valign="top"><a href="#Output-Section-Fill">Output Section Fill</a></td></tr>
  11328. <tr><td></td><td valign="top"><a href="#index-section-groups">section groups</a>:</td><td>&nbsp;</td><td valign="top"><a href="#Options">Options</a></td></tr>
  11329. <tr><td></td><td valign="top"><a href="#index-section-groups-1">section groups</a>:</td><td>&nbsp;</td><td valign="top"><a href="#Miscellaneous-Commands">Miscellaneous Commands</a></td></tr>
  11330. <tr><td></td><td valign="top"><a href="#index-section-load-address">section load address</a>:</td><td>&nbsp;</td><td valign="top"><a href="#Output-Section-LMA">Output Section LMA</a></td></tr>
  11331. <tr><td></td><td valign="top"><a href="#index-section-load-address-in-expression">section load address in expression</a>:</td><td>&nbsp;</td><td valign="top"><a href="#Builtin-Functions">Builtin Functions</a></td></tr>
  11332. <tr><td></td><td valign="top"><a href="#index-section-name">section name</a>:</td><td>&nbsp;</td><td valign="top"><a href="#Output-Section-Name">Output Section Name</a></td></tr>
  11333. <tr><td></td><td valign="top"><a href="#index-section-name-wildcard-patterns">section name wildcard patterns</a>:</td><td>&nbsp;</td><td valign="top"><a href="#Input-Section-Wildcards">Input Section Wildcards</a></td></tr>
  11334. <tr><td></td><td valign="top"><a href="#index-section-size">section size</a>:</td><td>&nbsp;</td><td valign="top"><a href="#Builtin-Functions">Builtin Functions</a></td></tr>
  11335. <tr><td></td><td valign="top"><a href="#index-section_002c-assigning-to-memory-region">section, assigning to memory region</a>:</td><td>&nbsp;</td><td valign="top"><a href="#Output-Section-Region">Output Section Region</a></td></tr>
  11336. <tr><td></td><td valign="top"><a href="#index-section_002c-assigning-to-program-header">section, assigning to program header</a>:</td><td>&nbsp;</td><td valign="top"><a href="#Output-Section-Phdr">Output Section Phdr</a></td></tr>
  11337. <tr><td></td><td valign="top"><a href="#index-SECTIONS"><code>SECTIONS</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#SECTIONS">SECTIONS</a></td></tr>
  11338. <tr><td></td><td valign="top"><a href="#index-sections_002c-discarding">sections, discarding</a>:</td><td>&nbsp;</td><td valign="top"><a href="#Output-Section-Discarding">Output Section Discarding</a></td></tr>
  11339. <tr><td></td><td valign="top"><a href="#index-sections_002c-orphan">sections, orphan</a>:</td><td>&nbsp;</td><td valign="top"><a href="#Options">Options</a></td></tr>
  11340. <tr><td></td><td valign="top"><a href="#index-Secure-gateway-import-library">Secure gateway import library</a>:</td><td>&nbsp;</td><td valign="top"><a href="#ARM">ARM</a></td></tr>
  11341. <tr><td></td><td valign="top"><a href="#index-segment-origins_002c-cmd-line">segment origins, cmd line</a>:</td><td>&nbsp;</td><td valign="top"><a href="#Options">Options</a></td></tr>
  11342. <tr><td></td><td valign="top"><a href="#index-segments_002c-ELF">segments, ELF</a>:</td><td>&nbsp;</td><td valign="top"><a href="#PHDRS">PHDRS</a></td></tr>
  11343. <tr><td></td><td valign="top"><a href="#index-SEGMENT_005fSTART_0028segment_002c-default_0029"><code>SEGMENT_START(<var>segment</var>, <var>default</var>)</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Builtin-Functions">Builtin Functions</a></td></tr>
  11344. <tr><td></td><td valign="top"><a href="#index-shared-libraries">shared libraries</a>:</td><td>&nbsp;</td><td valign="top"><a href="#Options">Options</a></td></tr>
  11345. <tr><td></td><td valign="top"><a href="#index-SHORT_0028expression_0029"><code>SHORT(<var>expression</var>)</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Output-Section-Data">Output Section Data</a></td></tr>
  11346. <tr><td></td><td valign="top"><a href="#index-SIZEOF_0028section_0029"><code>SIZEOF(<var>section</var>)</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Builtin-Functions">Builtin Functions</a></td></tr>
  11347. <tr><td></td><td valign="top"><a href="#index-SIZEOF_005fHEADERS"><code>SIZEOF_HEADERS</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Builtin-Functions">Builtin Functions</a></td></tr>
  11348. <tr><td></td><td valign="top"><a href="#index-small-common-symbols">small common symbols</a>:</td><td>&nbsp;</td><td valign="top"><a href="#Input-Section-Common">Input Section Common</a></td></tr>
  11349. <tr><td></td><td valign="top"><a href="#index-SORT">SORT</a>:</td><td>&nbsp;</td><td valign="top"><a href="#Input-Section-Wildcards">Input Section Wildcards</a></td></tr>
  11350. <tr><td></td><td valign="top"><a href="#index-SORT_005fBY_005fALIGNMENT">SORT_BY_ALIGNMENT</a>:</td><td>&nbsp;</td><td valign="top"><a href="#Input-Section-Wildcards">Input Section Wildcards</a></td></tr>
  11351. <tr><td></td><td valign="top"><a href="#index-SORT_005fBY_005fINIT_005fPRIORITY">SORT_BY_INIT_PRIORITY</a>:</td><td>&nbsp;</td><td valign="top"><a href="#Input-Section-Wildcards">Input Section Wildcards</a></td></tr>
  11352. <tr><td></td><td valign="top"><a href="#index-SORT_005fBY_005fNAME">SORT_BY_NAME</a>:</td><td>&nbsp;</td><td valign="top"><a href="#Input-Section-Wildcards">Input Section Wildcards</a></td></tr>
  11353. <tr><td></td><td valign="top"><a href="#index-SORT_005fNONE">SORT_NONE</a>:</td><td>&nbsp;</td><td valign="top"><a href="#Input-Section-Wildcards">Input Section Wildcards</a></td></tr>
  11354. <tr><td></td><td valign="top"><a href="#index-SPU">SPU</a>:</td><td>&nbsp;</td><td valign="top"><a href="#SPU-ELF">SPU ELF</a></td></tr>
  11355. <tr><td></td><td valign="top"><a href="#index-SPU-1">SPU</a>:</td><td>&nbsp;</td><td valign="top"><a href="#SPU-ELF">SPU ELF</a></td></tr>
  11356. <tr><td></td><td valign="top"><a href="#index-SPU-ELF-options">SPU ELF options</a>:</td><td>&nbsp;</td><td valign="top"><a href="#SPU-ELF">SPU ELF</a></td></tr>
  11357. <tr><td></td><td valign="top"><a href="#index-SPU-extra-overlay-stubs">SPU extra overlay stubs</a>:</td><td>&nbsp;</td><td valign="top"><a href="#SPU-ELF">SPU ELF</a></td></tr>
  11358. <tr><td></td><td valign="top"><a href="#index-SPU-local-store-size">SPU local store size</a>:</td><td>&nbsp;</td><td valign="top"><a href="#SPU-ELF">SPU ELF</a></td></tr>
  11359. <tr><td></td><td valign="top"><a href="#index-SPU-overlay-stub-symbols">SPU overlay stub symbols</a>:</td><td>&nbsp;</td><td valign="top"><a href="#SPU-ELF">SPU ELF</a></td></tr>
  11360. <tr><td></td><td valign="top"><a href="#index-SPU-overlays">SPU overlays</a>:</td><td>&nbsp;</td><td valign="top"><a href="#SPU-ELF">SPU ELF</a></td></tr>
  11361. <tr><td></td><td valign="top"><a href="#index-SPU-plugins">SPU plugins</a>:</td><td>&nbsp;</td><td valign="top"><a href="#SPU-ELF">SPU ELF</a></td></tr>
  11362. <tr><td></td><td valign="top"><a href="#index-SQUAD_0028expression_0029"><code>SQUAD(<var>expression</var>)</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Output-Section-Data">Output Section Data</a></td></tr>
  11363. <tr><td></td><td valign="top"><a href="#index-stack-size">stack size</a>:</td><td>&nbsp;</td><td valign="top"><a href="#Options">Options</a></td></tr>
  11364. <tr><td></td><td valign="top"><a href="#index-standard-Unix-system">standard Unix system</a>:</td><td>&nbsp;</td><td valign="top"><a href="#Options">Options</a></td></tr>
  11365. <tr><td></td><td valign="top"><a href="#index-start-of-execution">start of execution</a>:</td><td>&nbsp;</td><td valign="top"><a href="#Entry-Point">Entry Point</a></td></tr>
  11366. <tr><td></td><td valign="top"><a href="#index-start_002dstop_002dgc">start-stop-gc</a>:</td><td>&nbsp;</td><td valign="top"><a href="#Options">Options</a></td></tr>
  11367. <tr><td></td><td valign="top"><a href="#index-STARTUP_0028filename_0029"><code>STARTUP(<var>filename</var>)</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#File-Commands">File Commands</a></td></tr>
  11368. <tr><td></td><td valign="top"><a href="#index-static-library-dependencies">static library dependencies</a>:</td><td>&nbsp;</td><td valign="top"><a href="#libdep-Plugin">libdep Plugin</a></td></tr>
  11369. <tr><td></td><td valign="top"><a href="#index-STM32L4xx-erratum-workaround">STM32L4xx erratum workaround</a>:</td><td>&nbsp;</td><td valign="top"><a href="#ARM">ARM</a></td></tr>
  11370. <tr><td></td><td valign="top"><a href="#index-strip-all-symbols">strip all symbols</a>:</td><td>&nbsp;</td><td valign="top"><a href="#Options">Options</a></td></tr>
  11371. <tr><td></td><td valign="top"><a href="#index-strip-debugger-symbols">strip debugger symbols</a>:</td><td>&nbsp;</td><td valign="top"><a href="#Options">Options</a></td></tr>
  11372. <tr><td></td><td valign="top"><a href="#index-stripping-all-but-some-symbols">stripping all but some symbols</a>:</td><td>&nbsp;</td><td valign="top"><a href="#Options">Options</a></td></tr>
  11373. <tr><td></td><td valign="top"><a href="#index-STUB_005fGROUP_005fSIZE">STUB_GROUP_SIZE</a>:</td><td>&nbsp;</td><td valign="top"><a href="#ARM">ARM</a></td></tr>
  11374. <tr><td></td><td valign="top"><a href="#index-SUBALIGN_0028subsection_005falign_0029"><code>SUBALIGN(<var>subsection_align</var>)</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Forced-Input-Alignment">Forced Input Alignment</a></td></tr>
  11375. <tr><td></td><td valign="top"><a href="#index-suffixes-for-integers">suffixes for integers</a>:</td><td>&nbsp;</td><td valign="top"><a href="#Constants">Constants</a></td></tr>
  11376. <tr><td></td><td valign="top"><a href="#index-symbol-defaults">symbol defaults</a>:</td><td>&nbsp;</td><td valign="top"><a href="#Builtin-Functions">Builtin Functions</a></td></tr>
  11377. <tr><td></td><td valign="top"><a href="#index-symbol-definition_002c-scripts">symbol definition, scripts</a>:</td><td>&nbsp;</td><td valign="top"><a href="#Assignments">Assignments</a></td></tr>
  11378. <tr><td></td><td valign="top"><a href="#index-symbol-names">symbol names</a>:</td><td>&nbsp;</td><td valign="top"><a href="#Symbols">Symbols</a></td></tr>
  11379. <tr><td></td><td valign="top"><a href="#index-symbol-tracing">symbol tracing</a>:</td><td>&nbsp;</td><td valign="top"><a href="#Options">Options</a></td></tr>
  11380. <tr><td></td><td valign="top"><a href="#index-symbol-versions">symbol versions</a>:</td><td>&nbsp;</td><td valign="top"><a href="#VERSION">VERSION</a></td></tr>
  11381. <tr><td></td><td valign="top"><a href="#index-symbol_002donly-input">symbol-only input</a>:</td><td>&nbsp;</td><td valign="top"><a href="#Options">Options</a></td></tr>
  11382. <tr><td></td><td valign="top"><a href="#index-symbolic-constants">symbolic constants</a>:</td><td>&nbsp;</td><td valign="top"><a href="#Symbolic-Constants">Symbolic Constants</a></td></tr>
  11383. <tr><td></td><td valign="top"><a href="#index-symbols_002c-from-command-line">symbols, from command line</a>:</td><td>&nbsp;</td><td valign="top"><a href="#Options">Options</a></td></tr>
  11384. <tr><td></td><td valign="top"><a href="#index-symbols_002c-relocatable-and-absolute">symbols, relocatable and absolute</a>:</td><td>&nbsp;</td><td valign="top"><a href="#Expression-Section">Expression Section</a></td></tr>
  11385. <tr><td></td><td valign="top"><a href="#index-symbols_002c-require-defined">symbols, require defined</a>:</td><td>&nbsp;</td><td valign="top"><a href="#Options">Options</a></td></tr>
  11386. <tr><td></td><td valign="top"><a href="#index-symbols_002c-retaining-selectively">symbols, retaining selectively</a>:</td><td>&nbsp;</td><td valign="top"><a href="#Options">Options</a></td></tr>
  11387. <tr><td></td><td valign="top"><a href="#index-synthesizing-linker">synthesizing linker</a>:</td><td>&nbsp;</td><td valign="top"><a href="#Options">Options</a></td></tr>
  11388. <tr><td></td><td valign="top"><a href="#index-synthesizing-on-H8_002f300">synthesizing on H8/300</a>:</td><td>&nbsp;</td><td valign="top"><a href="#H8_002f300">H8/300</a></td></tr>
  11389. <tr><td colspan="4"> <hr></td></tr>
  11390. <tr><th id="LD-Index_cp_letter-T">T</th><td></td><td></td></tr>
  11391. <tr><td></td><td valign="top"><a href="#index-TARGET_0028bfdname_0029"><code>TARGET(<var>bfdname</var>)</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Format-Commands">Format Commands</a></td></tr>
  11392. <tr><td></td><td valign="top"><a href="#index-TARGET1">TARGET1</a>:</td><td>&nbsp;</td><td valign="top"><a href="#ARM">ARM</a></td></tr>
  11393. <tr><td></td><td valign="top"><a href="#index-TARGET2">TARGET2</a>:</td><td>&nbsp;</td><td valign="top"><a href="#ARM">ARM</a></td></tr>
  11394. <tr><td></td><td valign="top"><a href="#index-text-segment-origin_002c-cmd-line">text segment origin, cmd line</a>:</td><td>&nbsp;</td><td valign="top"><a href="#Options">Options</a></td></tr>
  11395. <tr><td></td><td valign="top"><a href="#index-thumb-entry-point">thumb entry point</a>:</td><td>&nbsp;</td><td valign="top"><a href="#ARM">ARM</a></td></tr>
  11396. <tr><td></td><td valign="top"><a href="#index-TI-COFF-versions">TI COFF versions</a>:</td><td>&nbsp;</td><td valign="top"><a href="#TI-COFF">TI COFF</a></td></tr>
  11397. <tr><td></td><td valign="top"><a href="#index-traditional-format">traditional format</a>:</td><td>&nbsp;</td><td valign="top"><a href="#Options">Options</a></td></tr>
  11398. <tr><td></td><td valign="top"><a href="#index-trampoline-generation-on-M68HC11">trampoline generation on M68HC11</a>:</td><td>&nbsp;</td><td valign="top"><a href="#M68HC11_002f68HC12">M68HC11/68HC12</a></td></tr>
  11399. <tr><td></td><td valign="top"><a href="#index-trampoline-generation-on-M68HC12">trampoline generation on M68HC12</a>:</td><td>&nbsp;</td><td valign="top"><a href="#M68HC11_002f68HC12">M68HC11/68HC12</a></td></tr>
  11400. <tr><td colspan="4"> <hr></td></tr>
  11401. <tr><th id="LD-Index_cp_letter-U">U</th><td></td><td></td></tr>
  11402. <tr><td></td><td valign="top"><a href="#index-unallocated-address_002c-next">unallocated address, next</a>:</td><td>&nbsp;</td><td valign="top"><a href="#Builtin-Functions">Builtin Functions</a></td></tr>
  11403. <tr><td></td><td valign="top"><a href="#index-undefined-symbol">undefined symbol</a>:</td><td>&nbsp;</td><td valign="top"><a href="#Options">Options</a></td></tr>
  11404. <tr><td></td><td valign="top"><a href="#index-undefined-symbol-in-linker-script">undefined symbol in linker script</a>:</td><td>&nbsp;</td><td valign="top"><a href="#Miscellaneous-Commands">Miscellaneous Commands</a></td></tr>
  11405. <tr><td></td><td valign="top"><a href="#index-undefined-symbols_002c-warnings-on">undefined symbols, warnings on</a>:</td><td>&nbsp;</td><td valign="top"><a href="#Options">Options</a></td></tr>
  11406. <tr><td></td><td valign="top"><a href="#index-uninitialized-data-placement">uninitialized data placement</a>:</td><td>&nbsp;</td><td valign="top"><a href="#Input-Section-Common">Input Section Common</a></td></tr>
  11407. <tr><td></td><td valign="top"><a href="#index-unspecified-memory">unspecified memory</a>:</td><td>&nbsp;</td><td valign="top"><a href="#Output-Section-Data">Output Section Data</a></td></tr>
  11408. <tr><td></td><td valign="top"><a href="#index-usage">usage</a>:</td><td>&nbsp;</td><td valign="top"><a href="#Options">Options</a></td></tr>
  11409. <tr><td></td><td valign="top"><a href="#index-USE_005fBLX">USE_BLX</a>:</td><td>&nbsp;</td><td valign="top"><a href="#ARM">ARM</a></td></tr>
  11410. <tr><td></td><td valign="top"><a href="#index-using-a-DEF-file">using a DEF file</a>:</td><td>&nbsp;</td><td valign="top"><a href="#WIN32">WIN32</a></td></tr>
  11411. <tr><td></td><td valign="top"><a href="#index-using-auto_002dexport-functionality">using auto-export functionality</a>:</td><td>&nbsp;</td><td valign="top"><a href="#WIN32">WIN32</a></td></tr>
  11412. <tr><td></td><td valign="top"><a href="#index-Using-decorations">Using decorations</a>:</td><td>&nbsp;</td><td valign="top"><a href="#WIN32">WIN32</a></td></tr>
  11413. <tr><td colspan="4"> <hr></td></tr>
  11414. <tr><th id="LD-Index_cp_letter-V">V</th><td></td><td></td></tr>
  11415. <tr><td></td><td valign="top"><a href="#index-variables_002c-defining">variables, defining</a>:</td><td>&nbsp;</td><td valign="top"><a href="#Assignments">Assignments</a></td></tr>
  11416. <tr><td></td><td valign="top"><a href="#index-verbose_005b_003dNUMBER_005d">verbose[=<var>NUMBER</var>]</a>:</td><td>&nbsp;</td><td valign="top"><a href="#Options">Options</a></td></tr>
  11417. <tr><td></td><td valign="top"><a href="#index-version">version</a>:</td><td>&nbsp;</td><td valign="top"><a href="#Options">Options</a></td></tr>
  11418. <tr><td></td><td valign="top"><a href="#index-version-script">version script</a>:</td><td>&nbsp;</td><td valign="top"><a href="#VERSION">VERSION</a></td></tr>
  11419. <tr><td></td><td valign="top"><a href="#index-version-script_002c-symbol-versions">version script, symbol versions</a>:</td><td>&nbsp;</td><td valign="top"><a href="#Options">Options</a></td></tr>
  11420. <tr><td></td><td valign="top"><a href="#index-VERSION-_007bscript-text_007d"><code>VERSION {script text}</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#VERSION">VERSION</a></td></tr>
  11421. <tr><td></td><td valign="top"><a href="#index-versions-of-symbols">versions of symbols</a>:</td><td>&nbsp;</td><td valign="top"><a href="#VERSION">VERSION</a></td></tr>
  11422. <tr><td></td><td valign="top"><a href="#index-VFP11_005fDENORM_005fFIX">VFP11_DENORM_FIX</a>:</td><td>&nbsp;</td><td valign="top"><a href="#ARM">ARM</a></td></tr>
  11423. <tr><td></td><td valign="top"><a href="#index-visibility">visibility</a>:</td><td>&nbsp;</td><td valign="top"><a href="#Options">Options</a></td></tr>
  11424. <tr><td colspan="4"> <hr></td></tr>
  11425. <tr><th id="LD-Index_cp_letter-W">W</th><td></td><td></td></tr>
  11426. <tr><td></td><td valign="top"><a href="#index-warnings_002c-on-combining-symbols">warnings, on combining symbols</a>:</td><td>&nbsp;</td><td valign="top"><a href="#Options">Options</a></td></tr>
  11427. <tr><td></td><td valign="top"><a href="#index-warnings_002c-on-executable-stack">warnings, on executable stack</a>:</td><td>&nbsp;</td><td valign="top"><a href="#Options">Options</a></td></tr>
  11428. <tr><td></td><td valign="top"><a href="#index-warnings_002c-on-section-alignment">warnings, on section alignment</a>:</td><td>&nbsp;</td><td valign="top"><a href="#Options">Options</a></td></tr>
  11429. <tr><td></td><td valign="top"><a href="#index-warnings_002c-on-undefined-symbols">warnings, on undefined symbols</a>:</td><td>&nbsp;</td><td valign="top"><a href="#Options">Options</a></td></tr>
  11430. <tr><td></td><td valign="top"><a href="#index-warnings_002c-on-writeable-and-exectuable-segments">warnings, on writeable and exectuable segments</a>:</td><td>&nbsp;</td><td valign="top"><a href="#Options">Options</a></td></tr>
  11431. <tr><td></td><td valign="top"><a href="#index-weak-externals">weak externals</a>:</td><td>&nbsp;</td><td valign="top"><a href="#WIN32">WIN32</a></td></tr>
  11432. <tr><td></td><td valign="top"><a href="#index-what-is-this_003f">what is this?</a>:</td><td>&nbsp;</td><td valign="top"><a href="#Overview">Overview</a></td></tr>
  11433. <tr><td></td><td valign="top"><a href="#index-wildcard-file-name-patterns">wildcard file name patterns</a>:</td><td>&nbsp;</td><td valign="top"><a href="#Input-Section-Wildcards">Input Section Wildcards</a></td></tr>
  11434. <tr><td colspan="4"> <hr></td></tr>
  11435. <tr><th id="LD-Index_cp_letter-X">X</th><td></td><td></td></tr>
  11436. <tr><td></td><td valign="top"><a href="#index-Xtensa-options">Xtensa options</a>:</td><td>&nbsp;</td><td valign="top"><a href="#Xtensa">Xtensa</a></td></tr>
  11437. <tr><td></td><td valign="top"><a href="#index-Xtensa-processors">Xtensa processors</a>:</td><td>&nbsp;</td><td valign="top"><a href="#Xtensa">Xtensa</a></td></tr>
  11438. <tr><td colspan="4"> <hr></td></tr>
  11439. </table>
  11440. <table><tr><th valign="top">Jump to: &nbsp; </th><td><a class="summary-letter" href="#LD-Index_cp_symbol-1"><b>&quot;</b></a>
  11441. &nbsp;
  11442. <a class="summary-letter" href="#LD-Index_cp_symbol-2"><b>-</b></a>
  11443. &nbsp;
  11444. <a class="summary-letter" href="#LD-Index_cp_symbol-3"><b>.</b></a>
  11445. &nbsp;
  11446. <a class="summary-letter" href="#LD-Index_cp_symbol-4"><b>/</b></a>
  11447. &nbsp;
  11448. <a class="summary-letter" href="#LD-Index_cp_symbol-5"><b>3</b></a>
  11449. &nbsp;
  11450. <a class="summary-letter" href="#LD-Index_cp_symbol-6"><b>:</b></a>
  11451. &nbsp;
  11452. <a class="summary-letter" href="#LD-Index_cp_symbol-7"><b>=</b></a>
  11453. &nbsp;
  11454. <a class="summary-letter" href="#LD-Index_cp_symbol-8"><b>&gt;</b></a>
  11455. &nbsp;
  11456. <a class="summary-letter" href="#LD-Index_cp_symbol-9"><b>[</b></a>
  11457. &nbsp;
  11458. <br>
  11459. <a class="summary-letter" href="#LD-Index_cp_letter-A"><b>A</b></a>
  11460. &nbsp;
  11461. <a class="summary-letter" href="#LD-Index_cp_letter-B"><b>B</b></a>
  11462. &nbsp;
  11463. <a class="summary-letter" href="#LD-Index_cp_letter-C"><b>C</b></a>
  11464. &nbsp;
  11465. <a class="summary-letter" href="#LD-Index_cp_letter-D"><b>D</b></a>
  11466. &nbsp;
  11467. <a class="summary-letter" href="#LD-Index_cp_letter-E"><b>E</b></a>
  11468. &nbsp;
  11469. <a class="summary-letter" href="#LD-Index_cp_letter-F"><b>F</b></a>
  11470. &nbsp;
  11471. <a class="summary-letter" href="#LD-Index_cp_letter-G"><b>G</b></a>
  11472. &nbsp;
  11473. <a class="summary-letter" href="#LD-Index_cp_letter-H"><b>H</b></a>
  11474. &nbsp;
  11475. <a class="summary-letter" href="#LD-Index_cp_letter-I"><b>I</b></a>
  11476. &nbsp;
  11477. <a class="summary-letter" href="#LD-Index_cp_letter-K"><b>K</b></a>
  11478. &nbsp;
  11479. <a class="summary-letter" href="#LD-Index_cp_letter-L"><b>L</b></a>
  11480. &nbsp;
  11481. <a class="summary-letter" href="#LD-Index_cp_letter-M"><b>M</b></a>
  11482. &nbsp;
  11483. <a class="summary-letter" href="#LD-Index_cp_letter-N"><b>N</b></a>
  11484. &nbsp;
  11485. <a class="summary-letter" href="#LD-Index_cp_letter-O"><b>O</b></a>
  11486. &nbsp;
  11487. <a class="summary-letter" href="#LD-Index_cp_letter-P"><b>P</b></a>
  11488. &nbsp;
  11489. <a class="summary-letter" href="#LD-Index_cp_letter-Q"><b>Q</b></a>
  11490. &nbsp;
  11491. <a class="summary-letter" href="#LD-Index_cp_letter-R"><b>R</b></a>
  11492. &nbsp;
  11493. <a class="summary-letter" href="#LD-Index_cp_letter-S"><b>S</b></a>
  11494. &nbsp;
  11495. <a class="summary-letter" href="#LD-Index_cp_letter-T"><b>T</b></a>
  11496. &nbsp;
  11497. <a class="summary-letter" href="#LD-Index_cp_letter-U"><b>U</b></a>
  11498. &nbsp;
  11499. <a class="summary-letter" href="#LD-Index_cp_letter-V"><b>V</b></a>
  11500. &nbsp;
  11501. <a class="summary-letter" href="#LD-Index_cp_letter-W"><b>W</b></a>
  11502. &nbsp;
  11503. <a class="summary-letter" href="#LD-Index_cp_letter-X"><b>X</b></a>
  11504. &nbsp;
  11505. </td></tr></table>
  11506. <hr>
  11507. </body>
  11508. </html>