ld.info 394 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784478547864787478847894790479147924793479447954796479747984799480048014802480348044805480648074808480948104811481248134814481548164817481848194820482148224823482448254826482748284829483048314832483348344835483648374838483948404841484248434844484548464847484848494850485148524853485448554856485748584859486048614862486348644865486648674868486948704871487248734874487548764877487848794880488148824883488448854886488748884889489048914892489348944895489648974898489949004901490249034904490549064907490849094910491149124913491449154916491749184919492049214922492349244925492649274928492949304931493249334934493549364937493849394940494149424943494449454946494749484949495049514952495349544955495649574958495949604961496249634964496549664967496849694970497149724973497449754976497749784979498049814982498349844985498649874988498949904991499249934994499549964997499849995000500150025003500450055006500750085009501050115012501350145015501650175018501950205021502250235024502550265027502850295030503150325033503450355036503750385039504050415042504350445045504650475048504950505051505250535054505550565057505850595060506150625063506450655066506750685069507050715072507350745075507650775078507950805081508250835084508550865087508850895090509150925093509450955096509750985099510051015102510351045105510651075108510951105111511251135114511551165117511851195120512151225123512451255126512751285129513051315132513351345135513651375138513951405141514251435144514551465147514851495150515151525153515451555156515751585159516051615162516351645165516651675168516951705171517251735174517551765177517851795180518151825183518451855186518751885189519051915192519351945195519651975198519952005201520252035204520552065207520852095210521152125213521452155216521752185219522052215222522352245225522652275228522952305231523252335234523552365237523852395240524152425243524452455246524752485249525052515252525352545255525652575258525952605261526252635264526552665267526852695270527152725273527452755276527752785279528052815282528352845285528652875288528952905291529252935294529552965297529852995300530153025303530453055306530753085309531053115312531353145315531653175318531953205321532253235324532553265327532853295330533153325333533453355336533753385339534053415342534353445345534653475348534953505351535253535354535553565357535853595360536153625363536453655366536753685369537053715372537353745375537653775378537953805381538253835384538553865387538853895390539153925393539453955396539753985399540054015402540354045405540654075408540954105411541254135414541554165417541854195420542154225423542454255426542754285429543054315432543354345435543654375438543954405441544254435444544554465447544854495450545154525453545454555456545754585459546054615462546354645465546654675468546954705471547254735474547554765477547854795480548154825483548454855486548754885489549054915492549354945495549654975498549955005501550255035504550555065507550855095510551155125513551455155516551755185519552055215522552355245525552655275528552955305531553255335534553555365537553855395540554155425543554455455546554755485549555055515552555355545555555655575558555955605561556255635564556555665567556855695570557155725573557455755576557755785579558055815582558355845585558655875588558955905591559255935594559555965597559855995600560156025603560456055606560756085609561056115612561356145615561656175618561956205621562256235624562556265627562856295630563156325633563456355636563756385639564056415642564356445645564656475648564956505651565256535654565556565657565856595660566156625663566456655666566756685669567056715672567356745675567656775678567956805681568256835684568556865687568856895690569156925693569456955696569756985699570057015702570357045705570657075708570957105711571257135714571557165717571857195720572157225723572457255726572757285729573057315732573357345735573657375738573957405741574257435744574557465747574857495750575157525753575457555756575757585759576057615762576357645765576657675768576957705771577257735774577557765777577857795780578157825783578457855786578757885789579057915792579357945795579657975798579958005801580258035804580558065807580858095810581158125813581458155816581758185819582058215822582358245825582658275828582958305831583258335834583558365837583858395840584158425843584458455846584758485849585058515852585358545855585658575858585958605861586258635864586558665867586858695870587158725873587458755876587758785879588058815882588358845885588658875888588958905891589258935894589558965897589858995900590159025903590459055906590759085909591059115912591359145915591659175918591959205921592259235924592559265927592859295930593159325933593459355936593759385939594059415942594359445945594659475948594959505951595259535954595559565957595859595960596159625963596459655966596759685969597059715972597359745975597659775978597959805981598259835984598559865987598859895990599159925993599459955996599759985999600060016002600360046005600660076008600960106011601260136014601560166017601860196020602160226023602460256026602760286029603060316032603360346035603660376038603960406041604260436044604560466047604860496050605160526053605460556056605760586059606060616062606360646065606660676068606960706071607260736074607560766077607860796080608160826083608460856086608760886089609060916092609360946095609660976098609961006101610261036104610561066107610861096110611161126113611461156116611761186119612061216122612361246125612661276128612961306131613261336134613561366137613861396140614161426143614461456146614761486149615061516152615361546155615661576158615961606161616261636164616561666167616861696170617161726173617461756176617761786179618061816182618361846185618661876188618961906191619261936194619561966197619861996200620162026203620462056206620762086209621062116212621362146215621662176218621962206221622262236224622562266227622862296230623162326233623462356236623762386239624062416242624362446245624662476248624962506251625262536254625562566257625862596260626162626263626462656266626762686269627062716272627362746275627662776278627962806281628262836284628562866287628862896290629162926293629462956296629762986299630063016302630363046305630663076308630963106311631263136314631563166317631863196320632163226323632463256326632763286329633063316332633363346335633663376338633963406341634263436344634563466347634863496350635163526353635463556356635763586359636063616362636363646365636663676368636963706371637263736374637563766377637863796380638163826383638463856386638763886389639063916392639363946395639663976398639964006401640264036404640564066407640864096410641164126413641464156416641764186419642064216422642364246425642664276428642964306431643264336434643564366437643864396440644164426443644464456446644764486449645064516452645364546455645664576458645964606461646264636464646564666467646864696470647164726473647464756476647764786479648064816482648364846485648664876488648964906491649264936494649564966497649864996500650165026503650465056506650765086509651065116512651365146515651665176518651965206521652265236524652565266527652865296530653165326533653465356536653765386539654065416542654365446545654665476548654965506551655265536554655565566557655865596560656165626563656465656566656765686569657065716572657365746575657665776578657965806581658265836584658565866587658865896590659165926593659465956596659765986599660066016602660366046605660666076608660966106611661266136614661566166617661866196620662166226623662466256626662766286629663066316632663366346635663666376638663966406641664266436644664566466647664866496650665166526653665466556656665766586659666066616662666366646665666666676668666966706671667266736674667566766677667866796680668166826683668466856686668766886689669066916692669366946695669666976698669967006701670267036704670567066707670867096710671167126713671467156716671767186719672067216722672367246725672667276728672967306731673267336734673567366737673867396740674167426743674467456746674767486749675067516752675367546755675667576758675967606761676267636764676567666767676867696770677167726773677467756776677767786779678067816782678367846785678667876788678967906791679267936794679567966797679867996800680168026803680468056806680768086809681068116812681368146815681668176818681968206821682268236824682568266827682868296830683168326833683468356836683768386839684068416842684368446845684668476848684968506851685268536854685568566857685868596860686168626863686468656866686768686869687068716872687368746875687668776878687968806881688268836884688568866887688868896890689168926893689468956896689768986899690069016902690369046905690669076908690969106911691269136914691569166917691869196920692169226923692469256926692769286929693069316932693369346935693669376938693969406941694269436944694569466947694869496950695169526953695469556956695769586959696069616962696369646965696669676968696969706971697269736974697569766977697869796980698169826983698469856986698769886989699069916992699369946995699669976998699970007001700270037004700570067007700870097010701170127013701470157016701770187019702070217022702370247025702670277028702970307031703270337034703570367037703870397040704170427043704470457046704770487049705070517052705370547055705670577058705970607061706270637064706570667067706870697070707170727073707470757076707770787079708070817082708370847085708670877088708970907091709270937094709570967097709870997100710171027103710471057106710771087109711071117112711371147115711671177118711971207121712271237124712571267127712871297130713171327133713471357136713771387139714071417142714371447145714671477148714971507151715271537154715571567157715871597160716171627163716471657166716771687169717071717172717371747175717671777178717971807181718271837184718571867187718871897190719171927193719471957196719771987199720072017202720372047205720672077208720972107211721272137214721572167217721872197220722172227223722472257226722772287229723072317232723372347235723672377238723972407241724272437244724572467247724872497250725172527253725472557256725772587259726072617262726372647265726672677268726972707271727272737274727572767277727872797280728172827283728472857286728772887289729072917292729372947295729672977298729973007301730273037304730573067307730873097310731173127313731473157316731773187319732073217322732373247325732673277328732973307331733273337334733573367337733873397340734173427343734473457346734773487349735073517352735373547355735673577358735973607361736273637364736573667367736873697370737173727373737473757376737773787379738073817382738373847385738673877388738973907391739273937394739573967397739873997400740174027403740474057406740774087409741074117412741374147415741674177418741974207421742274237424742574267427742874297430743174327433743474357436743774387439744074417442744374447445744674477448744974507451745274537454745574567457745874597460746174627463746474657466746774687469747074717472747374747475747674777478747974807481748274837484748574867487748874897490749174927493749474957496749774987499750075017502750375047505750675077508750975107511751275137514751575167517751875197520752175227523752475257526752775287529753075317532753375347535753675377538753975407541754275437544754575467547754875497550755175527553755475557556755775587559756075617562756375647565756675677568756975707571757275737574757575767577757875797580758175827583758475857586758775887589759075917592759375947595759675977598759976007601760276037604760576067607760876097610761176127613761476157616761776187619762076217622762376247625762676277628762976307631763276337634763576367637763876397640764176427643764476457646764776487649765076517652765376547655765676577658765976607661766276637664766576667667766876697670767176727673767476757676767776787679768076817682768376847685768676877688768976907691769276937694769576967697769876997700770177027703770477057706770777087709771077117712771377147715771677177718771977207721772277237724772577267727772877297730773177327733773477357736773777387739774077417742774377447745774677477748774977507751775277537754775577567757775877597760776177627763776477657766776777687769777077717772777377747775777677777778777977807781778277837784778577867787778877897790779177927793779477957796779777987799780078017802780378047805780678077808780978107811781278137814781578167817781878197820782178227823782478257826782778287829783078317832783378347835783678377838783978407841784278437844784578467847784878497850785178527853785478557856785778587859786078617862786378647865786678677868786978707871787278737874787578767877787878797880788178827883788478857886788778887889789078917892789378947895789678977898789979007901790279037904790579067907790879097910791179127913791479157916791779187919792079217922792379247925792679277928792979307931793279337934793579367937793879397940794179427943794479457946794779487949795079517952795379547955795679577958795979607961796279637964796579667967796879697970797179727973797479757976797779787979798079817982798379847985798679877988798979907991799279937994799579967997799879998000800180028003800480058006800780088009801080118012801380148015801680178018801980208021802280238024802580268027802880298030803180328033803480358036803780388039804080418042804380448045804680478048804980508051805280538054805580568057805880598060806180628063806480658066806780688069807080718072807380748075807680778078807980808081808280838084808580868087808880898090809180928093809480958096809780988099810081018102810381048105810681078108810981108111811281138114811581168117811881198120812181228123812481258126812781288129813081318132813381348135813681378138813981408141814281438144814581468147814881498150815181528153815481558156815781588159816081618162816381648165816681678168816981708171817281738174817581768177817881798180818181828183818481858186818781888189819081918192819381948195819681978198819982008201820282038204820582068207820882098210821182128213821482158216821782188219822082218222822382248225822682278228822982308231823282338234823582368237823882398240824182428243824482458246824782488249825082518252825382548255825682578258825982608261826282638264826582668267826882698270827182728273827482758276827782788279828082818282828382848285828682878288828982908291829282938294829582968297829882998300830183028303830483058306830783088309831083118312831383148315831683178318831983208321832283238324832583268327832883298330833183328333833483358336833783388339834083418342834383448345834683478348834983508351835283538354835583568357835883598360836183628363836483658366836783688369837083718372837383748375837683778378837983808381838283838384838583868387838883898390839183928393839483958396839783988399840084018402840384048405840684078408840984108411841284138414841584168417841884198420842184228423842484258426842784288429843084318432843384348435843684378438843984408441844284438444844584468447844884498450845184528453845484558456845784588459846084618462846384648465846684678468846984708471847284738474847584768477847884798480848184828483848484858486848784888489849084918492849384948495849684978498849985008501850285038504850585068507850885098510851185128513851485158516851785188519852085218522852385248525852685278528852985308531853285338534853585368537853885398540854185428543854485458546854785488549855085518552855385548555855685578558855985608561856285638564856585668567856885698570857185728573857485758576857785788579858085818582858385848585858685878588858985908591
  1. This is ld.info, produced by makeinfo version 5.2 from ld.texinfo.
  2. This file documents the GNU linker LD (GNU Binutils) version 2.28.
  3. Copyright (C) 1991-2017 Free Software Foundation, Inc.
  4. Permission is granted to copy, distribute and/or modify this document
  5. under the terms of the GNU Free Documentation License, Version 1.3 or
  6. any later version published by the Free Software Foundation; with no
  7. Invariant Sections, with no Front-Cover Texts, and with no Back-Cover
  8. Texts. A copy of the license is included in the section entitled "GNU
  9. Free Documentation License".
  10. INFO-DIR-SECTION Software development
  11. START-INFO-DIR-ENTRY
  12. * Ld: (ld). The GNU linker.
  13. END-INFO-DIR-ENTRY
  14. 
  15. File: ld.info, Node: Top, Next: Overview, Up: (dir)
  16. LD
  17. **
  18. This file documents the GNU linker ld (GNU Binutils) version 2.28.
  19. This document is distributed under the terms of the GNU Free
  20. Documentation License version 1.3. A copy of the license is included in
  21. the section entitled "GNU Free Documentation License".
  22. * Menu:
  23. * Overview:: Overview
  24. * Invocation:: Invocation
  25. * Scripts:: Linker Scripts
  26. * Machine Dependent:: Machine Dependent Features
  27. * BFD:: BFD
  28. * Reporting Bugs:: Reporting Bugs
  29. * MRI:: MRI Compatible Script Files
  30. * GNU Free Documentation License:: GNU Free Documentation License
  31. * LD Index:: LD Index
  32. 
  33. File: ld.info, Node: Overview, Next: Invocation, Prev: Top, Up: Top
  34. 1 Overview
  35. **********
  36. 'ld' combines a number of object and archive files, relocates their data
  37. and ties up symbol references. Usually the last step in compiling a
  38. program is to run 'ld'.
  39. 'ld' accepts Linker Command Language files written in a superset of
  40. AT&T's Link Editor Command Language syntax, to provide explicit and
  41. total control over the linking process.
  42. This version of 'ld' uses the general purpose BFD libraries to
  43. operate on object files. This allows 'ld' to read, combine, and write
  44. object files in many different formats--for example, COFF or 'a.out'.
  45. Different formats may be linked together to produce any available kind
  46. of object file. *Note BFD::, for more information.
  47. Aside from its flexibility, the GNU linker is more helpful than other
  48. linkers in providing diagnostic information. Many linkers abandon
  49. execution immediately upon encountering an error; whenever possible,
  50. 'ld' continues executing, allowing you to identify other errors (or, in
  51. some cases, to get an output file in spite of the error).
  52. 
  53. File: ld.info, Node: Invocation, Next: Scripts, Prev: Overview, Up: Top
  54. 2 Invocation
  55. ************
  56. The GNU linker 'ld' is meant to cover a broad range of situations, and
  57. to be as compatible as possible with other linkers. As a result, you
  58. have many choices to control its behavior.
  59. * Menu:
  60. * Options:: Command Line Options
  61. * Environment:: Environment Variables
  62. 
  63. File: ld.info, Node: Options, Next: Environment, Up: Invocation
  64. 2.1 Command Line Options
  65. ========================
  66. The linker supports a plethora of command-line options, but in actual
  67. practice few of them are used in any particular context. For instance,
  68. a frequent use of 'ld' is to link standard Unix object files on a
  69. standard, supported Unix system. On such a system, to link a file
  70. 'hello.o':
  71. ld -o OUTPUT /lib/crt0.o hello.o -lc
  72. This tells 'ld' to produce a file called OUTPUT as the result of
  73. linking the file '/lib/crt0.o' with 'hello.o' and the library 'libc.a',
  74. which will come from the standard search directories. (See the
  75. discussion of the '-l' option below.)
  76. Some of the command-line options to 'ld' may be specified at any
  77. point in the command line. However, options which refer to files, such
  78. as '-l' or '-T', cause the file to be read at the point at which the
  79. option appears in the command line, relative to the object files and
  80. other file options. Repeating non-file options with a different
  81. argument will either have no further effect, or override prior
  82. occurrences (those further to the left on the command line) of that
  83. option. Options which may be meaningfully specified more than once are
  84. noted in the descriptions below.
  85. Non-option arguments are object files or archives which are to be
  86. linked together. They may follow, precede, or be mixed in with
  87. command-line options, except that an object file argument may not be
  88. placed between an option and its argument.
  89. Usually the linker is invoked with at least one object file, but you
  90. can specify other forms of binary input files using '-l', '-R', and the
  91. script command language. If _no_ binary input files at all are
  92. specified, the linker does not produce any output, and issues the
  93. message 'No input files'.
  94. If the linker cannot recognize the format of an object file, it will
  95. assume that it is a linker script. A script specified in this way
  96. augments the main linker script used for the link (either the default
  97. linker script or the one specified by using '-T'). This feature permits
  98. the linker to link against a file which appears to be an object or an
  99. archive, but actually merely defines some symbol values, or uses 'INPUT'
  100. or 'GROUP' to load other objects. Specifying a script in this way
  101. merely augments the main linker script, with the extra commands placed
  102. after the main script; use the '-T' option to replace the default linker
  103. script entirely, but note the effect of the 'INSERT' command. *Note
  104. Scripts::.
  105. For options whose names are a single letter, option arguments must
  106. either follow the option letter without intervening whitespace, or be
  107. given as separate arguments immediately following the option that
  108. requires them.
  109. For options whose names are multiple letters, either one dash or two
  110. can precede the option name; for example, '-trace-symbol' and
  111. '--trace-symbol' are equivalent. Note--there is one exception to this
  112. rule. Multiple letter options that start with a lower case 'o' can only
  113. be preceded by two dashes. This is to reduce confusion with the '-o'
  114. option. So for example '-omagic' sets the output file name to 'magic'
  115. whereas '--omagic' sets the NMAGIC flag on the output.
  116. Arguments to multiple-letter options must either be separated from
  117. the option name by an equals sign, or be given as separate arguments
  118. immediately following the option that requires them. For example,
  119. '--trace-symbol foo' and '--trace-symbol=foo' are equivalent. Unique
  120. abbreviations of the names of multiple-letter options are accepted.
  121. Note--if the linker is being invoked indirectly, via a compiler
  122. driver (e.g. 'gcc') then all the linker command line options should be
  123. prefixed by '-Wl,' (or whatever is appropriate for the particular
  124. compiler driver) like this:
  125. gcc -Wl,--start-group foo.o bar.o -Wl,--end-group
  126. This is important, because otherwise the compiler driver program may
  127. silently drop the linker options, resulting in a bad link. Confusion
  128. may also arise when passing options that require values through a
  129. driver, as the use of a space between option and argument acts as a
  130. separator, and causes the driver to pass only the option to the linker
  131. and the argument to the compiler. In this case, it is simplest to use
  132. the joined forms of both single- and multiple-letter options, such as:
  133. gcc foo.o bar.o -Wl,-eENTRY -Wl,-Map=a.map
  134. Here is a table of the generic command line switches accepted by the
  135. GNU linker:
  136. '@FILE'
  137. Read command-line options from FILE. The options read are inserted
  138. in place of the original @FILE option. If FILE does not exist, or
  139. cannot be read, then the option will be treated literally, and not
  140. removed.
  141. Options in FILE are separated by whitespace. A whitespace
  142. character may be included in an option by surrounding the entire
  143. option in either single or double quotes. Any character (including
  144. a backslash) may be included by prefixing the character to be
  145. included with a backslash. The FILE may itself contain additional
  146. @FILE options; any such options will be processed recursively.
  147. '-a KEYWORD'
  148. This option is supported for HP/UX compatibility. The KEYWORD
  149. argument must be one of the strings 'archive', 'shared', or
  150. 'default'. '-aarchive' is functionally equivalent to '-Bstatic',
  151. and the other two keywords are functionally equivalent to
  152. '-Bdynamic'. This option may be used any number of times.
  153. '--audit AUDITLIB'
  154. Adds AUDITLIB to the 'DT_AUDIT' entry of the dynamic section.
  155. AUDITLIB is not checked for existence, nor will it use the
  156. DT_SONAME specified in the library. If specified multiple times
  157. 'DT_AUDIT' will contain a colon separated list of audit interfaces
  158. to use. If the linker finds an object with an audit entry while
  159. searching for shared libraries, it will add a corresponding
  160. 'DT_DEPAUDIT' entry in the output file. This option is only
  161. meaningful on ELF platforms supporting the rtld-audit interface.
  162. '-A ARCHITECTURE'
  163. '--architecture=ARCHITECTURE'
  164. In the current release of 'ld', this option is useful only for the
  165. Intel 960 family of architectures. In that 'ld' configuration, the
  166. ARCHITECTURE argument identifies the particular architecture in the
  167. 960 family, enabling some safeguards and modifying the
  168. archive-library search path. *Note 'ld' and the Intel 960 family:
  169. i960, for details.
  170. Future releases of 'ld' may support similar functionality for other
  171. architecture families.
  172. '-b INPUT-FORMAT'
  173. '--format=INPUT-FORMAT'
  174. 'ld' may be configured to support more than one kind of object
  175. file. If your 'ld' is configured this way, you can use the '-b'
  176. option to specify the binary format for input object files that
  177. follow this option on the command line. Even when 'ld' is
  178. configured to support alternative object formats, you don't usually
  179. need to specify this, as 'ld' should be configured to expect as a
  180. default input format the most usual format on each machine.
  181. INPUT-FORMAT is a text string, the name of a particular format
  182. supported by the BFD libraries. (You can list the available binary
  183. formats with 'objdump -i'.) *Note BFD::.
  184. You may want to use this option if you are linking files with an
  185. unusual binary format. You can also use '-b' to switch formats
  186. explicitly (when linking object files of different formats), by
  187. including '-b INPUT-FORMAT' before each group of object files in a
  188. particular format.
  189. The default format is taken from the environment variable
  190. 'GNUTARGET'. *Note Environment::. You can also define the input
  191. format from a script, using the command 'TARGET'; see *note Format
  192. Commands::.
  193. '-c MRI-COMMANDFILE'
  194. '--mri-script=MRI-COMMANDFILE'
  195. For compatibility with linkers produced by MRI, 'ld' accepts script
  196. files written in an alternate, restricted command language,
  197. described in *note MRI Compatible Script Files: MRI. Introduce MRI
  198. script files with the option '-c'; use the '-T' option to run
  199. linker scripts written in the general-purpose 'ld' scripting
  200. language. If MRI-CMDFILE does not exist, 'ld' looks for it in the
  201. directories specified by any '-L' options.
  202. '-d'
  203. '-dc'
  204. '-dp'
  205. These three options are equivalent; multiple forms are supported
  206. for compatibility with other linkers. They assign space to common
  207. symbols even if a relocatable output file is specified (with '-r').
  208. The script command 'FORCE_COMMON_ALLOCATION' has the same effect.
  209. *Note Miscellaneous Commands::.
  210. '--depaudit AUDITLIB'
  211. '-P AUDITLIB'
  212. Adds AUDITLIB to the 'DT_DEPAUDIT' entry of the dynamic section.
  213. AUDITLIB is not checked for existence, nor will it use the
  214. DT_SONAME specified in the library. If specified multiple times
  215. 'DT_DEPAUDIT' will contain a colon separated list of audit
  216. interfaces to use. This option is only meaningful on ELF platforms
  217. supporting the rtld-audit interface. The -P option is provided for
  218. Solaris compatibility.
  219. '-e ENTRY'
  220. '--entry=ENTRY'
  221. Use ENTRY as the explicit symbol for beginning execution of your
  222. program, rather than the default entry point. If there is no
  223. symbol named ENTRY, the linker will try to parse ENTRY as a number,
  224. and use that as the entry address (the number will be interpreted
  225. in base 10; you may use a leading '0x' for base 16, or a leading
  226. '0' for base 8). *Note Entry Point::, for a discussion of defaults
  227. and other ways of specifying the entry point.
  228. '--exclude-libs LIB,LIB,...'
  229. Specifies a list of archive libraries from which symbols should not
  230. be automatically exported. The library names may be delimited by
  231. commas or colons. Specifying '--exclude-libs ALL' excludes symbols
  232. in all archive libraries from automatic export. This option is
  233. available only for the i386 PE targeted port of the linker and for
  234. ELF targeted ports. For i386 PE, symbols explicitly listed in a
  235. .def file are still exported, regardless of this option. For ELF
  236. targeted ports, symbols affected by this option will be treated as
  237. hidden.
  238. '--exclude-modules-for-implib MODULE,MODULE,...'
  239. Specifies a list of object files or archive members, from which
  240. symbols should not be automatically exported, but which should be
  241. copied wholesale into the import library being generated during the
  242. link. The module names may be delimited by commas or colons, and
  243. must match exactly the filenames used by 'ld' to open the files;
  244. for archive members, this is simply the member name, but for object
  245. files the name listed must include and match precisely any path
  246. used to specify the input file on the linker's command-line. This
  247. option is available only for the i386 PE targeted port of the
  248. linker. Symbols explicitly listed in a .def file are still
  249. exported, regardless of this option.
  250. '-E'
  251. '--export-dynamic'
  252. '--no-export-dynamic'
  253. When creating a dynamically linked executable, using the '-E'
  254. option or the '--export-dynamic' option causes the linker to add
  255. all symbols to the dynamic symbol table. The dynamic symbol table
  256. is the set of symbols which are visible from dynamic objects at run
  257. time.
  258. If you do not use either of these options (or use the
  259. '--no-export-dynamic' option to restore the default behavior), the
  260. dynamic symbol table will normally contain only those symbols which
  261. are referenced by some dynamic object mentioned in the link.
  262. If you use 'dlopen' to load a dynamic object which needs to refer
  263. back to the symbols defined by the program, rather than some other
  264. dynamic object, then you will probably need to use this option when
  265. linking the program itself.
  266. You can also use the dynamic list to control what symbols should be
  267. added to the dynamic symbol table if the output format supports it.
  268. See the description of '--dynamic-list'.
  269. Note that this option is specific to ELF targeted ports. PE
  270. targets support a similar function to export all symbols from a DLL
  271. or EXE; see the description of '--export-all-symbols' below.
  272. '-EB'
  273. Link big-endian objects. This affects the default output format.
  274. '-EL'
  275. Link little-endian objects. This affects the default output
  276. format.
  277. '-f NAME'
  278. '--auxiliary=NAME'
  279. When creating an ELF shared object, set the internal DT_AUXILIARY
  280. field to the specified name. This tells the dynamic linker that
  281. the symbol table of the shared object should be used as an
  282. auxiliary filter on the symbol table of the shared object NAME.
  283. If you later link a program against this filter object, then, when
  284. you run the program, the dynamic linker will see the DT_AUXILIARY
  285. field. If the dynamic linker resolves any symbols from the filter
  286. object, it will first check whether there is a definition in the
  287. shared object NAME. If there is one, it will be used instead of
  288. the definition in the filter object. The shared object NAME need
  289. not exist. Thus the shared object NAME may be used to provide an
  290. alternative implementation of certain functions, perhaps for
  291. debugging or for machine specific performance.
  292. This option may be specified more than once. The DT_AUXILIARY
  293. entries will be created in the order in which they appear on the
  294. command line.
  295. '-F NAME'
  296. '--filter=NAME'
  297. When creating an ELF shared object, set the internal DT_FILTER
  298. field to the specified name. This tells the dynamic linker that
  299. the symbol table of the shared object which is being created should
  300. be used as a filter on the symbol table of the shared object NAME.
  301. If you later link a program against this filter object, then, when
  302. you run the program, the dynamic linker will see the DT_FILTER
  303. field. The dynamic linker will resolve symbols according to the
  304. symbol table of the filter object as usual, but it will actually
  305. link to the definitions found in the shared object NAME. Thus the
  306. filter object can be used to select a subset of the symbols
  307. provided by the object NAME.
  308. Some older linkers used the '-F' option throughout a compilation
  309. toolchain for specifying object-file format for both input and
  310. output object files. The GNU linker uses other mechanisms for this
  311. purpose: the '-b', '--format', '--oformat' options, the 'TARGET'
  312. command in linker scripts, and the 'GNUTARGET' environment
  313. variable. The GNU linker will ignore the '-F' option when not
  314. creating an ELF shared object.
  315. '-fini=NAME'
  316. When creating an ELF executable or shared object, call NAME when
  317. the executable or shared object is unloaded, by setting DT_FINI to
  318. the address of the function. By default, the linker uses '_fini'
  319. as the function to call.
  320. '-g'
  321. Ignored. Provided for compatibility with other tools.
  322. '-G VALUE'
  323. '--gpsize=VALUE'
  324. Set the maximum size of objects to be optimized using the GP
  325. register to SIZE. This is only meaningful for object file formats
  326. such as MIPS ELF that support putting large and small objects into
  327. different sections. This is ignored for other object file formats.
  328. '-h NAME'
  329. '-soname=NAME'
  330. When creating an ELF shared object, set the internal DT_SONAME
  331. field to the specified name. When an executable is linked with a
  332. shared object which has a DT_SONAME field, then when the executable
  333. is run the dynamic linker will attempt to load the shared object
  334. specified by the DT_SONAME field rather than the using the file
  335. name given to the linker.
  336. '-i'
  337. Perform an incremental link (same as option '-r').
  338. '-init=NAME'
  339. When creating an ELF executable or shared object, call NAME when
  340. the executable or shared object is loaded, by setting DT_INIT to
  341. the address of the function. By default, the linker uses '_init'
  342. as the function to call.
  343. '-l NAMESPEC'
  344. '--library=NAMESPEC'
  345. Add the archive or object file specified by NAMESPEC to the list of
  346. files to link. This option may be used any number of times. If
  347. NAMESPEC is of the form ':FILENAME', 'ld' will search the library
  348. path for a file called FILENAME, otherwise it will search the
  349. library path for a file called 'libNAMESPEC.a'.
  350. On systems which support shared libraries, 'ld' may also search for
  351. files other than 'libNAMESPEC.a'. Specifically, on ELF and SunOS
  352. systems, 'ld' will search a directory for a library called
  353. 'libNAMESPEC.so' before searching for one called 'libNAMESPEC.a'.
  354. (By convention, a '.so' extension indicates a shared library.)
  355. Note that this behavior does not apply to ':FILENAME', which always
  356. specifies a file called FILENAME.
  357. The linker will search an archive only once, at the location where
  358. it is specified on the command line. If the archive defines a
  359. symbol which was undefined in some object which appeared before the
  360. archive on the command line, the linker will include the
  361. appropriate file(s) from the archive. However, an undefined symbol
  362. in an object appearing later on the command line will not cause the
  363. linker to search the archive again.
  364. See the '-(' option for a way to force the linker to search
  365. archives multiple times.
  366. You may list the same archive multiple times on the command line.
  367. This type of archive searching is standard for Unix linkers.
  368. However, if you are using 'ld' on AIX, note that it is different
  369. from the behaviour of the AIX linker.
  370. '-L SEARCHDIR'
  371. '--library-path=SEARCHDIR'
  372. Add path SEARCHDIR to the list of paths that 'ld' will search for
  373. archive libraries and 'ld' control scripts. You may use this
  374. option any number of times. The directories are searched in the
  375. order in which they are specified on the command line. Directories
  376. specified on the command line are searched before the default
  377. directories. All '-L' options apply to all '-l' options,
  378. regardless of the order in which the options appear. '-L' options
  379. do not affect how 'ld' searches for a linker script unless '-T'
  380. option is specified.
  381. If SEARCHDIR begins with '=', then the '=' will be replaced by the
  382. "sysroot prefix", controlled by the '--sysroot' option, or
  383. specified when the linker is configured.
  384. The default set of paths searched (without being specified with
  385. '-L') depends on which emulation mode 'ld' is using, and in some
  386. cases also on how it was configured. *Note Environment::.
  387. The paths can also be specified in a link script with the
  388. 'SEARCH_DIR' command. Directories specified this way are searched
  389. at the point in which the linker script appears in the command
  390. line.
  391. '-m EMULATION'
  392. Emulate the EMULATION linker. You can list the available
  393. emulations with the '--verbose' or '-V' options.
  394. If the '-m' option is not used, the emulation is taken from the
  395. 'LDEMULATION' environment variable, if that is defined.
  396. Otherwise, the default emulation depends upon how the linker was
  397. configured.
  398. '-M'
  399. '--print-map'
  400. Print a link map to the standard output. A link map provides
  401. information about the link, including the following:
  402. * Where object files are mapped into memory.
  403. * How common symbols are allocated.
  404. * All archive members included in the link, with a mention of
  405. the symbol which caused the archive member to be brought in.
  406. * The values assigned to symbols.
  407. Note - symbols whose values are computed by an expression
  408. which involves a reference to a previous value of the same
  409. symbol may not have correct result displayed in the link map.
  410. This is because the linker discards intermediate results and
  411. only retains the final value of an expression. Under such
  412. circumstances the linker will display the final value enclosed
  413. by square brackets. Thus for example a linker script
  414. containing:
  415. foo = 1
  416. foo = foo * 4
  417. foo = foo + 8
  418. will produce the following output in the link map if the '-M'
  419. option is used:
  420. 0x00000001 foo = 0x1
  421. [0x0000000c] foo = (foo * 0x4)
  422. [0x0000000c] foo = (foo + 0x8)
  423. See *note Expressions:: for more information about expressions
  424. in linker scripts.
  425. '-n'
  426. '--nmagic'
  427. Turn off page alignment of sections, and disable linking against
  428. shared libraries. If the output format supports Unix style magic
  429. numbers, mark the output as 'NMAGIC'.
  430. '-N'
  431. '--omagic'
  432. Set the text and data sections to be readable and writable. Also,
  433. do not page-align the data segment, and disable linking against
  434. shared libraries. If the output format supports Unix style magic
  435. numbers, mark the output as 'OMAGIC'. Note: Although a writable
  436. text section is allowed for PE-COFF targets, it does not conform to
  437. the format specification published by Microsoft.
  438. '--no-omagic'
  439. This option negates most of the effects of the '-N' option. It
  440. sets the text section to be read-only, and forces the data segment
  441. to be page-aligned. Note - this option does not enable linking
  442. against shared libraries. Use '-Bdynamic' for this.
  443. '-o OUTPUT'
  444. '--output=OUTPUT'
  445. Use OUTPUT as the name for the program produced by 'ld'; if this
  446. option is not specified, the name 'a.out' is used by default. The
  447. script command 'OUTPUT' can also specify the output file name.
  448. '-O LEVEL'
  449. If LEVEL is a numeric values greater than zero 'ld' optimizes the
  450. output. This might take significantly longer and therefore
  451. probably should only be enabled for the final binary. At the
  452. moment this option only affects ELF shared library generation.
  453. Future releases of the linker may make more use of this option.
  454. Also currently there is no difference in the linker's behaviour for
  455. different non-zero values of this option. Again this may change
  456. with future releases.
  457. '--push-state'
  458. The '--push-state' allows to preserve the current state of the
  459. flags which govern the input file handling so that they can all be
  460. restored with one corresponding '--pop-state' option.
  461. The option which are covered are: '-Bdynamic', '-Bstatic', '-dn',
  462. '-dy', '-call_shared', '-non_shared', '-static', '-N', '-n',
  463. '--whole-archive', '--no-whole-archive', '-r', '-Ur',
  464. '--copy-dt-needed-entries', '--no-copy-dt-needed-entries',
  465. '--as-needed', '--no-as-needed', and '-a'.
  466. One target for this option are specifications for 'pkg-config'.
  467. When used with the '--libs' option all possibly needed libraries
  468. are listed and then possibly linked with all the time. It is
  469. better to return something as follows:
  470. -Wl,--push-state,--as-needed -libone -libtwo -Wl,--pop-state
  471. Undoes the effect of -push-state, restores the previous values of
  472. the flags governing input file handling.
  473. '-q'
  474. '--emit-relocs'
  475. Leave relocation sections and contents in fully linked executables.
  476. Post link analysis and optimization tools may need this information
  477. in order to perform correct modifications of executables. This
  478. results in larger executables.
  479. This option is currently only supported on ELF platforms.
  480. '--force-dynamic'
  481. Force the output file to have dynamic sections. This option is
  482. specific to VxWorks targets.
  483. '-r'
  484. '--relocatable'
  485. Generate relocatable output--i.e., generate an output file that can
  486. in turn serve as input to 'ld'. This is often called "partial
  487. linking". As a side effect, in environments that support standard
  488. Unix magic numbers, this option also sets the output file's magic
  489. number to 'OMAGIC'. If this option is not specified, an absolute
  490. file is produced. When linking C++ programs, this option _will
  491. not_ resolve references to constructors; to do that, use '-Ur'.
  492. When an input file does not have the same format as the output
  493. file, partial linking is only supported if that input file does not
  494. contain any relocations. Different output formats can have further
  495. restrictions; for example some 'a.out'-based formats do not support
  496. partial linking with input files in other formats at all.
  497. This option does the same thing as '-i'.
  498. '-R FILENAME'
  499. '--just-symbols=FILENAME'
  500. Read symbol names and their addresses from FILENAME, but do not
  501. relocate it or include it in the output. This allows your output
  502. file to refer symbolically to absolute locations of memory defined
  503. in other programs. You may use this option more than once.
  504. For compatibility with other ELF linkers, if the '-R' option is
  505. followed by a directory name, rather than a file name, it is
  506. treated as the '-rpath' option.
  507. '-s'
  508. '--strip-all'
  509. Omit all symbol information from the output file.
  510. '-S'
  511. '--strip-debug'
  512. Omit debugger symbol information (but not all symbols) from the
  513. output file.
  514. '-t'
  515. '--trace'
  516. Print the names of the input files as 'ld' processes them.
  517. '-T SCRIPTFILE'
  518. '--script=SCRIPTFILE'
  519. Use SCRIPTFILE as the linker script. This script replaces 'ld''s
  520. default linker script (rather than adding to it), so COMMANDFILE
  521. must specify everything necessary to describe the output file.
  522. *Note Scripts::. If SCRIPTFILE does not exist in the current
  523. directory, 'ld' looks for it in the directories specified by any
  524. preceding '-L' options. Multiple '-T' options accumulate.
  525. '-dT SCRIPTFILE'
  526. '--default-script=SCRIPTFILE'
  527. Use SCRIPTFILE as the default linker script. *Note Scripts::.
  528. This option is similar to the '--script' option except that
  529. processing of the script is delayed until after the rest of the
  530. command line has been processed. This allows options placed after
  531. the '--default-script' option on the command line to affect the
  532. behaviour of the linker script, which can be important when the
  533. linker command line cannot be directly controlled by the user. (eg
  534. because the command line is being constructed by another tool, such
  535. as 'gcc').
  536. '-u SYMBOL'
  537. '--undefined=SYMBOL'
  538. Force SYMBOL to be entered in the output file as an undefined
  539. symbol. Doing this may, for example, trigger linking of additional
  540. modules from standard libraries. '-u' may be repeated with
  541. different option arguments to enter additional undefined symbols.
  542. This option is equivalent to the 'EXTERN' linker script command.
  543. If this option is being used to force additional modules to be
  544. pulled into the link, and if it is an error for the symbol to
  545. remain undefined, then the option '--require-defined' should be
  546. used instead.
  547. '--require-defined=SYMBOL'
  548. Require that SYMBOL is defined in the output file. This option is
  549. the same as option '--undefined' except that if SYMBOL is not
  550. defined in the output file then the linker will issue an error and
  551. exit. The same effect can be achieved in a linker script by using
  552. 'EXTERN', 'ASSERT' and 'DEFINED' together. This option can be used
  553. multiple times to require additional symbols.
  554. '-Ur'
  555. For anything other than C++ programs, this option is equivalent to
  556. '-r': it generates relocatable output--i.e., an output file that
  557. can in turn serve as input to 'ld'. When linking C++ programs,
  558. '-Ur' _does_ resolve references to constructors, unlike '-r'. It
  559. does not work to use '-Ur' on files that were themselves linked
  560. with '-Ur'; once the constructor table has been built, it cannot be
  561. added to. Use '-Ur' only for the last partial link, and '-r' for
  562. the others.
  563. '--orphan-handling=MODE'
  564. Control how orphan sections are handled. An orphan section is one
  565. not specifically mentioned in a linker script. *Note Orphan
  566. Sections::.
  567. MODE can have any of the following values:
  568. 'place'
  569. Orphan sections are placed into a suitable output section
  570. following the strategy described in *note Orphan Sections::.
  571. The option '--unique' also effects how sections are placed.
  572. 'discard'
  573. All orphan sections are discarded, by placing them in the
  574. '/DISCARD/' section (*note Output Section Discarding::).
  575. 'warn'
  576. The linker will place the orphan section as for 'place' and
  577. also issue a warning.
  578. 'error'
  579. The linker will exit with an error if any orphan section is
  580. found.
  581. The default if '--orphan-handling' is not given is 'place'.
  582. '--unique[=SECTION]'
  583. Creates a separate output section for every input section matching
  584. SECTION, or if the optional wildcard SECTION argument is missing,
  585. for every orphan input section. An orphan section is one not
  586. specifically mentioned in a linker script. You may use this option
  587. multiple times on the command line; It prevents the normal merging
  588. of input sections with the same name, overriding output section
  589. assignments in a linker script.
  590. '-v'
  591. '--version'
  592. '-V'
  593. Display the version number for 'ld'. The '-V' option also lists
  594. the supported emulations.
  595. '-x'
  596. '--discard-all'
  597. Delete all local symbols.
  598. '-X'
  599. '--discard-locals'
  600. Delete all temporary local symbols. (These symbols start with
  601. system-specific local label prefixes, typically '.L' for ELF
  602. systems or 'L' for traditional a.out systems.)
  603. '-y SYMBOL'
  604. '--trace-symbol=SYMBOL'
  605. Print the name of each linked file in which SYMBOL appears. This
  606. option may be given any number of times. On many systems it is
  607. necessary to prepend an underscore.
  608. This option is useful when you have an undefined symbol in your
  609. link but don't know where the reference is coming from.
  610. '-Y PATH'
  611. Add PATH to the default library search path. This option exists
  612. for Solaris compatibility.
  613. '-z KEYWORD'
  614. The recognized keywords are:
  615. 'combreloc'
  616. Combines multiple reloc sections and sorts them to make
  617. dynamic symbol lookup caching possible.
  618. 'common'
  619. Generate common symbols with the STT_COMMON type druing a
  620. relocatable link.
  621. 'defs'
  622. Disallows undefined symbols in object files. Undefined
  623. symbols in shared libraries are still allowed.
  624. 'execstack'
  625. Marks the object as requiring executable stack.
  626. 'global'
  627. This option is only meaningful when building a shared object.
  628. It makes the symbols defined by this shared object available
  629. for symbol resolution of subsequently loaded libraries.
  630. 'initfirst'
  631. This option is only meaningful when building a shared object.
  632. It marks the object so that its runtime initialization will
  633. occur before the runtime initialization of any other objects
  634. brought into the process at the same time. Similarly the
  635. runtime finalization of the object will occur after the
  636. runtime finalization of any other objects.
  637. 'interpose'
  638. Marks the object that its symbol table interposes before all
  639. symbols but the primary executable.
  640. 'lazy'
  641. When generating an executable or shared library, mark it to
  642. tell the dynamic linker to defer function call resolution to
  643. the point when the function is called (lazy binding), rather
  644. than at load time. Lazy binding is the default.
  645. 'loadfltr'
  646. Marks the object that its filters be processed immediately at
  647. runtime.
  648. 'muldefs'
  649. Allows multiple definitions.
  650. 'nocombreloc'
  651. Disables multiple reloc sections combining.
  652. 'nocommon'
  653. Generate common symbols with the STT_OBJECT type druing a
  654. relocatable link.
  655. 'nocopyreloc'
  656. Disable linker generated .dynbss variables used in place of
  657. variables defined in shared libraries. May result in dynamic
  658. text relocations.
  659. 'nodefaultlib'
  660. Marks the object that the search for dependencies of this
  661. object will ignore any default library search paths.
  662. 'nodelete'
  663. Marks the object shouldn't be unloaded at runtime.
  664. 'nodlopen'
  665. Marks the object not available to 'dlopen'.
  666. 'nodump'
  667. Marks the object can not be dumped by 'dldump'.
  668. 'noexecstack'
  669. Marks the object as not requiring executable stack.
  670. 'text'
  671. Treat DT_TEXTREL in shared object as error.
  672. 'notext'
  673. Don't treat DT_TEXTREL in shared object as error.
  674. 'textoff'
  675. Don't treat DT_TEXTREL in shared object as error.
  676. 'norelro'
  677. Don't create an ELF 'PT_GNU_RELRO' segment header in the
  678. object.
  679. 'now'
  680. When generating an executable or shared library, mark it to
  681. tell the dynamic linker to resolve all symbols when the
  682. program is started, or when the shared library is linked to
  683. using dlopen, instead of deferring function call resolution to
  684. the point when the function is first called.
  685. 'origin'
  686. Marks the object may contain $ORIGIN.
  687. 'relro'
  688. Create an ELF 'PT_GNU_RELRO' segment header in the object.
  689. 'max-page-size=VALUE'
  690. Set the emulation maximum page size to VALUE.
  691. 'common-page-size=VALUE'
  692. Set the emulation common page size to VALUE.
  693. 'stack-size=VALUE'
  694. Specify a stack size for in an ELF 'PT_GNU_STACK' segment.
  695. Specifying zero will override any default non-zero sized
  696. 'PT_GNU_STACK' segment creation.
  697. 'bndplt'
  698. Always generate BND prefix in PLT entries. Supported for
  699. Linux/x86_64.
  700. 'noextern-protected-data'
  701. Don't treat protected data symbol as external when building
  702. shared library. This option overrides linker backend default.
  703. It can be used to workaround incorrect relocations against
  704. protected data symbols generated by compiler. Updates on
  705. protected data symbols by another module aren't visible to the
  706. resulting shared library. Supported for i386 and x86-64.
  707. 'nodynamic-undefined-weak'
  708. Don't treat undefined weak symbols as dynamic when building
  709. executable. This option overrides linker backend default. It
  710. can be used to avoid dynamic relocations against undefined
  711. weak symbols in executable. Supported for i386 and x86-64.
  712. 'noreloc-overflow'
  713. Disable relocation overflow check. This can be used to
  714. disable relocation overflow check if there will be no dynamic
  715. relocation overflow at run-time. Supported for x86_64.
  716. 'call-nop=prefix-addr'
  717. 'call-nop=suffix-nop'
  718. 'call-nop=prefix-BYTE'
  719. 'call-nop=suffix-BYTE'
  720. Specify the 1-byte 'NOP' padding when transforming indirect
  721. call to a locally defined function, foo, via its GOT slot.
  722. 'call-nop=prefix-addr' generates '0x67 call foo'.
  723. 'call-nop=suffix-nop' generates 'call foo 0x90'.
  724. 'call-nop=prefix-BYTE' generates 'BYTE call foo'.
  725. 'call-nop=suffix-BYTE' generates 'call foo BYTE'. Supported
  726. for i386 and x86_64.
  727. Other keywords are ignored for Solaris compatibility.
  728. '-( ARCHIVES -)'
  729. '--start-group ARCHIVES --end-group'
  730. The ARCHIVES should be a list of archive files. They may be either
  731. explicit file names, or '-l' options.
  732. The specified archives are searched repeatedly until no new
  733. undefined references are created. Normally, an archive is searched
  734. only once in the order that it is specified on the command line.
  735. If a symbol in that archive is needed to resolve an undefined
  736. symbol referred to by an object in an archive that appears later on
  737. the command line, the linker would not be able to resolve that
  738. reference. By grouping the archives, they all be searched
  739. repeatedly until all possible references are resolved.
  740. Using this option has a significant performance cost. It is best
  741. to use it only when there are unavoidable circular references
  742. between two or more archives.
  743. '--accept-unknown-input-arch'
  744. '--no-accept-unknown-input-arch'
  745. Tells the linker to accept input files whose architecture cannot be
  746. recognised. The assumption is that the user knows what they are
  747. doing and deliberately wants to link in these unknown input files.
  748. This was the default behaviour of the linker, before release 2.14.
  749. The default behaviour from release 2.14 onwards is to reject such
  750. input files, and so the '--accept-unknown-input-arch' option has
  751. been added to restore the old behaviour.
  752. '--as-needed'
  753. '--no-as-needed'
  754. This option affects ELF DT_NEEDED tags for dynamic libraries
  755. mentioned on the command line after the '--as-needed' option.
  756. Normally the linker will add a DT_NEEDED tag for each dynamic
  757. library mentioned on the command line, regardless of whether the
  758. library is actually needed or not. '--as-needed' causes a
  759. DT_NEEDED tag to only be emitted for a library that _at that point
  760. in the link_ satisfies a non-weak undefined symbol reference from a
  761. regular object file or, if the library is not found in the
  762. DT_NEEDED lists of other needed libraries, a non-weak undefined
  763. symbol reference from another needed dynamic library. Object files
  764. or libraries appearing on the command line _after_ the library in
  765. question do not affect whether the library is seen as needed. This
  766. is similar to the rules for extraction of object files from
  767. archives. '--no-as-needed' restores the default behaviour.
  768. '--add-needed'
  769. '--no-add-needed'
  770. These two options have been deprecated because of the similarity of
  771. their names to the '--as-needed' and '--no-as-needed' options.
  772. They have been replaced by '--copy-dt-needed-entries' and
  773. '--no-copy-dt-needed-entries'.
  774. '-assert KEYWORD'
  775. This option is ignored for SunOS compatibility.
  776. '-Bdynamic'
  777. '-dy'
  778. '-call_shared'
  779. Link against dynamic libraries. This is only meaningful on
  780. platforms for which shared libraries are supported. This option is
  781. normally the default on such platforms. The different variants of
  782. this option are for compatibility with various systems. You may
  783. use this option multiple times on the command line: it affects
  784. library searching for '-l' options which follow it.
  785. '-Bgroup'
  786. Set the 'DF_1_GROUP' flag in the 'DT_FLAGS_1' entry in the dynamic
  787. section. This causes the runtime linker to handle lookups in this
  788. object and its dependencies to be performed only inside the group.
  789. '--unresolved-symbols=report-all' is implied. This option is only
  790. meaningful on ELF platforms which support shared libraries.
  791. '-Bstatic'
  792. '-dn'
  793. '-non_shared'
  794. '-static'
  795. Do not link against shared libraries. This is only meaningful on
  796. platforms for which shared libraries are supported. The different
  797. variants of this option are for compatibility with various systems.
  798. You may use this option multiple times on the command line: it
  799. affects library searching for '-l' options which follow it. This
  800. option also implies '--unresolved-symbols=report-all'. This option
  801. can be used with '-shared'. Doing so means that a shared library
  802. is being created but that all of the library's external references
  803. must be resolved by pulling in entries from static libraries.
  804. '-Bsymbolic'
  805. When creating a shared library, bind references to global symbols
  806. to the definition within the shared library, if any. Normally, it
  807. is possible for a program linked against a shared library to
  808. override the definition within the shared library. This option can
  809. also be used with the '--export-dynamic' option, when creating a
  810. position independent executable, to bind references to global
  811. symbols to the definition within the executable. This option is
  812. only meaningful on ELF platforms which support shared libraries and
  813. position independent executables.
  814. '-Bsymbolic-functions'
  815. When creating a shared library, bind references to global function
  816. symbols to the definition within the shared library, if any. This
  817. option can also be used with the '--export-dynamic' option, when
  818. creating a position independent executable, to bind references to
  819. global function symbols to the definition within the executable.
  820. This option is only meaningful on ELF platforms which support
  821. shared libraries and position independent executables.
  822. '--dynamic-list=DYNAMIC-LIST-FILE'
  823. Specify the name of a dynamic list file to the linker. This is
  824. typically used when creating shared libraries to specify a list of
  825. global symbols whose references shouldn't be bound to the
  826. definition within the shared library, or creating dynamically
  827. linked executables to specify a list of symbols which should be
  828. added to the symbol table in the executable. This option is only
  829. meaningful on ELF platforms which support shared libraries.
  830. The format of the dynamic list is the same as the version node
  831. without scope and node name. See *note VERSION:: for more
  832. information.
  833. '--dynamic-list-data'
  834. Include all global data symbols to the dynamic list.
  835. '--dynamic-list-cpp-new'
  836. Provide the builtin dynamic list for C++ operator new and delete.
  837. It is mainly useful for building shared libstdc++.
  838. '--dynamic-list-cpp-typeinfo'
  839. Provide the builtin dynamic list for C++ runtime type
  840. identification.
  841. '--check-sections'
  842. '--no-check-sections'
  843. Asks the linker _not_ to check section addresses after they have
  844. been assigned to see if there are any overlaps. Normally the
  845. linker will perform this check, and if it finds any overlaps it
  846. will produce suitable error messages. The linker does know about,
  847. and does make allowances for sections in overlays. The default
  848. behaviour can be restored by using the command line switch
  849. '--check-sections'. Section overlap is not usually checked for
  850. relocatable links. You can force checking in that case by using
  851. the '--check-sections' option.
  852. '--copy-dt-needed-entries'
  853. '--no-copy-dt-needed-entries'
  854. This option affects the treatment of dynamic libraries referred to
  855. by DT_NEEDED tags _inside_ ELF dynamic libraries mentioned on the
  856. command line. Normally the linker won't add a DT_NEEDED tag to the
  857. output binary for each library mentioned in a DT_NEEDED tag in an
  858. input dynamic library. With '--copy-dt-needed-entries' specified
  859. on the command line however any dynamic libraries that follow it
  860. will have their DT_NEEDED entries added. The default behaviour can
  861. be restored with '--no-copy-dt-needed-entries'.
  862. This option also has an effect on the resolution of symbols in
  863. dynamic libraries. With '--copy-dt-needed-entries' dynamic
  864. libraries mentioned on the command line will be recursively
  865. searched, following their DT_NEEDED tags to other libraries, in
  866. order to resolve symbols required by the output binary. With the
  867. default setting however the searching of dynamic libraries that
  868. follow it will stop with the dynamic library itself. No DT_NEEDED
  869. links will be traversed to resolve symbols.
  870. '--cref'
  871. Output a cross reference table. If a linker map file is being
  872. generated, the cross reference table is printed to the map file.
  873. Otherwise, it is printed on the standard output.
  874. The format of the table is intentionally simple, so that it may be
  875. easily processed by a script if necessary. The symbols are printed
  876. out, sorted by name. For each symbol, a list of file names is
  877. given. If the symbol is defined, the first file listed is the
  878. location of the definition. If the symbol is defined as a common
  879. value then any files where this happens appear next. Finally any
  880. files that reference the symbol are listed.
  881. '--no-define-common'
  882. This option inhibits the assignment of addresses to common symbols.
  883. The script command 'INHIBIT_COMMON_ALLOCATION' has the same effect.
  884. *Note Miscellaneous Commands::.
  885. The '--no-define-common' option allows decoupling the decision to
  886. assign addresses to Common symbols from the choice of the output
  887. file type; otherwise a non-Relocatable output type forces assigning
  888. addresses to Common symbols. Using '--no-define-common' allows
  889. Common symbols that are referenced from a shared library to be
  890. assigned addresses only in the main program. This eliminates the
  891. unused duplicate space in the shared library, and also prevents any
  892. possible confusion over resolving to the wrong duplicate when there
  893. are many dynamic modules with specialized search paths for runtime
  894. symbol resolution.
  895. '--defsym=SYMBOL=EXPRESSION'
  896. Create a global symbol in the output file, containing the absolute
  897. address given by EXPRESSION. You may use this option as many times
  898. as necessary to define multiple symbols in the command line. A
  899. limited form of arithmetic is supported for the EXPRESSION in this
  900. context: you may give a hexadecimal constant or the name of an
  901. existing symbol, or use '+' and '-' to add or subtract hexadecimal
  902. constants or symbols. If you need more elaborate expressions,
  903. consider using the linker command language from a script (*note
  904. Assignments::). _Note:_ there should be no white space between
  905. SYMBOL, the equals sign ("<=>"), and EXPRESSION.
  906. '--demangle[=STYLE]'
  907. '--no-demangle'
  908. These options control whether to demangle symbol names in error
  909. messages and other output. When the linker is told to demangle, it
  910. tries to present symbol names in a readable fashion: it strips
  911. leading underscores if they are used by the object file format, and
  912. converts C++ mangled symbol names into user readable names.
  913. Different compilers have different mangling styles. The optional
  914. demangling style argument can be used to choose an appropriate
  915. demangling style for your compiler. The linker will demangle by
  916. default unless the environment variable 'COLLECT_NO_DEMANGLE' is
  917. set. These options may be used to override the default.
  918. '-IFILE'
  919. '--dynamic-linker=FILE'
  920. Set the name of the dynamic linker. This is only meaningful when
  921. generating dynamically linked ELF executables. The default dynamic
  922. linker is normally correct; don't use this unless you know what you
  923. are doing.
  924. '--no-dynamic-linker'
  925. When producing an executable file, omit the request for a dynamic
  926. linker to be used at load-time. This is only meaningful for ELF
  927. executables that contain dynamic relocations, and usually requires
  928. entry point code that is capable of processing these relocations.
  929. '--fatal-warnings'
  930. '--no-fatal-warnings'
  931. Treat all warnings as errors. The default behaviour can be
  932. restored with the option '--no-fatal-warnings'.
  933. '--force-exe-suffix'
  934. Make sure that an output file has a .exe suffix.
  935. If a successfully built fully linked output file does not have a
  936. '.exe' or '.dll' suffix, this option forces the linker to copy the
  937. output file to one of the same name with a '.exe' suffix. This
  938. option is useful when using unmodified Unix makefiles on a
  939. Microsoft Windows host, since some versions of Windows won't run an
  940. image unless it ends in a '.exe' suffix.
  941. '--gc-sections'
  942. '--no-gc-sections'
  943. Enable garbage collection of unused input sections. It is ignored
  944. on targets that do not support this option. The default behaviour
  945. (of not performing this garbage collection) can be restored by
  946. specifying '--no-gc-sections' on the command line. Note that
  947. garbage collection for COFF and PE format targets is supported, but
  948. the implementation is currently considered to be experimental.
  949. '--gc-sections' decides which input sections are used by examining
  950. symbols and relocations. The section containing the entry symbol
  951. and all sections containing symbols undefined on the command-line
  952. will be kept, as will sections containing symbols referenced by
  953. dynamic objects. Note that when building shared libraries, the
  954. linker must assume that any visible symbol is referenced. Once
  955. this initial set of sections has been determined, the linker
  956. recursively marks as used any section referenced by their
  957. relocations. See '--entry' and '--undefined'.
  958. This option can be set when doing a partial link (enabled with
  959. option '-r'). In this case the root of symbols kept must be
  960. explicitly specified either by an '--entry' or '--undefined' option
  961. or by a 'ENTRY' command in the linker script.
  962. '--print-gc-sections'
  963. '--no-print-gc-sections'
  964. List all sections removed by garbage collection. The listing is
  965. printed on stderr. This option is only effective if garbage
  966. collection has been enabled via the '--gc-sections') option. The
  967. default behaviour (of not listing the sections that are removed)
  968. can be restored by specifying '--no-print-gc-sections' on the
  969. command line.
  970. '--gc-keep-exported'
  971. When '--gc-sections' is enabled, this option prevents garbage
  972. collection of unused input sections that contain global symbols
  973. having default or protected visibility. This option is intended to
  974. be used for executables where unreferenced sections would otherwise
  975. be garbage collected regardless of the external visibility of
  976. contained symbols. Note that this option has no effect when
  977. linking shared objects since it is already the default behaviour.
  978. This option is only supported for ELF format targets.
  979. '--print-output-format'
  980. Print the name of the default output format (perhaps influenced by
  981. other command-line options). This is the string that would appear
  982. in an 'OUTPUT_FORMAT' linker script command (*note File
  983. Commands::).
  984. '--print-memory-usage'
  985. Print used size, total size and used size of memory regions created
  986. with the *note MEMORY:: command. This is useful on embedded
  987. targets to have a quick view of amount of free memory. The format
  988. of the output has one headline and one line per region. It is both
  989. human readable and easily parsable by tools. Here is an example of
  990. an output:
  991. Memory region Used Size Region Size %age Used
  992. ROM: 256 KB 1 MB 25.00%
  993. RAM: 32 B 2 GB 0.00%
  994. '--help'
  995. Print a summary of the command-line options on the standard output
  996. and exit.
  997. '--target-help'
  998. Print a summary of all target specific options on the standard
  999. output and exit.
  1000. '-Map=MAPFILE'
  1001. Print a link map to the file MAPFILE. See the description of the
  1002. '-M' option, above.
  1003. '--no-keep-memory'
  1004. 'ld' normally optimizes for speed over memory usage by caching the
  1005. symbol tables of input files in memory. This option tells 'ld' to
  1006. instead optimize for memory usage, by rereading the symbol tables
  1007. as necessary. This may be required if 'ld' runs out of memory
  1008. space while linking a large executable.
  1009. '--no-undefined'
  1010. '-z defs'
  1011. Report unresolved symbol references from regular object files.
  1012. This is done even if the linker is creating a non-symbolic shared
  1013. library. The switch '--[no-]allow-shlib-undefined' controls the
  1014. behaviour for reporting unresolved references found in shared
  1015. libraries being linked in.
  1016. '--allow-multiple-definition'
  1017. '-z muldefs'
  1018. Normally when a symbol is defined multiple times, the linker will
  1019. report a fatal error. These options allow multiple definitions and
  1020. the first definition will be used.
  1021. '--allow-shlib-undefined'
  1022. '--no-allow-shlib-undefined'
  1023. Allows or disallows undefined symbols in shared libraries. This
  1024. switch is similar to '--no-undefined' except that it determines the
  1025. behaviour when the undefined symbols are in a shared library rather
  1026. than a regular object file. It does not affect how undefined
  1027. symbols in regular object files are handled.
  1028. The default behaviour is to report errors for any undefined symbols
  1029. referenced in shared libraries if the linker is being used to
  1030. create an executable, but to allow them if the linker is being used
  1031. to create a shared library.
  1032. The reasons for allowing undefined symbol references in shared
  1033. libraries specified at link time are that:
  1034. * A shared library specified at link time may not be the same as
  1035. the one that is available at load time, so the symbol might
  1036. actually be resolvable at load time.
  1037. * There are some operating systems, eg BeOS and HPPA, where
  1038. undefined symbols in shared libraries are normal.
  1039. The BeOS kernel for example patches shared libraries at load
  1040. time to select whichever function is most appropriate for the
  1041. current architecture. This is used, for example, to
  1042. dynamically select an appropriate memset function.
  1043. '--no-undefined-version'
  1044. Normally when a symbol has an undefined version, the linker will
  1045. ignore it. This option disallows symbols with undefined version
  1046. and a fatal error will be issued instead.
  1047. '--default-symver'
  1048. Create and use a default symbol version (the soname) for
  1049. unversioned exported symbols.
  1050. '--default-imported-symver'
  1051. Create and use a default symbol version (the soname) for
  1052. unversioned imported symbols.
  1053. '--no-warn-mismatch'
  1054. Normally 'ld' will give an error if you try to link together input
  1055. files that are mismatched for some reason, perhaps because they
  1056. have been compiled for different processors or for different
  1057. endiannesses. This option tells 'ld' that it should silently
  1058. permit such possible errors. This option should only be used with
  1059. care, in cases when you have taken some special action that ensures
  1060. that the linker errors are inappropriate.
  1061. '--no-warn-search-mismatch'
  1062. Normally 'ld' will give a warning if it finds an incompatible
  1063. library during a library search. This option silences the warning.
  1064. '--no-whole-archive'
  1065. Turn off the effect of the '--whole-archive' option for subsequent
  1066. archive files.
  1067. '--noinhibit-exec'
  1068. Retain the executable output file whenever it is still usable.
  1069. Normally, the linker will not produce an output file if it
  1070. encounters errors during the link process; it exits without writing
  1071. an output file when it issues any error whatsoever.
  1072. '-nostdlib'
  1073. Only search library directories explicitly specified on the command
  1074. line. Library directories specified in linker scripts (including
  1075. linker scripts specified on the command line) are ignored.
  1076. '--oformat=OUTPUT-FORMAT'
  1077. 'ld' may be configured to support more than one kind of object
  1078. file. If your 'ld' is configured this way, you can use the
  1079. '--oformat' option to specify the binary format for the output
  1080. object file. Even when 'ld' is configured to support alternative
  1081. object formats, you don't usually need to specify this, as 'ld'
  1082. should be configured to produce as a default output format the most
  1083. usual format on each machine. OUTPUT-FORMAT is a text string, the
  1084. name of a particular format supported by the BFD libraries. (You
  1085. can list the available binary formats with 'objdump -i'.) The
  1086. script command 'OUTPUT_FORMAT' can also specify the output format,
  1087. but this option overrides it. *Note BFD::.
  1088. '--out-implib FILE'
  1089. Create an import library in FILE corresponding to the executable
  1090. the linker is generating (eg. a DLL or ELF program). This import
  1091. library (which should be called '*.dll.a' or '*.a' for DLLs) may be
  1092. used to link clients against the generated executable; this
  1093. behaviour makes it possible to skip a separate import library
  1094. creation step (eg. 'dlltool' for DLLs). This option is only
  1095. available for the i386 PE and ELF targetted ports of the linker.
  1096. '-pie'
  1097. '--pic-executable'
  1098. Create a position independent executable. This is currently only
  1099. supported on ELF platforms. Position independent executables are
  1100. similar to shared libraries in that they are relocated by the
  1101. dynamic linker to the virtual address the OS chooses for them
  1102. (which can vary between invocations). Like normal dynamically
  1103. linked executables they can be executed and symbols defined in the
  1104. executable cannot be overridden by shared libraries.
  1105. '-qmagic'
  1106. This option is ignored for Linux compatibility.
  1107. '-Qy'
  1108. This option is ignored for SVR4 compatibility.
  1109. '--relax'
  1110. '--no-relax'
  1111. An option with machine dependent effects. This option is only
  1112. supported on a few targets. *Note 'ld' and the H8/300: H8/300.
  1113. *Note 'ld' and the Intel 960 family: i960. *Note 'ld' and Xtensa
  1114. Processors: Xtensa. *Note 'ld' and the 68HC11 and 68HC12:
  1115. M68HC11/68HC12. *Note 'ld' and the Altera Nios II: Nios II. *Note
  1116. 'ld' and PowerPC 32-bit ELF Support: PowerPC ELF32.
  1117. On some platforms the '--relax' option performs target specific,
  1118. global optimizations that become possible when the linker resolves
  1119. addressing in the program, such as relaxing address modes,
  1120. synthesizing new instructions, selecting shorter version of current
  1121. instructions, and combining constant values.
  1122. On some platforms these link time global optimizations may make
  1123. symbolic debugging of the resulting executable impossible. This is
  1124. known to be the case for the Matsushita MN10200 and MN10300 family
  1125. of processors.
  1126. On platforms where this is not supported, '--relax' is accepted,
  1127. but ignored.
  1128. On platforms where '--relax' is accepted the option '--no-relax'
  1129. can be used to disable the feature.
  1130. '--retain-symbols-file=FILENAME'
  1131. Retain _only_ the symbols listed in the file FILENAME, discarding
  1132. all others. FILENAME is simply a flat file, with one symbol name
  1133. per line. This option is especially useful in environments (such
  1134. as VxWorks) where a large global symbol table is accumulated
  1135. gradually, to conserve run-time memory.
  1136. '--retain-symbols-file' does _not_ discard undefined symbols, or
  1137. symbols needed for relocations.
  1138. You may only specify '--retain-symbols-file' once in the command
  1139. line. It overrides '-s' and '-S'.
  1140. '-rpath=DIR'
  1141. Add a directory to the runtime library search path. This is used
  1142. when linking an ELF executable with shared objects. All '-rpath'
  1143. arguments are concatenated and passed to the runtime linker, which
  1144. uses them to locate shared objects at runtime. The '-rpath' option
  1145. is also used when locating shared objects which are needed by
  1146. shared objects explicitly included in the link; see the description
  1147. of the '-rpath-link' option. If '-rpath' is not used when linking
  1148. an ELF executable, the contents of the environment variable
  1149. 'LD_RUN_PATH' will be used if it is defined.
  1150. The '-rpath' option may also be used on SunOS. By default, on
  1151. SunOS, the linker will form a runtime search path out of all the
  1152. '-L' options it is given. If a '-rpath' option is used, the
  1153. runtime search path will be formed exclusively using the '-rpath'
  1154. options, ignoring the '-L' options. This can be useful when using
  1155. gcc, which adds many '-L' options which may be on NFS mounted file
  1156. systems.
  1157. For compatibility with other ELF linkers, if the '-R' option is
  1158. followed by a directory name, rather than a file name, it is
  1159. treated as the '-rpath' option.
  1160. '-rpath-link=DIR'
  1161. When using ELF or SunOS, one shared library may require another.
  1162. This happens when an 'ld -shared' link includes a shared library as
  1163. one of the input files.
  1164. When the linker encounters such a dependency when doing a
  1165. non-shared, non-relocatable link, it will automatically try to
  1166. locate the required shared library and include it in the link, if
  1167. it is not included explicitly. In such a case, the '-rpath-link'
  1168. option specifies the first set of directories to search. The
  1169. '-rpath-link' option may specify a sequence of directory names
  1170. either by specifying a list of names separated by colons, or by
  1171. appearing multiple times.
  1172. The tokens $ORIGIN and $LIB can appear in these search directories.
  1173. They will be replaced by the full path to the directory containing
  1174. the program or shared object in the case of $ORIGIN and either
  1175. 'lib' - for 32-bit binaries - or 'lib64' - for 64-bit binaries - in
  1176. the case of $LIB.
  1177. The alternative form of these tokens - ${ORIGIN} and ${LIB} can
  1178. also be used. The token $PLATFORM is not supported.
  1179. This option should be used with caution as it overrides the search
  1180. path that may have been hard compiled into a shared library. In
  1181. such a case it is possible to use unintentionally a different
  1182. search path than the runtime linker would do.
  1183. The linker uses the following search paths to locate required
  1184. shared libraries:
  1185. 1. Any directories specified by '-rpath-link' options.
  1186. 2. Any directories specified by '-rpath' options. The difference
  1187. between '-rpath' and '-rpath-link' is that directories
  1188. specified by '-rpath' options are included in the executable
  1189. and used at runtime, whereas the '-rpath-link' option is only
  1190. effective at link time. Searching '-rpath' in this way is
  1191. only supported by native linkers and cross linkers which have
  1192. been configured with the '--with-sysroot' option.
  1193. 3. On an ELF system, for native linkers, if the '-rpath' and
  1194. '-rpath-link' options were not used, search the contents of
  1195. the environment variable 'LD_RUN_PATH'.
  1196. 4. On SunOS, if the '-rpath' option was not used, search any
  1197. directories specified using '-L' options.
  1198. 5. For a native linker, search the contents of the environment
  1199. variable 'LD_LIBRARY_PATH'.
  1200. 6. For a native ELF linker, the directories in 'DT_RUNPATH' or
  1201. 'DT_RPATH' of a shared library are searched for shared
  1202. libraries needed by it. The 'DT_RPATH' entries are ignored if
  1203. 'DT_RUNPATH' entries exist.
  1204. 7. The default directories, normally '/lib' and '/usr/lib'.
  1205. 8. For a native linker on an ELF system, if the file
  1206. '/etc/ld.so.conf' exists, the list of directories found in
  1207. that file.
  1208. If the required shared library is not found, the linker will issue
  1209. a warning and continue with the link.
  1210. '-shared'
  1211. '-Bshareable'
  1212. Create a shared library. This is currently only supported on ELF,
  1213. XCOFF and SunOS platforms. On SunOS, the linker will automatically
  1214. create a shared library if the '-e' option is not used and there
  1215. are undefined symbols in the link.
  1216. '--sort-common'
  1217. '--sort-common=ascending'
  1218. '--sort-common=descending'
  1219. This option tells 'ld' to sort the common symbols by alignment in
  1220. ascending or descending order when it places them in the
  1221. appropriate output sections. The symbol alignments considered are
  1222. sixteen-byte or larger, eight-byte, four-byte, two-byte, and
  1223. one-byte. This is to prevent gaps between symbols due to alignment
  1224. constraints. If no sorting order is specified, then descending
  1225. order is assumed.
  1226. '--sort-section=name'
  1227. This option will apply 'SORT_BY_NAME' to all wildcard section
  1228. patterns in the linker script.
  1229. '--sort-section=alignment'
  1230. This option will apply 'SORT_BY_ALIGNMENT' to all wildcard section
  1231. patterns in the linker script.
  1232. '--split-by-file[=SIZE]'
  1233. Similar to '--split-by-reloc' but creates a new output section for
  1234. each input file when SIZE is reached. SIZE defaults to a size of 1
  1235. if not given.
  1236. '--split-by-reloc[=COUNT]'
  1237. Tries to creates extra sections in the output file so that no
  1238. single output section in the file contains more than COUNT
  1239. relocations. This is useful when generating huge relocatable files
  1240. for downloading into certain real time kernels with the COFF object
  1241. file format; since COFF cannot represent more than 65535
  1242. relocations in a single section. Note that this will fail to work
  1243. with object file formats which do not support arbitrary sections.
  1244. The linker will not split up individual input sections for
  1245. redistribution, so if a single input section contains more than
  1246. COUNT relocations one output section will contain that many
  1247. relocations. COUNT defaults to a value of 32768.
  1248. '--stats'
  1249. Compute and display statistics about the operation of the linker,
  1250. such as execution time and memory usage.
  1251. '--sysroot=DIRECTORY'
  1252. Use DIRECTORY as the location of the sysroot, overriding the
  1253. configure-time default. This option is only supported by linkers
  1254. that were configured using '--with-sysroot'.
  1255. '--traditional-format'
  1256. For some targets, the output of 'ld' is different in some ways from
  1257. the output of some existing linker. This switch requests 'ld' to
  1258. use the traditional format instead.
  1259. For example, on SunOS, 'ld' combines duplicate entries in the
  1260. symbol string table. This can reduce the size of an output file
  1261. with full debugging information by over 30 percent. Unfortunately,
  1262. the SunOS 'dbx' program can not read the resulting program ('gdb'
  1263. has no trouble). The '--traditional-format' switch tells 'ld' to
  1264. not combine duplicate entries.
  1265. '--section-start=SECTIONNAME=ORG'
  1266. Locate a section in the output file at the absolute address given
  1267. by ORG. You may use this option as many times as necessary to
  1268. locate multiple sections in the command line. ORG must be a single
  1269. hexadecimal integer; for compatibility with other linkers, you may
  1270. omit the leading '0x' usually associated with hexadecimal values.
  1271. _Note:_ there should be no white space between SECTIONNAME, the
  1272. equals sign ("<=>"), and ORG.
  1273. '-Tbss=ORG'
  1274. '-Tdata=ORG'
  1275. '-Ttext=ORG'
  1276. Same as '--section-start', with '.bss', '.data' or '.text' as the
  1277. SECTIONNAME.
  1278. '-Ttext-segment=ORG'
  1279. When creating an ELF executable, it will set the address of the
  1280. first byte of the text segment.
  1281. '-Trodata-segment=ORG'
  1282. When creating an ELF executable or shared object for a target where
  1283. the read-only data is in its own segment separate from the
  1284. executable text, it will set the address of the first byte of the
  1285. read-only data segment.
  1286. '-Tldata-segment=ORG'
  1287. When creating an ELF executable or shared object for x86-64 medium
  1288. memory model, it will set the address of the first byte of the
  1289. ldata segment.
  1290. '--unresolved-symbols=METHOD'
  1291. Determine how to handle unresolved symbols. There are four
  1292. possible values for 'method':
  1293. 'ignore-all'
  1294. Do not report any unresolved symbols.
  1295. 'report-all'
  1296. Report all unresolved symbols. This is the default.
  1297. 'ignore-in-object-files'
  1298. Report unresolved symbols that are contained in shared
  1299. libraries, but ignore them if they come from regular object
  1300. files.
  1301. 'ignore-in-shared-libs'
  1302. Report unresolved symbols that come from regular object files,
  1303. but ignore them if they come from shared libraries. This can
  1304. be useful when creating a dynamic binary and it is known that
  1305. all the shared libraries that it should be referencing are
  1306. included on the linker's command line.
  1307. The behaviour for shared libraries on their own can also be
  1308. controlled by the '--[no-]allow-shlib-undefined' option.
  1309. Normally the linker will generate an error message for each
  1310. reported unresolved symbol but the option
  1311. '--warn-unresolved-symbols' can change this to a warning.
  1312. '--dll-verbose'
  1313. '--verbose[=NUMBER]'
  1314. Display the version number for 'ld' and list the linker emulations
  1315. supported. Display which input files can and cannot be opened.
  1316. Display the linker script being used by the linker. If the
  1317. optional NUMBER argument > 1, plugin symbol status will also be
  1318. displayed.
  1319. '--version-script=VERSION-SCRIPTFILE'
  1320. Specify the name of a version script to the linker. This is
  1321. typically used when creating shared libraries to specify additional
  1322. information about the version hierarchy for the library being
  1323. created. This option is only fully supported on ELF platforms
  1324. which support shared libraries; see *note VERSION::. It is
  1325. partially supported on PE platforms, which can use version scripts
  1326. to filter symbol visibility in auto-export mode: any symbols marked
  1327. 'local' in the version script will not be exported. *Note WIN32::.
  1328. '--warn-common'
  1329. Warn when a common symbol is combined with another common symbol or
  1330. with a symbol definition. Unix linkers allow this somewhat sloppy
  1331. practice, but linkers on some other operating systems do not. This
  1332. option allows you to find potential problems from combining global
  1333. symbols. Unfortunately, some C libraries use this practice, so you
  1334. may get some warnings about symbols in the libraries as well as in
  1335. your programs.
  1336. There are three kinds of global symbols, illustrated here by C
  1337. examples:
  1338. 'int i = 1;'
  1339. A definition, which goes in the initialized data section of
  1340. the output file.
  1341. 'extern int i;'
  1342. An undefined reference, which does not allocate space. There
  1343. must be either a definition or a common symbol for the
  1344. variable somewhere.
  1345. 'int i;'
  1346. A common symbol. If there are only (one or more) common
  1347. symbols for a variable, it goes in the uninitialized data area
  1348. of the output file. The linker merges multiple common symbols
  1349. for the same variable into a single symbol. If they are of
  1350. different sizes, it picks the largest size. The linker turns
  1351. a common symbol into a declaration, if there is a definition
  1352. of the same variable.
  1353. The '--warn-common' option can produce five kinds of warnings.
  1354. Each warning consists of a pair of lines: the first describes the
  1355. symbol just encountered, and the second describes the previous
  1356. symbol encountered with the same name. One or both of the two
  1357. symbols will be a common symbol.
  1358. 1. Turning a common symbol into a reference, because there is
  1359. already a definition for the symbol.
  1360. FILE(SECTION): warning: common of `SYMBOL'
  1361. overridden by definition
  1362. FILE(SECTION): warning: defined here
  1363. 2. Turning a common symbol into a reference, because a later
  1364. definition for the symbol is encountered. This is the same as
  1365. the previous case, except that the symbols are encountered in
  1366. a different order.
  1367. FILE(SECTION): warning: definition of `SYMBOL'
  1368. overriding common
  1369. FILE(SECTION): warning: common is here
  1370. 3. Merging a common symbol with a previous same-sized common
  1371. symbol.
  1372. FILE(SECTION): warning: multiple common
  1373. of `SYMBOL'
  1374. FILE(SECTION): warning: previous common is here
  1375. 4. Merging a common symbol with a previous larger common symbol.
  1376. FILE(SECTION): warning: common of `SYMBOL'
  1377. overridden by larger common
  1378. FILE(SECTION): warning: larger common is here
  1379. 5. Merging a common symbol with a previous smaller common symbol.
  1380. This is the same as the previous case, except that the symbols
  1381. are encountered in a different order.
  1382. FILE(SECTION): warning: common of `SYMBOL'
  1383. overriding smaller common
  1384. FILE(SECTION): warning: smaller common is here
  1385. '--warn-constructors'
  1386. Warn if any global constructors are used. This is only useful for
  1387. a few object file formats. For formats like COFF or ELF, the
  1388. linker can not detect the use of global constructors.
  1389. '--warn-multiple-gp'
  1390. Warn if multiple global pointer values are required in the output
  1391. file. This is only meaningful for certain processors, such as the
  1392. Alpha. Specifically, some processors put large-valued constants in
  1393. a special section. A special register (the global pointer) points
  1394. into the middle of this section, so that constants can be loaded
  1395. efficiently via a base-register relative addressing mode. Since
  1396. the offset in base-register relative mode is fixed and relatively
  1397. small (e.g., 16 bits), this limits the maximum size of the constant
  1398. pool. Thus, in large programs, it is often necessary to use
  1399. multiple global pointer values in order to be able to address all
  1400. possible constants. This option causes a warning to be issued
  1401. whenever this case occurs.
  1402. '--warn-once'
  1403. Only warn once for each undefined symbol, rather than once per
  1404. module which refers to it.
  1405. '--warn-section-align'
  1406. Warn if the address of an output section is changed because of
  1407. alignment. Typically, the alignment will be set by an input
  1408. section. The address will only be changed if it not explicitly
  1409. specified; that is, if the 'SECTIONS' command does not specify a
  1410. start address for the section (*note SECTIONS::).
  1411. '--warn-shared-textrel'
  1412. Warn if the linker adds a DT_TEXTREL to a shared object.
  1413. '--warn-alternate-em'
  1414. Warn if an object has alternate ELF machine code.
  1415. '--warn-unresolved-symbols'
  1416. If the linker is going to report an unresolved symbol (see the
  1417. option '--unresolved-symbols') it will normally generate an error.
  1418. This option makes it generate a warning instead.
  1419. '--error-unresolved-symbols'
  1420. This restores the linker's default behaviour of generating errors
  1421. when it is reporting unresolved symbols.
  1422. '--whole-archive'
  1423. For each archive mentioned on the command line after the
  1424. '--whole-archive' option, include every object file in the archive
  1425. in the link, rather than searching the archive for the required
  1426. object files. This is normally used to turn an archive file into a
  1427. shared library, forcing every object to be included in the
  1428. resulting shared library. This option may be used more than once.
  1429. Two notes when using this option from gcc: First, gcc doesn't know
  1430. about this option, so you have to use '-Wl,-whole-archive'.
  1431. Second, don't forget to use '-Wl,-no-whole-archive' after your list
  1432. of archives, because gcc will add its own list of archives to your
  1433. link and you may not want this flag to affect those as well.
  1434. '--wrap=SYMBOL'
  1435. Use a wrapper function for SYMBOL. Any undefined reference to
  1436. SYMBOL will be resolved to '__wrap_SYMBOL'. Any undefined
  1437. reference to '__real_SYMBOL' will be resolved to SYMBOL.
  1438. This can be used to provide a wrapper for a system function. The
  1439. wrapper function should be called '__wrap_SYMBOL'. If it wishes to
  1440. call the system function, it should call '__real_SYMBOL'.
  1441. Here is a trivial example:
  1442. void *
  1443. __wrap_malloc (size_t c)
  1444. {
  1445. printf ("malloc called with %zu\n", c);
  1446. return __real_malloc (c);
  1447. }
  1448. If you link other code with this file using '--wrap malloc', then
  1449. all calls to 'malloc' will call the function '__wrap_malloc'
  1450. instead. The call to '__real_malloc' in '__wrap_malloc' will call
  1451. the real 'malloc' function.
  1452. You may wish to provide a '__real_malloc' function as well, so that
  1453. links without the '--wrap' option will succeed. If you do this,
  1454. you should not put the definition of '__real_malloc' in the same
  1455. file as '__wrap_malloc'; if you do, the assembler may resolve the
  1456. call before the linker has a chance to wrap it to 'malloc'.
  1457. '--eh-frame-hdr'
  1458. '--no-eh-frame-hdr'
  1459. Request ('--eh-frame-hdr') or suppress ('--no-eh-frame-hdr') the
  1460. creation of '.eh_frame_hdr' section and ELF 'PT_GNU_EH_FRAME'
  1461. segment header.
  1462. '--no-ld-generated-unwind-info'
  1463. Request creation of '.eh_frame' unwind info for linker generated
  1464. code sections like PLT. This option is on by default if linker
  1465. generated unwind info is supported.
  1466. '--enable-new-dtags'
  1467. '--disable-new-dtags'
  1468. This linker can create the new dynamic tags in ELF. But the older
  1469. ELF systems may not understand them. If you specify
  1470. '--enable-new-dtags', the new dynamic tags will be created as
  1471. needed and older dynamic tags will be omitted. If you specify
  1472. '--disable-new-dtags', no new dynamic tags will be created. By
  1473. default, the new dynamic tags are not created. Note that those
  1474. options are only available for ELF systems.
  1475. '--hash-size=NUMBER'
  1476. Set the default size of the linker's hash tables to a prime number
  1477. close to NUMBER. Increasing this value can reduce the length of
  1478. time it takes the linker to perform its tasks, at the expense of
  1479. increasing the linker's memory requirements. Similarly reducing
  1480. this value can reduce the memory requirements at the expense of
  1481. speed.
  1482. '--hash-style=STYLE'
  1483. Set the type of linker's hash table(s). STYLE can be either 'sysv'
  1484. for classic ELF '.hash' section, 'gnu' for new style GNU
  1485. '.gnu.hash' section or 'both' for both the classic ELF '.hash' and
  1486. new style GNU '.gnu.hash' hash tables. The default is 'sysv'.
  1487. '--compress-debug-sections=none'
  1488. '--compress-debug-sections=zlib'
  1489. '--compress-debug-sections=zlib-gnu'
  1490. '--compress-debug-sections=zlib-gabi'
  1491. On ELF platforms, these options control how DWARF debug sections
  1492. are compressed using zlib.
  1493. '--compress-debug-sections=none' doesn't compress DWARF debug
  1494. sections. '--compress-debug-sections=zlib-gnu' compresses DWARF
  1495. debug sections and renames them to begin with '.zdebug' instead of
  1496. '.debug'. '--compress-debug-sections=zlib-gabi' also compresses
  1497. DWARF debug sections, but rather than renaming them it sets the
  1498. SHF_COMPRESSED flag in the sections' headers.
  1499. The '--compress-debug-sections=zlib' option is an alias for
  1500. '--compress-debug-sections=zlib-gabi'.
  1501. Note that this option overrides any compression in input debug
  1502. sections, so if a binary is linked with
  1503. '--compress-debug-sections=none' for example, then any compressed
  1504. debug sections in input files will be uncompressed before they are
  1505. copied into the output binary.
  1506. The default compression behaviour varies depending upon the target
  1507. involved and the configure options used to build the toolchain.
  1508. The default can be determined by examining the output from the
  1509. linker's '--help' option.
  1510. '--reduce-memory-overheads'
  1511. This option reduces memory requirements at ld runtime, at the
  1512. expense of linking speed. This was introduced to select the old
  1513. O(n^2) algorithm for link map file generation, rather than the new
  1514. O(n) algorithm which uses about 40% more memory for symbol storage.
  1515. Another effect of the switch is to set the default hash table size
  1516. to 1021, which again saves memory at the cost of lengthening the
  1517. linker's run time. This is not done however if the '--hash-size'
  1518. switch has been used.
  1519. The '--reduce-memory-overheads' switch may be also be used to
  1520. enable other tradeoffs in future versions of the linker.
  1521. '--build-id'
  1522. '--build-id=STYLE'
  1523. Request the creation of a '.note.gnu.build-id' ELF note section or
  1524. a '.buildid' COFF section. The contents of the note are unique
  1525. bits identifying this linked file. STYLE can be 'uuid' to use 128
  1526. random bits, 'sha1' to use a 160-bit SHA1 hash on the normative
  1527. parts of the output contents, 'md5' to use a 128-bit MD5 hash on
  1528. the normative parts of the output contents, or '0xHEXSTRING' to use
  1529. a chosen bit string specified as an even number of hexadecimal
  1530. digits ('-' and ':' characters between digit pairs are ignored).
  1531. If STYLE is omitted, 'sha1' is used.
  1532. The 'md5' and 'sha1' styles produces an identifier that is always
  1533. the same in an identical output file, but will be unique among all
  1534. nonidentical output files. It is not intended to be compared as a
  1535. checksum for the file's contents. A linked file may be changed
  1536. later by other tools, but the build ID bit string identifying the
  1537. original linked file does not change.
  1538. Passing 'none' for STYLE disables the setting from any '--build-id'
  1539. options earlier on the command line.
  1540. 2.1.1 Options Specific to i386 PE Targets
  1541. -----------------------------------------
  1542. The i386 PE linker supports the '-shared' option, which causes the
  1543. output to be a dynamically linked library (DLL) instead of a normal
  1544. executable. You should name the output '*.dll' when you use this
  1545. option. In addition, the linker fully supports the standard '*.def'
  1546. files, which may be specified on the linker command line like an object
  1547. file (in fact, it should precede archives it exports symbols from, to
  1548. ensure that they get linked in, just like a normal object file).
  1549. In addition to the options common to all targets, the i386 PE linker
  1550. support additional command line options that are specific to the i386 PE
  1551. target. Options that take values may be separated from their values by
  1552. either a space or an equals sign.
  1553. '--add-stdcall-alias'
  1554. If given, symbols with a stdcall suffix (@NN) will be exported
  1555. as-is and also with the suffix stripped. [This option is specific
  1556. to the i386 PE targeted port of the linker]
  1557. '--base-file FILE'
  1558. Use FILE as the name of a file in which to save the base addresses
  1559. of all the relocations needed for generating DLLs with 'dlltool'.
  1560. [This is an i386 PE specific option]
  1561. '--dll'
  1562. Create a DLL instead of a regular executable. You may also use
  1563. '-shared' or specify a 'LIBRARY' in a given '.def' file. [This
  1564. option is specific to the i386 PE targeted port of the linker]
  1565. '--enable-long-section-names'
  1566. '--disable-long-section-names'
  1567. The PE variants of the COFF object format add an extension that
  1568. permits the use of section names longer than eight characters, the
  1569. normal limit for COFF. By default, these names are only allowed in
  1570. object files, as fully-linked executable images do not carry the
  1571. COFF string table required to support the longer names. As a GNU
  1572. extension, it is possible to allow their use in executable images
  1573. as well, or to (probably pointlessly!) disallow it in object
  1574. files, by using these two options. Executable images generated
  1575. with these long section names are slightly non-standard, carrying
  1576. as they do a string table, and may generate confusing output when
  1577. examined with non-GNU PE-aware tools, such as file viewers and
  1578. dumpers. However, GDB relies on the use of PE long section names
  1579. to find Dwarf-2 debug information sections in an executable image
  1580. at runtime, and so if neither option is specified on the
  1581. command-line, 'ld' will enable long section names, overriding the
  1582. default and technically correct behaviour, when it finds the
  1583. presence of debug information while linking an executable image and
  1584. not stripping symbols. [This option is valid for all PE targeted
  1585. ports of the linker]
  1586. '--enable-stdcall-fixup'
  1587. '--disable-stdcall-fixup'
  1588. If the link finds a symbol that it cannot resolve, it will attempt
  1589. to do "fuzzy linking" by looking for another defined symbol that
  1590. differs only in the format of the symbol name (cdecl vs stdcall)
  1591. and will resolve that symbol by linking to the match. For example,
  1592. the undefined symbol '_foo' might be linked to the function
  1593. '_foo@12', or the undefined symbol '_bar@16' might be linked to the
  1594. function '_bar'. When the linker does this, it prints a warning,
  1595. since it normally should have failed to link, but sometimes import
  1596. libraries generated from third-party dlls may need this feature to
  1597. be usable. If you specify '--enable-stdcall-fixup', this feature
  1598. is fully enabled and warnings are not printed. If you specify
  1599. '--disable-stdcall-fixup', this feature is disabled and such
  1600. mismatches are considered to be errors. [This option is specific
  1601. to the i386 PE targeted port of the linker]
  1602. '--leading-underscore'
  1603. '--no-leading-underscore'
  1604. For most targets default symbol-prefix is an underscore and is
  1605. defined in target's description. By this option it is possible to
  1606. disable/enable the default underscore symbol-prefix.
  1607. '--export-all-symbols'
  1608. If given, all global symbols in the objects used to build a DLL
  1609. will be exported by the DLL. Note that this is the default if there
  1610. otherwise wouldn't be any exported symbols. When symbols are
  1611. explicitly exported via DEF files or implicitly exported via
  1612. function attributes, the default is to not export anything else
  1613. unless this option is given. Note that the symbols 'DllMain@12',
  1614. 'DllEntryPoint@0', 'DllMainCRTStartup@12', and 'impure_ptr' will
  1615. not be automatically exported. Also, symbols imported from other
  1616. DLLs will not be re-exported, nor will symbols specifying the DLL's
  1617. internal layout such as those beginning with '_head_' or ending
  1618. with '_iname'. In addition, no symbols from 'libgcc', 'libstd++',
  1619. 'libmingw32', or 'crtX.o' will be exported. Symbols whose names
  1620. begin with '__rtti_' or '__builtin_' will not be exported, to help
  1621. with C++ DLLs. Finally, there is an extensive list of
  1622. cygwin-private symbols that are not exported (obviously, this
  1623. applies on when building DLLs for cygwin targets). These
  1624. cygwin-excludes are: '_cygwin_dll_entry@12',
  1625. '_cygwin_crt0_common@8', '_cygwin_noncygwin_dll_entry@12',
  1626. '_fmode', '_impure_ptr', 'cygwin_attach_dll', 'cygwin_premain0',
  1627. 'cygwin_premain1', 'cygwin_premain2', 'cygwin_premain3', and
  1628. 'environ'. [This option is specific to the i386 PE targeted port
  1629. of the linker]
  1630. '--exclude-symbols SYMBOL,SYMBOL,...'
  1631. Specifies a list of symbols which should not be automatically
  1632. exported. The symbol names may be delimited by commas or colons.
  1633. [This option is specific to the i386 PE targeted port of the
  1634. linker]
  1635. '--exclude-all-symbols'
  1636. Specifies no symbols should be automatically exported. [This
  1637. option is specific to the i386 PE targeted port of the linker]
  1638. '--file-alignment'
  1639. Specify the file alignment. Sections in the file will always begin
  1640. at file offsets which are multiples of this number. This defaults
  1641. to 512. [This option is specific to the i386 PE targeted port of
  1642. the linker]
  1643. '--heap RESERVE'
  1644. '--heap RESERVE,COMMIT'
  1645. Specify the number of bytes of memory to reserve (and optionally
  1646. commit) to be used as heap for this program. The default is 1MB
  1647. reserved, 4K committed. [This option is specific to the i386 PE
  1648. targeted port of the linker]
  1649. '--image-base VALUE'
  1650. Use VALUE as the base address of your program or dll. This is the
  1651. lowest memory location that will be used when your program or dll
  1652. is loaded. To reduce the need to relocate and improve performance
  1653. of your dlls, each should have a unique base address and not
  1654. overlap any other dlls. The default is 0x400000 for executables,
  1655. and 0x10000000 for dlls. [This option is specific to the i386 PE
  1656. targeted port of the linker]
  1657. '--kill-at'
  1658. If given, the stdcall suffixes (@NN) will be stripped from symbols
  1659. before they are exported. [This option is specific to the i386 PE
  1660. targeted port of the linker]
  1661. '--large-address-aware'
  1662. If given, the appropriate bit in the "Characteristics" field of the
  1663. COFF header is set to indicate that this executable supports
  1664. virtual addresses greater than 2 gigabytes. This should be used in
  1665. conjunction with the /3GB or /USERVA=VALUE megabytes switch in the
  1666. "[operating systems]" section of the BOOT.INI. Otherwise, this bit
  1667. has no effect. [This option is specific to PE targeted ports of
  1668. the linker]
  1669. '--disable-large-address-aware'
  1670. Reverts the effect of a previous '--large-address-aware' option.
  1671. This is useful if '--large-address-aware' is always set by the
  1672. compiler driver (e.g. Cygwin gcc) and the executable does not
  1673. support virtual addresses greater than 2 gigabytes. [This option
  1674. is specific to PE targeted ports of the linker]
  1675. '--major-image-version VALUE'
  1676. Sets the major number of the "image version". Defaults to 1.
  1677. [This option is specific to the i386 PE targeted port of the
  1678. linker]
  1679. '--major-os-version VALUE'
  1680. Sets the major number of the "os version". Defaults to 4. [This
  1681. option is specific to the i386 PE targeted port of the linker]
  1682. '--major-subsystem-version VALUE'
  1683. Sets the major number of the "subsystem version". Defaults to 4.
  1684. [This option is specific to the i386 PE targeted port of the
  1685. linker]
  1686. '--minor-image-version VALUE'
  1687. Sets the minor number of the "image version". Defaults to 0.
  1688. [This option is specific to the i386 PE targeted port of the
  1689. linker]
  1690. '--minor-os-version VALUE'
  1691. Sets the minor number of the "os version". Defaults to 0. [This
  1692. option is specific to the i386 PE targeted port of the linker]
  1693. '--minor-subsystem-version VALUE'
  1694. Sets the minor number of the "subsystem version". Defaults to 0.
  1695. [This option is specific to the i386 PE targeted port of the
  1696. linker]
  1697. '--output-def FILE'
  1698. The linker will create the file FILE which will contain a DEF file
  1699. corresponding to the DLL the linker is generating. This DEF file
  1700. (which should be called '*.def') may be used to create an import
  1701. library with 'dlltool' or may be used as a reference to
  1702. automatically or implicitly exported symbols. [This option is
  1703. specific to the i386 PE targeted port of the linker]
  1704. '--enable-auto-image-base'
  1705. '--enable-auto-image-base=VALUE'
  1706. Automatically choose the image base for DLLs, optionally starting
  1707. with base VALUE, unless one is specified using the '--image-base'
  1708. argument. By using a hash generated from the dllname to create
  1709. unique image bases for each DLL, in-memory collisions and
  1710. relocations which can delay program execution are avoided. [This
  1711. option is specific to the i386 PE targeted port of the linker]
  1712. '--disable-auto-image-base'
  1713. Do not automatically generate a unique image base. If there is no
  1714. user-specified image base ('--image-base') then use the platform
  1715. default. [This option is specific to the i386 PE targeted port of
  1716. the linker]
  1717. '--dll-search-prefix STRING'
  1718. When linking dynamically to a dll without an import library, search
  1719. for '<string><basename>.dll' in preference to 'lib<basename>.dll'.
  1720. This behaviour allows easy distinction between DLLs built for the
  1721. various "subplatforms": native, cygwin, uwin, pw, etc. For
  1722. instance, cygwin DLLs typically use '--dll-search-prefix=cyg'.
  1723. [This option is specific to the i386 PE targeted port of the
  1724. linker]
  1725. '--enable-auto-import'
  1726. Do sophisticated linking of '_symbol' to '__imp__symbol' for DATA
  1727. imports from DLLs, and create the necessary thunking symbols when
  1728. building the import libraries with those DATA exports. Note: Use
  1729. of the 'auto-import' extension will cause the text section of the
  1730. image file to be made writable. This does not conform to the
  1731. PE-COFF format specification published by Microsoft.
  1732. Note - use of the 'auto-import' extension will also cause read only
  1733. data which would normally be placed into the .rdata section to be
  1734. placed into the .data section instead. This is in order to work
  1735. around a problem with consts that is described here:
  1736. http://www.cygwin.com/ml/cygwin/2004-09/msg01101.html
  1737. Using 'auto-import' generally will 'just work' - but sometimes you
  1738. may see this message:
  1739. "variable '<var>' can't be auto-imported. Please read the
  1740. documentation for ld's '--enable-auto-import' for details."
  1741. This message occurs when some (sub)expression accesses an address
  1742. ultimately given by the sum of two constants (Win32 import tables
  1743. only allow one). Instances where this may occur include accesses
  1744. to member fields of struct variables imported from a DLL, as well
  1745. as using a constant index into an array variable imported from a
  1746. DLL. Any multiword variable (arrays, structs, long long, etc) may
  1747. trigger this error condition. However, regardless of the exact
  1748. data type of the offending exported variable, ld will always detect
  1749. it, issue the warning, and exit.
  1750. There are several ways to address this difficulty, regardless of
  1751. the data type of the exported variable:
  1752. One way is to use -enable-runtime-pseudo-reloc switch. This leaves
  1753. the task of adjusting references in your client code for runtime
  1754. environment, so this method works only when runtime environment
  1755. supports this feature.
  1756. A second solution is to force one of the 'constants' to be a
  1757. variable - that is, unknown and un-optimizable at compile time.
  1758. For arrays, there are two possibilities: a) make the indexee (the
  1759. array's address) a variable, or b) make the 'constant' index a
  1760. variable. Thus:
  1761. extern type extern_array[];
  1762. extern_array[1] -->
  1763. { volatile type *t=extern_array; t[1] }
  1764. or
  1765. extern type extern_array[];
  1766. extern_array[1] -->
  1767. { volatile int t=1; extern_array[t] }
  1768. For structs (and most other multiword data types) the only option
  1769. is to make the struct itself (or the long long, or the ...)
  1770. variable:
  1771. extern struct s extern_struct;
  1772. extern_struct.field -->
  1773. { volatile struct s *t=&extern_struct; t->field }
  1774. or
  1775. extern long long extern_ll;
  1776. extern_ll -->
  1777. { volatile long long * local_ll=&extern_ll; *local_ll }
  1778. A third method of dealing with this difficulty is to abandon
  1779. 'auto-import' for the offending symbol and mark it with
  1780. '__declspec(dllimport)'. However, in practice that requires using
  1781. compile-time #defines to indicate whether you are building a DLL,
  1782. building client code that will link to the DLL, or merely
  1783. building/linking to a static library. In making the choice between
  1784. the various methods of resolving the 'direct address with constant
  1785. offset' problem, you should consider typical real-world usage:
  1786. Original:
  1787. --foo.h
  1788. extern int arr[];
  1789. --foo.c
  1790. #include "foo.h"
  1791. void main(int argc, char **argv){
  1792. printf("%d\n",arr[1]);
  1793. }
  1794. Solution 1:
  1795. --foo.h
  1796. extern int arr[];
  1797. --foo.c
  1798. #include "foo.h"
  1799. void main(int argc, char **argv){
  1800. /* This workaround is for win32 and cygwin; do not "optimize" */
  1801. volatile int *parr = arr;
  1802. printf("%d\n",parr[1]);
  1803. }
  1804. Solution 2:
  1805. --foo.h
  1806. /* Note: auto-export is assumed (no __declspec(dllexport)) */
  1807. #if (defined(_WIN32) || defined(__CYGWIN__)) && \
  1808. !(defined(FOO_BUILD_DLL) || defined(FOO_STATIC))
  1809. #define FOO_IMPORT __declspec(dllimport)
  1810. #else
  1811. #define FOO_IMPORT
  1812. #endif
  1813. extern FOO_IMPORT int arr[];
  1814. --foo.c
  1815. #include "foo.h"
  1816. void main(int argc, char **argv){
  1817. printf("%d\n",arr[1]);
  1818. }
  1819. A fourth way to avoid this problem is to re-code your library to
  1820. use a functional interface rather than a data interface for the
  1821. offending variables (e.g. set_foo() and get_foo() accessor
  1822. functions). [This option is specific to the i386 PE targeted port
  1823. of the linker]
  1824. '--disable-auto-import'
  1825. Do not attempt to do sophisticated linking of '_symbol' to
  1826. '__imp__symbol' for DATA imports from DLLs. [This option is
  1827. specific to the i386 PE targeted port of the linker]
  1828. '--enable-runtime-pseudo-reloc'
  1829. If your code contains expressions described in -enable-auto-import
  1830. section, that is, DATA imports from DLL with non-zero offset, this
  1831. switch will create a vector of 'runtime pseudo relocations' which
  1832. can be used by runtime environment to adjust references to such
  1833. data in your client code. [This option is specific to the i386 PE
  1834. targeted port of the linker]
  1835. '--disable-runtime-pseudo-reloc'
  1836. Do not create pseudo relocations for non-zero offset DATA imports
  1837. from DLLs. [This option is specific to the i386 PE targeted port
  1838. of the linker]
  1839. '--enable-extra-pe-debug'
  1840. Show additional debug info related to auto-import symbol thunking.
  1841. [This option is specific to the i386 PE targeted port of the
  1842. linker]
  1843. '--section-alignment'
  1844. Sets the section alignment. Sections in memory will always begin
  1845. at addresses which are a multiple of this number. Defaults to
  1846. 0x1000. [This option is specific to the i386 PE targeted port of
  1847. the linker]
  1848. '--stack RESERVE'
  1849. '--stack RESERVE,COMMIT'
  1850. Specify the number of bytes of memory to reserve (and optionally
  1851. commit) to be used as stack for this program. The default is 2MB
  1852. reserved, 4K committed. [This option is specific to the i386 PE
  1853. targeted port of the linker]
  1854. '--subsystem WHICH'
  1855. '--subsystem WHICH:MAJOR'
  1856. '--subsystem WHICH:MAJOR.MINOR'
  1857. Specifies the subsystem under which your program will execute. The
  1858. legal values for WHICH are 'native', 'windows', 'console', 'posix',
  1859. and 'xbox'. You may optionally set the subsystem version also.
  1860. Numeric values are also accepted for WHICH. [This option is
  1861. specific to the i386 PE targeted port of the linker]
  1862. The following options set flags in the 'DllCharacteristics' field
  1863. of the PE file header: [These options are specific to PE targeted
  1864. ports of the linker]
  1865. '--high-entropy-va'
  1866. Image is compatible with 64-bit address space layout randomization
  1867. (ASLR).
  1868. '--dynamicbase'
  1869. The image base address may be relocated using address space layout
  1870. randomization (ASLR). This feature was introduced with MS Windows
  1871. Vista for i386 PE targets.
  1872. '--forceinteg'
  1873. Code integrity checks are enforced.
  1874. '--nxcompat'
  1875. The image is compatible with the Data Execution Prevention. This
  1876. feature was introduced with MS Windows XP SP2 for i386 PE targets.
  1877. '--no-isolation'
  1878. Although the image understands isolation, do not isolate the image.
  1879. '--no-seh'
  1880. The image does not use SEH. No SE handler may be called from this
  1881. image.
  1882. '--no-bind'
  1883. Do not bind this image.
  1884. '--wdmdriver'
  1885. The driver uses the MS Windows Driver Model.
  1886. '--tsaware'
  1887. The image is Terminal Server aware.
  1888. '--insert-timestamp'
  1889. '--no-insert-timestamp'
  1890. Insert a real timestamp into the image. This is the default
  1891. behaviour as it matches legacy code and it means that the image
  1892. will work with other, proprietary tools. The problem with this
  1893. default is that it will result in slightly different images being
  1894. produced each time the same sources are linked. The option
  1895. '--no-insert-timestamp' can be used to insert a zero value for the
  1896. timestamp, this ensuring that binaries produced from identical
  1897. sources will compare identically.
  1898. 2.1.2 Options specific to C6X uClinux targets
  1899. ---------------------------------------------
  1900. The C6X uClinux target uses a binary format called DSBT to support
  1901. shared libraries. Each shared library in the system needs to have a
  1902. unique index; all executables use an index of 0.
  1903. '--dsbt-size SIZE'
  1904. This option sets the number of entries in the DSBT of the current
  1905. executable or shared library to SIZE. The default is to create a
  1906. table with 64 entries.
  1907. '--dsbt-index INDEX'
  1908. This option sets the DSBT index of the current executable or shared
  1909. library to INDEX. The default is 0, which is appropriate for
  1910. generating executables. If a shared library is generated with a
  1911. DSBT index of 0, the 'R_C6000_DSBT_INDEX' relocs are copied into
  1912. the output file.
  1913. The '--no-merge-exidx-entries' switch disables the merging of
  1914. adjacent exidx entries in frame unwind info.
  1915. 2.1.3 Options specific to Motorola 68HC11 and 68HC12 targets
  1916. ------------------------------------------------------------
  1917. The 68HC11 and 68HC12 linkers support specific options to control the
  1918. memory bank switching mapping and trampoline code generation.
  1919. '--no-trampoline'
  1920. This option disables the generation of trampoline. By default a
  1921. trampoline is generated for each far function which is called using
  1922. a 'jsr' instruction (this happens when a pointer to a far function
  1923. is taken).
  1924. '--bank-window NAME'
  1925. This option indicates to the linker the name of the memory region
  1926. in the 'MEMORY' specification that describes the memory bank
  1927. window. The definition of such region is then used by the linker
  1928. to compute paging and addresses within the memory window.
  1929. 2.1.4 Options specific to Motorola 68K target
  1930. ---------------------------------------------
  1931. The following options are supported to control handling of GOT
  1932. generation when linking for 68K targets.
  1933. '--got=TYPE'
  1934. This option tells the linker which GOT generation scheme to use.
  1935. TYPE should be one of 'single', 'negative', 'multigot' or 'target'.
  1936. For more information refer to the Info entry for 'ld'.
  1937. 2.1.5 Options specific to MIPS targets
  1938. --------------------------------------
  1939. The following options are supported to control microMIPS instruction
  1940. generation and branch relocation checks for ISA mode transitions when
  1941. linking for MIPS targets.
  1942. '--insn32'
  1943. '--no-insn32'
  1944. These options control the choice of microMIPS instructions used in
  1945. code generated by the linker, such as that in the PLT or lazy
  1946. binding stubs, or in relaxation. If '--insn32' is used, then the
  1947. linker only uses 32-bit instruction encodings. By default or if
  1948. '--no-insn32' is used, all instruction encodings are used,
  1949. including 16-bit ones where possible.
  1950. '--ignore-branch-isa'
  1951. '--no-ignore-branch-isa'
  1952. These options control branch relocation checks for invalid ISA mode
  1953. transitions. If '--ignore-branch-isa' is used, then the linker
  1954. accepts any branch relocations and any ISA mode transition required
  1955. is lost in relocation calculation, except for some cases of 'BAL'
  1956. instructions which meet relaxation conditions and are converted to
  1957. equivalent 'JALX' instructions as the associated relocation is
  1958. calculated. By default or if '--no-ignore-branch-isa' is used a
  1959. check is made causing the loss of an ISA mode transition to produce
  1960. an error.
  1961. 
  1962. File: ld.info, Node: Environment, Prev: Options, Up: Invocation
  1963. 2.2 Environment Variables
  1964. =========================
  1965. You can change the behaviour of 'ld' with the environment variables
  1966. 'GNUTARGET', 'LDEMULATION' and 'COLLECT_NO_DEMANGLE'.
  1967. 'GNUTARGET' determines the input-file object format if you don't use
  1968. '-b' (or its synonym '--format'). Its value should be one of the BFD
  1969. names for an input format (*note BFD::). If there is no 'GNUTARGET' in
  1970. the environment, 'ld' uses the natural format of the target. If
  1971. 'GNUTARGET' is set to 'default' then BFD attempts to discover the input
  1972. format by examining binary input files; this method often succeeds, but
  1973. there are potential ambiguities, since there is no method of ensuring
  1974. that the magic number used to specify object-file formats is unique.
  1975. However, the configuration procedure for BFD on each system places the
  1976. conventional format for that system first in the search-list, so
  1977. ambiguities are resolved in favor of convention.
  1978. 'LDEMULATION' determines the default emulation if you don't use the
  1979. '-m' option. The emulation can affect various aspects of linker
  1980. behaviour, particularly the default linker script. You can list the
  1981. available emulations with the '--verbose' or '-V' options. If the '-m'
  1982. option is not used, and the 'LDEMULATION' environment variable is not
  1983. defined, the default emulation depends upon how the linker was
  1984. configured.
  1985. Normally, the linker will default to demangling symbols. However, if
  1986. 'COLLECT_NO_DEMANGLE' is set in the environment, then it will default to
  1987. not demangling symbols. This environment variable is used in a similar
  1988. fashion by the 'gcc' linker wrapper program. The default may be
  1989. overridden by the '--demangle' and '--no-demangle' options.
  1990. 
  1991. File: ld.info, Node: Scripts, Next: Machine Dependent, Prev: Invocation, Up: Top
  1992. 3 Linker Scripts
  1993. ****************
  1994. Every link is controlled by a "linker script". This script is written
  1995. in the linker command language.
  1996. The main purpose of the linker script is to describe how the sections
  1997. in the input files should be mapped into the output file, and to control
  1998. the memory layout of the output file. Most linker scripts do nothing
  1999. more than this. However, when necessary, the linker script can also
  2000. direct the linker to perform many other operations, using the commands
  2001. described below.
  2002. The linker always uses a linker script. If you do not supply one
  2003. yourself, the linker will use a default script that is compiled into the
  2004. linker executable. You can use the '--verbose' command line option to
  2005. display the default linker script. Certain command line options, such
  2006. as '-r' or '-N', will affect the default linker script.
  2007. You may supply your own linker script by using the '-T' command line
  2008. option. When you do this, your linker script will replace the default
  2009. linker script.
  2010. You may also use linker scripts implicitly by naming them as input
  2011. files to the linker, as though they were files to be linked. *Note
  2012. Implicit Linker Scripts::.
  2013. * Menu:
  2014. * Basic Script Concepts:: Basic Linker Script Concepts
  2015. * Script Format:: Linker Script Format
  2016. * Simple Example:: Simple Linker Script Example
  2017. * Simple Commands:: Simple Linker Script Commands
  2018. * Assignments:: Assigning Values to Symbols
  2019. * SECTIONS:: SECTIONS Command
  2020. * MEMORY:: MEMORY Command
  2021. * PHDRS:: PHDRS Command
  2022. * VERSION:: VERSION Command
  2023. * Expressions:: Expressions in Linker Scripts
  2024. * Implicit Linker Scripts:: Implicit Linker Scripts
  2025. 
  2026. File: ld.info, Node: Basic Script Concepts, Next: Script Format, Up: Scripts
  2027. 3.1 Basic Linker Script Concepts
  2028. ================================
  2029. We need to define some basic concepts and vocabulary in order to
  2030. describe the linker script language.
  2031. The linker combines input files into a single output file. The
  2032. output file and each input file are in a special data format known as an
  2033. "object file format". Each file is called an "object file". The output
  2034. file is often called an "executable", but for our purposes we will also
  2035. call it an object file. Each object file has, among other things, a
  2036. list of "sections". We sometimes refer to a section in an input file as
  2037. an "input section"; similarly, a section in the output file is an
  2038. "output section".
  2039. Each section in an object file has a name and a size. Most sections
  2040. also have an associated block of data, known as the "section contents".
  2041. A section may be marked as "loadable", which means that the contents
  2042. should be loaded into memory when the output file is run. A section
  2043. with no contents may be "allocatable", which means that an area in
  2044. memory should be set aside, but nothing in particular should be loaded
  2045. there (in some cases this memory must be zeroed out). A section which
  2046. is neither loadable nor allocatable typically contains some sort of
  2047. debugging information.
  2048. Every loadable or allocatable output section has two addresses. The
  2049. first is the "VMA", or virtual memory address. This is the address the
  2050. section will have when the output file is run. The second is the "LMA",
  2051. or load memory address. This is the address at which the section will
  2052. be loaded. In most cases the two addresses will be the same. An
  2053. example of when they might be different is when a data section is loaded
  2054. into ROM, and then copied into RAM when the program starts up (this
  2055. technique is often used to initialize global variables in a ROM based
  2056. system). In this case the ROM address would be the LMA, and the RAM
  2057. address would be the VMA.
  2058. You can see the sections in an object file by using the 'objdump'
  2059. program with the '-h' option.
  2060. Every object file also has a list of "symbols", known as the "symbol
  2061. table". A symbol may be defined or undefined. Each symbol has a name,
  2062. and each defined symbol has an address, among other information. If you
  2063. compile a C or C++ program into an object file, you will get a defined
  2064. symbol for every defined function and global or static variable. Every
  2065. undefined function or global variable which is referenced in the input
  2066. file will become an undefined symbol.
  2067. You can see the symbols in an object file by using the 'nm' program,
  2068. or by using the 'objdump' program with the '-t' option.
  2069. 
  2070. File: ld.info, Node: Script Format, Next: Simple Example, Prev: Basic Script Concepts, Up: Scripts
  2071. 3.2 Linker Script Format
  2072. ========================
  2073. Linker scripts are text files.
  2074. You write a linker script as a series of commands. Each command is
  2075. either a keyword, possibly followed by arguments, or an assignment to a
  2076. symbol. You may separate commands using semicolons. Whitespace is
  2077. generally ignored.
  2078. Strings such as file or format names can normally be entered
  2079. directly. If the file name contains a character such as a comma which
  2080. would otherwise serve to separate file names, you may put the file name
  2081. in double quotes. There is no way to use a double quote character in a
  2082. file name.
  2083. You may include comments in linker scripts just as in C, delimited by
  2084. '/*' and '*/'. As in C, comments are syntactically equivalent to
  2085. whitespace.
  2086. 
  2087. File: ld.info, Node: Simple Example, Next: Simple Commands, Prev: Script Format, Up: Scripts
  2088. 3.3 Simple Linker Script Example
  2089. ================================
  2090. Many linker scripts are fairly simple.
  2091. The simplest possible linker script has just one command: 'SECTIONS'.
  2092. You use the 'SECTIONS' command to describe the memory layout of the
  2093. output file.
  2094. The 'SECTIONS' command is a powerful command. Here we will describe
  2095. a simple use of it. Let's assume your program consists only of code,
  2096. initialized data, and uninitialized data. These will be in the '.text',
  2097. '.data', and '.bss' sections, respectively. Let's assume further that
  2098. these are the only sections which appear in your input files.
  2099. For this example, let's say that the code should be loaded at address
  2100. 0x10000, and that the data should start at address 0x8000000. Here is a
  2101. linker script which will do that:
  2102. SECTIONS
  2103. {
  2104. . = 0x10000;
  2105. .text : { *(.text) }
  2106. . = 0x8000000;
  2107. .data : { *(.data) }
  2108. .bss : { *(.bss) }
  2109. }
  2110. You write the 'SECTIONS' command as the keyword 'SECTIONS', followed
  2111. by a series of symbol assignments and output section descriptions
  2112. enclosed in curly braces.
  2113. The first line inside the 'SECTIONS' command of the above example
  2114. sets the value of the special symbol '.', which is the location counter.
  2115. If you do not specify the address of an output section in some other way
  2116. (other ways are described later), the address is set from the current
  2117. value of the location counter. The location counter is then incremented
  2118. by the size of the output section. At the start of the 'SECTIONS'
  2119. command, the location counter has the value '0'.
  2120. The second line defines an output section, '.text'. The colon is
  2121. required syntax which may be ignored for now. Within the curly braces
  2122. after the output section name, you list the names of the input sections
  2123. which should be placed into this output section. The '*' is a wildcard
  2124. which matches any file name. The expression '*(.text)' means all
  2125. '.text' input sections in all input files.
  2126. Since the location counter is '0x10000' when the output section
  2127. '.text' is defined, the linker will set the address of the '.text'
  2128. section in the output file to be '0x10000'.
  2129. The remaining lines define the '.data' and '.bss' sections in the
  2130. output file. The linker will place the '.data' output section at
  2131. address '0x8000000'. After the linker places the '.data' output
  2132. section, the value of the location counter will be '0x8000000' plus the
  2133. size of the '.data' output section. The effect is that the linker will
  2134. place the '.bss' output section immediately after the '.data' output
  2135. section in memory.
  2136. The linker will ensure that each output section has the required
  2137. alignment, by increasing the location counter if necessary. In this
  2138. example, the specified addresses for the '.text' and '.data' sections
  2139. will probably satisfy any alignment constraints, but the linker may have
  2140. to create a small gap between the '.data' and '.bss' sections.
  2141. That's it! That's a simple and complete linker script.
  2142. 
  2143. File: ld.info, Node: Simple Commands, Next: Assignments, Prev: Simple Example, Up: Scripts
  2144. 3.4 Simple Linker Script Commands
  2145. =================================
  2146. In this section we describe the simple linker script commands.
  2147. * Menu:
  2148. * Entry Point:: Setting the entry point
  2149. * File Commands:: Commands dealing with files
  2150. * Format Commands:: Commands dealing with object file formats
  2151. * REGION_ALIAS:: Assign alias names to memory regions
  2152. * Miscellaneous Commands:: Other linker script commands
  2153. 
  2154. File: ld.info, Node: Entry Point, Next: File Commands, Up: Simple Commands
  2155. 3.4.1 Setting the Entry Point
  2156. -----------------------------
  2157. The first instruction to execute in a program is called the "entry
  2158. point". You can use the 'ENTRY' linker script command to set the entry
  2159. point. The argument is a symbol name:
  2160. ENTRY(SYMBOL)
  2161. There are several ways to set the entry point. The linker will set
  2162. the entry point by trying each of the following methods in order, and
  2163. stopping when one of them succeeds:
  2164. * the '-e' ENTRY command-line option;
  2165. * the 'ENTRY(SYMBOL)' command in a linker script;
  2166. * the value of a target specific symbol, if it is defined; For many
  2167. targets this is 'start', but PE and BeOS based systems for example
  2168. check a list of possible entry symbols, matching the first one
  2169. found.
  2170. * the address of the first byte of the '.text' section, if present;
  2171. * The address '0'.
  2172. 
  2173. File: ld.info, Node: File Commands, Next: Format Commands, Prev: Entry Point, Up: Simple Commands
  2174. 3.4.2 Commands Dealing with Files
  2175. ---------------------------------
  2176. Several linker script commands deal with files.
  2177. 'INCLUDE FILENAME'
  2178. Include the linker script FILENAME at this point. The file will be
  2179. searched for in the current directory, and in any directory
  2180. specified with the '-L' option. You can nest calls to 'INCLUDE' up
  2181. to 10 levels deep.
  2182. You can place 'INCLUDE' directives at the top level, in 'MEMORY' or
  2183. 'SECTIONS' commands, or in output section descriptions.
  2184. 'INPUT(FILE, FILE, ...)'
  2185. 'INPUT(FILE FILE ...)'
  2186. The 'INPUT' command directs the linker to include the named files
  2187. in the link, as though they were named on the command line.
  2188. For example, if you always want to include 'subr.o' any time you do
  2189. a link, but you can't be bothered to put it on every link command
  2190. line, then you can put 'INPUT (subr.o)' in your linker script.
  2191. In fact, if you like, you can list all of your input files in the
  2192. linker script, and then invoke the linker with nothing but a '-T'
  2193. option.
  2194. In case a "sysroot prefix" is configured, and the filename starts
  2195. with the '/' character, and the script being processed was located
  2196. inside the "sysroot prefix", the filename will be looked for in the
  2197. "sysroot prefix". Otherwise, the linker will try to open the file
  2198. in the current directory. If it is not found, the linker will
  2199. search through the archive library search path. The "sysroot
  2200. prefix" can also be forced by specifying '=' as the first character
  2201. in the filename path. See also the description of '-L' in *note
  2202. Command Line Options: Options.
  2203. If you use 'INPUT (-lFILE)', 'ld' will transform the name to
  2204. 'libFILE.a', as with the command line argument '-l'.
  2205. When you use the 'INPUT' command in an implicit linker script, the
  2206. files will be included in the link at the point at which the linker
  2207. script file is included. This can affect archive searching.
  2208. 'GROUP(FILE, FILE, ...)'
  2209. 'GROUP(FILE FILE ...)'
  2210. The 'GROUP' command is like 'INPUT', except that the named files
  2211. should all be archives, and they are searched repeatedly until no
  2212. new undefined references are created. See the description of '-('
  2213. in *note Command Line Options: Options.
  2214. 'AS_NEEDED(FILE, FILE, ...)'
  2215. 'AS_NEEDED(FILE FILE ...)'
  2216. This construct can appear only inside of the 'INPUT' or 'GROUP'
  2217. commands, among other filenames. The files listed will be handled
  2218. as if they appear directly in the 'INPUT' or 'GROUP' commands, with
  2219. the exception of ELF shared libraries, that will be added only when
  2220. they are actually needed. This construct essentially enables
  2221. '--as-needed' option for all the files listed inside of it and
  2222. restores previous '--as-needed' resp. '--no-as-needed' setting
  2223. afterwards.
  2224. 'OUTPUT(FILENAME)'
  2225. The 'OUTPUT' command names the output file. Using
  2226. 'OUTPUT(FILENAME)' in the linker script is exactly like using '-o
  2227. FILENAME' on the command line (*note Command Line Options:
  2228. Options.). If both are used, the command line option takes
  2229. precedence.
  2230. You can use the 'OUTPUT' command to define a default name for the
  2231. output file other than the usual default of 'a.out'.
  2232. 'SEARCH_DIR(PATH)'
  2233. The 'SEARCH_DIR' command adds PATH to the list of paths where 'ld'
  2234. looks for archive libraries. Using 'SEARCH_DIR(PATH)' is exactly
  2235. like using '-L PATH' on the command line (*note Command Line
  2236. Options: Options.). If both are used, then the linker will search
  2237. both paths. Paths specified using the command line option are
  2238. searched first.
  2239. 'STARTUP(FILENAME)'
  2240. The 'STARTUP' command is just like the 'INPUT' command, except that
  2241. FILENAME will become the first input file to be linked, as though
  2242. it were specified first on the command line. This may be useful
  2243. when using a system in which the entry point is always the start of
  2244. the first file.
  2245. 
  2246. File: ld.info, Node: Format Commands, Next: REGION_ALIAS, Prev: File Commands, Up: Simple Commands
  2247. 3.4.3 Commands Dealing with Object File Formats
  2248. -----------------------------------------------
  2249. A couple of linker script commands deal with object file formats.
  2250. 'OUTPUT_FORMAT(BFDNAME)'
  2251. 'OUTPUT_FORMAT(DEFAULT, BIG, LITTLE)'
  2252. The 'OUTPUT_FORMAT' command names the BFD format to use for the
  2253. output file (*note BFD::). Using 'OUTPUT_FORMAT(BFDNAME)' is
  2254. exactly like using '--oformat BFDNAME' on the command line (*note
  2255. Command Line Options: Options.). If both are used, the command
  2256. line option takes precedence.
  2257. You can use 'OUTPUT_FORMAT' with three arguments to use different
  2258. formats based on the '-EB' and '-EL' command line options. This
  2259. permits the linker script to set the output format based on the
  2260. desired endianness.
  2261. If neither '-EB' nor '-EL' are used, then the output format will be
  2262. the first argument, DEFAULT. If '-EB' is used, the output format
  2263. will be the second argument, BIG. If '-EL' is used, the output
  2264. format will be the third argument, LITTLE.
  2265. For example, the default linker script for the MIPS ELF target uses
  2266. this command:
  2267. OUTPUT_FORMAT(elf32-bigmips, elf32-bigmips, elf32-littlemips)
  2268. This says that the default format for the output file is
  2269. 'elf32-bigmips', but if the user uses the '-EL' command line
  2270. option, the output file will be created in the 'elf32-littlemips'
  2271. format.
  2272. 'TARGET(BFDNAME)'
  2273. The 'TARGET' command names the BFD format to use when reading input
  2274. files. It affects subsequent 'INPUT' and 'GROUP' commands. This
  2275. command is like using '-b BFDNAME' on the command line (*note
  2276. Command Line Options: Options.). If the 'TARGET' command is used
  2277. but 'OUTPUT_FORMAT' is not, then the last 'TARGET' command is also
  2278. used to set the format for the output file. *Note BFD::.
  2279. 
  2280. File: ld.info, Node: REGION_ALIAS, Next: Miscellaneous Commands, Prev: Format Commands, Up: Simple Commands
  2281. 3.4.4 Assign alias names to memory regions
  2282. ------------------------------------------
  2283. Alias names can be added to existing memory regions created with the
  2284. *note MEMORY:: command. Each name corresponds to at most one memory
  2285. region.
  2286. REGION_ALIAS(ALIAS, REGION)
  2287. The 'REGION_ALIAS' function creates an alias name ALIAS for the
  2288. memory region REGION. This allows a flexible mapping of output sections
  2289. to memory regions. An example follows.
  2290. Suppose we have an application for embedded systems which come with
  2291. various memory storage devices. All have a general purpose, volatile
  2292. memory 'RAM' that allows code execution or data storage. Some may have
  2293. a read-only, non-volatile memory 'ROM' that allows code execution and
  2294. read-only data access. The last variant is a read-only, non-volatile
  2295. memory 'ROM2' with read-only data access and no code execution
  2296. capability. We have four output sections:
  2297. * '.text' program code;
  2298. * '.rodata' read-only data;
  2299. * '.data' read-write initialized data;
  2300. * '.bss' read-write zero initialized data.
  2301. The goal is to provide a linker command file that contains a system
  2302. independent part defining the output sections and a system dependent
  2303. part mapping the output sections to the memory regions available on the
  2304. system. Our embedded systems come with three different memory setups
  2305. 'A', 'B' and 'C':
  2306. Section Variant A Variant B Variant C
  2307. .text RAM ROM ROM
  2308. .rodata RAM ROM ROM2
  2309. .data RAM RAM/ROM RAM/ROM2
  2310. .bss RAM RAM RAM
  2311. The notation 'RAM/ROM' or 'RAM/ROM2' means that this section is
  2312. loaded into region 'ROM' or 'ROM2' respectively. Please note that the
  2313. load address of the '.data' section starts in all three variants at the
  2314. end of the '.rodata' section.
  2315. The base linker script that deals with the output sections follows.
  2316. It includes the system dependent 'linkcmds.memory' file that describes
  2317. the memory layout:
  2318. INCLUDE linkcmds.memory
  2319. SECTIONS
  2320. {
  2321. .text :
  2322. {
  2323. *(.text)
  2324. } > REGION_TEXT
  2325. .rodata :
  2326. {
  2327. *(.rodata)
  2328. rodata_end = .;
  2329. } > REGION_RODATA
  2330. .data : AT (rodata_end)
  2331. {
  2332. data_start = .;
  2333. *(.data)
  2334. } > REGION_DATA
  2335. data_size = SIZEOF(.data);
  2336. data_load_start = LOADADDR(.data);
  2337. .bss :
  2338. {
  2339. *(.bss)
  2340. } > REGION_BSS
  2341. }
  2342. Now we need three different 'linkcmds.memory' files to define memory
  2343. regions and alias names. The content of 'linkcmds.memory' for the three
  2344. variants 'A', 'B' and 'C':
  2345. 'A'
  2346. Here everything goes into the 'RAM'.
  2347. MEMORY
  2348. {
  2349. RAM : ORIGIN = 0, LENGTH = 4M
  2350. }
  2351. REGION_ALIAS("REGION_TEXT", RAM);
  2352. REGION_ALIAS("REGION_RODATA", RAM);
  2353. REGION_ALIAS("REGION_DATA", RAM);
  2354. REGION_ALIAS("REGION_BSS", RAM);
  2355. 'B'
  2356. Program code and read-only data go into the 'ROM'. Read-write data
  2357. goes into the 'RAM'. An image of the initialized data is loaded
  2358. into the 'ROM' and will be copied during system start into the
  2359. 'RAM'.
  2360. MEMORY
  2361. {
  2362. ROM : ORIGIN = 0, LENGTH = 3M
  2363. RAM : ORIGIN = 0x10000000, LENGTH = 1M
  2364. }
  2365. REGION_ALIAS("REGION_TEXT", ROM);
  2366. REGION_ALIAS("REGION_RODATA", ROM);
  2367. REGION_ALIAS("REGION_DATA", RAM);
  2368. REGION_ALIAS("REGION_BSS", RAM);
  2369. 'C'
  2370. Program code goes into the 'ROM'. Read-only data goes into the
  2371. 'ROM2'. Read-write data goes into the 'RAM'. An image of the
  2372. initialized data is loaded into the 'ROM2' and will be copied
  2373. during system start into the 'RAM'.
  2374. MEMORY
  2375. {
  2376. ROM : ORIGIN = 0, LENGTH = 2M
  2377. ROM2 : ORIGIN = 0x10000000, LENGTH = 1M
  2378. RAM : ORIGIN = 0x20000000, LENGTH = 1M
  2379. }
  2380. REGION_ALIAS("REGION_TEXT", ROM);
  2381. REGION_ALIAS("REGION_RODATA", ROM2);
  2382. REGION_ALIAS("REGION_DATA", RAM);
  2383. REGION_ALIAS("REGION_BSS", RAM);
  2384. It is possible to write a common system initialization routine to
  2385. copy the '.data' section from 'ROM' or 'ROM2' into the 'RAM' if
  2386. necessary:
  2387. #include <string.h>
  2388. extern char data_start [];
  2389. extern char data_size [];
  2390. extern char data_load_start [];
  2391. void copy_data(void)
  2392. {
  2393. if (data_start != data_load_start)
  2394. {
  2395. memcpy(data_start, data_load_start, (size_t) data_size);
  2396. }
  2397. }
  2398. 
  2399. File: ld.info, Node: Miscellaneous Commands, Prev: REGION_ALIAS, Up: Simple Commands
  2400. 3.4.5 Other Linker Script Commands
  2401. ----------------------------------
  2402. There are a few other linker scripts commands.
  2403. 'ASSERT(EXP, MESSAGE)'
  2404. Ensure that EXP is non-zero. If it is zero, then exit the linker
  2405. with an error code, and print MESSAGE.
  2406. Note that assertions are checked before the final stages of linking
  2407. take place. This means that expressions involving symbols PROVIDEd
  2408. inside section definitions will fail if the user has not set values
  2409. for those symbols. The only exception to this rule is PROVIDEd
  2410. symbols that just reference dot. Thus an assertion like this:
  2411. .stack :
  2412. {
  2413. PROVIDE (__stack = .);
  2414. PROVIDE (__stack_size = 0x100);
  2415. ASSERT ((__stack > (_end + __stack_size)), "Error: No room left for the stack");
  2416. }
  2417. will fail if '__stack_size' is not defined elsewhere. Symbols
  2418. PROVIDEd outside of section definitions are evaluated earlier, so
  2419. they can be used inside ASSERTions. Thus:
  2420. PROVIDE (__stack_size = 0x100);
  2421. .stack :
  2422. {
  2423. PROVIDE (__stack = .);
  2424. ASSERT ((__stack > (_end + __stack_size)), "Error: No room left for the stack");
  2425. }
  2426. will work.
  2427. 'EXTERN(SYMBOL SYMBOL ...)'
  2428. Force SYMBOL to be entered in the output file as an undefined
  2429. symbol. Doing this may, for example, trigger linking of additional
  2430. modules from standard libraries. You may list several SYMBOLs for
  2431. each 'EXTERN', and you may use 'EXTERN' multiple times. This
  2432. command has the same effect as the '-u' command-line option.
  2433. 'FORCE_COMMON_ALLOCATION'
  2434. This command has the same effect as the '-d' command-line option:
  2435. to make 'ld' assign space to common symbols even if a relocatable
  2436. output file is specified ('-r').
  2437. 'INHIBIT_COMMON_ALLOCATION'
  2438. This command has the same effect as the '--no-define-common'
  2439. command-line option: to make 'ld' omit the assignment of addresses
  2440. to common symbols even for a non-relocatable output file.
  2441. 'INSERT [ AFTER | BEFORE ] OUTPUT_SECTION'
  2442. This command is typically used in a script specified by '-T' to
  2443. augment the default 'SECTIONS' with, for example, overlays. It
  2444. inserts all prior linker script statements after (or before)
  2445. OUTPUT_SECTION, and also causes '-T' to not override the default
  2446. linker script. The exact insertion point is as for orphan
  2447. sections. *Note Location Counter::. The insertion happens after
  2448. the linker has mapped input sections to output sections. Prior to
  2449. the insertion, since '-T' scripts are parsed before the default
  2450. linker script, statements in the '-T' script occur before the
  2451. default linker script statements in the internal linker
  2452. representation of the script. In particular, input section
  2453. assignments will be made to '-T' output sections before those in
  2454. the default script. Here is an example of how a '-T' script using
  2455. 'INSERT' might look:
  2456. SECTIONS
  2457. {
  2458. OVERLAY :
  2459. {
  2460. .ov1 { ov1*(.text) }
  2461. .ov2 { ov2*(.text) }
  2462. }
  2463. }
  2464. INSERT AFTER .text;
  2465. 'NOCROSSREFS(SECTION SECTION ...)'
  2466. This command may be used to tell 'ld' to issue an error about any
  2467. references among certain output sections.
  2468. In certain types of programs, particularly on embedded systems when
  2469. using overlays, when one section is loaded into memory, another
  2470. section will not be. Any direct references between the two
  2471. sections would be errors. For example, it would be an error if
  2472. code in one section called a function defined in the other section.
  2473. The 'NOCROSSREFS' command takes a list of output section names. If
  2474. 'ld' detects any cross references between the sections, it reports
  2475. an error and returns a non-zero exit status. Note that the
  2476. 'NOCROSSREFS' command uses output section names, not input section
  2477. names.
  2478. 'NOCROSSREFS_TO(TOSECTION FROMSECTION ...)'
  2479. This command may be used to tell 'ld' to issue an error about any
  2480. references to one section from a list of other sections.
  2481. The 'NOCROSSREFS' command is useful when ensuring that two or more
  2482. output sections are entirely independent but there are situations
  2483. where a one-way dependency is needed. For example, in a multi-core
  2484. application there may be shared code that can be called from each
  2485. core but for safety must never call back.
  2486. The 'NOCROSSREFS_TO' command takes a list of output section names.
  2487. The first section can not be referenced from any of the other
  2488. sections. If 'ld' detects any references to the first section from
  2489. any of the other sections, it reports an error and returns a
  2490. non-zero exit status. Note that the 'NOCROSSREFS_TO' command uses
  2491. output section names, not input section names.
  2492. 'OUTPUT_ARCH(BFDARCH)'
  2493. Specify a particular output machine architecture. The argument is
  2494. one of the names used by the BFD library (*note BFD::). You can
  2495. see the architecture of an object file by using the 'objdump'
  2496. program with the '-f' option.
  2497. 'LD_FEATURE(STRING)'
  2498. This command may be used to modify 'ld' behavior. If STRING is
  2499. '"SANE_EXPR"' then absolute symbols and numbers in a script are
  2500. simply treated as numbers everywhere. *Note Expression Section::.
  2501. 
  2502. File: ld.info, Node: Assignments, Next: SECTIONS, Prev: Simple Commands, Up: Scripts
  2503. 3.5 Assigning Values to Symbols
  2504. ===============================
  2505. You may assign a value to a symbol in a linker script. This will define
  2506. the symbol and place it into the symbol table with a global scope.
  2507. * Menu:
  2508. * Simple Assignments:: Simple Assignments
  2509. * HIDDEN:: HIDDEN
  2510. * PROVIDE:: PROVIDE
  2511. * PROVIDE_HIDDEN:: PROVIDE_HIDDEN
  2512. * Source Code Reference:: How to use a linker script defined symbol in source code
  2513. 
  2514. File: ld.info, Node: Simple Assignments, Next: HIDDEN, Up: Assignments
  2515. 3.5.1 Simple Assignments
  2516. ------------------------
  2517. You may assign to a symbol using any of the C assignment operators:
  2518. 'SYMBOL = EXPRESSION ;'
  2519. 'SYMBOL += EXPRESSION ;'
  2520. 'SYMBOL -= EXPRESSION ;'
  2521. 'SYMBOL *= EXPRESSION ;'
  2522. 'SYMBOL /= EXPRESSION ;'
  2523. 'SYMBOL <<= EXPRESSION ;'
  2524. 'SYMBOL >>= EXPRESSION ;'
  2525. 'SYMBOL &= EXPRESSION ;'
  2526. 'SYMBOL |= EXPRESSION ;'
  2527. The first case will define SYMBOL to the value of EXPRESSION. In the
  2528. other cases, SYMBOL must already be defined, and the value will be
  2529. adjusted accordingly.
  2530. The special symbol name '.' indicates the location counter. You may
  2531. only use this within a 'SECTIONS' command. *Note Location Counter::.
  2532. The semicolon after EXPRESSION is required.
  2533. Expressions are defined below; see *note Expressions::.
  2534. You may write symbol assignments as commands in their own right, or
  2535. as statements within a 'SECTIONS' command, or as part of an output
  2536. section description in a 'SECTIONS' command.
  2537. The section of the symbol will be set from the section of the
  2538. expression; for more information, see *note Expression Section::.
  2539. Here is an example showing the three different places that symbol
  2540. assignments may be used:
  2541. floating_point = 0;
  2542. SECTIONS
  2543. {
  2544. .text :
  2545. {
  2546. *(.text)
  2547. _etext = .;
  2548. }
  2549. _bdata = (. + 3) & ~ 3;
  2550. .data : { *(.data) }
  2551. }
  2552. In this example, the symbol 'floating_point' will be defined as zero.
  2553. The symbol '_etext' will be defined as the address following the last
  2554. '.text' input section. The symbol '_bdata' will be defined as the
  2555. address following the '.text' output section aligned upward to a 4 byte
  2556. boundary.
  2557. 
  2558. File: ld.info, Node: HIDDEN, Next: PROVIDE, Prev: Simple Assignments, Up: Assignments
  2559. 3.5.2 HIDDEN
  2560. ------------
  2561. For ELF targeted ports, define a symbol that will be hidden and won't be
  2562. exported. The syntax is 'HIDDEN(SYMBOL = EXPRESSION)'.
  2563. Here is the example from *note Simple Assignments::, rewritten to use
  2564. 'HIDDEN':
  2565. HIDDEN(floating_point = 0);
  2566. SECTIONS
  2567. {
  2568. .text :
  2569. {
  2570. *(.text)
  2571. HIDDEN(_etext = .);
  2572. }
  2573. HIDDEN(_bdata = (. + 3) & ~ 3);
  2574. .data : { *(.data) }
  2575. }
  2576. In this case none of the three symbols will be visible outside this
  2577. module.
  2578. 
  2579. File: ld.info, Node: PROVIDE, Next: PROVIDE_HIDDEN, Prev: HIDDEN, Up: Assignments
  2580. 3.5.3 PROVIDE
  2581. -------------
  2582. In some cases, it is desirable for a linker script to define a symbol
  2583. only if it is referenced and is not defined by any object included in
  2584. the link. For example, traditional linkers defined the symbol 'etext'.
  2585. However, ANSI C requires that the user be able to use 'etext' as a
  2586. function name without encountering an error. The 'PROVIDE' keyword may
  2587. be used to define a symbol, such as 'etext', only if it is referenced
  2588. but not defined. The syntax is 'PROVIDE(SYMBOL = EXPRESSION)'.
  2589. Here is an example of using 'PROVIDE' to define 'etext':
  2590. SECTIONS
  2591. {
  2592. .text :
  2593. {
  2594. *(.text)
  2595. _etext = .;
  2596. PROVIDE(etext = .);
  2597. }
  2598. }
  2599. In this example, if the program defines '_etext' (with a leading
  2600. underscore), the linker will give a multiple definition error. If, on
  2601. the other hand, the program defines 'etext' (with no leading
  2602. underscore), the linker will silently use the definition in the program.
  2603. If the program references 'etext' but does not define it, the linker
  2604. will use the definition in the linker script.
  2605. 
  2606. File: ld.info, Node: PROVIDE_HIDDEN, Next: Source Code Reference, Prev: PROVIDE, Up: Assignments
  2607. 3.5.4 PROVIDE_HIDDEN
  2608. --------------------
  2609. Similar to 'PROVIDE'. For ELF targeted ports, the symbol will be hidden
  2610. and won't be exported.
  2611. 
  2612. File: ld.info, Node: Source Code Reference, Prev: PROVIDE_HIDDEN, Up: Assignments
  2613. 3.5.5 Source Code Reference
  2614. ---------------------------
  2615. Accessing a linker script defined variable from source code is not
  2616. intuitive. In particular a linker script symbol is not equivalent to a
  2617. variable declaration in a high level language, it is instead a symbol
  2618. that does not have a value.
  2619. Before going further, it is important to note that compilers often
  2620. transform names in the source code into different names when they are
  2621. stored in the symbol table. For example, Fortran compilers commonly
  2622. prepend or append an underscore, and C++ performs extensive 'name
  2623. mangling'. Therefore there might be a discrepancy between the name of a
  2624. variable as it is used in source code and the name of the same variable
  2625. as it is defined in a linker script. For example in C a linker script
  2626. variable might be referred to as:
  2627. extern int foo;
  2628. But in the linker script it might be defined as:
  2629. _foo = 1000;
  2630. In the remaining examples however it is assumed that no name
  2631. transformation has taken place.
  2632. When a symbol is declared in a high level language such as C, two
  2633. things happen. The first is that the compiler reserves enough space in
  2634. the program's memory to hold the _value_ of the symbol. The second is
  2635. that the compiler creates an entry in the program's symbol table which
  2636. holds the symbol's _address_. ie the symbol table contains the address
  2637. of the block of memory holding the symbol's value. So for example the
  2638. following C declaration, at file scope:
  2639. int foo = 1000;
  2640. creates an entry called 'foo' in the symbol table. This entry holds
  2641. the address of an 'int' sized block of memory where the number 1000 is
  2642. initially stored.
  2643. When a program references a symbol the compiler generates code that
  2644. first accesses the symbol table to find the address of the symbol's
  2645. memory block and then code to read the value from that memory block.
  2646. So:
  2647. foo = 1;
  2648. looks up the symbol 'foo' in the symbol table, gets the address
  2649. associated with this symbol and then writes the value 1 into that
  2650. address. Whereas:
  2651. int * a = & foo;
  2652. looks up the symbol 'foo' in the symbol table, gets its address and
  2653. then copies this address into the block of memory associated with the
  2654. variable 'a'.
  2655. Linker scripts symbol declarations, by contrast, create an entry in
  2656. the symbol table but do not assign any memory to them. Thus they are an
  2657. address without a value. So for example the linker script definition:
  2658. foo = 1000;
  2659. creates an entry in the symbol table called 'foo' which holds the
  2660. address of memory location 1000, but nothing special is stored at
  2661. address 1000. This means that you cannot access the _value_ of a linker
  2662. script defined symbol - it has no value - all you can do is access the
  2663. _address_ of a linker script defined symbol.
  2664. Hence when you are using a linker script defined symbol in source
  2665. code you should always take the address of the symbol, and never attempt
  2666. to use its value. For example suppose you want to copy the contents of
  2667. a section of memory called .ROM into a section called .FLASH and the
  2668. linker script contains these declarations:
  2669. start_of_ROM = .ROM;
  2670. end_of_ROM = .ROM + sizeof (.ROM);
  2671. start_of_FLASH = .FLASH;
  2672. Then the C source code to perform the copy would be:
  2673. extern char start_of_ROM, end_of_ROM, start_of_FLASH;
  2674. memcpy (& start_of_FLASH, & start_of_ROM, & end_of_ROM - & start_of_ROM);
  2675. Note the use of the '&' operators. These are correct. Alternatively
  2676. the symbols can be treated as the names of vectors or arrays and then
  2677. the code will again work as expected:
  2678. extern char start_of_ROM[], end_of_ROM[], start_of_FLASH[];
  2679. memcpy (start_of_FLASH, start_of_ROM, end_of_ROM - start_of_ROM);
  2680. Note how using this method does not require the use of '&' operators.
  2681. 
  2682. File: ld.info, Node: SECTIONS, Next: MEMORY, Prev: Assignments, Up: Scripts
  2683. 3.6 SECTIONS Command
  2684. ====================
  2685. The 'SECTIONS' command tells the linker how to map input sections into
  2686. output sections, and how to place the output sections in memory.
  2687. The format of the 'SECTIONS' command is:
  2688. SECTIONS
  2689. {
  2690. SECTIONS-COMMAND
  2691. SECTIONS-COMMAND
  2692. ...
  2693. }
  2694. Each SECTIONS-COMMAND may of be one of the following:
  2695. * an 'ENTRY' command (*note Entry command: Entry Point.)
  2696. * a symbol assignment (*note Assignments::)
  2697. * an output section description
  2698. * an overlay description
  2699. The 'ENTRY' command and symbol assignments are permitted inside the
  2700. 'SECTIONS' command for convenience in using the location counter in
  2701. those commands. This can also make the linker script easier to
  2702. understand because you can use those commands at meaningful points in
  2703. the layout of the output file.
  2704. Output section descriptions and overlay descriptions are described
  2705. below.
  2706. If you do not use a 'SECTIONS' command in your linker script, the
  2707. linker will place each input section into an identically named output
  2708. section in the order that the sections are first encountered in the
  2709. input files. If all input sections are present in the first file, for
  2710. example, the order of sections in the output file will match the order
  2711. in the first input file. The first section will be at address zero.
  2712. * Menu:
  2713. * Output Section Description:: Output section description
  2714. * Output Section Name:: Output section name
  2715. * Output Section Address:: Output section address
  2716. * Input Section:: Input section description
  2717. * Output Section Data:: Output section data
  2718. * Output Section Keywords:: Output section keywords
  2719. * Output Section Discarding:: Output section discarding
  2720. * Output Section Attributes:: Output section attributes
  2721. * Overlay Description:: Overlay description
  2722. 
  2723. File: ld.info, Node: Output Section Description, Next: Output Section Name, Up: SECTIONS
  2724. 3.6.1 Output Section Description
  2725. --------------------------------
  2726. The full description of an output section looks like this:
  2727. SECTION [ADDRESS] [(TYPE)] :
  2728. [AT(LMA)]
  2729. [ALIGN(SECTION_ALIGN) | ALIGN_WITH_INPUT]
  2730. [SUBALIGN(SUBSECTION_ALIGN)]
  2731. [CONSTRAINT]
  2732. {
  2733. OUTPUT-SECTION-COMMAND
  2734. OUTPUT-SECTION-COMMAND
  2735. ...
  2736. } [>REGION] [AT>LMA_REGION] [:PHDR :PHDR ...] [=FILLEXP] [,]
  2737. Most output sections do not use most of the optional section
  2738. attributes.
  2739. The whitespace around SECTION is required, so that the section name
  2740. is unambiguous. The colon and the curly braces are also required. The
  2741. comma at the end may be required if a FILLEXP is used and the next
  2742. SECTIONS-COMMAND looks like a continuation of the expression. The line
  2743. breaks and other white space are optional.
  2744. Each OUTPUT-SECTION-COMMAND may be one of the following:
  2745. * a symbol assignment (*note Assignments::)
  2746. * an input section description (*note Input Section::)
  2747. * data values to include directly (*note Output Section Data::)
  2748. * a special output section keyword (*note Output Section Keywords::)
  2749. 
  2750. File: ld.info, Node: Output Section Name, Next: Output Section Address, Prev: Output Section Description, Up: SECTIONS
  2751. 3.6.2 Output Section Name
  2752. -------------------------
  2753. The name of the output section is SECTION. SECTION must meet the
  2754. constraints of your output format. In formats which only support a
  2755. limited number of sections, such as 'a.out', the name must be one of the
  2756. names supported by the format ('a.out', for example, allows only
  2757. '.text', '.data' or '.bss'). If the output format supports any number
  2758. of sections, but with numbers and not names (as is the case for Oasys),
  2759. the name should be supplied as a quoted numeric string. A section name
  2760. may consist of any sequence of characters, but a name which contains any
  2761. unusual characters such as commas must be quoted.
  2762. The output section name '/DISCARD/' is special; *note Output Section
  2763. Discarding::.
  2764. 
  2765. File: ld.info, Node: Output Section Address, Next: Input Section, Prev: Output Section Name, Up: SECTIONS
  2766. 3.6.3 Output Section Address
  2767. ----------------------------
  2768. The ADDRESS is an expression for the VMA (the virtual memory address) of
  2769. the output section. This address is optional, but if it is provided
  2770. then the output address will be set exactly as specified.
  2771. If the output address is not specified then one will be chosen for
  2772. the section, based on the heuristic below. This address will be
  2773. adjusted to fit the alignment requirement of the output section. The
  2774. alignment requirement is the strictest alignment of any input section
  2775. contained within the output section.
  2776. The output section address heuristic is as follows:
  2777. * If an output memory REGION is set for the section then it is added
  2778. to this region and its address will be the next free address in
  2779. that region.
  2780. * If the MEMORY command has been used to create a list of memory
  2781. regions then the first region which has attributes compatible with
  2782. the section is selected to contain it. The section's output
  2783. address will be the next free address in that region; *note
  2784. MEMORY::.
  2785. * If no memory regions were specified, or none match the section then
  2786. the output address will be based on the current value of the
  2787. location counter.
  2788. For example:
  2789. .text . : { *(.text) }
  2790. and
  2791. .text : { *(.text) }
  2792. are subtly different. The first will set the address of the '.text'
  2793. output section to the current value of the location counter. The second
  2794. will set it to the current value of the location counter aligned to the
  2795. strictest alignment of any of the '.text' input sections.
  2796. The ADDRESS may be an arbitrary expression; *note Expressions::. For
  2797. example, if you want to align the section on a 0x10 byte boundary, so
  2798. that the lowest four bits of the section address are zero, you could do
  2799. something like this:
  2800. .text ALIGN(0x10) : { *(.text) }
  2801. This works because 'ALIGN' returns the current location counter aligned
  2802. upward to the specified value.
  2803. Specifying ADDRESS for a section will change the value of the
  2804. location counter, provided that the section is non-empty. (Empty
  2805. sections are ignored).
  2806. 
  2807. File: ld.info, Node: Input Section, Next: Output Section Data, Prev: Output Section Address, Up: SECTIONS
  2808. 3.6.4 Input Section Description
  2809. -------------------------------
  2810. The most common output section command is an input section description.
  2811. The input section description is the most basic linker script
  2812. operation. You use output sections to tell the linker how to lay out
  2813. your program in memory. You use input section descriptions to tell the
  2814. linker how to map the input files into your memory layout.
  2815. * Menu:
  2816. * Input Section Basics:: Input section basics
  2817. * Input Section Wildcards:: Input section wildcard patterns
  2818. * Input Section Common:: Input section for common symbols
  2819. * Input Section Keep:: Input section and garbage collection
  2820. * Input Section Example:: Input section example
  2821. 
  2822. File: ld.info, Node: Input Section Basics, Next: Input Section Wildcards, Up: Input Section
  2823. 3.6.4.1 Input Section Basics
  2824. ............................
  2825. An input section description consists of a file name optionally followed
  2826. by a list of section names in parentheses.
  2827. The file name and the section name may be wildcard patterns, which we
  2828. describe further below (*note Input Section Wildcards::).
  2829. The most common input section description is to include all input
  2830. sections with a particular name in the output section. For example, to
  2831. include all input '.text' sections, you would write:
  2832. *(.text)
  2833. Here the '*' is a wildcard which matches any file name. To exclude a
  2834. list of files from matching the file name wildcard, EXCLUDE_FILE may be
  2835. used to match all files except the ones specified in the EXCLUDE_FILE
  2836. list. For example:
  2837. EXCLUDE_FILE (*crtend.o *otherfile.o) *(.ctors)
  2838. will cause all .ctors sections from all files except 'crtend.o' and
  2839. 'otherfile.o' to be included. The EXCLUDE_FILE can also be placed
  2840. inside the section list, for example:
  2841. *(EXCLUDE_FILE (*crtend.o *otherfile.o) .ctors)
  2842. The result of this is identically to the previous example. Supporting
  2843. two syntaxes for EXCLUDE_FILE is useful if the section list contains
  2844. more than one section, as described below.
  2845. There are two ways to include more than one section:
  2846. *(.text .rdata)
  2847. *(.text) *(.rdata)
  2848. The difference between these is the order in which the '.text' and
  2849. '.rdata' input sections will appear in the output section. In the first
  2850. example, they will be intermingled, appearing in the same order as they
  2851. are found in the linker input. In the second example, all '.text' input
  2852. sections will appear first, followed by all '.rdata' input sections.
  2853. When using EXCLUDE_FILE with more than one section, if the exclusion
  2854. is within the section list then the exclusion only applies to the
  2855. immediately following section, for example:
  2856. *(EXCLUDE_FILE (*somefile.o) .text .rdata)
  2857. will cause all '.text' sections from all files except 'somefile.o' to be
  2858. included, while all '.rdata' sections from all files, including
  2859. 'somefile.o', will be included. To exclude the '.rdata' sections from
  2860. 'somefile.o' the example could be modified to:
  2861. *(EXCLUDE_FILE (*somefile.o) .text EXCLUDE_FILE (*somefile.o) .rdata)
  2862. Alternatively, placing the EXCLUDE_FILE outside of the section list,
  2863. before the input file selection, will cause the exclusion to apply for
  2864. all sections. Thus the previous example can be rewritten as:
  2865. EXCLUDE_FILE (*somefile.o) *(.text .rdata)
  2866. You can specify a file name to include sections from a particular
  2867. file. You would do this if one or more of your files contain special
  2868. data that needs to be at a particular location in memory. For example:
  2869. data.o(.data)
  2870. To refine the sections that are included based on the section flags
  2871. of an input section, INPUT_SECTION_FLAGS may be used.
  2872. Here is a simple example for using Section header flags for ELF
  2873. sections:
  2874. SECTIONS {
  2875. .text : { INPUT_SECTION_FLAGS (SHF_MERGE & SHF_STRINGS) *(.text) }
  2876. .text2 : { INPUT_SECTION_FLAGS (!SHF_WRITE) *(.text) }
  2877. }
  2878. In this example, the output section '.text' will be comprised of any
  2879. input section matching the name *(.text) whose section header flags
  2880. 'SHF_MERGE' and 'SHF_STRINGS' are set. The output section '.text2' will
  2881. be comprised of any input section matching the name *(.text) whose
  2882. section header flag 'SHF_WRITE' is clear.
  2883. You can also specify files within archives by writing a pattern
  2884. matching the archive, a colon, then the pattern matching the file, with
  2885. no whitespace around the colon.
  2886. 'archive:file'
  2887. matches file within archive
  2888. 'archive:'
  2889. matches the whole archive
  2890. ':file'
  2891. matches file but not one in an archive
  2892. Either one or both of 'archive' and 'file' can contain shell
  2893. wildcards. On DOS based file systems, the linker will assume that a
  2894. single letter followed by a colon is a drive specifier, so 'c:myfile.o'
  2895. is a simple file specification, not 'myfile.o' within an archive called
  2896. 'c'. 'archive:file' filespecs may also be used within an 'EXCLUDE_FILE'
  2897. list, but may not appear in other linker script contexts. For instance,
  2898. you cannot extract a file from an archive by using 'archive:file' in an
  2899. 'INPUT' command.
  2900. If you use a file name without a list of sections, then all sections
  2901. in the input file will be included in the output section. This is not
  2902. commonly done, but it may by useful on occasion. For example:
  2903. data.o
  2904. When you use a file name which is not an 'archive:file' specifier and
  2905. does not contain any wild card characters, the linker will first see if
  2906. you also specified the file name on the linker command line or in an
  2907. 'INPUT' command. If you did not, the linker will attempt to open the
  2908. file as an input file, as though it appeared on the command line. Note
  2909. that this differs from an 'INPUT' command, because the linker will not
  2910. search for the file in the archive search path.
  2911. 
  2912. File: ld.info, Node: Input Section Wildcards, Next: Input Section Common, Prev: Input Section Basics, Up: Input Section
  2913. 3.6.4.2 Input Section Wildcard Patterns
  2914. .......................................
  2915. In an input section description, either the file name or the section
  2916. name or both may be wildcard patterns.
  2917. The file name of '*' seen in many examples is a simple wildcard
  2918. pattern for the file name.
  2919. The wildcard patterns are like those used by the Unix shell.
  2920. '*'
  2921. matches any number of characters
  2922. '?'
  2923. matches any single character
  2924. '[CHARS]'
  2925. matches a single instance of any of the CHARS; the '-' character
  2926. may be used to specify a range of characters, as in '[a-z]' to
  2927. match any lower case letter
  2928. '\'
  2929. quotes the following character
  2930. When a file name is matched with a wildcard, the wildcard characters
  2931. will not match a '/' character (used to separate directory names on
  2932. Unix). A pattern consisting of a single '*' character is an exception;
  2933. it will always match any file name, whether it contains a '/' or not.
  2934. In a section name, the wildcard characters will match a '/' character.
  2935. File name wildcard patterns only match files which are explicitly
  2936. specified on the command line or in an 'INPUT' command. The linker does
  2937. not search directories to expand wildcards.
  2938. If a file name matches more than one wildcard pattern, or if a file
  2939. name appears explicitly and is also matched by a wildcard pattern, the
  2940. linker will use the first match in the linker script. For example, this
  2941. sequence of input section descriptions is probably in error, because the
  2942. 'data.o' rule will not be used:
  2943. .data : { *(.data) }
  2944. .data1 : { data.o(.data) }
  2945. Normally, the linker will place files and sections matched by
  2946. wildcards in the order in which they are seen during the link. You can
  2947. change this by using the 'SORT_BY_NAME' keyword, which appears before a
  2948. wildcard pattern in parentheses (e.g., 'SORT_BY_NAME(.text*)'). When
  2949. the 'SORT_BY_NAME' keyword is used, the linker will sort the files or
  2950. sections into ascending order by name before placing them in the output
  2951. file.
  2952. 'SORT_BY_ALIGNMENT' is very similar to 'SORT_BY_NAME'. The
  2953. difference is 'SORT_BY_ALIGNMENT' will sort sections into descending
  2954. order by alignment before placing them in the output file. Larger
  2955. alignments are placed before smaller alignments in order to reduce the
  2956. amount of padding necessary.
  2957. 'SORT_BY_INIT_PRIORITY' is very similar to 'SORT_BY_NAME'. The
  2958. difference is 'SORT_BY_INIT_PRIORITY' will sort sections into ascending
  2959. order by numerical value of the GCC init_priority attribute encoded in
  2960. the section name before placing them in the output file.
  2961. 'SORT' is an alias for 'SORT_BY_NAME'.
  2962. When there are nested section sorting commands in linker script,
  2963. there can be at most 1 level of nesting for section sorting commands.
  2964. 1. 'SORT_BY_NAME' ('SORT_BY_ALIGNMENT' (wildcard section pattern)).
  2965. It will sort the input sections by name first, then by alignment if
  2966. two sections have the same name.
  2967. 2. 'SORT_BY_ALIGNMENT' ('SORT_BY_NAME' (wildcard section pattern)).
  2968. It will sort the input sections by alignment first, then by name if
  2969. two sections have the same alignment.
  2970. 3. 'SORT_BY_NAME' ('SORT_BY_NAME' (wildcard section pattern)) is
  2971. treated the same as 'SORT_BY_NAME' (wildcard section pattern).
  2972. 4. 'SORT_BY_ALIGNMENT' ('SORT_BY_ALIGNMENT' (wildcard section
  2973. pattern)) is treated the same as 'SORT_BY_ALIGNMENT' (wildcard
  2974. section pattern).
  2975. 5. All other nested section sorting commands are invalid.
  2976. When both command line section sorting option and linker script
  2977. section sorting command are used, section sorting command always takes
  2978. precedence over the command line option.
  2979. If the section sorting command in linker script isn't nested, the
  2980. command line option will make the section sorting command to be treated
  2981. as nested sorting command.
  2982. 1. 'SORT_BY_NAME' (wildcard section pattern ) with '--sort-sections
  2983. alignment' is equivalent to 'SORT_BY_NAME' ('SORT_BY_ALIGNMENT'
  2984. (wildcard section pattern)).
  2985. 2. 'SORT_BY_ALIGNMENT' (wildcard section pattern) with '--sort-section
  2986. name' is equivalent to 'SORT_BY_ALIGNMENT' ('SORT_BY_NAME'
  2987. (wildcard section pattern)).
  2988. If the section sorting command in linker script is nested, the
  2989. command line option will be ignored.
  2990. 'SORT_NONE' disables section sorting by ignoring the command line
  2991. section sorting option.
  2992. If you ever get confused about where input sections are going, use
  2993. the '-M' linker option to generate a map file. The map file shows
  2994. precisely how input sections are mapped to output sections.
  2995. This example shows how wildcard patterns might be used to partition
  2996. files. This linker script directs the linker to place all '.text'
  2997. sections in '.text' and all '.bss' sections in '.bss'. The linker will
  2998. place the '.data' section from all files beginning with an upper case
  2999. character in '.DATA'; for all other files, the linker will place the
  3000. '.data' section in '.data'.
  3001. SECTIONS {
  3002. .text : { *(.text) }
  3003. .DATA : { [A-Z]*(.data) }
  3004. .data : { *(.data) }
  3005. .bss : { *(.bss) }
  3006. }
  3007. 
  3008. File: ld.info, Node: Input Section Common, Next: Input Section Keep, Prev: Input Section Wildcards, Up: Input Section
  3009. 3.6.4.3 Input Section for Common Symbols
  3010. ........................................
  3011. A special notation is needed for common symbols, because in many object
  3012. file formats common symbols do not have a particular input section. The
  3013. linker treats common symbols as though they are in an input section
  3014. named 'COMMON'.
  3015. You may use file names with the 'COMMON' section just as with any
  3016. other input sections. You can use this to place common symbols from a
  3017. particular input file in one section while common symbols from other
  3018. input files are placed in another section.
  3019. In most cases, common symbols in input files will be placed in the
  3020. '.bss' section in the output file. For example:
  3021. .bss { *(.bss) *(COMMON) }
  3022. Some object file formats have more than one type of common symbol.
  3023. For example, the MIPS ELF object file format distinguishes standard
  3024. common symbols and small common symbols. In this case, the linker will
  3025. use a different special section name for other types of common symbols.
  3026. In the case of MIPS ELF, the linker uses 'COMMON' for standard common
  3027. symbols and '.scommon' for small common symbols. This permits you to
  3028. map the different types of common symbols into memory at different
  3029. locations.
  3030. You will sometimes see '[COMMON]' in old linker scripts. This
  3031. notation is now considered obsolete. It is equivalent to '*(COMMON)'.
  3032. 
  3033. File: ld.info, Node: Input Section Keep, Next: Input Section Example, Prev: Input Section Common, Up: Input Section
  3034. 3.6.4.4 Input Section and Garbage Collection
  3035. ............................................
  3036. When link-time garbage collection is in use ('--gc-sections'), it is
  3037. often useful to mark sections that should not be eliminated. This is
  3038. accomplished by surrounding an input section's wildcard entry with
  3039. 'KEEP()', as in 'KEEP(*(.init))' or 'KEEP(SORT_BY_NAME(*)(.ctors))'.
  3040. 
  3041. File: ld.info, Node: Input Section Example, Prev: Input Section Keep, Up: Input Section
  3042. 3.6.4.5 Input Section Example
  3043. .............................
  3044. The following example is a complete linker script. It tells the linker
  3045. to read all of the sections from file 'all.o' and place them at the
  3046. start of output section 'outputa' which starts at location '0x10000'.
  3047. All of section '.input1' from file 'foo.o' follows immediately, in the
  3048. same output section. All of section '.input2' from 'foo.o' goes into
  3049. output section 'outputb', followed by section '.input1' from 'foo1.o'.
  3050. All of the remaining '.input1' and '.input2' sections from any files are
  3051. written to output section 'outputc'.
  3052. SECTIONS {
  3053. outputa 0x10000 :
  3054. {
  3055. all.o
  3056. foo.o (.input1)
  3057. }
  3058. outputb :
  3059. {
  3060. foo.o (.input2)
  3061. foo1.o (.input1)
  3062. }
  3063. outputc :
  3064. {
  3065. *(.input1)
  3066. *(.input2)
  3067. }
  3068. }
  3069. 
  3070. File: ld.info, Node: Output Section Data, Next: Output Section Keywords, Prev: Input Section, Up: SECTIONS
  3071. 3.6.5 Output Section Data
  3072. -------------------------
  3073. You can include explicit bytes of data in an output section by using
  3074. 'BYTE', 'SHORT', 'LONG', 'QUAD', or 'SQUAD' as an output section
  3075. command. Each keyword is followed by an expression in parentheses
  3076. providing the value to store (*note Expressions::). The value of the
  3077. expression is stored at the current value of the location counter.
  3078. The 'BYTE', 'SHORT', 'LONG', and 'QUAD' commands store one, two,
  3079. four, and eight bytes (respectively). After storing the bytes, the
  3080. location counter is incremented by the number of bytes stored.
  3081. For example, this will store the byte 1 followed by the four byte
  3082. value of the symbol 'addr':
  3083. BYTE(1)
  3084. LONG(addr)
  3085. When using a 64 bit host or target, 'QUAD' and 'SQUAD' are the same;
  3086. they both store an 8 byte, or 64 bit, value. When both host and target
  3087. are 32 bits, an expression is computed as 32 bits. In this case 'QUAD'
  3088. stores a 32 bit value zero extended to 64 bits, and 'SQUAD' stores a 32
  3089. bit value sign extended to 64 bits.
  3090. If the object file format of the output file has an explicit
  3091. endianness, which is the normal case, the value will be stored in that
  3092. endianness. When the object file format does not have an explicit
  3093. endianness, as is true of, for example, S-records, the value will be
  3094. stored in the endianness of the first input object file.
  3095. Note--these commands only work inside a section description and not
  3096. between them, so the following will produce an error from the linker:
  3097. SECTIONS { .text : { *(.text) } LONG(1) .data : { *(.data) } }
  3098. whereas this will work:
  3099. SECTIONS { .text : { *(.text) ; LONG(1) } .data : { *(.data) } }
  3100. You may use the 'FILL' command to set the fill pattern for the
  3101. current section. It is followed by an expression in parentheses. Any
  3102. otherwise unspecified regions of memory within the section (for example,
  3103. gaps left due to the required alignment of input sections) are filled
  3104. with the value of the expression, repeated as necessary. A 'FILL'
  3105. statement covers memory locations after the point at which it occurs in
  3106. the section definition; by including more than one 'FILL' statement, you
  3107. can have different fill patterns in different parts of an output
  3108. section.
  3109. This example shows how to fill unspecified regions of memory with the
  3110. value '0x90':
  3111. FILL(0x90909090)
  3112. The 'FILL' command is similar to the '=FILLEXP' output section
  3113. attribute, but it only affects the part of the section following the
  3114. 'FILL' command, rather than the entire section. If both are used, the
  3115. 'FILL' command takes precedence. *Note Output Section Fill::, for
  3116. details on the fill expression.
  3117. 
  3118. File: ld.info, Node: Output Section Keywords, Next: Output Section Discarding, Prev: Output Section Data, Up: SECTIONS
  3119. 3.6.6 Output Section Keywords
  3120. -----------------------------
  3121. There are a couple of keywords which can appear as output section
  3122. commands.
  3123. 'CREATE_OBJECT_SYMBOLS'
  3124. The command tells the linker to create a symbol for each input
  3125. file. The name of each symbol will be the name of the
  3126. corresponding input file. The section of each symbol will be the
  3127. output section in which the 'CREATE_OBJECT_SYMBOLS' command
  3128. appears.
  3129. This is conventional for the a.out object file format. It is not
  3130. normally used for any other object file format.
  3131. 'CONSTRUCTORS'
  3132. When linking using the a.out object file format, the linker uses an
  3133. unusual set construct to support C++ global constructors and
  3134. destructors. When linking object file formats which do not support
  3135. arbitrary sections, such as ECOFF and XCOFF, the linker will
  3136. automatically recognize C++ global constructors and destructors by
  3137. name. For these object file formats, the 'CONSTRUCTORS' command
  3138. tells the linker to place constructor information in the output
  3139. section where the 'CONSTRUCTORS' command appears. The
  3140. 'CONSTRUCTORS' command is ignored for other object file formats.
  3141. The symbol '__CTOR_LIST__' marks the start of the global
  3142. constructors, and the symbol '__CTOR_END__' marks the end.
  3143. Similarly, '__DTOR_LIST__' and '__DTOR_END__' mark the start and
  3144. end of the global destructors. The first word in the list is the
  3145. number of entries, followed by the address of each constructor or
  3146. destructor, followed by a zero word. The compiler must arrange to
  3147. actually run the code. For these object file formats GNU C++
  3148. normally calls constructors from a subroutine '__main'; a call to
  3149. '__main' is automatically inserted into the startup code for
  3150. 'main'. GNU C++ normally runs destructors either by using
  3151. 'atexit', or directly from the function 'exit'.
  3152. For object file formats such as 'COFF' or 'ELF' which support
  3153. arbitrary section names, GNU C++ will normally arrange to put the
  3154. addresses of global constructors and destructors into the '.ctors'
  3155. and '.dtors' sections. Placing the following sequence into your
  3156. linker script will build the sort of table which the GNU C++
  3157. runtime code expects to see.
  3158. __CTOR_LIST__ = .;
  3159. LONG((__CTOR_END__ - __CTOR_LIST__) / 4 - 2)
  3160. *(.ctors)
  3161. LONG(0)
  3162. __CTOR_END__ = .;
  3163. __DTOR_LIST__ = .;
  3164. LONG((__DTOR_END__ - __DTOR_LIST__) / 4 - 2)
  3165. *(.dtors)
  3166. LONG(0)
  3167. __DTOR_END__ = .;
  3168. If you are using the GNU C++ support for initialization priority,
  3169. which provides some control over the order in which global
  3170. constructors are run, you must sort the constructors at link time
  3171. to ensure that they are executed in the correct order. When using
  3172. the 'CONSTRUCTORS' command, use 'SORT_BY_NAME(CONSTRUCTORS)'
  3173. instead. When using the '.ctors' and '.dtors' sections, use
  3174. '*(SORT_BY_NAME(.ctors))' and '*(SORT_BY_NAME(.dtors))' instead of
  3175. just '*(.ctors)' and '*(.dtors)'.
  3176. Normally the compiler and linker will handle these issues
  3177. automatically, and you will not need to concern yourself with them.
  3178. However, you may need to consider this if you are using C++ and
  3179. writing your own linker scripts.
  3180. 
  3181. File: ld.info, Node: Output Section Discarding, Next: Output Section Attributes, Prev: Output Section Keywords, Up: SECTIONS
  3182. 3.6.7 Output Section Discarding
  3183. -------------------------------
  3184. The linker will not normally create output sections with no contents.
  3185. This is for convenience when referring to input sections that may or may
  3186. not be present in any of the input files. For example:
  3187. .foo : { *(.foo) }
  3188. will only create a '.foo' section in the output file if there is a
  3189. '.foo' section in at least one input file, and if the input sections are
  3190. not all empty. Other link script directives that allocate space in an
  3191. output section will also create the output section. So too will
  3192. assignments to dot even if the assignment does not create space, except
  3193. for '. = 0', '. = . + 0', '. = sym', '. = . + sym' and '. = ALIGN (. !=
  3194. 0, expr, 1)' when 'sym' is an absolute symbol of value 0 defined in the
  3195. script. This allows you to force output of an empty section with '. =
  3196. .'.
  3197. The linker will ignore address assignments (*note Output Section
  3198. Address::) on discarded output sections, except when the linker script
  3199. defines symbols in the output section. In that case the linker will
  3200. obey the address assignments, possibly advancing dot even though the
  3201. section is discarded.
  3202. The special output section name '/DISCARD/' may be used to discard
  3203. input sections. Any input sections which are assigned to an output
  3204. section named '/DISCARD/' are not included in the output file.
  3205. 
  3206. File: ld.info, Node: Output Section Attributes, Next: Overlay Description, Prev: Output Section Discarding, Up: SECTIONS
  3207. 3.6.8 Output Section Attributes
  3208. -------------------------------
  3209. We showed above that the full description of an output section looked
  3210. like this:
  3211. SECTION [ADDRESS] [(TYPE)] :
  3212. [AT(LMA)]
  3213. [ALIGN(SECTION_ALIGN)]
  3214. [SUBALIGN(SUBSECTION_ALIGN)]
  3215. [CONSTRAINT]
  3216. {
  3217. OUTPUT-SECTION-COMMAND
  3218. OUTPUT-SECTION-COMMAND
  3219. ...
  3220. } [>REGION] [AT>LMA_REGION] [:PHDR :PHDR ...] [=FILLEXP]
  3221. We've already described SECTION, ADDRESS, and OUTPUT-SECTION-COMMAND.
  3222. In this section we will describe the remaining section attributes.
  3223. * Menu:
  3224. * Output Section Type:: Output section type
  3225. * Output Section LMA:: Output section LMA
  3226. * Forced Output Alignment:: Forced Output Alignment
  3227. * Forced Input Alignment:: Forced Input Alignment
  3228. * Output Section Constraint:: Output section constraint
  3229. * Output Section Region:: Output section region
  3230. * Output Section Phdr:: Output section phdr
  3231. * Output Section Fill:: Output section fill
  3232. 
  3233. File: ld.info, Node: Output Section Type, Next: Output Section LMA, Up: Output Section Attributes
  3234. 3.6.8.1 Output Section Type
  3235. ...........................
  3236. Each output section may have a type. The type is a keyword in
  3237. parentheses. The following types are defined:
  3238. 'NOLOAD'
  3239. The section should be marked as not loadable, so that it will not
  3240. be loaded into memory when the program is run.
  3241. 'DSECT'
  3242. 'COPY'
  3243. 'INFO'
  3244. 'OVERLAY'
  3245. These type names are supported for backward compatibility, and are
  3246. rarely used. They all have the same effect: the section should be
  3247. marked as not allocatable, so that no memory is allocated for the
  3248. section when the program is run.
  3249. The linker normally sets the attributes of an output section based on
  3250. the input sections which map into it. You can override this by using
  3251. the section type. For example, in the script sample below, the 'ROM'
  3252. section is addressed at memory location '0' and does not need to be
  3253. loaded when the program is run.
  3254. SECTIONS {
  3255. ROM 0 (NOLOAD) : { ... }
  3256. ...
  3257. }
  3258. 
  3259. File: ld.info, Node: Output Section LMA, Next: Forced Output Alignment, Prev: Output Section Type, Up: Output Section Attributes
  3260. 3.6.8.2 Output Section LMA
  3261. ..........................
  3262. Every section has a virtual address (VMA) and a load address (LMA); see
  3263. *note Basic Script Concepts::. The virtual address is specified by the
  3264. *note Output Section Address:: described earlier. The load address is
  3265. specified by the 'AT' or 'AT>' keywords. Specifying a load address is
  3266. optional.
  3267. The 'AT' keyword takes an expression as an argument. This specifies
  3268. the exact load address of the section. The 'AT>' keyword takes the name
  3269. of a memory region as an argument. *Note MEMORY::. The load address of
  3270. the section is set to the next free address in the region, aligned to
  3271. the section's alignment requirements.
  3272. If neither 'AT' nor 'AT>' is specified for an allocatable section,
  3273. the linker will use the following heuristic to determine the load
  3274. address:
  3275. * If the section has a specific VMA address, then this is used as the
  3276. LMA address as well.
  3277. * If the section is not allocatable then its LMA is set to its VMA.
  3278. * Otherwise if a memory region can be found that is compatible with
  3279. the current section, and this region contains at least one section,
  3280. then the LMA is set so the difference between the VMA and LMA is
  3281. the same as the difference between the VMA and LMA of the last
  3282. section in the located region.
  3283. * If no memory regions have been declared then a default region that
  3284. covers the entire address space is used in the previous step.
  3285. * If no suitable region could be found, or there was no previous
  3286. section then the LMA is set equal to the VMA.
  3287. This feature is designed to make it easy to build a ROM image. For
  3288. example, the following linker script creates three output sections: one
  3289. called '.text', which starts at '0x1000', one called '.mdata', which is
  3290. loaded at the end of the '.text' section even though its VMA is
  3291. '0x2000', and one called '.bss' to hold uninitialized data at address
  3292. '0x3000'. The symbol '_data' is defined with the value '0x2000', which
  3293. shows that the location counter holds the VMA value, not the LMA value.
  3294. SECTIONS
  3295. {
  3296. .text 0x1000 : { *(.text) _etext = . ; }
  3297. .mdata 0x2000 :
  3298. AT ( ADDR (.text) + SIZEOF (.text) )
  3299. { _data = . ; *(.data); _edata = . ; }
  3300. .bss 0x3000 :
  3301. { _bstart = . ; *(.bss) *(COMMON) ; _bend = . ;}
  3302. }
  3303. The run-time initialization code for use with a program generated
  3304. with this linker script would include something like the following, to
  3305. copy the initialized data from the ROM image to its runtime address.
  3306. Notice how this code takes advantage of the symbols defined by the
  3307. linker script.
  3308. extern char _etext, _data, _edata, _bstart, _bend;
  3309. char *src = &_etext;
  3310. char *dst = &_data;
  3311. /* ROM has data at end of text; copy it. */
  3312. while (dst < &_edata)
  3313. *dst++ = *src++;
  3314. /* Zero bss. */
  3315. for (dst = &_bstart; dst< &_bend; dst++)
  3316. *dst = 0;
  3317. 
  3318. File: ld.info, Node: Forced Output Alignment, Next: Forced Input Alignment, Prev: Output Section LMA, Up: Output Section Attributes
  3319. 3.6.8.3 Forced Output Alignment
  3320. ...............................
  3321. You can increase an output section's alignment by using ALIGN. As an
  3322. alternative you can enforce that the difference between the VMA and LMA
  3323. remains intact throughout this output section with the ALIGN_WITH_INPUT
  3324. attribute.
  3325. 
  3326. File: ld.info, Node: Forced Input Alignment, Next: Output Section Constraint, Prev: Forced Output Alignment, Up: Output Section Attributes
  3327. 3.6.8.4 Forced Input Alignment
  3328. ..............................
  3329. You can force input section alignment within an output section by using
  3330. SUBALIGN. The value specified overrides any alignment given by input
  3331. sections, whether larger or smaller.
  3332. 
  3333. File: ld.info, Node: Output Section Constraint, Next: Output Section Region, Prev: Forced Input Alignment, Up: Output Section Attributes
  3334. 3.6.8.5 Output Section Constraint
  3335. .................................
  3336. You can specify that an output section should only be created if all of
  3337. its input sections are read-only or all of its input sections are
  3338. read-write by using the keyword 'ONLY_IF_RO' and 'ONLY_IF_RW'
  3339. respectively.
  3340. 
  3341. File: ld.info, Node: Output Section Region, Next: Output Section Phdr, Prev: Output Section Constraint, Up: Output Section Attributes
  3342. 3.6.8.6 Output Section Region
  3343. .............................
  3344. You can assign a section to a previously defined region of memory by
  3345. using '>REGION'. *Note MEMORY::.
  3346. Here is a simple example:
  3347. MEMORY { rom : ORIGIN = 0x1000, LENGTH = 0x1000 }
  3348. SECTIONS { ROM : { *(.text) } >rom }
  3349. 
  3350. File: ld.info, Node: Output Section Phdr, Next: Output Section Fill, Prev: Output Section Region, Up: Output Section Attributes
  3351. 3.6.8.7 Output Section Phdr
  3352. ...........................
  3353. You can assign a section to a previously defined program segment by
  3354. using ':PHDR'. *Note PHDRS::. If a section is assigned to one or more
  3355. segments, then all subsequent allocated sections will be assigned to
  3356. those segments as well, unless they use an explicitly ':PHDR' modifier.
  3357. You can use ':NONE' to tell the linker to not put the section in any
  3358. segment at all.
  3359. Here is a simple example:
  3360. PHDRS { text PT_LOAD ; }
  3361. SECTIONS { .text : { *(.text) } :text }
  3362. 
  3363. File: ld.info, Node: Output Section Fill, Prev: Output Section Phdr, Up: Output Section Attributes
  3364. 3.6.8.8 Output Section Fill
  3365. ...........................
  3366. You can set the fill pattern for an entire section by using '=FILLEXP'.
  3367. FILLEXP is an expression (*note Expressions::). Any otherwise
  3368. unspecified regions of memory within the output section (for example,
  3369. gaps left due to the required alignment of input sections) will be
  3370. filled with the value, repeated as necessary. If the fill expression is
  3371. a simple hex number, ie. a string of hex digit starting with '0x' and
  3372. without a trailing 'k' or 'M', then an arbitrarily long sequence of hex
  3373. digits can be used to specify the fill pattern; Leading zeros become
  3374. part of the pattern too. For all other cases, including extra
  3375. parentheses or a unary '+', the fill pattern is the four least
  3376. significant bytes of the value of the expression. In all cases, the
  3377. number is big-endian.
  3378. You can also change the fill value with a 'FILL' command in the
  3379. output section commands; (*note Output Section Data::).
  3380. Here is a simple example:
  3381. SECTIONS { .text : { *(.text) } =0x90909090 }
  3382. 
  3383. File: ld.info, Node: Overlay Description, Prev: Output Section Attributes, Up: SECTIONS
  3384. 3.6.9 Overlay Description
  3385. -------------------------
  3386. An overlay description provides an easy way to describe sections which
  3387. are to be loaded as part of a single memory image but are to be run at
  3388. the same memory address. At run time, some sort of overlay manager will
  3389. copy the overlaid sections in and out of the runtime memory address as
  3390. required, perhaps by simply manipulating addressing bits. This approach
  3391. can be useful, for example, when a certain region of memory is faster
  3392. than another.
  3393. Overlays are described using the 'OVERLAY' command. The 'OVERLAY'
  3394. command is used within a 'SECTIONS' command, like an output section
  3395. description. The full syntax of the 'OVERLAY' command is as follows:
  3396. OVERLAY [START] : [NOCROSSREFS] [AT ( LDADDR )]
  3397. {
  3398. SECNAME1
  3399. {
  3400. OUTPUT-SECTION-COMMAND
  3401. OUTPUT-SECTION-COMMAND
  3402. ...
  3403. } [:PHDR...] [=FILL]
  3404. SECNAME2
  3405. {
  3406. OUTPUT-SECTION-COMMAND
  3407. OUTPUT-SECTION-COMMAND
  3408. ...
  3409. } [:PHDR...] [=FILL]
  3410. ...
  3411. } [>REGION] [:PHDR...] [=FILL] [,]
  3412. Everything is optional except 'OVERLAY' (a keyword), and each section
  3413. must have a name (SECNAME1 and SECNAME2 above). The section definitions
  3414. within the 'OVERLAY' construct are identical to those within the general
  3415. 'SECTIONS' construct (*note SECTIONS::), except that no addresses and no
  3416. memory regions may be defined for sections within an 'OVERLAY'.
  3417. The comma at the end may be required if a FILL is used and the next
  3418. SECTIONS-COMMAND looks like a continuation of the expression.
  3419. The sections are all defined with the same starting address. The
  3420. load addresses of the sections are arranged such that they are
  3421. consecutive in memory starting at the load address used for the
  3422. 'OVERLAY' as a whole (as with normal section definitions, the load
  3423. address is optional, and defaults to the start address; the start
  3424. address is also optional, and defaults to the current value of the
  3425. location counter).
  3426. If the 'NOCROSSREFS' keyword is used, and there are any references
  3427. among the sections, the linker will report an error. Since the sections
  3428. all run at the same address, it normally does not make sense for one
  3429. section to refer directly to another. *Note NOCROSSREFS: Miscellaneous
  3430. Commands.
  3431. For each section within the 'OVERLAY', the linker automatically
  3432. provides two symbols. The symbol '__load_start_SECNAME' is defined as
  3433. the starting load address of the section. The symbol
  3434. '__load_stop_SECNAME' is defined as the final load address of the
  3435. section. Any characters within SECNAME which are not legal within C
  3436. identifiers are removed. C (or assembler) code may use these symbols to
  3437. move the overlaid sections around as necessary.
  3438. At the end of the overlay, the value of the location counter is set
  3439. to the start address of the overlay plus the size of the largest
  3440. section.
  3441. Here is an example. Remember that this would appear inside a
  3442. 'SECTIONS' construct.
  3443. OVERLAY 0x1000 : AT (0x4000)
  3444. {
  3445. .text0 { o1/*.o(.text) }
  3446. .text1 { o2/*.o(.text) }
  3447. }
  3448. This will define both '.text0' and '.text1' to start at address 0x1000.
  3449. '.text0' will be loaded at address 0x4000, and '.text1' will be loaded
  3450. immediately after '.text0'. The following symbols will be defined if
  3451. referenced: '__load_start_text0', '__load_stop_text0',
  3452. '__load_start_text1', '__load_stop_text1'.
  3453. C code to copy overlay '.text1' into the overlay area might look like
  3454. the following.
  3455. extern char __load_start_text1, __load_stop_text1;
  3456. memcpy ((char *) 0x1000, &__load_start_text1,
  3457. &__load_stop_text1 - &__load_start_text1);
  3458. Note that the 'OVERLAY' command is just syntactic sugar, since
  3459. everything it does can be done using the more basic commands. The above
  3460. example could have been written identically as follows.
  3461. .text0 0x1000 : AT (0x4000) { o1/*.o(.text) }
  3462. PROVIDE (__load_start_text0 = LOADADDR (.text0));
  3463. PROVIDE (__load_stop_text0 = LOADADDR (.text0) + SIZEOF (.text0));
  3464. .text1 0x1000 : AT (0x4000 + SIZEOF (.text0)) { o2/*.o(.text) }
  3465. PROVIDE (__load_start_text1 = LOADADDR (.text1));
  3466. PROVIDE (__load_stop_text1 = LOADADDR (.text1) + SIZEOF (.text1));
  3467. . = 0x1000 + MAX (SIZEOF (.text0), SIZEOF (.text1));
  3468. 
  3469. File: ld.info, Node: MEMORY, Next: PHDRS, Prev: SECTIONS, Up: Scripts
  3470. 3.7 MEMORY Command
  3471. ==================
  3472. The linker's default configuration permits allocation of all available
  3473. memory. You can override this by using the 'MEMORY' command.
  3474. The 'MEMORY' command describes the location and size of blocks of
  3475. memory in the target. You can use it to describe which memory regions
  3476. may be used by the linker, and which memory regions it must avoid. You
  3477. can then assign sections to particular memory regions. The linker will
  3478. set section addresses based on the memory regions, and will warn about
  3479. regions that become too full. The linker will not shuffle sections
  3480. around to fit into the available regions.
  3481. A linker script may contain many uses of the 'MEMORY' command,
  3482. however, all memory blocks defined are treated as if they were specified
  3483. inside a single 'MEMORY' command. The syntax for 'MEMORY' is:
  3484. MEMORY
  3485. {
  3486. NAME [(ATTR)] : ORIGIN = ORIGIN, LENGTH = LEN
  3487. ...
  3488. }
  3489. The NAME is a name used in the linker script to refer to the region.
  3490. The region name has no meaning outside of the linker script. Region
  3491. names are stored in a separate name space, and will not conflict with
  3492. symbol names, file names, or section names. Each memory region must
  3493. have a distinct name within the 'MEMORY' command. However you can add
  3494. later alias names to existing memory regions with the *note
  3495. REGION_ALIAS:: command.
  3496. The ATTR string is an optional list of attributes that specify
  3497. whether to use a particular memory region for an input section which is
  3498. not explicitly mapped in the linker script. As described in *note
  3499. SECTIONS::, if you do not specify an output section for some input
  3500. section, the linker will create an output section with the same name as
  3501. the input section. If you define region attributes, the linker will use
  3502. them to select the memory region for the output section that it creates.
  3503. The ATTR string must consist only of the following characters:
  3504. 'R'
  3505. Read-only section
  3506. 'W'
  3507. Read/write section
  3508. 'X'
  3509. Executable section
  3510. 'A'
  3511. Allocatable section
  3512. 'I'
  3513. Initialized section
  3514. 'L'
  3515. Same as 'I'
  3516. '!'
  3517. Invert the sense of any of the attributes that follow
  3518. If a unmapped section matches any of the listed attributes other than
  3519. '!', it will be placed in the memory region. The '!' attribute reverses
  3520. this test, so that an unmapped section will be placed in the memory
  3521. region only if it does not match any of the listed attributes.
  3522. The ORIGIN is an numerical expression for the start address of the
  3523. memory region. The expression must evaluate to a constant and it cannot
  3524. involve any symbols. The keyword 'ORIGIN' may be abbreviated to 'org'
  3525. or 'o' (but not, for example, 'ORG').
  3526. The LEN is an expression for the size in bytes of the memory region.
  3527. As with the ORIGIN expression, the expression must be numerical only and
  3528. must evaluate to a constant. The keyword 'LENGTH' may be abbreviated to
  3529. 'len' or 'l'.
  3530. In the following example, we specify that there are two memory
  3531. regions available for allocation: one starting at '0' for 256 kilobytes,
  3532. and the other starting at '0x40000000' for four megabytes. The linker
  3533. will place into the 'rom' memory region every section which is not
  3534. explicitly mapped into a memory region, and is either read-only or
  3535. executable. The linker will place other sections which are not
  3536. explicitly mapped into a memory region into the 'ram' memory region.
  3537. MEMORY
  3538. {
  3539. rom (rx) : ORIGIN = 0, LENGTH = 256K
  3540. ram (!rx) : org = 0x40000000, l = 4M
  3541. }
  3542. Once you define a memory region, you can direct the linker to place
  3543. specific output sections into that memory region by using the '>REGION'
  3544. output section attribute. For example, if you have a memory region
  3545. named 'mem', you would use '>mem' in the output section definition.
  3546. *Note Output Section Region::. If no address was specified for the
  3547. output section, the linker will set the address to the next available
  3548. address within the memory region. If the combined output sections
  3549. directed to a memory region are too large for the region, the linker
  3550. will issue an error message.
  3551. It is possible to access the origin and length of a memory in an
  3552. expression via the 'ORIGIN(MEMORY)' and 'LENGTH(MEMORY)' functions:
  3553. _fstack = ORIGIN(ram) + LENGTH(ram) - 4;
  3554. 
  3555. File: ld.info, Node: PHDRS, Next: VERSION, Prev: MEMORY, Up: Scripts
  3556. 3.8 PHDRS Command
  3557. =================
  3558. The ELF object file format uses "program headers", also knows as
  3559. "segments". The program headers describe how the program should be
  3560. loaded into memory. You can print them out by using the 'objdump'
  3561. program with the '-p' option.
  3562. When you run an ELF program on a native ELF system, the system loader
  3563. reads the program headers in order to figure out how to load the
  3564. program. This will only work if the program headers are set correctly.
  3565. This manual does not describe the details of how the system loader
  3566. interprets program headers; for more information, see the ELF ABI.
  3567. The linker will create reasonable program headers by default.
  3568. However, in some cases, you may need to specify the program headers more
  3569. precisely. You may use the 'PHDRS' command for this purpose. When the
  3570. linker sees the 'PHDRS' command in the linker script, it will not create
  3571. any program headers other than the ones specified.
  3572. The linker only pays attention to the 'PHDRS' command when generating
  3573. an ELF output file. In other cases, the linker will simply ignore
  3574. 'PHDRS'.
  3575. This is the syntax of the 'PHDRS' command. The words 'PHDRS',
  3576. 'FILEHDR', 'AT', and 'FLAGS' are keywords.
  3577. PHDRS
  3578. {
  3579. NAME TYPE [ FILEHDR ] [ PHDRS ] [ AT ( ADDRESS ) ]
  3580. [ FLAGS ( FLAGS ) ] ;
  3581. }
  3582. The NAME is used only for reference in the 'SECTIONS' command of the
  3583. linker script. It is not put into the output file. Program header
  3584. names are stored in a separate name space, and will not conflict with
  3585. symbol names, file names, or section names. Each program header must
  3586. have a distinct name. The headers are processed in order and it is
  3587. usual for them to map to sections in ascending load address order.
  3588. Certain program header types describe segments of memory which the
  3589. system loader will load from the file. In the linker script, you
  3590. specify the contents of these segments by placing allocatable output
  3591. sections in the segments. You use the ':PHDR' output section attribute
  3592. to place a section in a particular segment. *Note Output Section
  3593. Phdr::.
  3594. It is normal to put certain sections in more than one segment. This
  3595. merely implies that one segment of memory contains another. You may
  3596. repeat ':PHDR', using it once for each segment which should contain the
  3597. section.
  3598. If you place a section in one or more segments using ':PHDR', then
  3599. the linker will place all subsequent allocatable sections which do not
  3600. specify ':PHDR' in the same segments. This is for convenience, since
  3601. generally a whole set of contiguous sections will be placed in a single
  3602. segment. You can use ':NONE' to override the default segment and tell
  3603. the linker to not put the section in any segment at all.
  3604. You may use the 'FILEHDR' and 'PHDRS' keywords after the program
  3605. header type to further describe the contents of the segment. The
  3606. 'FILEHDR' keyword means that the segment should include the ELF file
  3607. header. The 'PHDRS' keyword means that the segment should include the
  3608. ELF program headers themselves. If applied to a loadable segment
  3609. ('PT_LOAD'), all prior loadable segments must have one of these
  3610. keywords.
  3611. The TYPE may be one of the following. The numbers indicate the value
  3612. of the keyword.
  3613. 'PT_NULL' (0)
  3614. Indicates an unused program header.
  3615. 'PT_LOAD' (1)
  3616. Indicates that this program header describes a segment to be loaded
  3617. from the file.
  3618. 'PT_DYNAMIC' (2)
  3619. Indicates a segment where dynamic linking information can be found.
  3620. 'PT_INTERP' (3)
  3621. Indicates a segment where the name of the program interpreter may
  3622. be found.
  3623. 'PT_NOTE' (4)
  3624. Indicates a segment holding note information.
  3625. 'PT_SHLIB' (5)
  3626. A reserved program header type, defined but not specified by the
  3627. ELF ABI.
  3628. 'PT_PHDR' (6)
  3629. Indicates a segment where the program headers may be found.
  3630. 'PT_TLS' (7)
  3631. Indicates a segment containing thread local storage.
  3632. EXPRESSION
  3633. An expression giving the numeric type of the program header. This
  3634. may be used for types not defined above.
  3635. You can specify that a segment should be loaded at a particular
  3636. address in memory by using an 'AT' expression. This is identical to the
  3637. 'AT' command used as an output section attribute (*note Output Section
  3638. LMA::). The 'AT' command for a program header overrides the output
  3639. section attribute.
  3640. The linker will normally set the segment flags based on the sections
  3641. which comprise the segment. You may use the 'FLAGS' keyword to
  3642. explicitly specify the segment flags. The value of FLAGS must be an
  3643. integer. It is used to set the 'p_flags' field of the program header.
  3644. Here is an example of 'PHDRS'. This shows a typical set of program
  3645. headers used on a native ELF system.
  3646. PHDRS
  3647. {
  3648. headers PT_PHDR PHDRS ;
  3649. interp PT_INTERP ;
  3650. text PT_LOAD FILEHDR PHDRS ;
  3651. data PT_LOAD ;
  3652. dynamic PT_DYNAMIC ;
  3653. }
  3654. SECTIONS
  3655. {
  3656. . = SIZEOF_HEADERS;
  3657. .interp : { *(.interp) } :text :interp
  3658. .text : { *(.text) } :text
  3659. .rodata : { *(.rodata) } /* defaults to :text */
  3660. ...
  3661. . = . + 0x1000; /* move to a new page in memory */
  3662. .data : { *(.data) } :data
  3663. .dynamic : { *(.dynamic) } :data :dynamic
  3664. ...
  3665. }
  3666. 
  3667. File: ld.info, Node: VERSION, Next: Expressions, Prev: PHDRS, Up: Scripts
  3668. 3.9 VERSION Command
  3669. ===================
  3670. The linker supports symbol versions when using ELF. Symbol versions are
  3671. only useful when using shared libraries. The dynamic linker can use
  3672. symbol versions to select a specific version of a function when it runs
  3673. a program that may have been linked against an earlier version of the
  3674. shared library.
  3675. You can include a version script directly in the main linker script,
  3676. or you can supply the version script as an implicit linker script. You
  3677. can also use the '--version-script' linker option.
  3678. The syntax of the 'VERSION' command is simply
  3679. VERSION { version-script-commands }
  3680. The format of the version script commands is identical to that used
  3681. by Sun's linker in Solaris 2.5. The version script defines a tree of
  3682. version nodes. You specify the node names and interdependencies in the
  3683. version script. You can specify which symbols are bound to which
  3684. version nodes, and you can reduce a specified set of symbols to local
  3685. scope so that they are not globally visible outside of the shared
  3686. library.
  3687. The easiest way to demonstrate the version script language is with a
  3688. few examples.
  3689. VERS_1.1 {
  3690. global:
  3691. foo1;
  3692. local:
  3693. old*;
  3694. original*;
  3695. new*;
  3696. };
  3697. VERS_1.2 {
  3698. foo2;
  3699. } VERS_1.1;
  3700. VERS_2.0 {
  3701. bar1; bar2;
  3702. extern "C++" {
  3703. ns::*;
  3704. "f(int, double)";
  3705. };
  3706. } VERS_1.2;
  3707. This example version script defines three version nodes. The first
  3708. version node defined is 'VERS_1.1'; it has no other dependencies. The
  3709. script binds the symbol 'foo1' to 'VERS_1.1'. It reduces a number of
  3710. symbols to local scope so that they are not visible outside of the
  3711. shared library; this is done using wildcard patterns, so that any symbol
  3712. whose name begins with 'old', 'original', or 'new' is matched. The
  3713. wildcard patterns available are the same as those used in the shell when
  3714. matching filenames (also known as "globbing"). However, if you specify
  3715. the symbol name inside double quotes, then the name is treated as
  3716. literal, rather than as a glob pattern.
  3717. Next, the version script defines node 'VERS_1.2'. This node depends
  3718. upon 'VERS_1.1'. The script binds the symbol 'foo2' to the version node
  3719. 'VERS_1.2'.
  3720. Finally, the version script defines node 'VERS_2.0'. This node
  3721. depends upon 'VERS_1.2'. The scripts binds the symbols 'bar1' and
  3722. 'bar2' are bound to the version node 'VERS_2.0'.
  3723. When the linker finds a symbol defined in a library which is not
  3724. specifically bound to a version node, it will effectively bind it to an
  3725. unspecified base version of the library. You can bind all otherwise
  3726. unspecified symbols to a given version node by using 'global: *;'
  3727. somewhere in the version script. Note that it's slightly crazy to use
  3728. wildcards in a global spec except on the last version node. Global
  3729. wildcards elsewhere run the risk of accidentally adding symbols to the
  3730. set exported for an old version. That's wrong since older versions
  3731. ought to have a fixed set of symbols.
  3732. The names of the version nodes have no specific meaning other than
  3733. what they might suggest to the person reading them. The '2.0' version
  3734. could just as well have appeared in between '1.1' and '1.2'. However,
  3735. this would be a confusing way to write a version script.
  3736. Node name can be omitted, provided it is the only version node in the
  3737. version script. Such version script doesn't assign any versions to
  3738. symbols, only selects which symbols will be globally visible out and
  3739. which won't.
  3740. { global: foo; bar; local: *; };
  3741. When you link an application against a shared library that has
  3742. versioned symbols, the application itself knows which version of each
  3743. symbol it requires, and it also knows which version nodes it needs from
  3744. each shared library it is linked against. Thus at runtime, the dynamic
  3745. loader can make a quick check to make sure that the libraries you have
  3746. linked against do in fact supply all of the version nodes that the
  3747. application will need to resolve all of the dynamic symbols. In this
  3748. way it is possible for the dynamic linker to know with certainty that
  3749. all external symbols that it needs will be resolvable without having to
  3750. search for each symbol reference.
  3751. The symbol versioning is in effect a much more sophisticated way of
  3752. doing minor version checking that SunOS does. The fundamental problem
  3753. that is being addressed here is that typically references to external
  3754. functions are bound on an as-needed basis, and are not all bound when
  3755. the application starts up. If a shared library is out of date, a
  3756. required interface may be missing; when the application tries to use
  3757. that interface, it may suddenly and unexpectedly fail. With symbol
  3758. versioning, the user will get a warning when they start their program if
  3759. the libraries being used with the application are too old.
  3760. There are several GNU extensions to Sun's versioning approach. The
  3761. first of these is the ability to bind a symbol to a version node in the
  3762. source file where the symbol is defined instead of in the versioning
  3763. script. This was done mainly to reduce the burden on the library
  3764. maintainer. You can do this by putting something like:
  3765. __asm__(".symver original_foo,foo@VERS_1.1");
  3766. in the C source file. This renames the function 'original_foo' to be an
  3767. alias for 'foo' bound to the version node 'VERS_1.1'. The 'local:'
  3768. directive can be used to prevent the symbol 'original_foo' from being
  3769. exported. A '.symver' directive takes precedence over a version script.
  3770. The second GNU extension is to allow multiple versions of the same
  3771. function to appear in a given shared library. In this way you can make
  3772. an incompatible change to an interface without increasing the major
  3773. version number of the shared library, while still allowing applications
  3774. linked against the old interface to continue to function.
  3775. To do this, you must use multiple '.symver' directives in the source
  3776. file. Here is an example:
  3777. __asm__(".symver original_foo,foo@");
  3778. __asm__(".symver old_foo,foo@VERS_1.1");
  3779. __asm__(".symver old_foo1,foo@VERS_1.2");
  3780. __asm__(".symver new_foo,foo@@VERS_2.0");
  3781. In this example, 'foo@' represents the symbol 'foo' bound to the
  3782. unspecified base version of the symbol. The source file that contains
  3783. this example would define 4 C functions: 'original_foo', 'old_foo',
  3784. 'old_foo1', and 'new_foo'.
  3785. When you have multiple definitions of a given symbol, there needs to
  3786. be some way to specify a default version to which external references to
  3787. this symbol will be bound. You can do this with the 'foo@@VERS_2.0'
  3788. type of '.symver' directive. You can only declare one version of a
  3789. symbol as the default in this manner; otherwise you would effectively
  3790. have multiple definitions of the same symbol.
  3791. If you wish to bind a reference to a specific version of the symbol
  3792. within the shared library, you can use the aliases of convenience (i.e.,
  3793. 'old_foo'), or you can use the '.symver' directive to specifically bind
  3794. to an external version of the function in question.
  3795. You can also specify the language in the version script:
  3796. VERSION extern "lang" { version-script-commands }
  3797. The supported 'lang's are 'C', 'C++', and 'Java'. The linker will
  3798. iterate over the list of symbols at the link time and demangle them
  3799. according to 'lang' before matching them to the patterns specified in
  3800. 'version-script-commands'. The default 'lang' is 'C'.
  3801. Demangled names may contains spaces and other special characters. As
  3802. described above, you can use a glob pattern to match demangled names, or
  3803. you can use a double-quoted string to match the string exactly. In the
  3804. latter case, be aware that minor differences (such as differing
  3805. whitespace) between the version script and the demangler output will
  3806. cause a mismatch. As the exact string generated by the demangler might
  3807. change in the future, even if the mangled name does not, you should
  3808. check that all of your version directives are behaving as you expect
  3809. when you upgrade.
  3810. 
  3811. File: ld.info, Node: Expressions, Next: Implicit Linker Scripts, Prev: VERSION, Up: Scripts
  3812. 3.10 Expressions in Linker Scripts
  3813. ==================================
  3814. The syntax for expressions in the linker script language is identical to
  3815. that of C expressions. All expressions are evaluated as integers. All
  3816. expressions are evaluated in the same size, which is 32 bits if both the
  3817. host and target are 32 bits, and is otherwise 64 bits.
  3818. You can use and set symbol values in expressions.
  3819. The linker defines several special purpose builtin functions for use
  3820. in expressions.
  3821. * Menu:
  3822. * Constants:: Constants
  3823. * Symbolic Constants:: Symbolic constants
  3824. * Symbols:: Symbol Names
  3825. * Orphan Sections:: Orphan Sections
  3826. * Location Counter:: The Location Counter
  3827. * Operators:: Operators
  3828. * Evaluation:: Evaluation
  3829. * Expression Section:: The Section of an Expression
  3830. * Builtin Functions:: Builtin Functions
  3831. 
  3832. File: ld.info, Node: Constants, Next: Symbolic Constants, Up: Expressions
  3833. 3.10.1 Constants
  3834. ----------------
  3835. All constants are integers.
  3836. As in C, the linker considers an integer beginning with '0' to be
  3837. octal, and an integer beginning with '0x' or '0X' to be hexadecimal.
  3838. Alternatively the linker accepts suffixes of 'h' or 'H' for hexadecimal,
  3839. 'o' or 'O' for octal, 'b' or 'B' for binary and 'd' or 'D' for decimal.
  3840. Any integer value without a prefix or a suffix is considered to be
  3841. decimal.
  3842. In addition, you can use the suffixes 'K' and 'M' to scale a constant
  3843. by '1024' or '1024*1024' respectively. For example, the following all
  3844. refer to the same quantity:
  3845. _fourk_1 = 4K;
  3846. _fourk_2 = 4096;
  3847. _fourk_3 = 0x1000;
  3848. _fourk_4 = 10000o;
  3849. Note - the 'K' and 'M' suffixes cannot be used in conjunction with
  3850. the base suffixes mentioned above.
  3851. 
  3852. File: ld.info, Node: Symbolic Constants, Next: Symbols, Prev: Constants, Up: Expressions
  3853. 3.10.2 Symbolic Constants
  3854. -------------------------
  3855. It is possible to refer to target specific constants via the use of the
  3856. 'CONSTANT(NAME)' operator, where NAME is one of:
  3857. 'MAXPAGESIZE'
  3858. The target's maximum page size.
  3859. 'COMMONPAGESIZE'
  3860. The target's default page size.
  3861. So for example:
  3862. .text ALIGN (CONSTANT (MAXPAGESIZE)) : { *(.text) }
  3863. will create a text section aligned to the largest page boundary
  3864. supported by the target.
  3865. 
  3866. File: ld.info, Node: Symbols, Next: Orphan Sections, Prev: Symbolic Constants, Up: Expressions
  3867. 3.10.3 Symbol Names
  3868. -------------------
  3869. Unless quoted, symbol names start with a letter, underscore, or period
  3870. and may include letters, digits, underscores, periods, and hyphens.
  3871. Unquoted symbol names must not conflict with any keywords. You can
  3872. specify a symbol which contains odd characters or has the same name as a
  3873. keyword by surrounding the symbol name in double quotes:
  3874. "SECTION" = 9;
  3875. "with a space" = "also with a space" + 10;
  3876. Since symbols can contain many non-alphabetic characters, it is
  3877. safest to delimit symbols with spaces. For example, 'A-B' is one
  3878. symbol, whereas 'A - B' is an expression involving subtraction.
  3879. 
  3880. File: ld.info, Node: Orphan Sections, Next: Location Counter, Prev: Symbols, Up: Expressions
  3881. 3.10.4 Orphan Sections
  3882. ----------------------
  3883. Orphan sections are sections present in the input files which are not
  3884. explicitly placed into the output file by the linker script. The linker
  3885. will still copy these sections into the output file, but it has to guess
  3886. as to where they should be placed. The linker uses a simple heuristic
  3887. to do this. It attempts to place orphan sections after non-orphan
  3888. sections of the same attribute, such as code vs data, loadable vs
  3889. non-loadable, etc. If there is not enough room to do this then it
  3890. places at the end of the file.
  3891. For ELF targets, the attribute of the section includes section type
  3892. as well as section flag.
  3893. The command line options '--orphan-handling' and '--unique' (*note
  3894. Command Line Options: Options.) can be used to control which output
  3895. sections an orphan is placed in.
  3896. If an orphaned section's name is representable as a C identifier then
  3897. the linker will automatically *note PROVIDE:: two symbols:
  3898. __start_SECNAME and __stop_SECNAME, where SECNAME is the name of the
  3899. section. These indicate the start address and end address of the
  3900. orphaned section respectively. Note: most section names are not
  3901. representable as C identifiers because they contain a '.' character.
  3902. 
  3903. File: ld.info, Node: Location Counter, Next: Operators, Prev: Orphan Sections, Up: Expressions
  3904. 3.10.5 The Location Counter
  3905. ---------------------------
  3906. The special linker variable "dot" '.' always contains the current output
  3907. location counter. Since the '.' always refers to a location in an
  3908. output section, it may only appear in an expression within a 'SECTIONS'
  3909. command. The '.' symbol may appear anywhere that an ordinary symbol is
  3910. allowed in an expression.
  3911. Assigning a value to '.' will cause the location counter to be moved.
  3912. This may be used to create holes in the output section. The location
  3913. counter may not be moved backwards inside an output section, and may not
  3914. be moved backwards outside of an output section if so doing creates
  3915. areas with overlapping LMAs.
  3916. SECTIONS
  3917. {
  3918. output :
  3919. {
  3920. file1(.text)
  3921. . = . + 1000;
  3922. file2(.text)
  3923. . += 1000;
  3924. file3(.text)
  3925. } = 0x12345678;
  3926. }
  3927. In the previous example, the '.text' section from 'file1' is located at
  3928. the beginning of the output section 'output'. It is followed by a 1000
  3929. byte gap. Then the '.text' section from 'file2' appears, also with a
  3930. 1000 byte gap following before the '.text' section from 'file3'. The
  3931. notation '= 0x12345678' specifies what data to write in the gaps (*note
  3932. Output Section Fill::).
  3933. Note: '.' actually refers to the byte offset from the start of the
  3934. current containing object. Normally this is the 'SECTIONS' statement,
  3935. whose start address is 0, hence '.' can be used as an absolute address.
  3936. If '.' is used inside a section description however, it refers to the
  3937. byte offset from the start of that section, not an absolute address.
  3938. Thus in a script like this:
  3939. SECTIONS
  3940. {
  3941. . = 0x100
  3942. .text: {
  3943. *(.text)
  3944. . = 0x200
  3945. }
  3946. . = 0x500
  3947. .data: {
  3948. *(.data)
  3949. . += 0x600
  3950. }
  3951. }
  3952. The '.text' section will be assigned a starting address of 0x100 and
  3953. a size of exactly 0x200 bytes, even if there is not enough data in the
  3954. '.text' input sections to fill this area. (If there is too much data,
  3955. an error will be produced because this would be an attempt to move '.'
  3956. backwards). The '.data' section will start at 0x500 and it will have an
  3957. extra 0x600 bytes worth of space after the end of the values from the
  3958. '.data' input sections and before the end of the '.data' output section
  3959. itself.
  3960. Setting symbols to the value of the location counter outside of an
  3961. output section statement can result in unexpected values if the linker
  3962. needs to place orphan sections. For example, given the following:
  3963. SECTIONS
  3964. {
  3965. start_of_text = . ;
  3966. .text: { *(.text) }
  3967. end_of_text = . ;
  3968. start_of_data = . ;
  3969. .data: { *(.data) }
  3970. end_of_data = . ;
  3971. }
  3972. If the linker needs to place some input section, e.g. '.rodata', not
  3973. mentioned in the script, it might choose to place that section between
  3974. '.text' and '.data'. You might think the linker should place '.rodata'
  3975. on the blank line in the above script, but blank lines are of no
  3976. particular significance to the linker. As well, the linker doesn't
  3977. associate the above symbol names with their sections. Instead, it
  3978. assumes that all assignments or other statements belong to the previous
  3979. output section, except for the special case of an assignment to '.'.
  3980. I.e., the linker will place the orphan '.rodata' section as if the
  3981. script was written as follows:
  3982. SECTIONS
  3983. {
  3984. start_of_text = . ;
  3985. .text: { *(.text) }
  3986. end_of_text = . ;
  3987. start_of_data = . ;
  3988. .rodata: { *(.rodata) }
  3989. .data: { *(.data) }
  3990. end_of_data = . ;
  3991. }
  3992. This may or may not be the script author's intention for the value of
  3993. 'start_of_data'. One way to influence the orphan section placement is
  3994. to assign the location counter to itself, as the linker assumes that an
  3995. assignment to '.' is setting the start address of a following output
  3996. section and thus should be grouped with that section. So you could
  3997. write:
  3998. SECTIONS
  3999. {
  4000. start_of_text = . ;
  4001. .text: { *(.text) }
  4002. end_of_text = . ;
  4003. . = . ;
  4004. start_of_data = . ;
  4005. .data: { *(.data) }
  4006. end_of_data = . ;
  4007. }
  4008. Now, the orphan '.rodata' section will be placed between
  4009. 'end_of_text' and 'start_of_data'.
  4010. 
  4011. File: ld.info, Node: Operators, Next: Evaluation, Prev: Location Counter, Up: Expressions
  4012. 3.10.6 Operators
  4013. ----------------
  4014. The linker recognizes the standard C set of arithmetic operators, with
  4015. the standard bindings and precedence levels:
  4016. precedence associativity Operators Notes
  4017. (highest)
  4018. 1 left ! - ~ (1)
  4019. 2 left * / %
  4020. 3 left + -
  4021. 4 left >> <<
  4022. 5 left == != > < <= >=
  4023. 6 left &
  4024. 7 left |
  4025. 8 left &&
  4026. 9 left ||
  4027. 10 right ? :
  4028. 11 right &= += -= *= /= (2)
  4029. (lowest)
  4030. Notes: (1) Prefix operators (2) *Note Assignments::.
  4031. 
  4032. File: ld.info, Node: Evaluation, Next: Expression Section, Prev: Operators, Up: Expressions
  4033. 3.10.7 Evaluation
  4034. -----------------
  4035. The linker evaluates expressions lazily. It only computes the value of
  4036. an expression when absolutely necessary.
  4037. The linker needs some information, such as the value of the start
  4038. address of the first section, and the origins and lengths of memory
  4039. regions, in order to do any linking at all. These values are computed
  4040. as soon as possible when the linker reads in the linker script.
  4041. However, other values (such as symbol values) are not known or needed
  4042. until after storage allocation. Such values are evaluated later, when
  4043. other information (such as the sizes of output sections) is available
  4044. for use in the symbol assignment expression.
  4045. The sizes of sections cannot be known until after allocation, so
  4046. assignments dependent upon these are not performed until after
  4047. allocation.
  4048. Some expressions, such as those depending upon the location counter
  4049. '.', must be evaluated during section allocation.
  4050. If the result of an expression is required, but the value is not
  4051. available, then an error results. For example, a script like the
  4052. following
  4053. SECTIONS
  4054. {
  4055. .text 9+this_isnt_constant :
  4056. { *(.text) }
  4057. }
  4058. will cause the error message 'non constant expression for initial
  4059. address'.
  4060. 
  4061. File: ld.info, Node: Expression Section, Next: Builtin Functions, Prev: Evaluation, Up: Expressions
  4062. 3.10.8 The Section of an Expression
  4063. -----------------------------------
  4064. Addresses and symbols may be section relative, or absolute. A section
  4065. relative symbol is relocatable. If you request relocatable output using
  4066. the '-r' option, a further link operation may change the value of a
  4067. section relative symbol. On the other hand, an absolute symbol will
  4068. retain the same value throughout any further link operations.
  4069. Some terms in linker expressions are addresses. This is true of
  4070. section relative symbols and for builtin functions that return an
  4071. address, such as 'ADDR', 'LOADADDR', 'ORIGIN' and 'SEGMENT_START'.
  4072. Other terms are simply numbers, or are builtin functions that return a
  4073. non-address value, such as 'LENGTH'. One complication is that unless
  4074. you set 'LD_FEATURE ("SANE_EXPR")' (*note Miscellaneous Commands::),
  4075. numbers and absolute symbols are treated differently depending on their
  4076. location, for compatibility with older versions of 'ld'. Expressions
  4077. appearing outside an output section definition treat all numbers as
  4078. absolute addresses. Expressions appearing inside an output section
  4079. definition treat absolute symbols as numbers. If 'LD_FEATURE
  4080. ("SANE_EXPR")' is given, then absolute symbols and numbers are simply
  4081. treated as numbers everywhere.
  4082. In the following simple example,
  4083. SECTIONS
  4084. {
  4085. . = 0x100;
  4086. __executable_start = 0x100;
  4087. .data :
  4088. {
  4089. . = 0x10;
  4090. __data_start = 0x10;
  4091. *(.data)
  4092. }
  4093. ...
  4094. }
  4095. both '.' and '__executable_start' are set to the absolute address
  4096. 0x100 in the first two assignments, then both '.' and '__data_start' are
  4097. set to 0x10 relative to the '.data' section in the second two
  4098. assignments.
  4099. For expressions involving numbers, relative addresses and absolute
  4100. addresses, ld follows these rules to evaluate terms:
  4101. * Unary operations on an absolute address or number, and binary
  4102. operations on two absolute addresses or two numbers, or between one
  4103. absolute address and a number, apply the operator to the value(s).
  4104. * Unary operations on a relative address, and binary operations on
  4105. two relative addresses in the same section or between one relative
  4106. address and a number, apply the operator to the offset part of the
  4107. address(es).
  4108. * Other binary operations, that is, between two relative addresses
  4109. not in the same section, or between a relative address and an
  4110. absolute address, first convert any non-absolute term to an
  4111. absolute address before applying the operator.
  4112. The result section of each sub-expression is as follows:
  4113. * An operation involving only numbers results in a number.
  4114. * The result of comparisons, '&&' and '||' is also a number.
  4115. * The result of other binary arithmetic and logical operations on two
  4116. relative addresses in the same section or two absolute addresses
  4117. (after above conversions) is also a number when 'LD_FEATURE
  4118. ("SANE_EXPR")' or inside an output section definition but an
  4119. absolute address otherwise.
  4120. * The result of other operations on relative addresses or one
  4121. relative address and a number, is a relative address in the same
  4122. section as the relative operand(s).
  4123. * The result of other operations on absolute addresses (after above
  4124. conversions) is an absolute address.
  4125. You can use the builtin function 'ABSOLUTE' to force an expression to
  4126. be absolute when it would otherwise be relative. For example, to create
  4127. an absolute symbol set to the address of the end of the output section
  4128. '.data':
  4129. SECTIONS
  4130. {
  4131. .data : { *(.data) _edata = ABSOLUTE(.); }
  4132. }
  4133. If 'ABSOLUTE' were not used, '_edata' would be relative to the '.data'
  4134. section.
  4135. Using 'LOADADDR' also forces an expression absolute, since this
  4136. particular builtin function returns an absolute address.
  4137. 
  4138. File: ld.info, Node: Builtin Functions, Prev: Expression Section, Up: Expressions
  4139. 3.10.9 Builtin Functions
  4140. ------------------------
  4141. The linker script language includes a number of builtin functions for
  4142. use in linker script expressions.
  4143. 'ABSOLUTE(EXP)'
  4144. Return the absolute (non-relocatable, as opposed to non-negative)
  4145. value of the expression EXP. Primarily useful to assign an
  4146. absolute value to a symbol within a section definition, where
  4147. symbol values are normally section relative. *Note Expression
  4148. Section::.
  4149. 'ADDR(SECTION)'
  4150. Return the address (VMA) of the named SECTION. Your script must
  4151. previously have defined the location of that section. In the
  4152. following example, 'start_of_output_1', 'symbol_1' and 'symbol_2'
  4153. are assigned equivalent values, except that 'symbol_1' will be
  4154. relative to the '.output1' section while the other two will be
  4155. absolute:
  4156. SECTIONS { ...
  4157. .output1 :
  4158. {
  4159. start_of_output_1 = ABSOLUTE(.);
  4160. ...
  4161. }
  4162. .output :
  4163. {
  4164. symbol_1 = ADDR(.output1);
  4165. symbol_2 = start_of_output_1;
  4166. }
  4167. ... }
  4168. 'ALIGN(ALIGN)'
  4169. 'ALIGN(EXP,ALIGN)'
  4170. Return the location counter ('.') or arbitrary expression aligned
  4171. to the next ALIGN boundary. The single operand 'ALIGN' doesn't
  4172. change the value of the location counter--it just does arithmetic
  4173. on it. The two operand 'ALIGN' allows an arbitrary expression to
  4174. be aligned upwards ('ALIGN(ALIGN)' is equivalent to
  4175. 'ALIGN(ABSOLUTE(.), ALIGN)').
  4176. Here is an example which aligns the output '.data' section to the
  4177. next '0x2000' byte boundary after the preceding section and sets a
  4178. variable within the section to the next '0x8000' boundary after the
  4179. input sections:
  4180. SECTIONS { ...
  4181. .data ALIGN(0x2000): {
  4182. *(.data)
  4183. variable = ALIGN(0x8000);
  4184. }
  4185. ... }
  4186. The first use of 'ALIGN' in this example specifies the location of
  4187. a section because it is used as the optional ADDRESS attribute of a
  4188. section definition (*note Output Section Address::). The second
  4189. use of 'ALIGN' is used to defines the value of a symbol.
  4190. The builtin function 'NEXT' is closely related to 'ALIGN'.
  4191. 'ALIGNOF(SECTION)'
  4192. Return the alignment in bytes of the named SECTION, if that section
  4193. has been allocated. If the section has not been allocated when
  4194. this is evaluated, the linker will report an error. In the
  4195. following example, the alignment of the '.output' section is stored
  4196. as the first value in that section.
  4197. SECTIONS{ ...
  4198. .output {
  4199. LONG (ALIGNOF (.output))
  4200. ...
  4201. }
  4202. ... }
  4203. 'BLOCK(EXP)'
  4204. This is a synonym for 'ALIGN', for compatibility with older linker
  4205. scripts. It is most often seen when setting the address of an
  4206. output section.
  4207. 'DATA_SEGMENT_ALIGN(MAXPAGESIZE, COMMONPAGESIZE)'
  4208. This is equivalent to either
  4209. (ALIGN(MAXPAGESIZE) + (. & (MAXPAGESIZE - 1)))
  4210. or
  4211. (ALIGN(MAXPAGESIZE)
  4212. + ((. + COMMONPAGESIZE - 1) & (MAXPAGESIZE - COMMONPAGESIZE)))
  4213. depending on whether the latter uses fewer COMMONPAGESIZE sized
  4214. pages for the data segment (area between the result of this
  4215. expression and 'DATA_SEGMENT_END') than the former or not. If the
  4216. latter form is used, it means COMMONPAGESIZE bytes of runtime
  4217. memory will be saved at the expense of up to COMMONPAGESIZE wasted
  4218. bytes in the on-disk file.
  4219. This expression can only be used directly in 'SECTIONS' commands,
  4220. not in any output section descriptions and only once in the linker
  4221. script. COMMONPAGESIZE should be less or equal to MAXPAGESIZE and
  4222. should be the system page size the object wants to be optimized for
  4223. (while still working on system page sizes up to MAXPAGESIZE).
  4224. Example:
  4225. . = DATA_SEGMENT_ALIGN(0x10000, 0x2000);
  4226. 'DATA_SEGMENT_END(EXP)'
  4227. This defines the end of data segment for 'DATA_SEGMENT_ALIGN'
  4228. evaluation purposes.
  4229. . = DATA_SEGMENT_END(.);
  4230. 'DATA_SEGMENT_RELRO_END(OFFSET, EXP)'
  4231. This defines the end of the 'PT_GNU_RELRO' segment when '-z relro'
  4232. option is used. When '-z relro' option is not present,
  4233. 'DATA_SEGMENT_RELRO_END' does nothing, otherwise
  4234. 'DATA_SEGMENT_ALIGN' is padded so that EXP + OFFSET is aligned to
  4235. the most commonly used page boundary for particular target. If
  4236. present in the linker script, it must always come in between
  4237. 'DATA_SEGMENT_ALIGN' and 'DATA_SEGMENT_END'. Evaluates to the
  4238. second argument plus any padding needed at the end of the
  4239. 'PT_GNU_RELRO' segment due to section alignment.
  4240. . = DATA_SEGMENT_RELRO_END(24, .);
  4241. 'DEFINED(SYMBOL)'
  4242. Return 1 if SYMBOL is in the linker global symbol table and is
  4243. defined before the statement using DEFINED in the script, otherwise
  4244. return 0. You can use this function to provide default values for
  4245. symbols. For example, the following script fragment shows how to
  4246. set a global symbol 'begin' to the first location in the '.text'
  4247. section--but if a symbol called 'begin' already existed, its value
  4248. is preserved:
  4249. SECTIONS { ...
  4250. .text : {
  4251. begin = DEFINED(begin) ? begin : . ;
  4252. ...
  4253. }
  4254. ...
  4255. }
  4256. 'LENGTH(MEMORY)'
  4257. Return the length of the memory region named MEMORY.
  4258. 'LOADADDR(SECTION)'
  4259. Return the absolute LMA of the named SECTION. (*note Output
  4260. Section LMA::).
  4261. 'LOG2CEIL(EXP)'
  4262. Return the binary logarithm of EXP rounded towards infinity.
  4263. 'LOG2CEIL(0)' returns 0.
  4264. 'MAX(EXP1, EXP2)'
  4265. Returns the maximum of EXP1 and EXP2.
  4266. 'MIN(EXP1, EXP2)'
  4267. Returns the minimum of EXP1 and EXP2.
  4268. 'NEXT(EXP)'
  4269. Return the next unallocated address that is a multiple of EXP.
  4270. This function is closely related to 'ALIGN(EXP)'; unless you use
  4271. the 'MEMORY' command to define discontinuous memory for the output
  4272. file, the two functions are equivalent.
  4273. 'ORIGIN(MEMORY)'
  4274. Return the origin of the memory region named MEMORY.
  4275. 'SEGMENT_START(SEGMENT, DEFAULT)'
  4276. Return the base address of the named SEGMENT. If an explicit value
  4277. has already been given for this segment (with a command-line '-T'
  4278. option) then that value will be returned otherwise the value will
  4279. be DEFAULT. At present, the '-T' command-line option can only be
  4280. used to set the base address for the "text", "data", and "bss"
  4281. sections, but you can use 'SEGMENT_START' with any segment name.
  4282. 'SIZEOF(SECTION)'
  4283. Return the size in bytes of the named SECTION, if that section has
  4284. been allocated. If the section has not been allocated when this is
  4285. evaluated, the linker will report an error. In the following
  4286. example, 'symbol_1' and 'symbol_2' are assigned identical values:
  4287. SECTIONS{ ...
  4288. .output {
  4289. .start = . ;
  4290. ...
  4291. .end = . ;
  4292. }
  4293. symbol_1 = .end - .start ;
  4294. symbol_2 = SIZEOF(.output);
  4295. ... }
  4296. 'SIZEOF_HEADERS'
  4297. 'sizeof_headers'
  4298. Return the size in bytes of the output file's headers. This is
  4299. information which appears at the start of the output file. You can
  4300. use this number when setting the start address of the first
  4301. section, if you choose, to facilitate paging.
  4302. When producing an ELF output file, if the linker script uses the
  4303. 'SIZEOF_HEADERS' builtin function, the linker must compute the
  4304. number of program headers before it has determined all the section
  4305. addresses and sizes. If the linker later discovers that it needs
  4306. additional program headers, it will report an error 'not enough
  4307. room for program headers'. To avoid this error, you must avoid
  4308. using the 'SIZEOF_HEADERS' function, or you must rework your linker
  4309. script to avoid forcing the linker to use additional program
  4310. headers, or you must define the program headers yourself using the
  4311. 'PHDRS' command (*note PHDRS::).
  4312. 
  4313. File: ld.info, Node: Implicit Linker Scripts, Prev: Expressions, Up: Scripts
  4314. 3.11 Implicit Linker Scripts
  4315. ============================
  4316. If you specify a linker input file which the linker can not recognize as
  4317. an object file or an archive file, it will try to read the file as a
  4318. linker script. If the file can not be parsed as a linker script, the
  4319. linker will report an error.
  4320. An implicit linker script will not replace the default linker script.
  4321. Typically an implicit linker script would contain only symbol
  4322. assignments, or the 'INPUT', 'GROUP', or 'VERSION' commands.
  4323. Any input files read because of an implicit linker script will be
  4324. read at the position in the command line where the implicit linker
  4325. script was read. This can affect archive searching.
  4326. 
  4327. File: ld.info, Node: Machine Dependent, Next: BFD, Prev: Scripts, Up: Top
  4328. 4 Machine Dependent Features
  4329. ****************************
  4330. 'ld' has additional features on some platforms; the following sections
  4331. describe them. Machines where 'ld' has no additional functionality are
  4332. not listed.
  4333. * Menu:
  4334. * H8/300:: 'ld' and the H8/300
  4335. * i960:: 'ld' and the Intel 960 family
  4336. * M68HC11/68HC12:: 'ld' and the Motorola 68HC11 and 68HC12 families
  4337. * ARM:: 'ld' and the ARM family
  4338. * HPPA ELF32:: 'ld' and HPPA 32-bit ELF
  4339. * M68K:: 'ld' and the Motorola 68K family
  4340. * MIPS:: 'ld' and the MIPS family
  4341. * MMIX:: 'ld' and MMIX
  4342. * MSP430:: 'ld' and MSP430
  4343. * NDS32:: 'ld' and NDS32
  4344. * Nios II:: 'ld' and the Altera Nios II
  4345. * PowerPC ELF32:: 'ld' and PowerPC 32-bit ELF Support
  4346. * PowerPC64 ELF64:: 'ld' and PowerPC64 64-bit ELF Support
  4347. * SPU ELF:: 'ld' and SPU ELF Support
  4348. * TI COFF:: 'ld' and TI COFF
  4349. * WIN32:: 'ld' and WIN32 (cygwin/mingw)
  4350. * Xtensa:: 'ld' and Xtensa Processors
  4351. 
  4352. File: ld.info, Node: H8/300, Next: i960, Up: Machine Dependent
  4353. 4.1 'ld' and the H8/300
  4354. =======================
  4355. For the H8/300, 'ld' can perform these global optimizations when you
  4356. specify the '--relax' command-line option.
  4357. _relaxing address modes_
  4358. 'ld' finds all 'jsr' and 'jmp' instructions whose targets are
  4359. within eight bits, and turns them into eight-bit program-counter
  4360. relative 'bsr' and 'bra' instructions, respectively.
  4361. _synthesizing instructions_
  4362. 'ld' finds all 'mov.b' instructions which use the sixteen-bit
  4363. absolute address form, but refer to the top page of memory, and
  4364. changes them to use the eight-bit address form. (That is: the
  4365. linker turns 'mov.b '@'AA:16' into 'mov.b '@'AA:8' whenever the
  4366. address AA is in the top page of memory).
  4367. 'ld' finds all 'mov' instructions which use the register indirect
  4368. with 32-bit displacement addressing mode, but use a small
  4369. displacement inside 16-bit displacement range, and changes them to
  4370. use the 16-bit displacement form. (That is: the linker turns
  4371. 'mov.b '@'D:32,ERx' into 'mov.b '@'D:16,ERx' whenever the
  4372. displacement D is in the 16 bit signed integer range. Only
  4373. implemented in ELF-format ld).
  4374. _bit manipulation instructions_
  4375. 'ld' finds all bit manipulation instructions like 'band, bclr,
  4376. biand, bild, bior, bist, bixor, bld, bnot, bor, bset, bst, btst,
  4377. bxor' which use 32 bit and 16 bit absolute address form, but refer
  4378. to the top page of memory, and changes them to use the 8 bit
  4379. address form. (That is: the linker turns 'bset #xx:3,'@'AA:32'
  4380. into 'bset #xx:3,'@'AA:8' whenever the address AA is in the top
  4381. page of memory).
  4382. _system control instructions_
  4383. 'ld' finds all 'ldc.w, stc.w' instructions which use the 32 bit
  4384. absolute address form, but refer to the top page of memory, and
  4385. changes them to use 16 bit address form. (That is: the linker
  4386. turns 'ldc.w '@'AA:32,ccr' into 'ldc.w '@'AA:16,ccr' whenever the
  4387. address AA is in the top page of memory).
  4388. 
  4389. File: ld.info, Node: i960, Next: M68HC11/68HC12, Prev: H8/300, Up: Machine Dependent
  4390. 4.2 'ld' and the Intel 960 Family
  4391. =================================
  4392. You can use the '-AARCHITECTURE' command line option to specify one of
  4393. the two-letter names identifying members of the 960 family; the option
  4394. specifies the desired output target, and warns of any incompatible
  4395. instructions in the input files. It also modifies the linker's search
  4396. strategy for archive libraries, to support the use of libraries specific
  4397. to each particular architecture, by including in the search loop names
  4398. suffixed with the string identifying the architecture.
  4399. For example, if your 'ld' command line included '-ACA' as well as
  4400. '-ltry', the linker would look (in its built-in search paths, and in any
  4401. paths you specify with '-L') for a library with the names
  4402. try
  4403. libtry.a
  4404. tryca
  4405. libtryca.a
  4406. The first two possibilities would be considered in any event; the last
  4407. two are due to the use of '-ACA'.
  4408. You can meaningfully use '-A' more than once on a command line, since
  4409. the 960 architecture family allows combination of target architectures;
  4410. each use will add another pair of name variants to search for when '-l'
  4411. specifies a library.
  4412. 'ld' supports the '--relax' option for the i960 family. If you
  4413. specify '--relax', 'ld' finds all 'balx' and 'calx' instructions whose
  4414. targets are within 24 bits, and turns them into 24-bit program-counter
  4415. relative 'bal' and 'cal' instructions, respectively. 'ld' also turns
  4416. 'cal' instructions into 'bal' instructions when it determines that the
  4417. target subroutine is a leaf routine (that is, the target subroutine does
  4418. not itself call any subroutines).
  4419. 
  4420. File: ld.info, Node: M68HC11/68HC12, Next: ARM, Prev: i960, Up: Machine Dependent
  4421. 4.3 'ld' and the Motorola 68HC11 and 68HC12 families
  4422. ====================================================
  4423. 4.3.1 Linker Relaxation
  4424. -----------------------
  4425. For the Motorola 68HC11, 'ld' can perform these global optimizations
  4426. when you specify the '--relax' command-line option.
  4427. _relaxing address modes_
  4428. 'ld' finds all 'jsr' and 'jmp' instructions whose targets are
  4429. within eight bits, and turns them into eight-bit program-counter
  4430. relative 'bsr' and 'bra' instructions, respectively.
  4431. 'ld' also looks at all 16-bit extended addressing modes and
  4432. transforms them in a direct addressing mode when the address is in
  4433. page 0 (between 0 and 0x0ff).
  4434. _relaxing gcc instruction group_
  4435. When 'gcc' is called with '-mrelax', it can emit group of
  4436. instructions that the linker can optimize to use a 68HC11 direct
  4437. addressing mode. These instructions consists of 'bclr' or 'bset'
  4438. instructions.
  4439. 4.3.2 Trampoline Generation
  4440. ---------------------------
  4441. For 68HC11 and 68HC12, 'ld' can generate trampoline code to call a far
  4442. function using a normal 'jsr' instruction. The linker will also change
  4443. the relocation to some far function to use the trampoline address
  4444. instead of the function address. This is typically the case when a
  4445. pointer to a function is taken. The pointer will in fact point to the
  4446. function trampoline.
  4447. 
  4448. File: ld.info, Node: ARM, Next: HPPA ELF32, Prev: M68HC11/68HC12, Up: Machine Dependent
  4449. 4.4 'ld' and the ARM family
  4450. ===========================
  4451. For the ARM, 'ld' will generate code stubs to allow functions calls
  4452. between ARM and Thumb code. These stubs only work with code that has
  4453. been compiled and assembled with the '-mthumb-interwork' command line
  4454. option. If it is necessary to link with old ARM object files or
  4455. libraries, which have not been compiled with the -mthumb-interwork
  4456. option then the '--support-old-code' command line switch should be given
  4457. to the linker. This will make it generate larger stub functions which
  4458. will work with non-interworking aware ARM code. Note, however, the
  4459. linker does not support generating stubs for function calls to
  4460. non-interworking aware Thumb code.
  4461. The '--thumb-entry' switch is a duplicate of the generic '--entry'
  4462. switch, in that it sets the program's starting address. But it also
  4463. sets the bottom bit of the address, so that it can be branched to using
  4464. a BX instruction, and the program will start executing in Thumb mode
  4465. straight away.
  4466. The '--use-nul-prefixed-import-tables' switch is specifying, that the
  4467. import tables idata4 and idata5 have to be generated with a zero element
  4468. prefix for import libraries. This is the old style to generate import
  4469. tables. By default this option is turned off.
  4470. The '--be8' switch instructs 'ld' to generate BE8 format executables.
  4471. This option is only valid when linking big-endian objects - ie ones
  4472. which have been assembled with the '-EB' option. The resulting image
  4473. will contain big-endian data and little-endian code.
  4474. The 'R_ARM_TARGET1' relocation is typically used for entries in the
  4475. '.init_array' section. It is interpreted as either 'R_ARM_REL32' or
  4476. 'R_ARM_ABS32', depending on the target. The '--target1-rel' and
  4477. '--target1-abs' switches override the default.
  4478. The '--target2=type' switch overrides the default definition of the
  4479. 'R_ARM_TARGET2' relocation. Valid values for 'type', their meanings,
  4480. and target defaults are as follows:
  4481. 'rel'
  4482. 'R_ARM_REL32' (arm*-*-elf, arm*-*-eabi)
  4483. 'abs'
  4484. 'R_ARM_ABS32' (arm*-*-symbianelf)
  4485. 'got-rel'
  4486. 'R_ARM_GOT_PREL' (arm*-*-linux, arm*-*-*bsd)
  4487. The 'R_ARM_V4BX' relocation (defined by the ARM AAELF specification)
  4488. enables objects compiled for the ARMv4 architecture to be
  4489. interworking-safe when linked with other objects compiled for ARMv4t,
  4490. but also allows pure ARMv4 binaries to be built from the same ARMv4
  4491. objects.
  4492. In the latter case, the switch '--fix-v4bx' must be passed to the
  4493. linker, which causes v4t 'BX rM' instructions to be rewritten as 'MOV
  4494. PC,rM', since v4 processors do not have a 'BX' instruction.
  4495. In the former case, the switch should not be used, and 'R_ARM_V4BX'
  4496. relocations are ignored.
  4497. Replace 'BX rM' instructions identified by 'R_ARM_V4BX' relocations
  4498. with a branch to the following veneer:
  4499. TST rM, #1
  4500. MOVEQ PC, rM
  4501. BX Rn
  4502. This allows generation of libraries/applications that work on ARMv4
  4503. cores and are still interworking safe. Note that the above veneer
  4504. clobbers the condition flags, so may cause incorrect program behavior in
  4505. rare cases.
  4506. The '--use-blx' switch enables the linker to use ARM/Thumb BLX
  4507. instructions (available on ARMv5t and above) in various situations.
  4508. Currently it is used to perform calls via the PLT from Thumb code using
  4509. BLX rather than using BX and a mode-switching stub before each PLT
  4510. entry. This should lead to such calls executing slightly faster.
  4511. This option is enabled implicitly for SymbianOS, so there is no need
  4512. to specify it if you are using that target.
  4513. The '--vfp11-denorm-fix' switch enables a link-time workaround for a
  4514. bug in certain VFP11 coprocessor hardware, which sometimes allows
  4515. instructions with denorm operands (which must be handled by support
  4516. code) to have those operands overwritten by subsequent instructions
  4517. before the support code can read the intended values.
  4518. The bug may be avoided in scalar mode if you allow at least one
  4519. intervening instruction between a VFP11 instruction which uses a
  4520. register and another instruction which writes to the same register, or
  4521. at least two intervening instructions if vector mode is in use. The bug
  4522. only affects full-compliance floating-point mode: you do not need this
  4523. workaround if you are using "runfast" mode. Please contact ARM for
  4524. further details.
  4525. If you know you are using buggy VFP11 hardware, you can enable this
  4526. workaround by specifying the linker option '--vfp-denorm-fix=scalar' if
  4527. you are using the VFP11 scalar mode only, or '--vfp-denorm-fix=vector'
  4528. if you are using vector mode (the latter also works for scalar code).
  4529. The default is '--vfp-denorm-fix=none'.
  4530. If the workaround is enabled, instructions are scanned for
  4531. potentially-troublesome sequences, and a veneer is created for each such
  4532. sequence which may trigger the erratum. The veneer consists of the
  4533. first instruction of the sequence and a branch back to the subsequent
  4534. instruction. The original instruction is then replaced with a branch to
  4535. the veneer. The extra cycles required to call and return from the
  4536. veneer are sufficient to avoid the erratum in both the scalar and vector
  4537. cases.
  4538. The '--fix-arm1176' switch enables a link-time workaround for an
  4539. erratum in certain ARM1176 processors. The workaround is enabled by
  4540. default if you are targeting ARM v6 (excluding ARM v6T2) or earlier. It
  4541. can be disabled unconditionally by specifying '--no-fix-arm1176'.
  4542. Further information is available in the "ARM1176JZ-S and ARM1176JZF-S
  4543. Programmer Advice Notice" available on the ARM documentation website at:
  4544. http://infocenter.arm.com/.
  4545. The '--fix-stm32l4xx-629360' switch enables a link-time workaround
  4546. for a bug in the bus matrix / memory controller for some of the STM32
  4547. Cortex-M4 based products (STM32L4xx). When accessing off-chip memory
  4548. via the affected bus for bus reads of 9 words or more, the bus can
  4549. generate corrupt data and/or abort. These are only core-initiated
  4550. accesses (not DMA), and might affect any access: integer loads such as
  4551. LDM, POP and floating-point loads such as VLDM, VPOP. Stores are not
  4552. affected.
  4553. The bug can be avoided by splitting memory accesses into the
  4554. necessary chunks to keep bus reads below 8 words.
  4555. The workaround is not enabled by default, this is equivalent to use
  4556. '--fix-stm32l4xx-629360=none'. If you know you are using buggy
  4557. STM32L4xx hardware, you can enable the workaround by specifying the
  4558. linker option '--fix-stm32l4xx-629360', or the equivalent
  4559. '--fix-stm32l4xx-629360=default'.
  4560. If the workaround is enabled, instructions are scanned for
  4561. potentially-troublesome sequences, and a veneer is created for each such
  4562. sequence which may trigger the erratum. The veneer consists in a
  4563. replacement sequence emulating the behaviour of the original one and a
  4564. branch back to the subsequent instruction. The original instruction is
  4565. then replaced with a branch to the veneer.
  4566. The workaround does not always preserve the memory access order for
  4567. the LDMDB instruction, when the instruction loads the PC.
  4568. The workaround is not able to handle problematic instructions when
  4569. they are in the middle of an IT block, since a branch is not allowed
  4570. there. In that case, the linker reports a warning and no replacement
  4571. occurs.
  4572. The workaround is not able to replace problematic instructions with a
  4573. PC-relative branch instruction if the '.text' section is too large. In
  4574. that case, when the branch that replaces the original code cannot be
  4575. encoded, the linker reports a warning and no replacement occurs.
  4576. The '--no-enum-size-warning' switch prevents the linker from warning
  4577. when linking object files that specify incompatible EABI enumeration
  4578. size attributes. For example, with this switch enabled, linking of an
  4579. object file using 32-bit enumeration values with another using
  4580. enumeration values fitted into the smallest possible space will not be
  4581. diagnosed.
  4582. The '--no-wchar-size-warning' switch prevents the linker from warning
  4583. when linking object files that specify incompatible EABI 'wchar_t' size
  4584. attributes. For example, with this switch enabled, linking of an object
  4585. file using 32-bit 'wchar_t' values with another using 16-bit 'wchar_t'
  4586. values will not be diagnosed.
  4587. The '--pic-veneer' switch makes the linker use PIC sequences for
  4588. ARM/Thumb interworking veneers, even if the rest of the binary is not
  4589. PIC. This avoids problems on uClinux targets where '--emit-relocs' is
  4590. used to generate relocatable binaries.
  4591. The linker will automatically generate and insert small sequences of
  4592. code into a linked ARM ELF executable whenever an attempt is made to
  4593. perform a function call to a symbol that is too far away. The placement
  4594. of these sequences of instructions - called stubs - is controlled by the
  4595. command line option '--stub-group-size=N'. The placement is important
  4596. because a poor choice can create a need for duplicate stubs, increasing
  4597. the code size. The linker will try to group stubs together in order to
  4598. reduce interruptions to the flow of code, but it needs guidance as to
  4599. how big these groups should be and where they should be placed.
  4600. The value of 'N', the parameter to the '--stub-group-size=' option
  4601. controls where the stub groups are placed. If it is negative then all
  4602. stubs are placed after the first branch that needs them. If it is
  4603. positive then the stubs can be placed either before or after the
  4604. branches that need them. If the value of 'N' is 1 (either +1 or -1)
  4605. then the linker will choose exactly where to place groups of stubs,
  4606. using its built in heuristics. A value of 'N' greater than 1 (or
  4607. smaller than -1) tells the linker that a single group of stubs can
  4608. service at most 'N' bytes from the input sections.
  4609. The default, if '--stub-group-size=' is not specified, is 'N = +1'.
  4610. Farcalls stubs insertion is fully supported for the ARM-EABI target
  4611. only, because it relies on object files properties not present
  4612. otherwise.
  4613. The '--fix-cortex-a8' switch enables a link-time workaround for an
  4614. erratum in certain Cortex-A8 processors. The workaround is enabled by
  4615. default if you are targeting the ARM v7-A architecture profile. It can
  4616. be enabled otherwise by specifying '--fix-cortex-a8', or disabled
  4617. unconditionally by specifying '--no-fix-cortex-a8'.
  4618. The erratum only affects Thumb-2 code. Please contact ARM for
  4619. further details.
  4620. The '--fix-cortex-a53-835769' switch enables a link-time workaround
  4621. for erratum 835769 present on certain early revisions of Cortex-A53
  4622. processors. The workaround is disabled by default. It can be enabled
  4623. by specifying '--fix-cortex-a53-835769', or disabled unconditionally by
  4624. specifying '--no-fix-cortex-a53-835769'.
  4625. Please contact ARM for further details.
  4626. The '--no-merge-exidx-entries' switch disables the merging of
  4627. adjacent exidx entries in debuginfo.
  4628. The '--long-plt' option enables the use of 16 byte PLT entries which
  4629. support up to 4Gb of code. The default is to use 12 byte PLT entries
  4630. which only support 512Mb of code.
  4631. The '--no-apply-dynamic-relocs' option makes AArch64 linker do not
  4632. apply link-time values for dynamic relocations.
  4633. All SG veneers are placed in the special output section
  4634. '.gnu.sgstubs'. Its start address must be set, either with the command
  4635. line option '--section-start' or in a linker script, to indicate where
  4636. to place these veneers in memory.
  4637. The '--cmse-implib' option requests that the import libraries
  4638. specified by the '--out-implib' and '--in-implib' options are secure
  4639. gateway import libraries, suitable for linking a non-secure executable
  4640. against secure code as per ARMv8-M Security Extensions.
  4641. The '--in-implib=file' specifies an input import library whose
  4642. symbols must keep the same address in the executable being produced. A
  4643. warning is given if no '--out-implib' is given but new symbols have been
  4644. introduced in the executable that should be listed in its import
  4645. library. Otherwise, if '--out-implib' is specified, the symbols are
  4646. added to the output import library. A warning is also given if some
  4647. symbols present in the input import library have disappeared from the
  4648. executable. This option is only effective for Secure Gateway import
  4649. libraries, ie. when '--cmse-implib' is specified.
  4650. 
  4651. File: ld.info, Node: HPPA ELF32, Next: M68K, Prev: ARM, Up: Machine Dependent
  4652. 4.5 'ld' and HPPA 32-bit ELF Support
  4653. ====================================
  4654. When generating a shared library, 'ld' will by default generate import
  4655. stubs suitable for use with a single sub-space application. The
  4656. '--multi-subspace' switch causes 'ld' to generate export stubs, and
  4657. different (larger) import stubs suitable for use with multiple
  4658. sub-spaces.
  4659. Long branch stubs and import/export stubs are placed by 'ld' in stub
  4660. sections located between groups of input sections. '--stub-group-size'
  4661. specifies the maximum size of a group of input sections handled by one
  4662. stub section. Since branch offsets are signed, a stub section may serve
  4663. two groups of input sections, one group before the stub section, and one
  4664. group after it. However, when using conditional branches that require
  4665. stubs, it may be better (for branch prediction) that stub sections only
  4666. serve one group of input sections. A negative value for 'N' chooses
  4667. this scheme, ensuring that branches to stubs always use a negative
  4668. offset. Two special values of 'N' are recognized, '1' and '-1'. These
  4669. both instruct 'ld' to automatically size input section groups for the
  4670. branch types detected, with the same behaviour regarding stub placement
  4671. as other positive or negative values of 'N' respectively.
  4672. Note that '--stub-group-size' does not split input sections. A
  4673. single input section larger than the group size specified will of course
  4674. create a larger group (of one section). If input sections are too
  4675. large, it may not be possible for a branch to reach its stub.
  4676. 
  4677. File: ld.info, Node: M68K, Next: MIPS, Prev: HPPA ELF32, Up: Machine Dependent
  4678. 4.6 'ld' and the Motorola 68K family
  4679. ====================================
  4680. The '--got=TYPE' option lets you choose the GOT generation scheme. The
  4681. choices are 'single', 'negative', 'multigot' and 'target'. When
  4682. 'target' is selected the linker chooses the default GOT generation
  4683. scheme for the current target. 'single' tells the linker to generate a
  4684. single GOT with entries only at non-negative offsets. 'negative'
  4685. instructs the linker to generate a single GOT with entries at both
  4686. negative and positive offsets. Not all environments support such GOTs.
  4687. 'multigot' allows the linker to generate several GOTs in the output
  4688. file. All GOT references from a single input object file access the
  4689. same GOT, but references from different input object files might access
  4690. different GOTs. Not all environments support such GOTs.
  4691. 
  4692. File: ld.info, Node: MIPS, Next: MMIX, Prev: M68K, Up: Machine Dependent
  4693. 4.7 'ld' and the MIPS family
  4694. ============================
  4695. The '--insn32' and '--no-insn32' options control the choice of microMIPS
  4696. instructions used in code generated by the linker, such as that in the
  4697. PLT or lazy binding stubs, or in relaxation. If '--insn32' is used,
  4698. then the linker only uses 32-bit instruction encodings. By default or
  4699. if '--no-insn32' is used, all instruction encodings are used, including
  4700. 16-bit ones where possible.
  4701. The '--ignore-branch-isa' and '--no-ignore-branch-isa' options
  4702. control branch relocation checks for invalid ISA mode transitions. If
  4703. '--ignore-branch-isa' is used, then the linker accepts any branch
  4704. relocations and any ISA mode transition required is lost in relocation
  4705. calculation, except for some cases of 'BAL' instructions which meet
  4706. relaxation conditions and are converted to equivalent 'JALX'
  4707. instructions as the associated relocation is calculated. By default or
  4708. if '--no-ignore-branch-isa' is used a check is made causing the loss of
  4709. an ISA mode transition to produce an error.
  4710. 
  4711. File: ld.info, Node: MMIX, Next: MSP430, Prev: MIPS, Up: Machine Dependent
  4712. 4.8 'ld' and MMIX
  4713. =================
  4714. For MMIX, there is a choice of generating 'ELF' object files or 'mmo'
  4715. object files when linking. The simulator 'mmix' understands the 'mmo'
  4716. format. The binutils 'objcopy' utility can translate between the two
  4717. formats.
  4718. There is one special section, the '.MMIX.reg_contents' section.
  4719. Contents in this section is assumed to correspond to that of global
  4720. registers, and symbols referring to it are translated to special
  4721. symbols, equal to registers. In a final link, the start address of the
  4722. '.MMIX.reg_contents' section corresponds to the first allocated global
  4723. register multiplied by 8. Register '$255' is not included in this
  4724. section; it is always set to the program entry, which is at the symbol
  4725. 'Main' for 'mmo' files.
  4726. Global symbols with the prefix '__.MMIX.start.', for example
  4727. '__.MMIX.start..text' and '__.MMIX.start..data' are special. The
  4728. default linker script uses these to set the default start address of a
  4729. section.
  4730. Initial and trailing multiples of zero-valued 32-bit words in a
  4731. section, are left out from an mmo file.
  4732. 
  4733. File: ld.info, Node: MSP430, Next: NDS32, Prev: MMIX, Up: Machine Dependent
  4734. 4.9 'ld' and MSP430
  4735. ===================
  4736. For the MSP430 it is possible to select the MPU architecture. The flag
  4737. '-m [mpu type]' will select an appropriate linker script for selected
  4738. MPU type. (To get a list of known MPUs just pass '-m help' option to
  4739. the linker).
  4740. The linker will recognize some extra sections which are MSP430
  4741. specific:
  4742. ''.vectors''
  4743. Defines a portion of ROM where interrupt vectors located.
  4744. ''.bootloader''
  4745. Defines the bootloader portion of the ROM (if applicable). Any
  4746. code in this section will be uploaded to the MPU.
  4747. ''.infomem''
  4748. Defines an information memory section (if applicable). Any code in
  4749. this section will be uploaded to the MPU.
  4750. ''.infomemnobits''
  4751. This is the same as the '.infomem' section except that any code in
  4752. this section will not be uploaded to the MPU.
  4753. ''.noinit''
  4754. Denotes a portion of RAM located above '.bss' section.
  4755. The last two sections are used by gcc.
  4756. 
  4757. File: ld.info, Node: NDS32, Next: Nios II, Prev: MSP430, Up: Machine Dependent
  4758. 4.10 'ld' and NDS32
  4759. ===================
  4760. For NDS32, there are some options to select relaxation behavior. The
  4761. linker relaxes objects according to these options.
  4762. ''--m[no-]fp-as-gp''
  4763. Disable/enable fp-as-gp relaxation.
  4764. ''--mexport-symbols=FILE''
  4765. Exporting symbols and their address into FILE as linker script.
  4766. ''--m[no-]ex9''
  4767. Disable/enable link-time EX9 relaxation.
  4768. ''--mexport-ex9=FILE''
  4769. Export the EX9 table after linking.
  4770. ''--mimport-ex9=FILE''
  4771. Import the Ex9 table for EX9 relaxation.
  4772. ''--mupdate-ex9''
  4773. Update the existing EX9 table.
  4774. ''--mex9-limit=NUM''
  4775. Maximum number of entries in the ex9 table.
  4776. ''--mex9-loop-aware''
  4777. Avoid generating the EX9 instruction inside the loop.
  4778. ''--m[no-]ifc''
  4779. Disable/enable the link-time IFC optimization.
  4780. ''--mifc-loop-aware''
  4781. Avoid generating the IFC instruction inside the loop.
  4782. 
  4783. File: ld.info, Node: Nios II, Next: PowerPC ELF32, Prev: NDS32, Up: Machine Dependent
  4784. 4.11 'ld' and the Altera Nios II
  4785. ================================
  4786. Call and immediate jump instructions on Nios II processors are limited
  4787. to transferring control to addresses in the same 256MB memory segment,
  4788. which may result in 'ld' giving 'relocation truncated to fit' errors
  4789. with very large programs. The command-line option '--relax' enables the
  4790. generation of trampolines that can access the entire 32-bit address
  4791. space for calls outside the normal 'call' and 'jmpi' address range.
  4792. These trampolines are inserted at section boundaries, so may not
  4793. themselves be reachable if an input section and its associated call
  4794. trampolines are larger than 256MB.
  4795. The '--relax' option is enabled by default unless '-r' is also
  4796. specified. You can disable trampoline generation by using the
  4797. '--no-relax' linker option. You can also disable this optimization
  4798. locally by using the 'set .noat' directive in assembly-language source
  4799. files, as the linker-inserted trampolines use the 'at' register as a
  4800. temporary.
  4801. Note that the linker '--relax' option is independent of assembler
  4802. relaxation options, and that using the GNU assembler's '-relax-all'
  4803. option interferes with the linker's more selective call instruction
  4804. relaxation.
  4805. 
  4806. File: ld.info, Node: PowerPC ELF32, Next: PowerPC64 ELF64, Prev: Nios II, Up: Machine Dependent
  4807. 4.12 'ld' and PowerPC 32-bit ELF Support
  4808. ========================================
  4809. Branches on PowerPC processors are limited to a signed 26-bit
  4810. displacement, which may result in 'ld' giving 'relocation truncated to
  4811. fit' errors with very large programs. '--relax' enables the generation
  4812. of trampolines that can access the entire 32-bit address space. These
  4813. trampolines are inserted at section boundaries, so may not themselves be
  4814. reachable if an input section exceeds 33M in size. You may combine '-r'
  4815. and '--relax' to add trampolines in a partial link. In that case both
  4816. branches to undefined symbols and inter-section branches are also
  4817. considered potentially out of range, and trampolines inserted.
  4818. '--bss-plt'
  4819. Current PowerPC GCC accepts a '-msecure-plt' option that generates
  4820. code capable of using a newer PLT and GOT layout that has the
  4821. security advantage of no executable section ever needing to be
  4822. writable and no writable section ever being executable. PowerPC
  4823. 'ld' will generate this layout, including stubs to access the PLT,
  4824. if all input files (including startup and static libraries) were
  4825. compiled with '-msecure-plt'. '--bss-plt' forces the old BSS PLT
  4826. (and GOT layout) which can give slightly better performance.
  4827. '--secure-plt'
  4828. 'ld' will use the new PLT and GOT layout if it is linking new
  4829. '-fpic' or '-fPIC' code, but does not do so automatically when
  4830. linking non-PIC code. This option requests the new PLT and GOT
  4831. layout. A warning will be given if some object file requires the
  4832. old style BSS PLT.
  4833. '--sdata-got'
  4834. The new secure PLT and GOT are placed differently relative to other
  4835. sections compared to older BSS PLT and GOT placement. The location
  4836. of '.plt' must change because the new secure PLT is an initialized
  4837. section while the old PLT is uninitialized. The reason for the
  4838. '.got' change is more subtle: The new placement allows '.got' to be
  4839. read-only in applications linked with '-z relro -z now'. However,
  4840. this placement means that '.sdata' cannot always be used in shared
  4841. libraries, because the PowerPC ABI accesses '.sdata' in shared
  4842. libraries from the GOT pointer. '--sdata-got' forces the old GOT
  4843. placement. PowerPC GCC doesn't use '.sdata' in shared libraries,
  4844. so this option is really only useful for other compilers that may
  4845. do so.
  4846. '--emit-stub-syms'
  4847. This option causes 'ld' to label linker stubs with a local symbol
  4848. that encodes the stub type and destination.
  4849. '--no-tls-optimize'
  4850. PowerPC 'ld' normally performs some optimization of code sequences
  4851. used to access Thread-Local Storage. Use this option to disable
  4852. the optimization.
  4853. 
  4854. File: ld.info, Node: PowerPC64 ELF64, Next: SPU ELF, Prev: PowerPC ELF32, Up: Machine Dependent
  4855. 4.13 'ld' and PowerPC64 64-bit ELF Support
  4856. ==========================================
  4857. '--stub-group-size'
  4858. Long branch stubs, PLT call stubs and TOC adjusting stubs are
  4859. placed by 'ld' in stub sections located between groups of input
  4860. sections. '--stub-group-size' specifies the maximum size of a
  4861. group of input sections handled by one stub section. Since branch
  4862. offsets are signed, a stub section may serve two groups of input
  4863. sections, one group before the stub section, and one group after
  4864. it. However, when using conditional branches that require stubs,
  4865. it may be better (for branch prediction) that stub sections only
  4866. serve one group of input sections. A negative value for 'N'
  4867. chooses this scheme, ensuring that branches to stubs always use a
  4868. negative offset. Two special values of 'N' are recognized, '1' and
  4869. '-1'. These both instruct 'ld' to automatically size input section
  4870. groups for the branch types detected, with the same behaviour
  4871. regarding stub placement as other positive or negative values of
  4872. 'N' respectively.
  4873. Note that '--stub-group-size' does not split input sections. A
  4874. single input section larger than the group size specified will of
  4875. course create a larger group (of one section). If input sections
  4876. are too large, it may not be possible for a branch to reach its
  4877. stub.
  4878. '--emit-stub-syms'
  4879. This option causes 'ld' to label linker stubs with a local symbol
  4880. that encodes the stub type and destination.
  4881. '--dotsyms'
  4882. '--no-dotsyms'
  4883. These two options control how 'ld' interprets version patterns in a
  4884. version script. Older PowerPC64 compilers emitted both a function
  4885. descriptor symbol with the same name as the function, and a code
  4886. entry symbol with the name prefixed by a dot ('.'). To properly
  4887. version a function 'foo', the version script thus needs to control
  4888. both 'foo' and '.foo'. The option '--dotsyms', on by default,
  4889. automatically adds the required dot-prefixed patterns. Use
  4890. '--no-dotsyms' to disable this feature.
  4891. '--save-restore-funcs'
  4892. '--no-save-restore-funcs'
  4893. These two options control whether PowerPC64 'ld' automatically
  4894. provides out-of-line register save and restore functions used by
  4895. '-Os' code. The default is to provide any such referenced function
  4896. for a normal final link, and to not do so for a relocatable link.
  4897. '--no-tls-optimize'
  4898. PowerPC64 'ld' normally performs some optimization of code
  4899. sequences used to access Thread-Local Storage. Use this option to
  4900. disable the optimization.
  4901. '--tls-get-addr-optimize'
  4902. '--no-tls-get-addr-optimize'
  4903. These options control whether PowerPC64 'ld' uses a special stub to
  4904. call __tls_get_addr. PowerPC64 glibc 2.22 and later support an
  4905. optimization that allows the second and subsequent calls to
  4906. '__tls_get_addr' for a given symbol to be resolved by the special
  4907. stub without calling in to glibc. By default the linker enables
  4908. this option when glibc advertises the availability of
  4909. __tls_get_addr_opt. Forcing this option on when using an older
  4910. glibc won't do much besides slow down your applications, but may be
  4911. useful if linking an application against an older glibc with the
  4912. expectation that it will normally be used on systems having a newer
  4913. glibc.
  4914. '--no-opd-optimize'
  4915. PowerPC64 'ld' normally removes '.opd' section entries
  4916. corresponding to deleted link-once functions, or functions removed
  4917. by the action of '--gc-sections' or linker script '/DISCARD/'. Use
  4918. this option to disable '.opd' optimization.
  4919. '--non-overlapping-opd'
  4920. Some PowerPC64 compilers have an option to generate compressed
  4921. '.opd' entries spaced 16 bytes apart, overlapping the third word,
  4922. the static chain pointer (unused in C) with the first word of the
  4923. next entry. This option expands such entries to the full 24 bytes.
  4924. '--no-toc-optimize'
  4925. PowerPC64 'ld' normally removes unused '.toc' section entries.
  4926. Such entries are detected by examining relocations that reference
  4927. the TOC in code sections. A reloc in a deleted code section marks
  4928. a TOC word as unneeded, while a reloc in a kept code section marks
  4929. a TOC word as needed. Since the TOC may reference itself, TOC
  4930. relocs are also examined. TOC words marked as both needed and
  4931. unneeded will of course be kept. TOC words without any referencing
  4932. reloc are assumed to be part of a multi-word entry, and are kept or
  4933. discarded as per the nearest marked preceding word. This works
  4934. reliably for compiler generated code, but may be incorrect if
  4935. assembly code is used to insert TOC entries. Use this option to
  4936. disable the optimization.
  4937. '--no-multi-toc'
  4938. If given any toc option besides '-mcmodel=medium' or
  4939. '-mcmodel=large', PowerPC64 GCC generates code for a TOC model
  4940. where TOC entries are accessed with a 16-bit offset from r2. This
  4941. limits the total TOC size to 64K. PowerPC64 'ld' extends this limit
  4942. by grouping code sections such that each group uses less than 64K
  4943. for its TOC entries, then inserts r2 adjusting stubs between
  4944. inter-group calls. 'ld' does not split apart input sections, so
  4945. cannot help if a single input file has a '.toc' section that
  4946. exceeds 64K, most likely from linking multiple files with 'ld -r'.
  4947. Use this option to turn off this feature.
  4948. '--no-toc-sort'
  4949. By default, 'ld' sorts TOC sections so that those whose file
  4950. happens to have a section called '.init' or '.fini' are placed
  4951. first, followed by TOC sections referenced by code generated with
  4952. PowerPC64 gcc's '-mcmodel=small', and lastly TOC sections
  4953. referenced only by code generated with PowerPC64 gcc's
  4954. '-mcmodel=medium' or '-mcmodel=large' options. Doing this results
  4955. in better TOC grouping for multi-TOC. Use this option to turn off
  4956. this feature.
  4957. '--plt-align'
  4958. '--no-plt-align'
  4959. Use these options to control whether individual PLT call stubs are
  4960. padded so that they don't cross a 32-byte boundary, or to the
  4961. specified power of two boundary when using '--plt-align='. Note
  4962. that this isn't alignment in the usual sense. By default PLT call
  4963. stubs are packed tightly.
  4964. '--plt-static-chain'
  4965. '--no-plt-static-chain'
  4966. Use these options to control whether PLT call stubs load the static
  4967. chain pointer (r11). 'ld' defaults to not loading the static chain
  4968. since there is never any need to do so on a PLT call.
  4969. '--plt-thread-safe'
  4970. '--no-thread-safe'
  4971. With power7's weakly ordered memory model, it is possible when
  4972. using lazy binding for ld.so to update a plt entry in one thread
  4973. and have another thread see the individual plt entry words update
  4974. in the wrong order, despite ld.so carefully writing in the correct
  4975. order and using memory write barriers. To avoid this we need some
  4976. sort of read barrier in the call stub, or use LD_BIND_NOW=1. By
  4977. default, 'ld' looks for calls to commonly used functions that
  4978. create threads, and if seen, adds the necessary barriers. Use
  4979. these options to change the default behaviour.
  4980. 
  4981. File: ld.info, Node: SPU ELF, Next: TI COFF, Prev: PowerPC64 ELF64, Up: Machine Dependent
  4982. 4.14 'ld' and SPU ELF Support
  4983. =============================
  4984. '--plugin'
  4985. This option marks an executable as a PIC plugin module.
  4986. '--no-overlays'
  4987. Normally, 'ld' recognizes calls to functions within overlay
  4988. regions, and redirects such calls to an overlay manager via a stub.
  4989. 'ld' also provides a built-in overlay manager. This option turns
  4990. off all this special overlay handling.
  4991. '--emit-stub-syms'
  4992. This option causes 'ld' to label overlay stubs with a local symbol
  4993. that encodes the stub type and destination.
  4994. '--extra-overlay-stubs'
  4995. This option causes 'ld' to add overlay call stubs on all function
  4996. calls out of overlay regions. Normally stubs are not added on
  4997. calls to non-overlay regions.
  4998. '--local-store=lo:hi'
  4999. 'ld' usually checks that a final executable for SPU fits in the
  5000. address range 0 to 256k. This option may be used to change the
  5001. range. Disable the check entirely with '--local-store=0:0'.
  5002. '--stack-analysis'
  5003. SPU local store space is limited. Over-allocation of stack space
  5004. unnecessarily limits space available for code and data, while
  5005. under-allocation results in runtime failures. If given this
  5006. option, 'ld' will provide an estimate of maximum stack usage. 'ld'
  5007. does this by examining symbols in code sections to determine the
  5008. extents of functions, and looking at function prologues for stack
  5009. adjusting instructions. A call-graph is created by looking for
  5010. relocations on branch instructions. The graph is then searched for
  5011. the maximum stack usage path. Note that this analysis does not
  5012. find calls made via function pointers, and does not handle
  5013. recursion and other cycles in the call graph. Stack usage may be
  5014. under-estimated if your code makes such calls. Also, stack usage
  5015. for dynamic allocation, e.g. alloca, will not be detected. If a
  5016. link map is requested, detailed information about each function's
  5017. stack usage and calls will be given.
  5018. '--emit-stack-syms'
  5019. This option, if given along with '--stack-analysis' will result in
  5020. 'ld' emitting stack sizing symbols for each function. These take
  5021. the form '__stack_<function_name>' for global functions, and
  5022. '__stack_<number>_<function_name>' for static functions.
  5023. '<number>' is the section id in hex. The value of such symbols is
  5024. the stack requirement for the corresponding function. The symbol
  5025. size will be zero, type 'STT_NOTYPE', binding 'STB_LOCAL', and
  5026. section 'SHN_ABS'.
  5027. 
  5028. File: ld.info, Node: TI COFF, Next: WIN32, Prev: SPU ELF, Up: Machine Dependent
  5029. 4.15 'ld''s Support for Various TI COFF Versions
  5030. ================================================
  5031. The '--format' switch allows selection of one of the various TI COFF
  5032. versions. The latest of this writing is 2; versions 0 and 1 are also
  5033. supported. The TI COFF versions also vary in header byte-order format;
  5034. 'ld' will read any version or byte order, but the output header format
  5035. depends on the default specified by the specific target.
  5036. 
  5037. File: ld.info, Node: WIN32, Next: Xtensa, Prev: TI COFF, Up: Machine Dependent
  5038. 4.16 'ld' and WIN32 (cygwin/mingw)
  5039. ==================================
  5040. This section describes some of the win32 specific 'ld' issues. See
  5041. *note Command Line Options: Options. for detailed description of the
  5042. command line options mentioned here.
  5043. _import libraries_
  5044. The standard Windows linker creates and uses so-called import
  5045. libraries, which contains information for linking to dll's. They
  5046. are regular static archives and are handled as any other static
  5047. archive. The cygwin and mingw ports of 'ld' have specific support
  5048. for creating such libraries provided with the '--out-implib'
  5049. command line option.
  5050. _exporting DLL symbols_
  5051. The cygwin/mingw 'ld' has several ways to export symbols for dll's.
  5052. _using auto-export functionality_
  5053. By default 'ld' exports symbols with the auto-export
  5054. functionality, which is controlled by the following command
  5055. line options:
  5056. * -export-all-symbols [This is the default]
  5057. * -exclude-symbols
  5058. * -exclude-libs
  5059. * -exclude-modules-for-implib
  5060. * -version-script
  5061. When auto-export is in operation, 'ld' will export all the
  5062. non-local (global and common) symbols it finds in a DLL, with
  5063. the exception of a few symbols known to belong to the system's
  5064. runtime and libraries. As it will often not be desirable to
  5065. export all of a DLL's symbols, which may include private
  5066. functions that are not part of any public interface, the
  5067. command-line options listed above may be used to filter
  5068. symbols out from the list for exporting. The '--output-def'
  5069. option can be used in order to see the final list of exported
  5070. symbols with all exclusions taken into effect.
  5071. If '--export-all-symbols' is not given explicitly on the
  5072. command line, then the default auto-export behavior will be
  5073. _disabled_ if either of the following are true:
  5074. * A DEF file is used.
  5075. * Any symbol in any object file was marked with the
  5076. __declspec(dllexport) attribute.
  5077. _using a DEF file_
  5078. Another way of exporting symbols is using a DEF file. A DEF
  5079. file is an ASCII file containing definitions of symbols which
  5080. should be exported when a dll is created. Usually it is named
  5081. '<dll name>.def' and is added as any other object file to the
  5082. linker's command line. The file's name must end in '.def' or
  5083. '.DEF'.
  5084. gcc -o <output> <objectfiles> <dll name>.def
  5085. Using a DEF file turns off the normal auto-export behavior,
  5086. unless the '--export-all-symbols' option is also used.
  5087. Here is an example of a DEF file for a shared library called
  5088. 'xyz.dll':
  5089. LIBRARY "xyz.dll" BASE=0x20000000
  5090. EXPORTS
  5091. foo
  5092. bar
  5093. _bar = bar
  5094. another_foo = abc.dll.afoo
  5095. var1 DATA
  5096. doo = foo == foo2
  5097. eoo DATA == var1
  5098. This example defines a DLL with a non-default base address and
  5099. seven symbols in the export table. The third exported symbol
  5100. '_bar' is an alias for the second. The fourth symbol,
  5101. 'another_foo' is resolved by "forwarding" to another module
  5102. and treating it as an alias for 'afoo' exported from the DLL
  5103. 'abc.dll'. The final symbol 'var1' is declared to be a data
  5104. object. The 'doo' symbol in export library is an alias of
  5105. 'foo', which gets the string name in export table 'foo2'. The
  5106. 'eoo' symbol is an data export symbol, which gets in export
  5107. table the name 'var1'.
  5108. The optional 'LIBRARY <name>' command indicates the _internal_
  5109. name of the output DLL. If '<name>' does not include a suffix,
  5110. the default library suffix, '.DLL' is appended.
  5111. When the .DEF file is used to build an application, rather
  5112. than a library, the 'NAME <name>' command should be used
  5113. instead of 'LIBRARY'. If '<name>' does not include a suffix,
  5114. the default executable suffix, '.EXE' is appended.
  5115. With either 'LIBRARY <name>' or 'NAME <name>' the optional
  5116. specification 'BASE = <number>' may be used to specify a
  5117. non-default base address for the image.
  5118. If neither 'LIBRARY <name>' nor 'NAME <name>' is specified, or
  5119. they specify an empty string, the internal name is the same as
  5120. the filename specified on the command line.
  5121. The complete specification of an export symbol is:
  5122. EXPORTS
  5123. ( ( ( <name1> [ = <name2> ] )
  5124. | ( <name1> = <module-name> . <external-name>))
  5125. [ @ <integer> ] [NONAME] [DATA] [CONSTANT] [PRIVATE] [== <name3>] ) *
  5126. Declares '<name1>' as an exported symbol from the DLL, or
  5127. declares '<name1>' as an exported alias for '<name2>'; or
  5128. declares '<name1>' as a "forward" alias for the symbol
  5129. '<external-name>' in the DLL '<module-name>'. Optionally, the
  5130. symbol may be exported by the specified ordinal '<integer>'
  5131. alias. The optional '<name3>' is the to be used string in
  5132. import/export table for the symbol.
  5133. The optional keywords that follow the declaration indicate:
  5134. 'NONAME': Do not put the symbol name in the DLL's export
  5135. table. It will still be exported by its ordinal alias (either
  5136. the value specified by the .def specification or, otherwise,
  5137. the value assigned by the linker). The symbol name, however,
  5138. does remain visible in the import library (if any), unless
  5139. 'PRIVATE' is also specified.
  5140. 'DATA': The symbol is a variable or object, rather than a
  5141. function. The import lib will export only an indirect
  5142. reference to 'foo' as the symbol '_imp__foo' (ie, 'foo' must
  5143. be resolved as '*_imp__foo').
  5144. 'CONSTANT': Like 'DATA', but put the undecorated 'foo' as well
  5145. as '_imp__foo' into the import library. Both refer to the
  5146. read-only import address table's pointer to the variable, not
  5147. to the variable itself. This can be dangerous. If the user
  5148. code fails to add the 'dllimport' attribute and also fails to
  5149. explicitly add the extra indirection that the use of the
  5150. attribute enforces, the application will behave unexpectedly.
  5151. 'PRIVATE': Put the symbol in the DLL's export table, but do
  5152. not put it into the static import library used to resolve
  5153. imports at link time. The symbol can still be imported using
  5154. the 'LoadLibrary/GetProcAddress' API at runtime or by by using
  5155. the GNU ld extension of linking directly to the DLL without an
  5156. import library.
  5157. See ld/deffilep.y in the binutils sources for the full
  5158. specification of other DEF file statements
  5159. While linking a shared dll, 'ld' is able to create a DEF file
  5160. with the '--output-def <file>' command line option.
  5161. _Using decorations_
  5162. Another way of marking symbols for export is to modify the
  5163. source code itself, so that when building the DLL each symbol
  5164. to be exported is declared as:
  5165. __declspec(dllexport) int a_variable
  5166. __declspec(dllexport) void a_function(int with_args)
  5167. All such symbols will be exported from the DLL. If, however,
  5168. any of the object files in the DLL contain symbols decorated
  5169. in this way, then the normal auto-export behavior is disabled,
  5170. unless the '--export-all-symbols' option is also used.
  5171. Note that object files that wish to access these symbols must
  5172. _not_ decorate them with dllexport. Instead, they should use
  5173. dllimport, instead:
  5174. __declspec(dllimport) int a_variable
  5175. __declspec(dllimport) void a_function(int with_args)
  5176. This complicates the structure of library header files,
  5177. because when included by the library itself the header must
  5178. declare the variables and functions as dllexport, but when
  5179. included by client code the header must declare them as
  5180. dllimport. There are a number of idioms that are typically
  5181. used to do this; often client code can omit the __declspec()
  5182. declaration completely. See '--enable-auto-import' and
  5183. 'automatic data imports' for more information.
  5184. _automatic data imports_
  5185. The standard Windows dll format supports data imports from dlls
  5186. only by adding special decorations (dllimport/dllexport), which let
  5187. the compiler produce specific assembler instructions to deal with
  5188. this issue. This increases the effort necessary to port existing
  5189. Un*x code to these platforms, especially for large c++ libraries
  5190. and applications. The auto-import feature, which was initially
  5191. provided by Paul Sokolovsky, allows one to omit the decorations to
  5192. achieve a behavior that conforms to that on POSIX/Un*x platforms.
  5193. This feature is enabled with the '--enable-auto-import'
  5194. command-line option, although it is enabled by default on
  5195. cygwin/mingw. The '--enable-auto-import' option itself now serves
  5196. mainly to suppress any warnings that are ordinarily emitted when
  5197. linked objects trigger the feature's use.
  5198. auto-import of variables does not always work flawlessly without
  5199. additional assistance. Sometimes, you will see this message
  5200. "variable '<var>' can't be auto-imported. Please read the
  5201. documentation for ld's '--enable-auto-import' for details."
  5202. The '--enable-auto-import' documentation explains why this error
  5203. occurs, and several methods that can be used to overcome this
  5204. difficulty. One of these methods is the _runtime pseudo-relocs_
  5205. feature, described below.
  5206. For complex variables imported from DLLs (such as structs or
  5207. classes), object files typically contain a base address for the
  5208. variable and an offset (_addend_) within the variable-to specify a
  5209. particular field or public member, for instance. Unfortunately,
  5210. the runtime loader used in win32 environments is incapable of
  5211. fixing these references at runtime without the additional
  5212. information supplied by dllimport/dllexport decorations. The
  5213. standard auto-import feature described above is unable to resolve
  5214. these references.
  5215. The '--enable-runtime-pseudo-relocs' switch allows these references
  5216. to be resolved without error, while leaving the task of adjusting
  5217. the references themselves (with their non-zero addends) to
  5218. specialized code provided by the runtime environment. Recent
  5219. versions of the cygwin and mingw environments and compilers provide
  5220. this runtime support; older versions do not. However, the support
  5221. is only necessary on the developer's platform; the compiled result
  5222. will run without error on an older system.
  5223. '--enable-runtime-pseudo-relocs' is not the default; it must be
  5224. explicitly enabled as needed.
  5225. _direct linking to a dll_
  5226. The cygwin/mingw ports of 'ld' support the direct linking,
  5227. including data symbols, to a dll without the usage of any import
  5228. libraries. This is much faster and uses much less memory than does
  5229. the traditional import library method, especially when linking
  5230. large libraries or applications. When 'ld' creates an import lib,
  5231. each function or variable exported from the dll is stored in its
  5232. own bfd, even though a single bfd could contain many exports. The
  5233. overhead involved in storing, loading, and processing so many bfd's
  5234. is quite large, and explains the tremendous time, memory, and
  5235. storage needed to link against particularly large or complex
  5236. libraries when using import libs.
  5237. Linking directly to a dll uses no extra command-line switches other
  5238. than '-L' and '-l', because 'ld' already searches for a number of
  5239. names to match each library. All that is needed from the
  5240. developer's perspective is an understanding of this search, in
  5241. order to force ld to select the dll instead of an import library.
  5242. For instance, when ld is called with the argument '-lxxx' it will
  5243. attempt to find, in the first directory of its search path,
  5244. libxxx.dll.a
  5245. xxx.dll.a
  5246. libxxx.a
  5247. xxx.lib
  5248. cygxxx.dll (*)
  5249. libxxx.dll
  5250. xxx.dll
  5251. before moving on to the next directory in the search path.
  5252. (*) Actually, this is not 'cygxxx.dll' but in fact is
  5253. '<prefix>xxx.dll', where '<prefix>' is set by the 'ld' option
  5254. '--dll-search-prefix=<prefix>'. In the case of cygwin, the
  5255. standard gcc spec file includes '--dll-search-prefix=cyg', so in
  5256. effect we actually search for 'cygxxx.dll'.
  5257. Other win32-based unix environments, such as mingw or pw32, may use
  5258. other '<prefix>'es, although at present only cygwin makes use of
  5259. this feature. It was originally intended to help avoid name
  5260. conflicts among dll's built for the various win32/un*x
  5261. environments, so that (for example) two versions of a zlib dll
  5262. could coexist on the same machine.
  5263. The generic cygwin/mingw path layout uses a 'bin' directory for
  5264. applications and dll's and a 'lib' directory for the import
  5265. libraries (using cygwin nomenclature):
  5266. bin/
  5267. cygxxx.dll
  5268. lib/
  5269. libxxx.dll.a (in case of dll's)
  5270. libxxx.a (in case of static archive)
  5271. Linking directly to a dll without using the import library can be
  5272. done two ways:
  5273. 1. Use the dll directly by adding the 'bin' path to the link line
  5274. gcc -Wl,-verbose -o a.exe -L../bin/ -lxxx
  5275. However, as the dll's often have version numbers appended to their
  5276. names ('cygncurses-5.dll') this will often fail, unless one
  5277. specifies '-L../bin -lncurses-5' to include the version. Import
  5278. libs are generally not versioned, and do not have this difficulty.
  5279. 2. Create a symbolic link from the dll to a file in the 'lib'
  5280. directory according to the above mentioned search pattern. This
  5281. should be used to avoid unwanted changes in the tools needed for
  5282. making the app/dll.
  5283. ln -s bin/cygxxx.dll lib/[cyg|lib|]xxx.dll[.a]
  5284. Then you can link without any make environment changes.
  5285. gcc -Wl,-verbose -o a.exe -L../lib/ -lxxx
  5286. This technique also avoids the version number problems, because the
  5287. following is perfectly legal
  5288. bin/
  5289. cygxxx-5.dll
  5290. lib/
  5291. libxxx.dll.a -> ../bin/cygxxx-5.dll
  5292. Linking directly to a dll without using an import lib will work
  5293. even when auto-import features are exercised, and even when
  5294. '--enable-runtime-pseudo-relocs' is used.
  5295. Given the improvements in speed and memory usage, one might
  5296. justifiably wonder why import libraries are used at all. There are
  5297. three reasons:
  5298. 1. Until recently, the link-directly-to-dll functionality did
  5299. _not_ work with auto-imported data.
  5300. 2. Sometimes it is necessary to include pure static objects within
  5301. the import library (which otherwise contains only bfd's for
  5302. indirection symbols that point to the exports of a dll). Again,
  5303. the import lib for the cygwin kernel makes use of this ability, and
  5304. it is not possible to do this without an import lib.
  5305. 3. Symbol aliases can only be resolved using an import lib. This
  5306. is critical when linking against OS-supplied dll's (eg, the win32
  5307. API) in which symbols are usually exported as undecorated aliases
  5308. of their stdcall-decorated assembly names.
  5309. So, import libs are not going away. But the ability to replace
  5310. true import libs with a simple symbolic link to (or a copy of) a
  5311. dll, in many cases, is a useful addition to the suite of tools
  5312. binutils makes available to the win32 developer. Given the massive
  5313. improvements in memory requirements during linking, storage
  5314. requirements, and linking speed, we expect that many developers
  5315. will soon begin to use this feature whenever possible.
  5316. _symbol aliasing_
  5317. _adding additional names_
  5318. Sometimes, it is useful to export symbols with additional
  5319. names. A symbol 'foo' will be exported as 'foo', but it can
  5320. also be exported as '_foo' by using special directives in the
  5321. DEF file when creating the dll. This will affect also the
  5322. optional created import library. Consider the following DEF
  5323. file:
  5324. LIBRARY "xyz.dll" BASE=0x61000000
  5325. EXPORTS
  5326. foo
  5327. _foo = foo
  5328. The line '_foo = foo' maps the symbol 'foo' to '_foo'.
  5329. Another method for creating a symbol alias is to create it in
  5330. the source code using the "weak" attribute:
  5331. void foo () { /* Do something. */; }
  5332. void _foo () __attribute__ ((weak, alias ("foo")));
  5333. See the gcc manual for more information about attributes and
  5334. weak symbols.
  5335. _renaming symbols_
  5336. Sometimes it is useful to rename exports. For instance, the
  5337. cygwin kernel does this regularly. A symbol '_foo' can be
  5338. exported as 'foo' but not as '_foo' by using special
  5339. directives in the DEF file. (This will also affect the import
  5340. library, if it is created). In the following example:
  5341. LIBRARY "xyz.dll" BASE=0x61000000
  5342. EXPORTS
  5343. _foo = foo
  5344. The line '_foo = foo' maps the exported symbol 'foo' to
  5345. '_foo'.
  5346. Note: using a DEF file disables the default auto-export behavior,
  5347. unless the '--export-all-symbols' command line option is used. If,
  5348. however, you are trying to rename symbols, then you should list
  5349. _all_ desired exports in the DEF file, including the symbols that
  5350. are not being renamed, and do _not_ use the '--export-all-symbols'
  5351. option. If you list only the renamed symbols in the DEF file, and
  5352. use '--export-all-symbols' to handle the other symbols, then the
  5353. both the new names _and_ the original names for the renamed symbols
  5354. will be exported. In effect, you'd be aliasing those symbols, not
  5355. renaming them, which is probably not what you wanted.
  5356. _weak externals_
  5357. The Windows object format, PE, specifies a form of weak symbols
  5358. called weak externals. When a weak symbol is linked and the symbol
  5359. is not defined, the weak symbol becomes an alias for some other
  5360. symbol. There are three variants of weak externals:
  5361. * Definition is searched for in objects and libraries,
  5362. historically called lazy externals.
  5363. * Definition is searched for only in other objects, not in
  5364. libraries. This form is not presently implemented.
  5365. * No search; the symbol is an alias. This form is not presently
  5366. implemented.
  5367. As a GNU extension, weak symbols that do not specify an alternate
  5368. symbol are supported. If the symbol is undefined when linking, the
  5369. symbol uses a default value.
  5370. _aligned common symbols_
  5371. As a GNU extension to the PE file format, it is possible to specify
  5372. the desired alignment for a common symbol. This information is
  5373. conveyed from the assembler or compiler to the linker by means of
  5374. GNU-specific commands carried in the object file's '.drectve'
  5375. section, which are recognized by 'ld' and respected when laying out
  5376. the common symbols. Native tools will be able to process object
  5377. files employing this GNU extension, but will fail to respect the
  5378. alignment instructions, and may issue noisy warnings about unknown
  5379. linker directives.
  5380. 
  5381. File: ld.info, Node: Xtensa, Prev: WIN32, Up: Machine Dependent
  5382. 4.17 'ld' and Xtensa Processors
  5383. ===============================
  5384. The default 'ld' behavior for Xtensa processors is to interpret
  5385. 'SECTIONS' commands so that lists of explicitly named sections in a
  5386. specification with a wildcard file will be interleaved when necessary to
  5387. keep literal pools within the range of PC-relative load offsets. For
  5388. example, with the command:
  5389. SECTIONS
  5390. {
  5391. .text : {
  5392. *(.literal .text)
  5393. }
  5394. }
  5395. 'ld' may interleave some of the '.literal' and '.text' sections from
  5396. different object files to ensure that the literal pools are within the
  5397. range of PC-relative load offsets. A valid interleaving might place the
  5398. '.literal' sections from an initial group of files followed by the
  5399. '.text' sections of that group of files. Then, the '.literal' sections
  5400. from the rest of the files and the '.text' sections from the rest of the
  5401. files would follow.
  5402. Relaxation is enabled by default for the Xtensa version of 'ld' and
  5403. provides two important link-time optimizations. The first optimization
  5404. is to combine identical literal values to reduce code size. A redundant
  5405. literal will be removed and all the 'L32R' instructions that use it will
  5406. be changed to reference an identical literal, as long as the location of
  5407. the replacement literal is within the offset range of all the 'L32R'
  5408. instructions. The second optimization is to remove unnecessary overhead
  5409. from assembler-generated "longcall" sequences of 'L32R'/'CALLXN' when
  5410. the target functions are within range of direct 'CALLN' instructions.
  5411. For each of these cases where an indirect call sequence can be
  5412. optimized to a direct call, the linker will change the 'CALLXN'
  5413. instruction to a 'CALLN' instruction, remove the 'L32R' instruction, and
  5414. remove the literal referenced by the 'L32R' instruction if it is not
  5415. used for anything else. Removing the 'L32R' instruction always reduces
  5416. code size but can potentially hurt performance by changing the alignment
  5417. of subsequent branch targets. By default, the linker will always
  5418. preserve alignments, either by switching some instructions between
  5419. 24-bit encodings and the equivalent density instructions or by inserting
  5420. a no-op in place of the 'L32R' instruction that was removed. If code
  5421. size is more important than performance, the '--size-opt' option can be
  5422. used to prevent the linker from widening density instructions or
  5423. inserting no-ops, except in a few cases where no-ops are required for
  5424. correctness.
  5425. The following Xtensa-specific command-line options can be used to
  5426. control the linker:
  5427. '--size-opt'
  5428. When optimizing indirect calls to direct calls, optimize for code
  5429. size more than performance. With this option, the linker will not
  5430. insert no-ops or widen density instructions to preserve branch
  5431. target alignment. There may still be some cases where no-ops are
  5432. required to preserve the correctness of the code.
  5433. 
  5434. File: ld.info, Node: BFD, Next: Reporting Bugs, Prev: Machine Dependent, Up: Top
  5435. 5 BFD
  5436. *****
  5437. The linker accesses object and archive files using the BFD libraries.
  5438. These libraries allow the linker to use the same routines to operate on
  5439. object files whatever the object file format. A different object file
  5440. format can be supported simply by creating a new BFD back end and adding
  5441. it to the library. To conserve runtime memory, however, the linker and
  5442. associated tools are usually configured to support only a subset of the
  5443. object file formats available. You can use 'objdump -i' (*note objdump:
  5444. (binutils.info)objdump.) to list all the formats available for your
  5445. configuration.
  5446. As with most implementations, BFD is a compromise between several
  5447. conflicting requirements. The major factor influencing BFD design was
  5448. efficiency: any time used converting between formats is time which would
  5449. not have been spent had BFD not been involved. This is partly offset by
  5450. abstraction payback; since BFD simplifies applications and back ends,
  5451. more time and care may be spent optimizing algorithms for a greater
  5452. speed.
  5453. One minor artifact of the BFD solution which you should bear in mind
  5454. is the potential for information loss. There are two places where
  5455. useful information can be lost using the BFD mechanism: during
  5456. conversion and during output. *Note BFD information loss::.
  5457. * Menu:
  5458. * BFD outline:: How it works: an outline of BFD
  5459. 
  5460. File: ld.info, Node: BFD outline, Up: BFD
  5461. 5.1 How It Works: An Outline of BFD
  5462. ===================================
  5463. When an object file is opened, BFD subroutines automatically determine
  5464. the format of the input object file. They then build a descriptor in
  5465. memory with pointers to routines that will be used to access elements of
  5466. the object file's data structures.
  5467. As different information from the object files is required, BFD reads
  5468. from different sections of the file and processes them. For example, a
  5469. very common operation for the linker is processing symbol tables. Each
  5470. BFD back end provides a routine for converting between the object file's
  5471. representation of symbols and an internal canonical format. When the
  5472. linker asks for the symbol table of an object file, it calls through a
  5473. memory pointer to the routine from the relevant BFD back end which reads
  5474. and converts the table into a canonical form. The linker then operates
  5475. upon the canonical form. When the link is finished and the linker
  5476. writes the output file's symbol table, another BFD back end routine is
  5477. called to take the newly created symbol table and convert it into the
  5478. chosen output format.
  5479. * Menu:
  5480. * BFD information loss:: Information Loss
  5481. * Canonical format:: The BFD canonical object-file format
  5482. 
  5483. File: ld.info, Node: BFD information loss, Next: Canonical format, Up: BFD outline
  5484. 5.1.1 Information Loss
  5485. ----------------------
  5486. _Information can be lost during output._ The output formats supported
  5487. by BFD do not provide identical facilities, and information which can be
  5488. described in one form has nowhere to go in another format. One example
  5489. of this is alignment information in 'b.out'. There is nowhere in an
  5490. 'a.out' format file to store alignment information on the contained
  5491. data, so when a file is linked from 'b.out' and an 'a.out' image is
  5492. produced, alignment information will not propagate to the output file.
  5493. (The linker will still use the alignment information internally, so the
  5494. link is performed correctly).
  5495. Another example is COFF section names. COFF files may contain an
  5496. unlimited number of sections, each one with a textual section name. If
  5497. the target of the link is a format which does not have many sections
  5498. (e.g., 'a.out') or has sections without names (e.g., the Oasys format),
  5499. the link cannot be done simply. You can circumvent this problem by
  5500. describing the desired input-to-output section mapping with the linker
  5501. command language.
  5502. _Information can be lost during canonicalization._ The BFD internal
  5503. canonical form of the external formats is not exhaustive; there are
  5504. structures in input formats for which there is no direct representation
  5505. internally. This means that the BFD back ends cannot maintain all
  5506. possible data richness through the transformation between external to
  5507. internal and back to external formats.
  5508. This limitation is only a problem when an application reads one
  5509. format and writes another. Each BFD back end is responsible for
  5510. maintaining as much data as possible, and the internal BFD canonical
  5511. form has structures which are opaque to the BFD core, and exported only
  5512. to the back ends. When a file is read in one format, the canonical form
  5513. is generated for BFD and the application. At the same time, the back
  5514. end saves away any information which may otherwise be lost. If the data
  5515. is then written back in the same format, the back end routine will be
  5516. able to use the canonical form provided by the BFD core as well as the
  5517. information it prepared earlier. Since there is a great deal of
  5518. commonality between back ends, there is no information lost when linking
  5519. or copying big endian COFF to little endian COFF, or 'a.out' to 'b.out'.
  5520. When a mixture of formats is linked, the information is only lost from
  5521. the files whose format differs from the destination.
  5522. 
  5523. File: ld.info, Node: Canonical format, Prev: BFD information loss, Up: BFD outline
  5524. 5.1.2 The BFD canonical object-file format
  5525. ------------------------------------------
  5526. The greatest potential for loss of information occurs when there is the
  5527. least overlap between the information provided by the source format,
  5528. that stored by the canonical format, and that needed by the destination
  5529. format. A brief description of the canonical form may help you
  5530. understand which kinds of data you can count on preserving across
  5531. conversions.
  5532. _files_
  5533. Information stored on a per-file basis includes target machine
  5534. architecture, particular implementation format type, a demand
  5535. pageable bit, and a write protected bit. Information like Unix
  5536. magic numbers is not stored here--only the magic numbers' meaning,
  5537. so a 'ZMAGIC' file would have both the demand pageable bit and the
  5538. write protected text bit set. The byte order of the target is
  5539. stored on a per-file basis, so that big- and little-endian object
  5540. files may be used with one another.
  5541. _sections_
  5542. Each section in the input file contains the name of the section,
  5543. the section's original address in the object file, size and
  5544. alignment information, various flags, and pointers into other BFD
  5545. data structures.
  5546. _symbols_
  5547. Each symbol contains a pointer to the information for the object
  5548. file which originally defined it, its name, its value, and various
  5549. flag bits. When a BFD back end reads in a symbol table, it
  5550. relocates all symbols to make them relative to the base of the
  5551. section where they were defined. Doing this ensures that each
  5552. symbol points to its containing section. Each symbol also has a
  5553. varying amount of hidden private data for the BFD back end. Since
  5554. the symbol points to the original file, the private data format for
  5555. that symbol is accessible. 'ld' can operate on a collection of
  5556. symbols of wildly different formats without problems.
  5557. Normal global and simple local symbols are maintained on output, so
  5558. an output file (no matter its format) will retain symbols pointing
  5559. to functions and to global, static, and common variables. Some
  5560. symbol information is not worth retaining; in 'a.out', type
  5561. information is stored in the symbol table as long symbol names.
  5562. This information would be useless to most COFF debuggers; the
  5563. linker has command line switches to allow users to throw it away.
  5564. There is one word of type information within the symbol, so if the
  5565. format supports symbol type information within symbols (for
  5566. example, COFF, IEEE, Oasys) and the type is simple enough to fit
  5567. within one word (nearly everything but aggregates), the information
  5568. will be preserved.
  5569. _relocation level_
  5570. Each canonical BFD relocation record contains a pointer to the
  5571. symbol to relocate to, the offset of the data to relocate, the
  5572. section the data is in, and a pointer to a relocation type
  5573. descriptor. Relocation is performed by passing messages through
  5574. the relocation type descriptor and the symbol pointer. Therefore,
  5575. relocations can be performed on output data using a relocation
  5576. method that is only available in one of the input formats. For
  5577. instance, Oasys provides a byte relocation format. A relocation
  5578. record requesting this relocation type would point indirectly to a
  5579. routine to perform this, so the relocation may be performed on a
  5580. byte being written to a 68k COFF file, even though 68k COFF has no
  5581. such relocation type.
  5582. _line numbers_
  5583. Object formats can contain, for debugging purposes, some form of
  5584. mapping between symbols, source line numbers, and addresses in the
  5585. output file. These addresses have to be relocated along with the
  5586. symbol information. Each symbol with an associated list of line
  5587. number records points to the first record of the list. The head of
  5588. a line number list consists of a pointer to the symbol, which
  5589. allows finding out the address of the function whose line number is
  5590. being described. The rest of the list is made up of pairs: offsets
  5591. into the section and line numbers. Any format which can simply
  5592. derive this information can pass it successfully between formats
  5593. (COFF, IEEE and Oasys).
  5594. 
  5595. File: ld.info, Node: Reporting Bugs, Next: MRI, Prev: BFD, Up: Top
  5596. 6 Reporting Bugs
  5597. ****************
  5598. Your bug reports play an essential role in making 'ld' reliable.
  5599. Reporting a bug may help you by bringing a solution to your problem,
  5600. or it may not. But in any case the principal function of a bug report
  5601. is to help the entire community by making the next version of 'ld' work
  5602. better. Bug reports are your contribution to the maintenance of 'ld'.
  5603. In order for a bug report to serve its purpose, you must include the
  5604. information that enables us to fix the bug.
  5605. * Menu:
  5606. * Bug Criteria:: Have you found a bug?
  5607. * Bug Reporting:: How to report bugs
  5608. 
  5609. File: ld.info, Node: Bug Criteria, Next: Bug Reporting, Up: Reporting Bugs
  5610. 6.1 Have You Found a Bug?
  5611. =========================
  5612. If you are not sure whether you have found a bug, here are some
  5613. guidelines:
  5614. * If the linker gets a fatal signal, for any input whatever, that is
  5615. a 'ld' bug. Reliable linkers never crash.
  5616. * If 'ld' produces an error message for valid input, that is a bug.
  5617. * If 'ld' does not produce an error message for invalid input, that
  5618. may be a bug. In the general case, the linker can not verify that
  5619. object files are correct.
  5620. * If you are an experienced user of linkers, your suggestions for
  5621. improvement of 'ld' are welcome in any case.
  5622. 
  5623. File: ld.info, Node: Bug Reporting, Prev: Bug Criteria, Up: Reporting Bugs
  5624. 6.2 How to Report Bugs
  5625. ======================
  5626. A number of companies and individuals offer support for GNU products.
  5627. If you obtained 'ld' from a support organization, we recommend you
  5628. contact that organization first.
  5629. You can find contact information for many support companies and
  5630. individuals in the file 'etc/SERVICE' in the GNU Emacs distribution.
  5631. Otherwise, send bug reports for 'ld' to
  5632. <http://www.sourceware.org/bugzilla/>.
  5633. The fundamental principle of reporting bugs usefully is this: *report
  5634. all the facts*. If you are not sure whether to state a fact or leave it
  5635. out, state it!
  5636. Often people omit facts because they think they know what causes the
  5637. problem and assume that some details do not matter. Thus, you might
  5638. assume that the name of a symbol you use in an example does not matter.
  5639. Well, probably it does not, but one cannot be sure. Perhaps the bug is
  5640. a stray memory reference which happens to fetch from the location where
  5641. that name is stored in memory; perhaps, if the name were different, the
  5642. contents of that location would fool the linker into doing the right
  5643. thing despite the bug. Play it safe and give a specific, complete
  5644. example. That is the easiest thing for you to do, and the most helpful.
  5645. Keep in mind that the purpose of a bug report is to enable us to fix
  5646. the bug if it is new to us. Therefore, always write your bug reports on
  5647. the assumption that the bug has not been reported previously.
  5648. Sometimes people give a few sketchy facts and ask, "Does this ring a
  5649. bell?" This cannot help us fix a bug, so it is basically useless. We
  5650. respond by asking for enough details to enable us to investigate. You
  5651. might as well expedite matters by sending them to begin with.
  5652. To enable us to fix the bug, you should include all these things:
  5653. * The version of 'ld'. 'ld' announces it if you start it with the
  5654. '--version' argument.
  5655. Without this, we will not know whether there is any point in
  5656. looking for the bug in the current version of 'ld'.
  5657. * Any patches you may have applied to the 'ld' source, including any
  5658. patches made to the 'BFD' library.
  5659. * The type of machine you are using, and the operating system name
  5660. and version number.
  5661. * What compiler (and its version) was used to compile 'ld'--e.g.
  5662. "'gcc-2.7'".
  5663. * The command arguments you gave the linker to link your example and
  5664. observe the bug. To guarantee you will not omit something
  5665. important, list them all. A copy of the Makefile (or the output
  5666. from make) is sufficient.
  5667. If we were to try to guess the arguments, we would probably guess
  5668. wrong and then we might not encounter the bug.
  5669. * A complete input file, or set of input files, that will reproduce
  5670. the bug. It is generally most helpful to send the actual object
  5671. files provided that they are reasonably small. Say no more than
  5672. 10K. For bigger files you can either make them available by FTP or
  5673. HTTP or else state that you are willing to send the object file(s)
  5674. to whomever requests them. (Note - your email will be going to a
  5675. mailing list, so we do not want to clog it up with large
  5676. attachments). But small attachments are best.
  5677. If the source files were assembled using 'gas' or compiled using
  5678. 'gcc', then it may be OK to send the source files rather than the
  5679. object files. In this case, be sure to say exactly what version of
  5680. 'gas' or 'gcc' was used to produce the object files. Also say how
  5681. 'gas' or 'gcc' were configured.
  5682. * A description of what behavior you observe that you believe is
  5683. incorrect. For example, "It gets a fatal signal."
  5684. Of course, if the bug is that 'ld' gets a fatal signal, then we
  5685. will certainly notice it. But if the bug is incorrect output, we
  5686. might not notice unless it is glaringly wrong. You might as well
  5687. not give us a chance to make a mistake.
  5688. Even if the problem you experience is a fatal signal, you should
  5689. still say so explicitly. Suppose something strange is going on,
  5690. such as, your copy of 'ld' is out of sync, or you have encountered
  5691. a bug in the C library on your system. (This has happened!) Your
  5692. copy might crash and ours would not. If you told us to expect a
  5693. crash, then when ours fails to crash, we would know that the bug
  5694. was not happening for us. If you had not told us to expect a
  5695. crash, then we would not be able to draw any conclusion from our
  5696. observations.
  5697. * If you wish to suggest changes to the 'ld' source, send us context
  5698. diffs, as generated by 'diff' with the '-u', '-c', or '-p' option.
  5699. Always send diffs from the old file to the new file. If you even
  5700. discuss something in the 'ld' source, refer to it by context, not
  5701. by line number.
  5702. The line numbers in our development sources will not match those in
  5703. your sources. Your line numbers would convey no useful information
  5704. to us.
  5705. Here are some things that are not necessary:
  5706. * A description of the envelope of the bug.
  5707. Often people who encounter a bug spend a lot of time investigating
  5708. which changes to the input file will make the bug go away and which
  5709. changes will not affect it.
  5710. This is often time consuming and not very useful, because the way
  5711. we will find the bug is by running a single example under the
  5712. debugger with breakpoints, not by pure deduction from a series of
  5713. examples. We recommend that you save your time for something else.
  5714. Of course, if you can find a simpler example to report _instead_ of
  5715. the original one, that is a convenience for us. Errors in the
  5716. output will be easier to spot, running under the debugger will take
  5717. less time, and so on.
  5718. However, simplification is not vital; if you do not want to do
  5719. this, report the bug anyway and send us the entire test case you
  5720. used.
  5721. * A patch for the bug.
  5722. A patch for the bug does help us if it is a good one. But do not
  5723. omit the necessary information, such as the test case, on the
  5724. assumption that a patch is all we need. We might see problems with
  5725. your patch and decide to fix the problem another way, or we might
  5726. not understand it at all.
  5727. Sometimes with a program as complicated as 'ld' it is very hard to
  5728. construct an example that will make the program follow a certain
  5729. path through the code. If you do not send us the example, we will
  5730. not be able to construct one, so we will not be able to verify that
  5731. the bug is fixed.
  5732. And if we cannot understand what bug you are trying to fix, or why
  5733. your patch should be an improvement, we will not install it. A
  5734. test case will help us to understand.
  5735. * A guess about what the bug is or what it depends on.
  5736. Such guesses are usually wrong. Even we cannot guess right about
  5737. such things without first using the debugger to find the facts.
  5738. 
  5739. File: ld.info, Node: MRI, Next: GNU Free Documentation License, Prev: Reporting Bugs, Up: Top
  5740. Appendix A MRI Compatible Script Files
  5741. **************************************
  5742. To aid users making the transition to GNU 'ld' from the MRI linker, 'ld'
  5743. can use MRI compatible linker scripts as an alternative to the more
  5744. general-purpose linker scripting language described in *note Scripts::.
  5745. MRI compatible linker scripts have a much simpler command set than the
  5746. scripting language otherwise used with 'ld'. GNU 'ld' supports the most
  5747. commonly used MRI linker commands; these commands are described here.
  5748. In general, MRI scripts aren't of much use with the 'a.out' object
  5749. file format, since it only has three sections and MRI scripts lack some
  5750. features to make use of them.
  5751. You can specify a file containing an MRI-compatible script using the
  5752. '-c' command-line option.
  5753. Each command in an MRI-compatible script occupies its own line; each
  5754. command line starts with the keyword that identifies the command (though
  5755. blank lines are also allowed for punctuation). If a line of an
  5756. MRI-compatible script begins with an unrecognized keyword, 'ld' issues a
  5757. warning message, but continues processing the script.
  5758. Lines beginning with '*' are comments.
  5759. You can write these commands using all upper-case letters, or all
  5760. lower case; for example, 'chip' is the same as 'CHIP'. The following
  5761. list shows only the upper-case form of each command.
  5762. 'ABSOLUTE SECNAME'
  5763. 'ABSOLUTE SECNAME, SECNAME, ... SECNAME'
  5764. Normally, 'ld' includes in the output file all sections from all
  5765. the input files. However, in an MRI-compatible script, you can use
  5766. the 'ABSOLUTE' command to restrict the sections that will be
  5767. present in your output program. If the 'ABSOLUTE' command is used
  5768. at all in a script, then only the sections named explicitly in
  5769. 'ABSOLUTE' commands will appear in the linker output. You can
  5770. still use other input sections (whatever you select on the command
  5771. line, or using 'LOAD') to resolve addresses in the output file.
  5772. 'ALIAS OUT-SECNAME, IN-SECNAME'
  5773. Use this command to place the data from input section IN-SECNAME in
  5774. a section called OUT-SECNAME in the linker output file.
  5775. IN-SECNAME may be an integer.
  5776. 'ALIGN SECNAME = EXPRESSION'
  5777. Align the section called SECNAME to EXPRESSION. The EXPRESSION
  5778. should be a power of two.
  5779. 'BASE EXPRESSION'
  5780. Use the value of EXPRESSION as the lowest address (other than
  5781. absolute addresses) in the output file.
  5782. 'CHIP EXPRESSION'
  5783. 'CHIP EXPRESSION, EXPRESSION'
  5784. This command does nothing; it is accepted only for compatibility.
  5785. 'END'
  5786. This command does nothing whatever; it's only accepted for
  5787. compatibility.
  5788. 'FORMAT OUTPUT-FORMAT'
  5789. Similar to the 'OUTPUT_FORMAT' command in the more general linker
  5790. language, but restricted to one of these output formats:
  5791. 1. S-records, if OUTPUT-FORMAT is 'S'
  5792. 2. IEEE, if OUTPUT-FORMAT is 'IEEE'
  5793. 3. COFF (the 'coff-m68k' variant in BFD), if OUTPUT-FORMAT is
  5794. 'COFF'
  5795. 'LIST ANYTHING...'
  5796. Print (to the standard output file) a link map, as produced by the
  5797. 'ld' command-line option '-M'.
  5798. The keyword 'LIST' may be followed by anything on the same line,
  5799. with no change in its effect.
  5800. 'LOAD FILENAME'
  5801. 'LOAD FILENAME, FILENAME, ... FILENAME'
  5802. Include one or more object file FILENAME in the link; this has the
  5803. same effect as specifying FILENAME directly on the 'ld' command
  5804. line.
  5805. 'NAME OUTPUT-NAME'
  5806. OUTPUT-NAME is the name for the program produced by 'ld'; the
  5807. MRI-compatible command 'NAME' is equivalent to the command-line
  5808. option '-o' or the general script language command 'OUTPUT'.
  5809. 'ORDER SECNAME, SECNAME, ... SECNAME'
  5810. 'ORDER SECNAME SECNAME SECNAME'
  5811. Normally, 'ld' orders the sections in its output file in the order
  5812. in which they first appear in the input files. In an
  5813. MRI-compatible script, you can override this ordering with the
  5814. 'ORDER' command. The sections you list with 'ORDER' will appear
  5815. first in your output file, in the order specified.
  5816. 'PUBLIC NAME=EXPRESSION'
  5817. 'PUBLIC NAME,EXPRESSION'
  5818. 'PUBLIC NAME EXPRESSION'
  5819. Supply a value (EXPRESSION) for external symbol NAME used in the
  5820. linker input files.
  5821. 'SECT SECNAME, EXPRESSION'
  5822. 'SECT SECNAME=EXPRESSION'
  5823. 'SECT SECNAME EXPRESSION'
  5824. You can use any of these three forms of the 'SECT' command to
  5825. specify the start address (EXPRESSION) for section SECNAME. If you
  5826. have more than one 'SECT' statement for the same SECNAME, only the
  5827. _first_ sets the start address.
  5828. 
  5829. File: ld.info, Node: GNU Free Documentation License, Next: LD Index, Prev: MRI, Up: Top
  5830. Appendix B GNU Free Documentation License
  5831. *****************************************
  5832. Version 1.3, 3 November 2008
  5833. Copyright (C) 2000, 2001, 2002, 2007, 2008 Free Software Foundation, Inc.
  5834. <http://fsf.org/>
  5835. Everyone is permitted to copy and distribute verbatim copies
  5836. of this license document, but changing it is not allowed.
  5837. 0. PREAMBLE
  5838. The purpose of this License is to make a manual, textbook, or other
  5839. functional and useful document "free" in the sense of freedom: to
  5840. assure everyone the effective freedom to copy and redistribute it,
  5841. with or without modifying it, either commercially or
  5842. noncommercially. Secondarily, this License preserves for the
  5843. author and publisher a way to get credit for their work, while not
  5844. being considered responsible for modifications made by others.
  5845. This License is a kind of "copyleft", which means that derivative
  5846. works of the document must themselves be free in the same sense.
  5847. It complements the GNU General Public License, which is a copyleft
  5848. license designed for free software.
  5849. We have designed this License in order to use it for manuals for
  5850. free software, because free software needs free documentation: a
  5851. free program should come with manuals providing the same freedoms
  5852. that the software does. But this License is not limited to
  5853. software manuals; it can be used for any textual work, regardless
  5854. of subject matter or whether it is published as a printed book. We
  5855. recommend this License principally for works whose purpose is
  5856. instruction or reference.
  5857. 1. APPLICABILITY AND DEFINITIONS
  5858. This License applies to any manual or other work, in any medium,
  5859. that contains a notice placed by the copyright holder saying it can
  5860. be distributed under the terms of this License. Such a notice
  5861. grants a world-wide, royalty-free license, unlimited in duration,
  5862. to use that work under the conditions stated herein. The
  5863. "Document", below, refers to any such manual or work. Any member
  5864. of the public is a licensee, and is addressed as "you". You accept
  5865. the license if you copy, modify or distribute the work in a way
  5866. requiring permission under copyright law.
  5867. A "Modified Version" of the Document means any work containing the
  5868. Document or a portion of it, either copied verbatim, or with
  5869. modifications and/or translated into another language.
  5870. A "Secondary Section" is a named appendix or a front-matter section
  5871. of the Document that deals exclusively with the relationship of the
  5872. publishers or authors of the Document to the Document's overall
  5873. subject (or to related matters) and contains nothing that could
  5874. fall directly within that overall subject. (Thus, if the Document
  5875. is in part a textbook of mathematics, a Secondary Section may not
  5876. explain any mathematics.) The relationship could be a matter of
  5877. historical connection with the subject or with related matters, or
  5878. of legal, commercial, philosophical, ethical or political position
  5879. regarding them.
  5880. The "Invariant Sections" are certain Secondary Sections whose
  5881. titles are designated, as being those of Invariant Sections, in the
  5882. notice that says that the Document is released under this License.
  5883. If a section does not fit the above definition of Secondary then it
  5884. is not allowed to be designated as Invariant. The Document may
  5885. contain zero Invariant Sections. If the Document does not identify
  5886. any Invariant Sections then there are none.
  5887. The "Cover Texts" are certain short passages of text that are
  5888. listed, as Front-Cover Texts or Back-Cover Texts, in the notice
  5889. that says that the Document is released under this License. A
  5890. Front-Cover Text may be at most 5 words, and a Back-Cover Text may
  5891. be at most 25 words.
  5892. A "Transparent" copy of the Document means a machine-readable copy,
  5893. represented in a format whose specification is available to the
  5894. general public, that is suitable for revising the document
  5895. straightforwardly with generic text editors or (for images composed
  5896. of pixels) generic paint programs or (for drawings) some widely
  5897. available drawing editor, and that is suitable for input to text
  5898. formatters or for automatic translation to a variety of formats
  5899. suitable for input to text formatters. A copy made in an otherwise
  5900. Transparent file format whose markup, or absence of markup, has
  5901. been arranged to thwart or discourage subsequent modification by
  5902. readers is not Transparent. An image format is not Transparent if
  5903. used for any substantial amount of text. A copy that is not
  5904. "Transparent" is called "Opaque".
  5905. Examples of suitable formats for Transparent copies include plain
  5906. ASCII without markup, Texinfo input format, LaTeX input format,
  5907. SGML or XML using a publicly available DTD, and standard-conforming
  5908. simple HTML, PostScript or PDF designed for human modification.
  5909. Examples of transparent image formats include PNG, XCF and JPG.
  5910. Opaque formats include proprietary formats that can be read and
  5911. edited only by proprietary word processors, SGML or XML for which
  5912. the DTD and/or processing tools are not generally available, and
  5913. the machine-generated HTML, PostScript or PDF produced by some word
  5914. processors for output purposes only.
  5915. The "Title Page" means, for a printed book, the title page itself,
  5916. plus such following pages as are needed to hold, legibly, the
  5917. material this License requires to appear in the title page. For
  5918. works in formats which do not have any title page as such, "Title
  5919. Page" means the text near the most prominent appearance of the
  5920. work's title, preceding the beginning of the body of the text.
  5921. The "publisher" means any person or entity that distributes copies
  5922. of the Document to the public.
  5923. A section "Entitled XYZ" means a named subunit of the Document
  5924. whose title either is precisely XYZ or contains XYZ in parentheses
  5925. following text that translates XYZ in another language. (Here XYZ
  5926. stands for a specific section name mentioned below, such as
  5927. "Acknowledgements", "Dedications", "Endorsements", or "History".)
  5928. To "Preserve the Title" of such a section when you modify the
  5929. Document means that it remains a section "Entitled XYZ" according
  5930. to this definition.
  5931. The Document may include Warranty Disclaimers next to the notice
  5932. which states that this License applies to the Document. These
  5933. Warranty Disclaimers are considered to be included by reference in
  5934. this License, but only as regards disclaiming warranties: any other
  5935. implication that these Warranty Disclaimers may have is void and
  5936. has no effect on the meaning of this License.
  5937. 2. VERBATIM COPYING
  5938. You may copy and distribute the Document in any medium, either
  5939. commercially or noncommercially, provided that this License, the
  5940. copyright notices, and the license notice saying this License
  5941. applies to the Document are reproduced in all copies, and that you
  5942. add no other conditions whatsoever to those of this License. You
  5943. may not use technical measures to obstruct or control the reading
  5944. or further copying of the copies you make or distribute. However,
  5945. you may accept compensation in exchange for copies. If you
  5946. distribute a large enough number of copies you must also follow the
  5947. conditions in section 3.
  5948. You may also lend copies, under the same conditions stated above,
  5949. and you may publicly display copies.
  5950. 3. COPYING IN QUANTITY
  5951. If you publish printed copies (or copies in media that commonly
  5952. have printed covers) of the Document, numbering more than 100, and
  5953. the Document's license notice requires Cover Texts, you must
  5954. enclose the copies in covers that carry, clearly and legibly, all
  5955. these Cover Texts: Front-Cover Texts on the front cover, and
  5956. Back-Cover Texts on the back cover. Both covers must also clearly
  5957. and legibly identify you as the publisher of these copies. The
  5958. front cover must present the full title with all words of the title
  5959. equally prominent and visible. You may add other material on the
  5960. covers in addition. Copying with changes limited to the covers, as
  5961. long as they preserve the title of the Document and satisfy these
  5962. conditions, can be treated as verbatim copying in other respects.
  5963. If the required texts for either cover are too voluminous to fit
  5964. legibly, you should put the first ones listed (as many as fit
  5965. reasonably) on the actual cover, and continue the rest onto
  5966. adjacent pages.
  5967. If you publish or distribute Opaque copies of the Document
  5968. numbering more than 100, you must either include a machine-readable
  5969. Transparent copy along with each Opaque copy, or state in or with
  5970. each Opaque copy a computer-network location from which the general
  5971. network-using public has access to download using public-standard
  5972. network protocols a complete Transparent copy of the Document, free
  5973. of added material. If you use the latter option, you must take
  5974. reasonably prudent steps, when you begin distribution of Opaque
  5975. copies in quantity, to ensure that this Transparent copy will
  5976. remain thus accessible at the stated location until at least one
  5977. year after the last time you distribute an Opaque copy (directly or
  5978. through your agents or retailers) of that edition to the public.
  5979. It is requested, but not required, that you contact the authors of
  5980. the Document well before redistributing any large number of copies,
  5981. to give them a chance to provide you with an updated version of the
  5982. Document.
  5983. 4. MODIFICATIONS
  5984. You may copy and distribute a Modified Version of the Document
  5985. under the conditions of sections 2 and 3 above, provided that you
  5986. release the Modified Version under precisely this License, with the
  5987. Modified Version filling the role of the Document, thus licensing
  5988. distribution and modification of the Modified Version to whoever
  5989. possesses a copy of it. In addition, you must do these things in
  5990. the Modified Version:
  5991. A. Use in the Title Page (and on the covers, if any) a title
  5992. distinct from that of the Document, and from those of previous
  5993. versions (which should, if there were any, be listed in the
  5994. History section of the Document). You may use the same title
  5995. as a previous version if the original publisher of that
  5996. version gives permission.
  5997. B. List on the Title Page, as authors, one or more persons or
  5998. entities responsible for authorship of the modifications in
  5999. the Modified Version, together with at least five of the
  6000. principal authors of the Document (all of its principal
  6001. authors, if it has fewer than five), unless they release you
  6002. from this requirement.
  6003. C. State on the Title page the name of the publisher of the
  6004. Modified Version, as the publisher.
  6005. D. Preserve all the copyright notices of the Document.
  6006. E. Add an appropriate copyright notice for your modifications
  6007. adjacent to the other copyright notices.
  6008. F. Include, immediately after the copyright notices, a license
  6009. notice giving the public permission to use the Modified
  6010. Version under the terms of this License, in the form shown in
  6011. the Addendum below.
  6012. G. Preserve in that license notice the full lists of Invariant
  6013. Sections and required Cover Texts given in the Document's
  6014. license notice.
  6015. H. Include an unaltered copy of this License.
  6016. I. Preserve the section Entitled "History", Preserve its Title,
  6017. and add to it an item stating at least the title, year, new
  6018. authors, and publisher of the Modified Version as given on the
  6019. Title Page. If there is no section Entitled "History" in the
  6020. Document, create one stating the title, year, authors, and
  6021. publisher of the Document as given on its Title Page, then add
  6022. an item describing the Modified Version as stated in the
  6023. previous sentence.
  6024. J. Preserve the network location, if any, given in the Document
  6025. for public access to a Transparent copy of the Document, and
  6026. likewise the network locations given in the Document for
  6027. previous versions it was based on. These may be placed in the
  6028. "History" section. You may omit a network location for a work
  6029. that was published at least four years before the Document
  6030. itself, or if the original publisher of the version it refers
  6031. to gives permission.
  6032. K. For any section Entitled "Acknowledgements" or "Dedications",
  6033. Preserve the Title of the section, and preserve in the section
  6034. all the substance and tone of each of the contributor
  6035. acknowledgements and/or dedications given therein.
  6036. L. Preserve all the Invariant Sections of the Document, unaltered
  6037. in their text and in their titles. Section numbers or the
  6038. equivalent are not considered part of the section titles.
  6039. M. Delete any section Entitled "Endorsements". Such a section
  6040. may not be included in the Modified Version.
  6041. N. Do not retitle any existing section to be Entitled
  6042. "Endorsements" or to conflict in title with any Invariant
  6043. Section.
  6044. O. Preserve any Warranty Disclaimers.
  6045. If the Modified Version includes new front-matter sections or
  6046. appendices that qualify as Secondary Sections and contain no
  6047. material copied from the Document, you may at your option designate
  6048. some or all of these sections as invariant. To do this, add their
  6049. titles to the list of Invariant Sections in the Modified Version's
  6050. license notice. These titles must be distinct from any other
  6051. section titles.
  6052. You may add a section Entitled "Endorsements", provided it contains
  6053. nothing but endorsements of your Modified Version by various
  6054. parties--for example, statements of peer review or that the text
  6055. has been approved by an organization as the authoritative
  6056. definition of a standard.
  6057. You may add a passage of up to five words as a Front-Cover Text,
  6058. and a passage of up to 25 words as a Back-Cover Text, to the end of
  6059. the list of Cover Texts in the Modified Version. Only one passage
  6060. of Front-Cover Text and one of Back-Cover Text may be added by (or
  6061. through arrangements made by) any one entity. If the Document
  6062. already includes a cover text for the same cover, previously added
  6063. by you or by arrangement made by the same entity you are acting on
  6064. behalf of, you may not add another; but you may replace the old
  6065. one, on explicit permission from the previous publisher that added
  6066. the old one.
  6067. The author(s) and publisher(s) of the Document do not by this
  6068. License give permission to use their names for publicity for or to
  6069. assert or imply endorsement of any Modified Version.
  6070. 5. COMBINING DOCUMENTS
  6071. You may combine the Document with other documents released under
  6072. this License, under the terms defined in section 4 above for
  6073. modified versions, provided that you include in the combination all
  6074. of the Invariant Sections of all of the original documents,
  6075. unmodified, and list them all as Invariant Sections of your
  6076. combined work in its license notice, and that you preserve all
  6077. their Warranty Disclaimers.
  6078. The combined work need only contain one copy of this License, and
  6079. multiple identical Invariant Sections may be replaced with a single
  6080. copy. If there are multiple Invariant Sections with the same name
  6081. but different contents, make the title of each such section unique
  6082. by adding at the end of it, in parentheses, the name of the
  6083. original author or publisher of that section if known, or else a
  6084. unique number. Make the same adjustment to the section titles in
  6085. the list of Invariant Sections in the license notice of the
  6086. combined work.
  6087. In the combination, you must combine any sections Entitled
  6088. "History" in the various original documents, forming one section
  6089. Entitled "History"; likewise combine any sections Entitled
  6090. "Acknowledgements", and any sections Entitled "Dedications". You
  6091. must delete all sections Entitled "Endorsements."
  6092. 6. COLLECTIONS OF DOCUMENTS
  6093. You may make a collection consisting of the Document and other
  6094. documents released under this License, and replace the individual
  6095. copies of this License in the various documents with a single copy
  6096. that is included in the collection, provided that you follow the
  6097. rules of this License for verbatim copying of each of the documents
  6098. in all other respects.
  6099. You may extract a single document from such a collection, and
  6100. distribute it individually under this License, provided you insert
  6101. a copy of this License into the extracted document, and follow this
  6102. License in all other respects regarding verbatim copying of that
  6103. document.
  6104. 7. AGGREGATION WITH INDEPENDENT WORKS
  6105. A compilation of the Document or its derivatives with other
  6106. separate and independent documents or works, in or on a volume of a
  6107. storage or distribution medium, is called an "aggregate" if the
  6108. copyright resulting from the compilation is not used to limit the
  6109. legal rights of the compilation's users beyond what the individual
  6110. works permit. When the Document is included in an aggregate, this
  6111. License does not apply to the other works in the aggregate which
  6112. are not themselves derivative works of the Document.
  6113. If the Cover Text requirement of section 3 is applicable to these
  6114. copies of the Document, then if the Document is less than one half
  6115. of the entire aggregate, the Document's Cover Texts may be placed
  6116. on covers that bracket the Document within the aggregate, or the
  6117. electronic equivalent of covers if the Document is in electronic
  6118. form. Otherwise they must appear on printed covers that bracket
  6119. the whole aggregate.
  6120. 8. TRANSLATION
  6121. Translation is considered a kind of modification, so you may
  6122. distribute translations of the Document under the terms of section
  6123. 4. Replacing Invariant Sections with translations requires special
  6124. permission from their copyright holders, but you may include
  6125. translations of some or all Invariant Sections in addition to the
  6126. original versions of these Invariant Sections. You may include a
  6127. translation of this License, and all the license notices in the
  6128. Document, and any Warranty Disclaimers, provided that you also
  6129. include the original English version of this License and the
  6130. original versions of those notices and disclaimers. In case of a
  6131. disagreement between the translation and the original version of
  6132. this License or a notice or disclaimer, the original version will
  6133. prevail.
  6134. If a section in the Document is Entitled "Acknowledgements",
  6135. "Dedications", or "History", the requirement (section 4) to
  6136. Preserve its Title (section 1) will typically require changing the
  6137. actual title.
  6138. 9. TERMINATION
  6139. You may not copy, modify, sublicense, or distribute the Document
  6140. except as expressly provided under this License. Any attempt
  6141. otherwise to copy, modify, sublicense, or distribute it is void,
  6142. and will automatically terminate your rights under this License.
  6143. However, if you cease all violation of this License, then your
  6144. license from a particular copyright holder is reinstated (a)
  6145. provisionally, unless and until the copyright holder explicitly and
  6146. finally terminates your license, and (b) permanently, if the
  6147. copyright holder fails to notify you of the violation by some
  6148. reasonable means prior to 60 days after the cessation.
  6149. Moreover, your license from a particular copyright holder is
  6150. reinstated permanently if the copyright holder notifies you of the
  6151. violation by some reasonable means, this is the first time you have
  6152. received notice of violation of this License (for any work) from
  6153. that copyright holder, and you cure the violation prior to 30 days
  6154. after your receipt of the notice.
  6155. Termination of your rights under this section does not terminate
  6156. the licenses of parties who have received copies or rights from you
  6157. under this License. If your rights have been terminated and not
  6158. permanently reinstated, receipt of a copy of some or all of the
  6159. same material does not give you any rights to use it.
  6160. 10. FUTURE REVISIONS OF THIS LICENSE
  6161. The Free Software Foundation may publish new, revised versions of
  6162. the GNU Free Documentation License from time to time. Such new
  6163. versions will be similar in spirit to the present version, but may
  6164. differ in detail to address new problems or concerns. See
  6165. <http://www.gnu.org/copyleft/>.
  6166. Each version of the License is given a distinguishing version
  6167. number. If the Document specifies that a particular numbered
  6168. version of this License "or any later version" applies to it, you
  6169. have the option of following the terms and conditions either of
  6170. that specified version or of any later version that has been
  6171. published (not as a draft) by the Free Software Foundation. If the
  6172. Document does not specify a version number of this License, you may
  6173. choose any version ever published (not as a draft) by the Free
  6174. Software Foundation. If the Document specifies that a proxy can
  6175. decide which future versions of this License can be used, that
  6176. proxy's public statement of acceptance of a version permanently
  6177. authorizes you to choose that version for the Document.
  6178. 11. RELICENSING
  6179. "Massive Multiauthor Collaboration Site" (or "MMC Site") means any
  6180. World Wide Web server that publishes copyrightable works and also
  6181. provides prominent facilities for anybody to edit those works. A
  6182. public wiki that anybody can edit is an example of such a server.
  6183. A "Massive Multiauthor Collaboration" (or "MMC") contained in the
  6184. site means any set of copyrightable works thus published on the MMC
  6185. site.
  6186. "CC-BY-SA" means the Creative Commons Attribution-Share Alike 3.0
  6187. license published by Creative Commons Corporation, a not-for-profit
  6188. corporation with a principal place of business in San Francisco,
  6189. California, as well as future copyleft versions of that license
  6190. published by that same organization.
  6191. "Incorporate" means to publish or republish a Document, in whole or
  6192. in part, as part of another Document.
  6193. An MMC is "eligible for relicensing" if it is licensed under this
  6194. License, and if all works that were first published under this
  6195. License somewhere other than this MMC, and subsequently
  6196. incorporated in whole or in part into the MMC, (1) had no cover
  6197. texts or invariant sections, and (2) were thus incorporated prior
  6198. to November 1, 2008.
  6199. The operator of an MMC Site may republish an MMC contained in the
  6200. site under CC-BY-SA on the same site at any time before August 1,
  6201. 2009, provided the MMC is eligible for relicensing.
  6202. ADDENDUM: How to use this License for your documents
  6203. ====================================================
  6204. To use this License in a document you have written, include a copy of
  6205. the License in the document and put the following copyright and license
  6206. notices just after the title page:
  6207. Copyright (C) YEAR YOUR NAME.
  6208. Permission is granted to copy, distribute and/or modify this document
  6209. under the terms of the GNU Free Documentation License, Version 1.3
  6210. or any later version published by the Free Software Foundation;
  6211. with no Invariant Sections, no Front-Cover Texts, and no Back-Cover
  6212. Texts. A copy of the license is included in the section entitled ``GNU
  6213. Free Documentation License''.
  6214. If you have Invariant Sections, Front-Cover Texts and Back-Cover
  6215. Texts, replace the "with...Texts." line with this:
  6216. with the Invariant Sections being LIST THEIR TITLES, with
  6217. the Front-Cover Texts being LIST, and with the Back-Cover Texts
  6218. being LIST.
  6219. If you have Invariant Sections without Cover Texts, or some other
  6220. combination of the three, merge those two alternatives to suit the
  6221. situation.
  6222. If your document contains nontrivial examples of program code, we
  6223. recommend releasing these examples in parallel under your choice of free
  6224. software license, such as the GNU General Public License, to permit
  6225. their use in free software.
  6226. 
  6227. File: ld.info, Node: LD Index, Prev: GNU Free Documentation License, Up: Top
  6228. LD Index
  6229. ********
  6230. �[index�]
  6231. * Menu:
  6232. * ": Symbols. (line 6)
  6233. * -(: Options. (line 814)
  6234. * --accept-unknown-input-arch: Options. (line 832)
  6235. * --add-needed: Options. (line 859)
  6236. * --add-stdcall-alias: Options. (line 1790)
  6237. * --allow-multiple-definition: Options. (line 1146)
  6238. * --allow-shlib-undefined: Options. (line 1152)
  6239. * --architecture=ARCH: Options. (line 122)
  6240. * --as-needed: Options. (line 842)
  6241. * --audit AUDITLIB: Options. (line 111)
  6242. * --auxiliary=NAME: Options. (line 254)
  6243. * --bank-window: Options. (line 2232)
  6244. * --base-file: Options. (line 1795)
  6245. * --be8: ARM. (line 28)
  6246. * --bss-plt: PowerPC ELF32. (line 16)
  6247. * --build-id: Options. (line 1752)
  6248. * --build-id=STYLE: Options. (line 1752)
  6249. * --check-sections: Options. (line 944)
  6250. * --cmse-implib: ARM. (line 234)
  6251. * --compress-debug-sections=none: Options. (line 1710)
  6252. * --compress-debug-sections=zlib: Options. (line 1710)
  6253. * --compress-debug-sections=zlib-gabi: Options. (line 1710)
  6254. * --compress-debug-sections=zlib-gnu: Options. (line 1710)
  6255. * --copy-dt-needed-entries: Options. (line 956)
  6256. * --cref: Options. (line 976)
  6257. * --default-imported-symver: Options. (line 1188)
  6258. * --default-script=SCRIPT: Options. (line 556)
  6259. * --default-symver: Options. (line 1184)
  6260. * --defsym=SYMBOL=EXP: Options. (line 1005)
  6261. * --demangle[=STYLE]: Options. (line 1017)
  6262. * --depaudit AUDITLIB: Options. (line 176)
  6263. * --disable-auto-image-base: Options. (line 1972)
  6264. * --disable-auto-import: Options. (line 2106)
  6265. * --disable-large-address-aware: Options. (line 1920)
  6266. * --disable-long-section-names: Options. (line 1805)
  6267. * --disable-new-dtags: Options. (line 1686)
  6268. * --disable-runtime-pseudo-reloc: Options. (line 2119)
  6269. * --disable-stdcall-fixup: Options. (line 1827)
  6270. * --discard-all: Options. (line 641)
  6271. * --discard-locals: Options. (line 645)
  6272. * --dll: Options. (line 1800)
  6273. * --dll-search-prefix: Options. (line 1978)
  6274. * --dotsyms: PowerPC64 ELF64. (line 33)
  6275. * --dsbt-index: Options. (line 2210)
  6276. * --dsbt-size: Options. (line 2205)
  6277. * --dynamic-linker=FILE: Options. (line 1030)
  6278. * --dynamic-list-cpp-new: Options. (line 936)
  6279. * --dynamic-list-cpp-typeinfo: Options. (line 940)
  6280. * --dynamic-list-data: Options. (line 933)
  6281. * --dynamic-list=DYNAMIC-LIST-FILE: Options. (line 920)
  6282. * --dynamicbase: Options. (line 2159)
  6283. * --eh-frame-hdr: Options. (line 1675)
  6284. * --emit-relocs: Options. (line 492)
  6285. * --emit-stack-syms: SPU ELF. (line 46)
  6286. * --emit-stub-syms: PowerPC ELF32. (line 47)
  6287. * --emit-stub-syms <1>: PowerPC64 ELF64. (line 29)
  6288. * --emit-stub-syms <2>: SPU ELF. (line 15)
  6289. * --enable-auto-image-base: Options. (line 1963)
  6290. * --enable-auto-import: Options. (line 1987)
  6291. * --enable-extra-pe-debug: Options. (line 2124)
  6292. * --enable-long-section-names: Options. (line 1805)
  6293. * --enable-new-dtags: Options. (line 1686)
  6294. * --enable-runtime-pseudo-reloc: Options. (line 2111)
  6295. * --enable-stdcall-fixup: Options. (line 1827)
  6296. * --entry=ENTRY: Options. (line 186)
  6297. * --error-unresolved-symbols: Options. (line 1628)
  6298. * --exclude-all-symbols: Options. (line 1880)
  6299. * --exclude-libs: Options. (line 196)
  6300. * --exclude-modules-for-implib: Options. (line 207)
  6301. * --exclude-symbols: Options. (line 1874)
  6302. * --export-all-symbols: Options. (line 1850)
  6303. * --export-dynamic: Options. (line 220)
  6304. * --extra-overlay-stubs: SPU ELF. (line 19)
  6305. * --fatal-warnings: Options. (line 1043)
  6306. * --file-alignment: Options. (line 1884)
  6307. * --filter=NAME: Options. (line 275)
  6308. * --fix-arm1176: ARM. (line 111)
  6309. * --fix-cortex-a53-835769: ARM. (line 211)
  6310. * --fix-cortex-a8: ARM. (line 202)
  6311. * --fix-stm32l4xx-629360: ARM. (line 120)
  6312. * --fix-v4bx: ARM. (line 48)
  6313. * --fix-v4bx-interworking: ARM. (line 61)
  6314. * --force-dynamic: Options. (line 501)
  6315. * --force-exe-suffix: Options. (line 1048)
  6316. * --forceinteg: Options. (line 2164)
  6317. * --format=FORMAT: Options. (line 133)
  6318. * --format=VERSION: TI COFF. (line 6)
  6319. * --gc-keep-exported: Options. (line 1091)
  6320. * --gc-sections: Options. (line 1058)
  6321. * --got: Options. (line 2244)
  6322. * --got=TYPE: M68K. (line 6)
  6323. * --gpsize=VALUE: Options. (line 307)
  6324. * --hash-size=NUMBER: Options. (line 1696)
  6325. * --hash-style=STYLE: Options. (line 1704)
  6326. * --heap: Options. (line 1890)
  6327. * --help: Options. (line 1119)
  6328. * --high-entropy-va: Options. (line 2155)
  6329. * --ignore-branch-isa: Options. (line 2265)
  6330. * --ignore-branch-isa <1>: MIPS. (line 13)
  6331. * --image-base: Options. (line 1897)
  6332. * --in-implib=FILE: ARM. (line 239)
  6333. * --insert-timestamp: Options. (line 2187)
  6334. * --insn32: Options. (line 2256)
  6335. * --insn32 <1>: MIPS. (line 6)
  6336. * --just-symbols=FILE: Options. (line 523)
  6337. * --kill-at: Options. (line 1906)
  6338. * --large-address-aware: Options. (line 1911)
  6339. * --ld-generated-unwind-info: Options. (line 1681)
  6340. * --leading-underscore: Options. (line 1844)
  6341. * --library-path=DIR: Options. (line 365)
  6342. * --library=NAMESPEC: Options. (line 332)
  6343. * --local-store=lo:hi: SPU ELF. (line 24)
  6344. * --long-plt: ARM. (line 222)
  6345. * --major-image-version: Options. (line 1927)
  6346. * --major-os-version: Options. (line 1932)
  6347. * --major-subsystem-version: Options. (line 1936)
  6348. * --merge-exidx-entries: ARM. (line 219)
  6349. * --minor-image-version: Options. (line 1941)
  6350. * --minor-os-version: Options. (line 1946)
  6351. * --minor-subsystem-version: Options. (line 1950)
  6352. * --mri-script=MRI-CMDFILE: Options. (line 157)
  6353. * --multi-subspace: HPPA ELF32. (line 6)
  6354. * --nmagic: Options. (line 434)
  6355. * --no-accept-unknown-input-arch: Options. (line 832)
  6356. * --no-add-needed: Options. (line 859)
  6357. * --no-allow-shlib-undefined: Options. (line 1152)
  6358. * --no-apply-dynamic-relocs: ARM. (line 226)
  6359. * --no-as-needed: Options. (line 842)
  6360. * --no-bind: Options. (line 2178)
  6361. * --no-check-sections: Options. (line 944)
  6362. * --no-copy-dt-needed-entries: Options. (line 956)
  6363. * --no-define-common: Options. (line 989)
  6364. * --no-demangle: Options. (line 1017)
  6365. * --no-dotsyms: PowerPC64 ELF64. (line 33)
  6366. * --no-dynamic-linker: Options. (line 1037)
  6367. * --no-eh-frame-hdr: Options. (line 1675)
  6368. * --no-enum-size-warning: ARM. (line 158)
  6369. * --no-export-dynamic: Options. (line 220)
  6370. * --no-fatal-warnings: Options. (line 1043)
  6371. * --no-fix-arm1176: ARM. (line 111)
  6372. * --no-fix-cortex-a53-835769: ARM. (line 211)
  6373. * --no-fix-cortex-a8: ARM. (line 202)
  6374. * --no-gc-sections: Options. (line 1058)
  6375. * --no-ignore-branch-isa: Options. (line 2266)
  6376. * --no-ignore-branch-isa <1>: MIPS. (line 13)
  6377. * --no-insn32: Options. (line 2257)
  6378. * --no-insn32 <1>: MIPS. (line 6)
  6379. * --no-isolation: Options. (line 2171)
  6380. * --no-keep-memory: Options. (line 1131)
  6381. * --no-leading-underscore: Options. (line 1844)
  6382. * --no-merge-exidx-entries: Options. (line 2217)
  6383. * --no-merge-exidx-entries <1>: ARM. (line 219)
  6384. * --no-multi-toc: PowerPC64 ELF64. (line 96)
  6385. * --no-omagic: Options. (line 449)
  6386. * --no-opd-optimize: PowerPC64 ELF64. (line 70)
  6387. * --no-overlays: SPU ELF. (line 9)
  6388. * --no-plt-align: PowerPC64 ELF64. (line 118)
  6389. * --no-plt-static-chain: PowerPC64 ELF64. (line 126)
  6390. * --no-plt-thread-safe: PowerPC64 ELF64. (line 132)
  6391. * --no-print-gc-sections: Options. (line 1082)
  6392. * --no-save-restore-funcs: PowerPC64 ELF64. (line 44)
  6393. * --no-seh: Options. (line 2174)
  6394. * --no-tls-get-addr-optimize: PowerPC64 ELF64. (line 56)
  6395. * --no-tls-optimize: PowerPC ELF32. (line 51)
  6396. * --no-tls-optimize <1>: PowerPC64 ELF64. (line 51)
  6397. * --no-toc-optimize: PowerPC64 ELF64. (line 82)
  6398. * --no-toc-sort: PowerPC64 ELF64. (line 108)
  6399. * --no-trampoline: Options. (line 2226)
  6400. * --no-undefined: Options. (line 1138)
  6401. * --no-undefined-version: Options. (line 1179)
  6402. * --no-warn-mismatch: Options. (line 1192)
  6403. * --no-warn-search-mismatch: Options. (line 1201)
  6404. * --no-wchar-size-warning: ARM. (line 165)
  6405. * --no-whole-archive: Options. (line 1205)
  6406. * --noinhibit-exec: Options. (line 1209)
  6407. * --non-overlapping-opd: PowerPC64 ELF64. (line 76)
  6408. * --nxcompat: Options. (line 2167)
  6409. * --oformat=OUTPUT-FORMAT: Options. (line 1220)
  6410. * --omagic: Options. (line 440)
  6411. * --orphan-handling=MODE: Options. (line 600)
  6412. * --out-implib: Options. (line 1233)
  6413. * --output-def: Options. (line 1955)
  6414. * --output=OUTPUT: Options. (line 455)
  6415. * --pic-executable: Options. (line 1242)
  6416. * --pic-veneer: ARM. (line 171)
  6417. * --plt-align: PowerPC64 ELF64. (line 118)
  6418. * --plt-static-chain: PowerPC64 ELF64. (line 126)
  6419. * --plt-thread-safe: PowerPC64 ELF64. (line 132)
  6420. * --plugin: SPU ELF. (line 6)
  6421. * --pop-state: Options. (line 489)
  6422. * --print-gc-sections: Options. (line 1082)
  6423. * --print-map: Options. (line 400)
  6424. * --print-memory-usage: Options. (line 1107)
  6425. * --print-output-format: Options. (line 1101)
  6426. * --push-state: Options. (line 471)
  6427. * --reduce-memory-overheads: Options. (line 1738)
  6428. * --relax: Options. (line 1258)
  6429. * '--relax' on i960: i960. (line 32)
  6430. * --relax on Nios II: Nios II. (line 6)
  6431. * --relax on PowerPC: PowerPC ELF32. (line 6)
  6432. * '--relax' on Xtensa: Xtensa. (line 27)
  6433. * --relocatable: Options. (line 505)
  6434. * --require-defined=SYMBOL: Options. (line 582)
  6435. * --retain-symbols-file=FILENAME: Options. (line 1284)
  6436. * --save-restore-funcs: PowerPC64 ELF64. (line 44)
  6437. * --script=SCRIPT: Options. (line 547)
  6438. * --sdata-got: PowerPC ELF32. (line 33)
  6439. * --section-alignment: Options. (line 2129)
  6440. * --section-start=SECTIONNAME=ORG: Options. (line 1442)
  6441. * --secure-plt: PowerPC ELF32. (line 26)
  6442. * --sort-common: Options. (line 1384)
  6443. * --sort-section=alignment: Options. (line 1399)
  6444. * --sort-section=name: Options. (line 1395)
  6445. * --split-by-file: Options. (line 1403)
  6446. * --split-by-reloc: Options. (line 1408)
  6447. * --stack: Options. (line 2135)
  6448. * --stack-analysis: SPU ELF. (line 29)
  6449. * --stats: Options. (line 1421)
  6450. * --strip-all: Options. (line 534)
  6451. * --strip-debug: Options. (line 538)
  6452. * --stub-group-size: PowerPC64 ELF64. (line 6)
  6453. * --stub-group-size=N: ARM. (line 176)
  6454. * --stub-group-size=N <1>: HPPA ELF32. (line 12)
  6455. * --subsystem: Options. (line 2142)
  6456. * --support-old-code: ARM. (line 6)
  6457. * --sysroot=DIRECTORY: Options. (line 1425)
  6458. * --target-help: Options. (line 1123)
  6459. * --target1-abs: ARM. (line 33)
  6460. * --target1-rel: ARM. (line 33)
  6461. * --target2=TYPE: ARM. (line 38)
  6462. * --thumb-entry=ENTRY: ARM. (line 17)
  6463. * --tls-get-addr-optimize: PowerPC64 ELF64. (line 56)
  6464. * --trace: Options. (line 543)
  6465. * --trace-symbol=SYMBOL: Options. (line 651)
  6466. * --traditional-format: Options. (line 1430)
  6467. * --tsaware: Options. (line 2184)
  6468. * --undefined=SYMBOL: Options. (line 569)
  6469. * --unique[=SECTION]: Options. (line 626)
  6470. * --unresolved-symbols: Options. (line 1472)
  6471. * --use-blx: ARM. (line 73)
  6472. * --use-nul-prefixed-import-tables: ARM. (line 23)
  6473. * --verbose[=NUMBER]: Options. (line 1501)
  6474. * --version: Options. (line 635)
  6475. * --version-script=VERSION-SCRIPTFILE: Options. (line 1509)
  6476. * --vfp11-denorm-fix: ARM. (line 82)
  6477. * --warn-alternate-em: Options. (line 1620)
  6478. * --warn-common: Options. (line 1519)
  6479. * --warn-constructors: Options. (line 1587)
  6480. * --warn-multiple-gp: Options. (line 1592)
  6481. * --warn-once: Options. (line 1606)
  6482. * --warn-section-align: Options. (line 1610)
  6483. * --warn-shared-textrel: Options. (line 1617)
  6484. * --warn-unresolved-symbols: Options. (line 1623)
  6485. * --wdmdriver: Options. (line 2181)
  6486. * --whole-archive: Options. (line 1632)
  6487. * --wrap=SYMBOL: Options. (line 1646)
  6488. * -A ARCH: Options. (line 121)
  6489. * -a KEYWORD: Options. (line 104)
  6490. * -assert KEYWORD: Options. (line 866)
  6491. * -b FORMAT: Options. (line 133)
  6492. * -Bdynamic: Options. (line 869)
  6493. * -Bgroup: Options. (line 879)
  6494. * -Bshareable: Options. (line 1377)
  6495. * -Bstatic: Options. (line 886)
  6496. * -Bsymbolic: Options. (line 900)
  6497. * -Bsymbolic-functions: Options. (line 911)
  6498. * -c MRI-CMDFILE: Options. (line 157)
  6499. * -call_shared: Options. (line 869)
  6500. * -d: Options. (line 167)
  6501. * -dc: Options. (line 167)
  6502. * -dn: Options. (line 886)
  6503. * -dp: Options. (line 167)
  6504. * -dT SCRIPT: Options. (line 556)
  6505. * -dy: Options. (line 869)
  6506. * -E: Options. (line 220)
  6507. * -e ENTRY: Options. (line 186)
  6508. * -EB: Options. (line 247)
  6509. * -EL: Options. (line 250)
  6510. * -f NAME: Options. (line 254)
  6511. * -F NAME: Options. (line 275)
  6512. * -fini=NAME: Options. (line 298)
  6513. * -g: Options. (line 304)
  6514. * -G VALUE: Options. (line 307)
  6515. * -h NAME: Options. (line 314)
  6516. * -i: Options. (line 323)
  6517. * -IFILE: Options. (line 1030)
  6518. * -init=NAME: Options. (line 326)
  6519. * -L DIR: Options. (line 365)
  6520. * -l NAMESPEC: Options. (line 332)
  6521. * -M: Options. (line 400)
  6522. * -m EMULATION: Options. (line 390)
  6523. * -Map=MAPFILE: Options. (line 1127)
  6524. * -n: Options. (line 434)
  6525. * -N: Options. (line 440)
  6526. * -no-relax: Options. (line 1258)
  6527. * -non_shared: Options. (line 886)
  6528. * -nostdlib: Options. (line 1215)
  6529. * -O LEVEL: Options. (line 461)
  6530. * -o OUTPUT: Options. (line 455)
  6531. * -P AUDITLIB: Options. (line 176)
  6532. * -pie: Options. (line 1242)
  6533. * -q: Options. (line 492)
  6534. * -qmagic: Options. (line 1252)
  6535. * -Qy: Options. (line 1255)
  6536. * -r: Options. (line 505)
  6537. * -R FILE: Options. (line 523)
  6538. * -rpath-link=DIR: Options. (line 1320)
  6539. * -rpath=DIR: Options. (line 1298)
  6540. * -s: Options. (line 534)
  6541. * -S: Options. (line 538)
  6542. * -shared: Options. (line 1377)
  6543. * -soname=NAME: Options. (line 314)
  6544. * -static: Options. (line 886)
  6545. * -t: Options. (line 543)
  6546. * -T SCRIPT: Options. (line 547)
  6547. * -Tbss=ORG: Options. (line 1451)
  6548. * -Tdata=ORG: Options. (line 1451)
  6549. * -Tldata-segment=ORG: Options. (line 1467)
  6550. * -Trodata-segment=ORG: Options. (line 1461)
  6551. * -Ttext-segment=ORG: Options. (line 1457)
  6552. * -Ttext=ORG: Options. (line 1451)
  6553. * -u SYMBOL: Options. (line 569)
  6554. * -Ur: Options. (line 590)
  6555. * -v: Options. (line 635)
  6556. * -V: Options. (line 635)
  6557. * -x: Options. (line 641)
  6558. * -X: Options. (line 645)
  6559. * -Y PATH: Options. (line 660)
  6560. * -y SYMBOL: Options. (line 651)
  6561. * -z defs: Options. (line 1138)
  6562. * -z KEYWORD: Options. (line 664)
  6563. * -z muldefs: Options. (line 1146)
  6564. * .: Location Counter. (line 6)
  6565. * /DISCARD/: Output Section Discarding.
  6566. (line 26)
  6567. * 32-bit PLT entries: ARM. (line 222)
  6568. * :PHDR: Output Section Phdr.
  6569. (line 6)
  6570. * =FILLEXP: Output Section Fill.
  6571. (line 6)
  6572. * >REGION: Output Section Region.
  6573. (line 6)
  6574. * [COMMON]: Input Section Common.
  6575. (line 29)
  6576. * AArch64 rela addend: ARM. (line 226)
  6577. * 'ABSOLUTE' (MRI): MRI. (line 32)
  6578. * absolute and relocatable symbols: Expression Section. (line 6)
  6579. * absolute expressions: Expression Section. (line 6)
  6580. * ABSOLUTE(EXP): Builtin Functions. (line 10)
  6581. * ADDR(SECTION): Builtin Functions. (line 17)
  6582. * address, section: Output Section Address.
  6583. (line 6)
  6584. * 'ALIAS' (MRI): MRI. (line 43)
  6585. * 'ALIGN' (MRI): MRI. (line 49)
  6586. * align expression: Builtin Functions. (line 38)
  6587. * align location counter: Builtin Functions. (line 38)
  6588. * ALIGN(ALIGN): Builtin Functions. (line 38)
  6589. * ALIGN(EXP,ALIGN): Builtin Functions. (line 38)
  6590. * ALIGN(SECTION_ALIGN): Forced Output Alignment.
  6591. (line 6)
  6592. * aligned common symbols: WIN32. (line 415)
  6593. * ALIGNOF(SECTION): Builtin Functions. (line 63)
  6594. * allocating memory: MEMORY. (line 6)
  6595. * architecture: Miscellaneous Commands.
  6596. (line 115)
  6597. * architectures: Options. (line 121)
  6598. * archive files, from cmd line: Options. (line 332)
  6599. * archive search path in linker script: File Commands. (line 76)
  6600. * arithmetic: Expressions. (line 6)
  6601. * arithmetic operators: Operators. (line 6)
  6602. * ARM interworking support: ARM. (line 6)
  6603. * ARM1176 erratum workaround: ARM. (line 111)
  6604. * ASSERT: Miscellaneous Commands.
  6605. (line 9)
  6606. * assertion in linker script: Miscellaneous Commands.
  6607. (line 9)
  6608. * assignment in scripts: Assignments. (line 6)
  6609. * AS_NEEDED(FILES): File Commands. (line 56)
  6610. * AT(LMA): Output Section LMA. (line 6)
  6611. * AT>LMA_REGION: Output Section LMA. (line 6)
  6612. * automatic data imports: WIN32. (line 185)
  6613. * back end: BFD. (line 6)
  6614. * 'BASE' (MRI): MRI. (line 53)
  6615. * BE8: ARM. (line 28)
  6616. * BFD canonical format: Canonical format. (line 11)
  6617. * BFD requirements: BFD. (line 16)
  6618. * big-endian objects: Options. (line 247)
  6619. * binary input format: Options. (line 133)
  6620. * BLOCK(EXP): Builtin Functions. (line 76)
  6621. * bug criteria: Bug Criteria. (line 6)
  6622. * bug reports: Bug Reporting. (line 6)
  6623. * bugs in 'ld': Reporting Bugs. (line 6)
  6624. * BYTE(EXPRESSION): Output Section Data.
  6625. (line 6)
  6626. * C++ constructors, arranging in link: Output Section Keywords.
  6627. (line 19)
  6628. * 'CHIP' (MRI): MRI. (line 57)
  6629. * COLLECT_NO_DEMANGLE: Environment. (line 29)
  6630. * combining symbols, warnings on: Options. (line 1519)
  6631. * command files: Scripts. (line 6)
  6632. * command line: Options. (line 6)
  6633. * common allocation: Options. (line 167)
  6634. * common allocation <1>: Options. (line 989)
  6635. * common allocation in linker script: Miscellaneous Commands.
  6636. (line 46)
  6637. * common allocation in linker script <1>: Miscellaneous Commands.
  6638. (line 51)
  6639. * common symbol placement: Input Section Common.
  6640. (line 6)
  6641. * COMMONPAGESIZE: Symbolic Constants. (line 13)
  6642. * compatibility, MRI: Options. (line 157)
  6643. * CONSTANT: Symbolic Constants. (line 6)
  6644. * constants in linker scripts: Constants. (line 6)
  6645. * constraints on output sections: Output Section Constraint.
  6646. (line 6)
  6647. * constructors: Options. (line 590)
  6648. * CONSTRUCTORS: Output Section Keywords.
  6649. (line 19)
  6650. * constructors, arranging in link: Output Section Keywords.
  6651. (line 19)
  6652. * Cortex-A53 erratum 835769 workaround: ARM. (line 211)
  6653. * Cortex-A8 erratum workaround: ARM. (line 202)
  6654. * crash of linker: Bug Criteria. (line 9)
  6655. * CREATE_OBJECT_SYMBOLS: Output Section Keywords.
  6656. (line 9)
  6657. * creating a DEF file: WIN32. (line 153)
  6658. * cross reference table: Options. (line 976)
  6659. * cross references: Miscellaneous Commands.
  6660. (line 82)
  6661. * cross references <1>: Miscellaneous Commands.
  6662. (line 98)
  6663. * current output location: Location Counter. (line 6)
  6664. * data: Output Section Data.
  6665. (line 6)
  6666. * DATA_SEGMENT_ALIGN(MAXPAGESIZE, COMMONPAGESIZE): Builtin Functions.
  6667. (line 81)
  6668. * DATA_SEGMENT_END(EXP): Builtin Functions. (line 103)
  6669. * DATA_SEGMENT_RELRO_END(OFFSET, EXP): Builtin Functions. (line 109)
  6670. * dbx: Options. (line 1435)
  6671. * DEF files, creating: Options. (line 1955)
  6672. * default emulation: Environment. (line 21)
  6673. * default input format: Environment. (line 9)
  6674. * defined symbol: Options. (line 582)
  6675. * DEFINED(SYMBOL): Builtin Functions. (line 122)
  6676. * deleting local symbols: Options. (line 641)
  6677. * demangling, default: Environment. (line 29)
  6678. * demangling, from command line: Options. (line 1017)
  6679. * direct linking to a dll: WIN32. (line 233)
  6680. * discarding sections: Output Section Discarding.
  6681. (line 6)
  6682. * discontinuous memory: MEMORY. (line 6)
  6683. * DLLs, creating: Options. (line 1850)
  6684. * DLLs, creating <1>: Options. (line 1955)
  6685. * DLLs, creating <2>: Options. (line 1963)
  6686. * DLLs, linking to: Options. (line 1978)
  6687. * dot: Location Counter. (line 6)
  6688. * dot inside sections: Location Counter. (line 36)
  6689. * dot outside sections: Location Counter. (line 66)
  6690. * dynamic linker, from command line: Options. (line 1030)
  6691. * dynamic symbol table: Options. (line 220)
  6692. * ELF program headers: PHDRS. (line 6)
  6693. * emulation: Options. (line 390)
  6694. * emulation, default: Environment. (line 21)
  6695. * 'END' (MRI): MRI. (line 61)
  6696. * endianness: Options. (line 247)
  6697. * entry point: Entry Point. (line 6)
  6698. * entry point, from command line: Options. (line 186)
  6699. * entry point, thumb: ARM. (line 17)
  6700. * ENTRY(SYMBOL): Entry Point. (line 6)
  6701. * error on valid input: Bug Criteria. (line 12)
  6702. * example of linker script: Simple Example. (line 6)
  6703. * EXCLUDE_FILE: Input Section Basics.
  6704. (line 17)
  6705. * exporting DLL symbols: WIN32. (line 19)
  6706. * expression evaluation order: Evaluation. (line 6)
  6707. * expression sections: Expression Section. (line 6)
  6708. * expression, absolute: Builtin Functions. (line 10)
  6709. * expressions: Expressions. (line 6)
  6710. * EXTERN: Miscellaneous Commands.
  6711. (line 39)
  6712. * fatal signal: Bug Criteria. (line 9)
  6713. * file name wildcard patterns: Input Section Wildcards.
  6714. (line 6)
  6715. * FILEHDR: PHDRS. (line 62)
  6716. * filename symbols: Output Section Keywords.
  6717. (line 9)
  6718. * fill pattern, entire section: Output Section Fill.
  6719. (line 6)
  6720. * FILL(EXPRESSION): Output Section Data.
  6721. (line 39)
  6722. * finalization function: Options. (line 298)
  6723. * first input file: File Commands. (line 84)
  6724. * first instruction: Entry Point. (line 6)
  6725. * FIX_V4BX: ARM. (line 48)
  6726. * FIX_V4BX_INTERWORKING: ARM. (line 61)
  6727. * FORCE_COMMON_ALLOCATION: Miscellaneous Commands.
  6728. (line 46)
  6729. * forcing input section alignment: Forced Input Alignment.
  6730. (line 6)
  6731. * forcing output section alignment: Forced Output Alignment.
  6732. (line 6)
  6733. * forcing the creation of dynamic sections: Options. (line 501)
  6734. * 'FORMAT' (MRI): MRI. (line 65)
  6735. * functions in expressions: Builtin Functions. (line 6)
  6736. * garbage collection: Options. (line 1058)
  6737. * garbage collection <1>: Options. (line 1082)
  6738. * garbage collection <2>: Options. (line 1091)
  6739. * garbage collection <3>: Input Section Keep. (line 6)
  6740. * generating optimized output: Options. (line 461)
  6741. * GNU linker: Overview. (line 6)
  6742. * GNUTARGET: Environment. (line 9)
  6743. * GROUP(FILES): File Commands. (line 49)
  6744. * grouping input files: File Commands. (line 49)
  6745. * groups of archives: Options. (line 814)
  6746. * H8/300 support: H8/300. (line 6)
  6747. * header size: Builtin Functions. (line 189)
  6748. * heap size: Options. (line 1890)
  6749. * help: Options. (line 1119)
  6750. * HIDDEN: HIDDEN. (line 6)
  6751. * holes: Location Counter. (line 12)
  6752. * holes, filling: Output Section Data.
  6753. (line 39)
  6754. * HPPA multiple sub-space stubs: HPPA ELF32. (line 6)
  6755. * HPPA stub grouping: HPPA ELF32. (line 12)
  6756. * i960 support: i960. (line 6)
  6757. * image base: Options. (line 1897)
  6758. * implicit linker scripts: Implicit Linker Scripts.
  6759. (line 6)
  6760. * import libraries: WIN32. (line 10)
  6761. * INCLUDE FILENAME: File Commands. (line 9)
  6762. * including a linker script: File Commands. (line 9)
  6763. * including an entire archive: Options. (line 1632)
  6764. * incremental link: Options. (line 323)
  6765. * INHIBIT_COMMON_ALLOCATION: Miscellaneous Commands.
  6766. (line 51)
  6767. * initialization function: Options. (line 326)
  6768. * initialized data in ROM: Output Section LMA. (line 39)
  6769. * input file format in linker script: Format Commands. (line 35)
  6770. * input filename symbols: Output Section Keywords.
  6771. (line 9)
  6772. * input files in linker scripts: File Commands. (line 19)
  6773. * input files, displaying: Options. (line 543)
  6774. * input format: Options. (line 133)
  6775. * input format <1>: Options. (line 133)
  6776. * Input import library: ARM. (line 239)
  6777. * input object files in linker scripts: File Commands. (line 19)
  6778. * input section alignment: Forced Input Alignment.
  6779. (line 6)
  6780. * input section basics: Input Section Basics.
  6781. (line 6)
  6782. * input section wildcards: Input Section Wildcards.
  6783. (line 6)
  6784. * input sections: Input Section. (line 6)
  6785. * INPUT(FILES): File Commands. (line 19)
  6786. * INSERT: Miscellaneous Commands.
  6787. (line 56)
  6788. * insert user script into default script: Miscellaneous Commands.
  6789. (line 56)
  6790. * integer notation: Constants. (line 6)
  6791. * integer suffixes: Constants. (line 15)
  6792. * internal object-file format: Canonical format. (line 11)
  6793. * invalid input: Bug Criteria. (line 14)
  6794. * K and M integer suffixes: Constants. (line 15)
  6795. * KEEP: Input Section Keep. (line 6)
  6796. * l =: MEMORY. (line 68)
  6797. * lazy evaluation: Evaluation. (line 6)
  6798. * 'ld' bugs, reporting: Bug Reporting. (line 6)
  6799. * ldata segment origin, cmd line: Options. (line 1468)
  6800. * LDEMULATION: Environment. (line 21)
  6801. * LD_FEATURE(STRING): Miscellaneous Commands.
  6802. (line 121)
  6803. * len =: MEMORY. (line 68)
  6804. * LENGTH =: MEMORY. (line 68)
  6805. * LENGTH(MEMORY): Builtin Functions. (line 139)
  6806. * library search path in linker script: File Commands. (line 76)
  6807. * link map: Options. (line 400)
  6808. * link-time runtime library search path: Options. (line 1320)
  6809. * linker crash: Bug Criteria. (line 9)
  6810. * linker script concepts: Basic Script Concepts.
  6811. (line 6)
  6812. * linker script example: Simple Example. (line 6)
  6813. * linker script file commands: File Commands. (line 6)
  6814. * linker script format: Script Format. (line 6)
  6815. * linker script input object files: File Commands. (line 19)
  6816. * linker script simple commands: Simple Commands. (line 6)
  6817. * linker scripts: Scripts. (line 6)
  6818. * 'LIST' (MRI): MRI. (line 76)
  6819. * little-endian objects: Options. (line 250)
  6820. * 'LOAD' (MRI): MRI. (line 83)
  6821. * load address: Output Section LMA. (line 6)
  6822. * LOADADDR(SECTION): Builtin Functions. (line 142)
  6823. * loading, preventing: Output Section Type.
  6824. (line 21)
  6825. * local symbols, deleting: Options. (line 645)
  6826. * location counter: Location Counter. (line 6)
  6827. * LOG2CEIL(EXP): Builtin Functions. (line 146)
  6828. * LONG(EXPRESSION): Output Section Data.
  6829. (line 6)
  6830. * M and K integer suffixes: Constants. (line 15)
  6831. * M68HC11 and 68HC12 support: M68HC11/68HC12. (line 5)
  6832. * machine architecture: Miscellaneous Commands.
  6833. (line 115)
  6834. * machine dependencies: Machine Dependent. (line 6)
  6835. * mapping input sections to output sections: Input Section. (line 6)
  6836. * MAX: Builtin Functions. (line 149)
  6837. * MAXPAGESIZE: Symbolic Constants. (line 10)
  6838. * MEMORY: MEMORY. (line 6)
  6839. * memory region attributes: MEMORY. (line 34)
  6840. * memory regions: MEMORY. (line 6)
  6841. * memory regions and sections: Output Section Region.
  6842. (line 6)
  6843. * memory usage: Options. (line 1107)
  6844. * memory usage <1>: Options. (line 1131)
  6845. * Merging exidx entries: ARM. (line 219)
  6846. * MIN: Builtin Functions. (line 152)
  6847. * MIPS branch relocation check control: MIPS. (line 13)
  6848. * MIPS microMIPS instruction choice selection: MIPS. (line 6)
  6849. * Motorola 68K GOT generation: M68K. (line 6)
  6850. * MRI compatibility: MRI. (line 6)
  6851. * MSP430 extra sections: MSP430. (line 11)
  6852. * 'NAME' (MRI): MRI. (line 89)
  6853. * name, section: Output Section Name.
  6854. (line 6)
  6855. * names: Symbols. (line 6)
  6856. * naming the output file: Options. (line 455)
  6857. * NEXT(EXP): Builtin Functions. (line 156)
  6858. * Nios II call relaxation: Nios II. (line 6)
  6859. * NMAGIC: Options. (line 434)
  6860. * NOCROSSREFS(SECTIONS): Miscellaneous Commands.
  6861. (line 82)
  6862. * NOCROSSREFS_TO(TOSECTION FROMSECTIONS): Miscellaneous Commands.
  6863. (line 98)
  6864. * NOLOAD: Output Section Type.
  6865. (line 21)
  6866. * not enough room for program headers: Builtin Functions. (line 194)
  6867. * NO_ENUM_SIZE_WARNING: ARM. (line 158)
  6868. * NO_WCHAR_SIZE_WARNING: ARM. (line 165)
  6869. * o =: MEMORY. (line 63)
  6870. * objdump -i: BFD. (line 6)
  6871. * object file management: BFD. (line 6)
  6872. * object files: Options. (line 29)
  6873. * object formats available: BFD. (line 6)
  6874. * object size: Options. (line 307)
  6875. * OMAGIC: Options. (line 440)
  6876. * OMAGIC <1>: Options. (line 449)
  6877. * ONLY_IF_RO: Output Section Constraint.
  6878. (line 6)
  6879. * ONLY_IF_RW: Output Section Constraint.
  6880. (line 6)
  6881. * opening object files: BFD outline. (line 6)
  6882. * operators for arithmetic: Operators. (line 6)
  6883. * options: Options. (line 6)
  6884. * 'ORDER' (MRI): MRI. (line 94)
  6885. * org =: MEMORY. (line 63)
  6886. * ORIGIN =: MEMORY. (line 63)
  6887. * ORIGIN(MEMORY): Builtin Functions. (line 162)
  6888. * orphan: Orphan Sections. (line 6)
  6889. * orphan sections: Options. (line 600)
  6890. * output file after errors: Options. (line 1209)
  6891. * output file format in linker script: Format Commands. (line 10)
  6892. * output file name in linker script: File Commands. (line 66)
  6893. * output format: Options. (line 1101)
  6894. * output section alignment: Forced Output Alignment.
  6895. (line 6)
  6896. * output section attributes: Output Section Attributes.
  6897. (line 6)
  6898. * output section data: Output Section Data.
  6899. (line 6)
  6900. * OUTPUT(FILENAME): File Commands. (line 66)
  6901. * OUTPUT_ARCH(BFDARCH): Miscellaneous Commands.
  6902. (line 115)
  6903. * OUTPUT_FORMAT(BFDNAME): Format Commands. (line 10)
  6904. * OVERLAY: Overlay Description.
  6905. (line 6)
  6906. * overlays: Overlay Description.
  6907. (line 6)
  6908. * partial link: Options. (line 505)
  6909. * PE import table prefixing: ARM. (line 23)
  6910. * PHDRS: PHDRS. (line 6)
  6911. * PHDRS <1>: PHDRS. (line 62)
  6912. * PIC_VENEER: ARM. (line 171)
  6913. * Placement of SG veneers: ARM. (line 229)
  6914. * pop state governing input file handling: Options. (line 489)
  6915. * position independent executables: Options. (line 1244)
  6916. * PowerPC ELF32 options: PowerPC ELF32. (line 16)
  6917. * PowerPC GOT: PowerPC ELF32. (line 33)
  6918. * PowerPC long branches: PowerPC ELF32. (line 6)
  6919. * PowerPC PLT: PowerPC ELF32. (line 16)
  6920. * PowerPC stub symbols: PowerPC ELF32. (line 47)
  6921. * PowerPC TLS optimization: PowerPC ELF32. (line 51)
  6922. * PowerPC64 dot symbols: PowerPC64 ELF64. (line 33)
  6923. * PowerPC64 ELF64 options: PowerPC64 ELF64. (line 6)
  6924. * PowerPC64 multi-TOC: PowerPC64 ELF64. (line 96)
  6925. * PowerPC64 OPD optimization: PowerPC64 ELF64. (line 70)
  6926. * PowerPC64 OPD spacing: PowerPC64 ELF64. (line 76)
  6927. * PowerPC64 PLT call stub static chain: PowerPC64 ELF64. (line 126)
  6928. * PowerPC64 PLT call stub thread safety: PowerPC64 ELF64. (line 132)
  6929. * PowerPC64 PLT stub alignment: PowerPC64 ELF64. (line 118)
  6930. * PowerPC64 register save/restore functions: PowerPC64 ELF64.
  6931. (line 44)
  6932. * PowerPC64 stub grouping: PowerPC64 ELF64. (line 6)
  6933. * PowerPC64 stub symbols: PowerPC64 ELF64. (line 29)
  6934. * PowerPC64 TLS optimization: PowerPC64 ELF64. (line 51)
  6935. * PowerPC64 TOC optimization: PowerPC64 ELF64. (line 82)
  6936. * PowerPC64 TOC sorting: PowerPC64 ELF64. (line 108)
  6937. * PowerPC64 __tls_get_addr optimization: PowerPC64 ELF64. (line 56)
  6938. * precedence in expressions: Operators. (line 6)
  6939. * prevent unnecessary loading: Output Section Type.
  6940. (line 21)
  6941. * program headers: PHDRS. (line 6)
  6942. * program headers and sections: Output Section Phdr.
  6943. (line 6)
  6944. * program headers, not enough room: Builtin Functions. (line 194)
  6945. * program segments: PHDRS. (line 6)
  6946. * PROVIDE: PROVIDE. (line 6)
  6947. * PROVIDE_HIDDEN: PROVIDE_HIDDEN. (line 6)
  6948. * 'PUBLIC' (MRI): MRI. (line 102)
  6949. * push state governing input file handling: Options. (line 471)
  6950. * QUAD(EXPRESSION): Output Section Data.
  6951. (line 6)
  6952. * quoted symbol names: Symbols. (line 6)
  6953. * read-only text: Options. (line 434)
  6954. * read/write from cmd line: Options. (line 440)
  6955. * region alias: REGION_ALIAS. (line 6)
  6956. * region names: REGION_ALIAS. (line 6)
  6957. * regions of memory: MEMORY. (line 6)
  6958. * REGION_ALIAS(ALIAS, REGION): REGION_ALIAS. (line 6)
  6959. * relative expressions: Expression Section. (line 6)
  6960. * relaxing addressing modes: Options. (line 1258)
  6961. * relaxing on H8/300: H8/300. (line 9)
  6962. * relaxing on i960: i960. (line 32)
  6963. * relaxing on M68HC11: M68HC11/68HC12. (line 12)
  6964. * relaxing on NDS32: NDS32. (line 6)
  6965. * relaxing on Xtensa: Xtensa. (line 27)
  6966. * relocatable and absolute symbols: Expression Section. (line 6)
  6967. * relocatable output: Options. (line 505)
  6968. * removing sections: Output Section Discarding.
  6969. (line 6)
  6970. * reporting bugs in 'ld': Reporting Bugs. (line 6)
  6971. * requirements for BFD: BFD. (line 16)
  6972. * retain relocations in final executable: Options. (line 492)
  6973. * retaining specified symbols: Options. (line 1284)
  6974. * rodata segment origin, cmd line: Options. (line 1462)
  6975. * ROM initialized data: Output Section LMA. (line 39)
  6976. * round up expression: Builtin Functions. (line 38)
  6977. * round up location counter: Builtin Functions. (line 38)
  6978. * runtime library name: Options. (line 314)
  6979. * runtime library search path: Options. (line 1298)
  6980. * runtime pseudo-relocation: WIN32. (line 211)
  6981. * scaled integers: Constants. (line 15)
  6982. * scommon section: Input Section Common.
  6983. (line 20)
  6984. * script files: Options. (line 547)
  6985. * script files <1>: Options. (line 556)
  6986. * scripts: Scripts. (line 6)
  6987. * search directory, from cmd line: Options. (line 365)
  6988. * search path in linker script: File Commands. (line 76)
  6989. * SEARCH_DIR(PATH): File Commands. (line 76)
  6990. * 'SECT' (MRI): MRI. (line 108)
  6991. * section address: Output Section Address.
  6992. (line 6)
  6993. * section address in expression: Builtin Functions. (line 17)
  6994. * section alignment: Builtin Functions. (line 63)
  6995. * section alignment, warnings on: Options. (line 1610)
  6996. * section data: Output Section Data.
  6997. (line 6)
  6998. * section fill pattern: Output Section Fill.
  6999. (line 6)
  7000. * section load address: Output Section LMA. (line 6)
  7001. * section load address in expression: Builtin Functions. (line 142)
  7002. * section name: Output Section Name.
  7003. (line 6)
  7004. * section name wildcard patterns: Input Section Wildcards.
  7005. (line 6)
  7006. * section size: Builtin Functions. (line 173)
  7007. * section, assigning to memory region: Output Section Region.
  7008. (line 6)
  7009. * section, assigning to program header: Output Section Phdr.
  7010. (line 6)
  7011. * SECTIONS: SECTIONS. (line 6)
  7012. * sections, discarding: Output Section Discarding.
  7013. (line 6)
  7014. * sections, orphan: Options. (line 600)
  7015. * Secure gateway import library: ARM. (line 234)
  7016. * segment origins, cmd line: Options. (line 1451)
  7017. * segments, ELF: PHDRS. (line 6)
  7018. * SEGMENT_START(SEGMENT, DEFAULT): Builtin Functions. (line 165)
  7019. * shared libraries: Options. (line 1379)
  7020. * SHORT(EXPRESSION): Output Section Data.
  7021. (line 6)
  7022. * SIZEOF(SECTION): Builtin Functions. (line 173)
  7023. * SIZEOF_HEADERS: Builtin Functions. (line 189)
  7024. * small common symbols: Input Section Common.
  7025. (line 20)
  7026. * SORT: Input Section Wildcards.
  7027. (line 62)
  7028. * SORT_BY_ALIGNMENT: Input Section Wildcards.
  7029. (line 51)
  7030. * SORT_BY_INIT_PRIORITY: Input Section Wildcards.
  7031. (line 57)
  7032. * SORT_BY_NAME: Input Section Wildcards.
  7033. (line 43)
  7034. * SORT_NONE: Input Section Wildcards.
  7035. (line 98)
  7036. * SPU: SPU ELF. (line 29)
  7037. * SPU <1>: SPU ELF. (line 46)
  7038. * SPU ELF options: SPU ELF. (line 6)
  7039. * SPU extra overlay stubs: SPU ELF. (line 19)
  7040. * SPU local store size: SPU ELF. (line 24)
  7041. * SPU overlay stub symbols: SPU ELF. (line 15)
  7042. * SPU overlays: SPU ELF. (line 9)
  7043. * SPU plugins: SPU ELF. (line 6)
  7044. * SQUAD(EXPRESSION): Output Section Data.
  7045. (line 6)
  7046. * stack size: Options. (line 2135)
  7047. * standard Unix system: Options. (line 7)
  7048. * start of execution: Entry Point. (line 6)
  7049. * STARTUP(FILENAME): File Commands. (line 84)
  7050. * STM32L4xx erratum workaround: ARM. (line 120)
  7051. * strip all symbols: Options. (line 534)
  7052. * strip debugger symbols: Options. (line 538)
  7053. * stripping all but some symbols: Options. (line 1284)
  7054. * STUB_GROUP_SIZE: ARM. (line 176)
  7055. * SUBALIGN(SUBSECTION_ALIGN): Forced Input Alignment.
  7056. (line 6)
  7057. * suffixes for integers: Constants. (line 15)
  7058. * symbol defaults: Builtin Functions. (line 122)
  7059. * symbol definition, scripts: Assignments. (line 6)
  7060. * symbol names: Symbols. (line 6)
  7061. * symbol tracing: Options. (line 651)
  7062. * symbol versions: VERSION. (line 6)
  7063. * symbol-only input: Options. (line 523)
  7064. * symbolic constants: Symbolic Constants. (line 6)
  7065. * symbols, from command line: Options. (line 1005)
  7066. * symbols, relocatable and absolute: Expression Section. (line 6)
  7067. * symbols, require defined: Options. (line 582)
  7068. * symbols, retaining selectively: Options. (line 1284)
  7069. * synthesizing linker: Options. (line 1258)
  7070. * synthesizing on H8/300: H8/300. (line 14)
  7071. * TARGET(BFDNAME): Format Commands. (line 35)
  7072. * TARGET1: ARM. (line 33)
  7073. * TARGET2: ARM. (line 38)
  7074. * text segment origin, cmd line: Options. (line 1458)
  7075. * thumb entry point: ARM. (line 17)
  7076. * TI COFF versions: TI COFF. (line 6)
  7077. * traditional format: Options. (line 1430)
  7078. * trampoline generation on M68HC11: M68HC11/68HC12. (line 30)
  7079. * trampoline generation on M68HC12: M68HC11/68HC12. (line 30)
  7080. * unallocated address, next: Builtin Functions. (line 156)
  7081. * undefined symbol: Options. (line 569)
  7082. * undefined symbol in linker script: Miscellaneous Commands.
  7083. (line 39)
  7084. * undefined symbols, warnings on: Options. (line 1606)
  7085. * uninitialized data placement: Input Section Common.
  7086. (line 6)
  7087. * unspecified memory: Output Section Data.
  7088. (line 39)
  7089. * usage: Options. (line 1119)
  7090. * USE_BLX: ARM. (line 73)
  7091. * using a DEF file: WIN32. (line 52)
  7092. * using auto-export functionality: WIN32. (line 22)
  7093. * Using decorations: WIN32. (line 157)
  7094. * variables, defining: Assignments. (line 6)
  7095. * verbose[=NUMBER]: Options. (line 1501)
  7096. * version: Options. (line 635)
  7097. * version script: VERSION. (line 6)
  7098. * version script, symbol versions: Options. (line 1509)
  7099. * VERSION {script text}: VERSION. (line 6)
  7100. * versions of symbols: VERSION. (line 6)
  7101. * VFP11_DENORM_FIX: ARM. (line 82)
  7102. * warnings, on combining symbols: Options. (line 1519)
  7103. * warnings, on section alignment: Options. (line 1610)
  7104. * warnings, on undefined symbols: Options. (line 1606)
  7105. * weak externals: WIN32. (line 400)
  7106. * what is this?: Overview. (line 6)
  7107. * wildcard file name patterns: Input Section Wildcards.
  7108. (line 6)
  7109. * Xtensa options: Xtensa. (line 55)
  7110. * Xtensa processors: Xtensa. (line 6)
  7111. 
  7112. Tag Table:
  7113. Node: Top706
  7114. Node: Overview1487
  7115. Node: Invocation2603
  7116. Node: Options3011
  7117. Node: Environment107071
  7118. Node: Scripts108832
  7119. Node: Basic Script Concepts110566
  7120. Node: Script Format113274
  7121. Node: Simple Example114137
  7122. Node: Simple Commands117231
  7123. Node: Entry Point117736
  7124. Node: File Commands118664
  7125. Node: Format Commands122785
  7126. Node: REGION_ALIAS124741
  7127. Node: Miscellaneous Commands129568
  7128. Node: Assignments135108
  7129. Node: Simple Assignments135619
  7130. Node: HIDDEN137350
  7131. Node: PROVIDE137977
  7132. Node: PROVIDE_HIDDEN139170
  7133. Node: Source Code Reference139414
  7134. Node: SECTIONS143331
  7135. Node: Output Section Description145219
  7136. Node: Output Section Name146460
  7137. Node: Output Section Address147337
  7138. Node: Input Section149570
  7139. Node: Input Section Basics150371
  7140. Node: Input Section Wildcards155389
  7141. Node: Input Section Common160590
  7142. Node: Input Section Keep162072
  7143. Node: Input Section Example162562
  7144. Node: Output Section Data163530
  7145. Node: Output Section Keywords166309
  7146. Node: Output Section Discarding169876
  7147. Node: Output Section Attributes171366
  7148. Node: Output Section Type172466
  7149. Node: Output Section LMA173536
  7150. Node: Forced Output Alignment176607
  7151. Node: Forced Input Alignment177036
  7152. Node: Output Section Constraint177424
  7153. Node: Output Section Region177852
  7154. Node: Output Section Phdr178285
  7155. Node: Output Section Fill178949
  7156. Node: Overlay Description180091
  7157. Node: MEMORY184536
  7158. Node: PHDRS188907
  7159. Node: VERSION194233
  7160. Node: Expressions202324
  7161. Node: Constants203253
  7162. Node: Symbolic Constants204127
  7163. Node: Symbols204678
  7164. Node: Orphan Sections205425
  7165. Node: Location Counter206762
  7166. Node: Operators211196
  7167. Node: Evaluation212118
  7168. Node: Expression Section213482
  7169. Node: Builtin Functions217452
  7170. Node: Implicit Linker Scripts225683
  7171. Node: Machine Dependent226458
  7172. Node: H8/300227565
  7173. Node: i960229628
  7174. Node: M68HC11/68HC12231324
  7175. Node: ARM232769
  7176. Node: HPPA ELF32245016
  7177. Node: M68K246639
  7178. Node: MIPS247548
  7179. Node: MMIX248664
  7180. Node: MSP430249829
  7181. Node: NDS32250869
  7182. Node: Nios II251835
  7183. Node: PowerPC ELF32253151
  7184. Node: PowerPC64 ELF64255982
  7185. Node: SPU ELF263307
  7186. Node: TI COFF265941
  7187. Node: WIN32266467
  7188. Node: Xtensa286596
  7189. Node: BFD289562
  7190. Node: BFD outline291020
  7191. Node: BFD information loss292308
  7192. Node: Canonical format294834
  7193. Node: Reporting Bugs299196
  7194. Node: Bug Criteria299890
  7195. Node: Bug Reporting300589
  7196. Node: MRI307627
  7197. Node: GNU Free Documentation License312269
  7198. Node: LD Index337406
  7199. 
  7200. End Tag Table