bfd-in2.h 245 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784478547864787478847894790479147924793479447954796479747984799480048014802480348044805480648074808480948104811481248134814481548164817481848194820482148224823482448254826482748284829483048314832483348344835483648374838483948404841484248434844484548464847484848494850485148524853485448554856485748584859486048614862486348644865486648674868486948704871487248734874487548764877487848794880488148824883488448854886488748884889489048914892489348944895489648974898489949004901490249034904490549064907490849094910491149124913491449154916491749184919492049214922492349244925492649274928492949304931493249334934493549364937493849394940494149424943494449454946494749484949495049514952495349544955495649574958495949604961496249634964496549664967496849694970497149724973497449754976497749784979498049814982498349844985498649874988498949904991499249934994499549964997499849995000500150025003500450055006500750085009501050115012501350145015501650175018501950205021502250235024502550265027502850295030503150325033503450355036503750385039504050415042504350445045504650475048504950505051505250535054505550565057505850595060506150625063506450655066506750685069507050715072507350745075507650775078507950805081508250835084508550865087508850895090509150925093509450955096509750985099510051015102510351045105510651075108510951105111511251135114511551165117511851195120512151225123512451255126512751285129513051315132513351345135513651375138513951405141514251435144514551465147514851495150515151525153515451555156515751585159516051615162516351645165516651675168516951705171517251735174517551765177517851795180518151825183518451855186518751885189519051915192519351945195519651975198519952005201520252035204520552065207520852095210521152125213521452155216521752185219522052215222522352245225522652275228522952305231523252335234523552365237523852395240524152425243524452455246524752485249525052515252525352545255525652575258525952605261526252635264526552665267526852695270527152725273527452755276527752785279528052815282528352845285528652875288528952905291529252935294529552965297529852995300530153025303530453055306530753085309531053115312531353145315531653175318531953205321532253235324532553265327532853295330533153325333533453355336533753385339534053415342534353445345534653475348534953505351535253535354535553565357535853595360536153625363536453655366536753685369537053715372537353745375537653775378537953805381538253835384538553865387538853895390539153925393539453955396539753985399540054015402540354045405540654075408540954105411541254135414541554165417541854195420542154225423542454255426542754285429543054315432543354345435543654375438543954405441544254435444544554465447544854495450545154525453545454555456545754585459546054615462546354645465546654675468546954705471547254735474547554765477547854795480548154825483548454855486548754885489549054915492549354945495549654975498549955005501550255035504550555065507550855095510551155125513551455155516551755185519552055215522552355245525552655275528552955305531553255335534553555365537553855395540554155425543554455455546554755485549555055515552555355545555555655575558555955605561556255635564556555665567556855695570557155725573557455755576557755785579558055815582558355845585558655875588558955905591559255935594559555965597559855995600560156025603560456055606560756085609561056115612561356145615561656175618561956205621562256235624562556265627562856295630563156325633563456355636563756385639564056415642564356445645564656475648564956505651565256535654565556565657565856595660566156625663566456655666566756685669567056715672567356745675567656775678567956805681568256835684568556865687568856895690569156925693569456955696569756985699570057015702570357045705570657075708570957105711571257135714571557165717571857195720572157225723572457255726572757285729573057315732573357345735573657375738573957405741574257435744574557465747574857495750575157525753575457555756575757585759576057615762576357645765576657675768576957705771577257735774577557765777577857795780578157825783578457855786578757885789579057915792579357945795579657975798579958005801580258035804580558065807580858095810581158125813581458155816581758185819582058215822582358245825582658275828582958305831583258335834583558365837583858395840584158425843584458455846584758485849585058515852585358545855585658575858585958605861586258635864586558665867586858695870587158725873587458755876587758785879588058815882588358845885588658875888588958905891589258935894589558965897589858995900590159025903590459055906590759085909591059115912591359145915591659175918591959205921592259235924592559265927592859295930593159325933593459355936593759385939594059415942594359445945594659475948594959505951595259535954595559565957595859595960596159625963596459655966596759685969597059715972597359745975597659775978597959805981598259835984598559865987598859895990599159925993599459955996599759985999600060016002600360046005600660076008600960106011601260136014601560166017601860196020602160226023602460256026602760286029603060316032603360346035603660376038603960406041604260436044604560466047604860496050605160526053605460556056605760586059606060616062606360646065606660676068606960706071607260736074607560766077607860796080608160826083608460856086608760886089609060916092609360946095609660976098609961006101610261036104610561066107610861096110611161126113611461156116611761186119612061216122612361246125612661276128612961306131613261336134613561366137613861396140614161426143614461456146614761486149615061516152615361546155615661576158615961606161616261636164616561666167616861696170617161726173617461756176617761786179618061816182618361846185618661876188618961906191619261936194619561966197619861996200620162026203620462056206620762086209621062116212621362146215621662176218621962206221622262236224622562266227622862296230623162326233623462356236623762386239624062416242624362446245624662476248624962506251625262536254625562566257625862596260626162626263626462656266626762686269627062716272627362746275627662776278627962806281628262836284628562866287628862896290629162926293629462956296629762986299630063016302630363046305630663076308630963106311631263136314631563166317631863196320632163226323632463256326632763286329633063316332633363346335633663376338633963406341634263436344634563466347634863496350635163526353635463556356635763586359636063616362636363646365636663676368636963706371637263736374637563766377637863796380638163826383638463856386638763886389639063916392639363946395639663976398639964006401640264036404640564066407640864096410641164126413641464156416641764186419642064216422642364246425642664276428642964306431643264336434643564366437643864396440644164426443644464456446644764486449645064516452645364546455645664576458645964606461646264636464646564666467646864696470647164726473647464756476647764786479648064816482648364846485648664876488648964906491649264936494649564966497649864996500650165026503650465056506650765086509651065116512651365146515651665176518651965206521652265236524652565266527652865296530653165326533653465356536653765386539654065416542654365446545654665476548654965506551655265536554655565566557655865596560656165626563656465656566656765686569657065716572657365746575657665776578657965806581658265836584658565866587658865896590659165926593659465956596659765986599660066016602660366046605660666076608660966106611661266136614661566166617661866196620662166226623662466256626662766286629663066316632663366346635663666376638663966406641664266436644664566466647664866496650665166526653665466556656665766586659666066616662666366646665666666676668666966706671667266736674667566766677667866796680668166826683668466856686668766886689669066916692669366946695669666976698669967006701670267036704670567066707670867096710671167126713671467156716671767186719672067216722672367246725672667276728672967306731673267336734673567366737673867396740674167426743674467456746674767486749675067516752675367546755675667576758675967606761676267636764676567666767676867696770677167726773677467756776677767786779678067816782678367846785678667876788678967906791679267936794679567966797679867996800680168026803680468056806680768086809681068116812681368146815681668176818681968206821682268236824682568266827682868296830683168326833683468356836683768386839684068416842684368446845684668476848684968506851685268536854685568566857685868596860686168626863686468656866686768686869687068716872687368746875687668776878687968806881688268836884688568866887688868896890689168926893689468956896689768986899690069016902690369046905690669076908690969106911691269136914691569166917691869196920692169226923692469256926692769286929693069316932693369346935693669376938693969406941694269436944694569466947694869496950695169526953695469556956695769586959696069616962696369646965696669676968696969706971697269736974697569766977697869796980698169826983698469856986698769886989699069916992699369946995699669976998699970007001700270037004700570067007700870097010701170127013701470157016701770187019702070217022702370247025702670277028702970307031703270337034703570367037703870397040704170427043704470457046704770487049705070517052705370547055705670577058705970607061706270637064706570667067706870697070707170727073707470757076707770787079708070817082708370847085708670877088708970907091709270937094709570967097709870997100710171027103710471057106710771087109711071117112711371147115711671177118711971207121712271237124712571267127712871297130713171327133713471357136713771387139714071417142714371447145714671477148714971507151715271537154715571567157715871597160716171627163716471657166716771687169717071717172717371747175717671777178717971807181718271837184718571867187718871897190719171927193719471957196719771987199720072017202720372047205720672077208720972107211721272137214721572167217721872197220722172227223722472257226722772287229723072317232723372347235723672377238723972407241724272437244724572467247724872497250725172527253725472557256725772587259726072617262726372647265726672677268726972707271727272737274727572767277727872797280728172827283728472857286728772887289729072917292729372947295729672977298729973007301730273037304730573067307730873097310731173127313731473157316731773187319732073217322732373247325732673277328732973307331733273337334733573367337733873397340734173427343734473457346734773487349735073517352735373547355735673577358735973607361736273637364736573667367736873697370737173727373737473757376737773787379738073817382738373847385738673877388738973907391739273937394739573967397739873997400740174027403740474057406740774087409741074117412741374147415741674177418741974207421742274237424742574267427742874297430743174327433743474357436743774387439744074417442744374447445744674477448744974507451745274537454745574567457745874597460746174627463746474657466746774687469747074717472747374747475747674777478747974807481748274837484748574867487748874897490749174927493749474957496749774987499750075017502750375047505750675077508750975107511751275137514751575167517751875197520752175227523752475257526752775287529753075317532753375347535753675377538753975407541754275437544754575467547
  1. /* DO NOT EDIT! -*- buffer-read-only: t -*- This file is automatically
  2. generated from "bfd-in.h", "init.c", "opncls.c", "libbfd.c",
  3. "bfdio.c", "bfdwin.c", "section.c", "archures.c", "reloc.c",
  4. "syms.c", "bfd.c", "archive.c", "corefile.c", "targets.c", "format.c",
  5. "linker.c", "simple.c" and "compress.c".
  6. Run "make headers" in your build bfd/ to regenerate. */
  7. /* Main header file for the bfd library -- portable access to object files.
  8. Copyright (C) 1990-2015 Free Software Foundation, Inc.
  9. Contributed by Cygnus Support.
  10. This file is part of BFD, the Binary File Descriptor library.
  11. This program is free software; you can redistribute it and/or modify
  12. it under the terms of the GNU General Public License as published by
  13. the Free Software Foundation; either version 3 of the License, or
  14. (at your option) any later version.
  15. This program is distributed in the hope that it will be useful,
  16. but WITHOUT ANY WARRANTY; without even the implied warranty of
  17. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  18. GNU General Public License for more details.
  19. You should have received a copy of the GNU General Public License
  20. along with this program; if not, write to the Free Software
  21. Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */
  22. #ifndef __BFD_H_SEEN__
  23. #define __BFD_H_SEEN__
  24. /* PR 14072: Ensure that config.h is included first. */
  25. #if !defined PACKAGE && !defined PACKAGE_VERSION
  26. #error config.h must be included before this header
  27. #endif
  28. #ifdef __cplusplus
  29. extern "C" {
  30. #endif
  31. #include "ansidecl.h"
  32. #include "symcat.h"
  33. #include <sys/stat.h>
  34. #if defined (__STDC__) || defined (ALMOST_STDC) || defined (HAVE_STRINGIZE)
  35. #ifndef SABER
  36. /* This hack is to avoid a problem with some strict ANSI C preprocessors.
  37. The problem is, "32_" is not a valid preprocessing token, and we don't
  38. want extra underscores (e.g., "nlm_32_"). The XCONCAT2 macro will
  39. cause the inner CONCAT2 macros to be evaluated first, producing
  40. still-valid pp-tokens. Then the final concatenation can be done. */
  41. #undef CONCAT4
  42. #define CONCAT4(a,b,c,d) XCONCAT2(CONCAT2(a,b),CONCAT2(c,d))
  43. #endif
  44. #endif
  45. /* This is a utility macro to handle the situation where the code
  46. wants to place a constant string into the code, followed by a
  47. comma and then the length of the string. Doing this by hand
  48. is error prone, so using this macro is safer. */
  49. #define STRING_COMMA_LEN(STR) (STR), (sizeof (STR) - 1)
  50. /* Unfortunately it is not possible to use the STRING_COMMA_LEN macro
  51. to create the arguments to another macro, since the preprocessor
  52. will mis-count the number of arguments to the outer macro (by not
  53. evaluating STRING_COMMA_LEN and so missing the comma). This is a
  54. problem for example when trying to use STRING_COMMA_LEN to build
  55. the arguments to the strncmp() macro. Hence this alternative
  56. definition of strncmp is provided here.
  57. Note - these macros do NOT work if STR2 is not a constant string. */
  58. #define CONST_STRNEQ(STR1,STR2) (strncmp ((STR1), (STR2), sizeof (STR2) - 1) == 0)
  59. /* strcpy() can have a similar problem, but since we know we are
  60. copying a constant string, we can use memcpy which will be faster
  61. since there is no need to check for a NUL byte inside STR. We
  62. can also save time if we do not need to copy the terminating NUL. */
  63. #define LITMEMCPY(DEST,STR2) memcpy ((DEST), (STR2), sizeof (STR2) - 1)
  64. #define LITSTRCPY(DEST,STR2) memcpy ((DEST), (STR2), sizeof (STR2))
  65. #define BFD_SUPPORTS_PLUGINS @supports_plugins@
  66. /* The word size used by BFD on the host. This may be 64 with a 32
  67. bit target if the host is 64 bit, or if other 64 bit targets have
  68. been selected with --enable-targets, or if --enable-64-bit-bfd. */
  69. #define BFD_ARCH_SIZE @wordsize@
  70. /* The word size of the default bfd target. */
  71. #define BFD_DEFAULT_TARGET_SIZE @bfd_default_target_size@
  72. #define BFD_HOST_64BIT_LONG @BFD_HOST_64BIT_LONG@
  73. #define BFD_HOST_64BIT_LONG_LONG @BFD_HOST_64BIT_LONG_LONG@
  74. #if @BFD_HOST_64_BIT_DEFINED@
  75. #define BFD_HOST_64_BIT @BFD_HOST_64_BIT@
  76. #define BFD_HOST_U_64_BIT @BFD_HOST_U_64_BIT@
  77. typedef BFD_HOST_64_BIT bfd_int64_t;
  78. typedef BFD_HOST_U_64_BIT bfd_uint64_t;
  79. #endif
  80. #if BFD_ARCH_SIZE >= 64
  81. #define BFD64
  82. #endif
  83. #ifndef INLINE
  84. #if __GNUC__ >= 2
  85. #define INLINE __inline__
  86. #else
  87. #define INLINE
  88. #endif
  89. #endif
  90. /* Declaring a type wide enough to hold a host long and a host pointer. */
  91. #define BFD_HOSTPTR_T @BFD_HOSTPTR_T@
  92. typedef BFD_HOSTPTR_T bfd_hostptr_t;
  93. /* Forward declaration. */
  94. typedef struct bfd bfd;
  95. /* Boolean type used in bfd. Too many systems define their own
  96. versions of "boolean" for us to safely typedef a "boolean" of
  97. our own. Using an enum for "bfd_boolean" has its own set of
  98. problems, with strange looking casts required to avoid warnings
  99. on some older compilers. Thus we just use an int.
  100. General rule: Functions which are bfd_boolean return TRUE on
  101. success and FALSE on failure (unless they're a predicate). */
  102. typedef int bfd_boolean;
  103. #undef FALSE
  104. #undef TRUE
  105. #define FALSE 0
  106. #define TRUE 1
  107. #ifdef BFD64
  108. #ifndef BFD_HOST_64_BIT
  109. #error No 64 bit integer type available
  110. #endif /* ! defined (BFD_HOST_64_BIT) */
  111. typedef BFD_HOST_U_64_BIT bfd_vma;
  112. typedef BFD_HOST_64_BIT bfd_signed_vma;
  113. typedef BFD_HOST_U_64_BIT bfd_size_type;
  114. typedef BFD_HOST_U_64_BIT symvalue;
  115. #if BFD_HOST_64BIT_LONG
  116. #define BFD_VMA_FMT "l"
  117. #elif defined (__MSVCRT__)
  118. #define BFD_VMA_FMT "I64"
  119. #else
  120. #define BFD_VMA_FMT "ll"
  121. #endif
  122. #ifndef fprintf_vma
  123. #define sprintf_vma(s,x) sprintf (s, "%016" BFD_VMA_FMT "x", x)
  124. #define fprintf_vma(f,x) fprintf (f, "%016" BFD_VMA_FMT "x", x)
  125. #endif
  126. #else /* not BFD64 */
  127. /* Represent a target address. Also used as a generic unsigned type
  128. which is guaranteed to be big enough to hold any arithmetic types
  129. we need to deal with. */
  130. typedef unsigned long bfd_vma;
  131. /* A generic signed type which is guaranteed to be big enough to hold any
  132. arithmetic types we need to deal with. Can be assumed to be compatible
  133. with bfd_vma in the same way that signed and unsigned ints are compatible
  134. (as parameters, in assignment, etc). */
  135. typedef long bfd_signed_vma;
  136. typedef unsigned long symvalue;
  137. typedef unsigned long bfd_size_type;
  138. /* Print a bfd_vma x on stream s. */
  139. #define BFD_VMA_FMT "l"
  140. #define fprintf_vma(s,x) fprintf (s, "%08" BFD_VMA_FMT "x", x)
  141. #define sprintf_vma(s,x) sprintf (s, "%08" BFD_VMA_FMT "x", x)
  142. #endif /* not BFD64 */
  143. #define HALF_BFD_SIZE_TYPE \
  144. (((bfd_size_type) 1) << (8 * sizeof (bfd_size_type) / 2))
  145. #ifndef BFD_HOST_64_BIT
  146. /* Fall back on a 32 bit type. The idea is to make these types always
  147. available for function return types, but in the case that
  148. BFD_HOST_64_BIT is undefined such a function should abort or
  149. otherwise signal an error. */
  150. typedef bfd_signed_vma bfd_int64_t;
  151. typedef bfd_vma bfd_uint64_t;
  152. #endif
  153. /* An offset into a file. BFD always uses the largest possible offset
  154. based on the build time availability of fseek, fseeko, or fseeko64. */
  155. typedef @bfd_file_ptr@ file_ptr;
  156. typedef unsigned @bfd_file_ptr@ ufile_ptr;
  157. extern void bfd_sprintf_vma (bfd *, char *, bfd_vma);
  158. extern void bfd_fprintf_vma (bfd *, void *, bfd_vma);
  159. #define printf_vma(x) fprintf_vma(stdout,x)
  160. #define bfd_printf_vma(abfd,x) bfd_fprintf_vma (abfd,stdout,x)
  161. typedef unsigned int flagword; /* 32 bits of flags */
  162. typedef unsigned char bfd_byte;
  163. /* File formats. */
  164. typedef enum bfd_format
  165. {
  166. bfd_unknown = 0, /* File format is unknown. */
  167. bfd_object, /* Linker/assembler/compiler output. */
  168. bfd_archive, /* Object archive file. */
  169. bfd_core, /* Core dump. */
  170. bfd_type_end /* Marks the end; don't use it! */
  171. }
  172. bfd_format;
  173. /* Symbols and relocation. */
  174. /* A count of carsyms (canonical archive symbols). */
  175. typedef unsigned long symindex;
  176. /* How to perform a relocation. */
  177. typedef const struct reloc_howto_struct reloc_howto_type;
  178. #define BFD_NO_MORE_SYMBOLS ((symindex) ~0)
  179. /* General purpose part of a symbol X;
  180. target specific parts are in libcoff.h, libaout.h, etc. */
  181. #define bfd_get_section(x) ((x)->section)
  182. #define bfd_get_output_section(x) ((x)->section->output_section)
  183. #define bfd_set_section(x,y) ((x)->section) = (y)
  184. #define bfd_asymbol_base(x) ((x)->section->vma)
  185. #define bfd_asymbol_value(x) (bfd_asymbol_base(x) + (x)->value)
  186. #define bfd_asymbol_name(x) ((x)->name)
  187. /*Perhaps future: #define bfd_asymbol_bfd(x) ((x)->section->owner)*/
  188. #define bfd_asymbol_bfd(x) ((x)->the_bfd)
  189. #define bfd_asymbol_flavour(x) \
  190. (((x)->flags & BSF_SYNTHETIC) != 0 \
  191. ? bfd_target_unknown_flavour \
  192. : bfd_asymbol_bfd (x)->xvec->flavour)
  193. /* A canonical archive symbol. */
  194. /* This is a type pun with struct ranlib on purpose! */
  195. typedef struct carsym
  196. {
  197. char *name;
  198. file_ptr file_offset; /* Look here to find the file. */
  199. }
  200. carsym; /* To make these you call a carsymogen. */
  201. /* Used in generating armaps (archive tables of contents).
  202. Perhaps just a forward definition would do? */
  203. struct orl /* Output ranlib. */
  204. {
  205. char **name; /* Symbol name. */
  206. union
  207. {
  208. file_ptr pos;
  209. bfd *abfd;
  210. } u; /* bfd* or file position. */
  211. int namidx; /* Index into string table. */
  212. };
  213. /* Linenumber stuff. */
  214. typedef struct lineno_cache_entry
  215. {
  216. unsigned int line_number; /* Linenumber from start of function. */
  217. union
  218. {
  219. struct bfd_symbol *sym; /* Function name. */
  220. bfd_vma offset; /* Offset into section. */
  221. } u;
  222. }
  223. alent;
  224. /* Object and core file sections. */
  225. #define align_power(addr, align) \
  226. (((addr) + ((bfd_vma) 1 << (align)) - 1) & ((bfd_vma) -1 << (align)))
  227. typedef struct bfd_section *sec_ptr;
  228. #define bfd_get_section_name(bfd, ptr) ((void) bfd, (ptr)->name)
  229. #define bfd_get_section_vma(bfd, ptr) ((void) bfd, (ptr)->vma)
  230. #define bfd_get_section_lma(bfd, ptr) ((void) bfd, (ptr)->lma)
  231. #define bfd_get_section_alignment(bfd, ptr) ((void) bfd, \
  232. (ptr)->alignment_power)
  233. #define bfd_section_name(bfd, ptr) ((ptr)->name)
  234. #define bfd_section_size(bfd, ptr) ((ptr)->size)
  235. #define bfd_get_section_size(ptr) ((ptr)->size)
  236. #define bfd_section_vma(bfd, ptr) ((ptr)->vma)
  237. #define bfd_section_lma(bfd, ptr) ((ptr)->lma)
  238. #define bfd_section_alignment(bfd, ptr) ((ptr)->alignment_power)
  239. #define bfd_get_section_flags(bfd, ptr) ((void) bfd, (ptr)->flags)
  240. #define bfd_get_section_userdata(bfd, ptr) ((void) bfd, (ptr)->userdata)
  241. #define bfd_is_com_section(ptr) (((ptr)->flags & SEC_IS_COMMON) != 0)
  242. #define bfd_get_section_limit_octets(bfd, sec) \
  243. ((bfd)->direction != write_direction && (sec)->rawsize != 0 \
  244. ? (sec)->rawsize : (sec)->size)
  245. /* Find the address one past the end of SEC. */
  246. #define bfd_get_section_limit(bfd, sec) \
  247. (bfd_get_section_limit_octets(bfd, sec) / bfd_octets_per_byte (bfd))
  248. /* Return TRUE if input section SEC has been discarded. */
  249. #define discarded_section(sec) \
  250. (!bfd_is_abs_section (sec) \
  251. && bfd_is_abs_section ((sec)->output_section) \
  252. && (sec)->sec_info_type != SEC_INFO_TYPE_MERGE \
  253. && (sec)->sec_info_type != SEC_INFO_TYPE_JUST_SYMS)
  254. typedef enum bfd_print_symbol
  255. {
  256. bfd_print_symbol_name,
  257. bfd_print_symbol_more,
  258. bfd_print_symbol_all
  259. } bfd_print_symbol_type;
  260. /* Information about a symbol that nm needs. */
  261. typedef struct _symbol_info
  262. {
  263. symvalue value;
  264. char type;
  265. const char *name; /* Symbol name. */
  266. unsigned char stab_type; /* Stab type. */
  267. char stab_other; /* Stab other. */
  268. short stab_desc; /* Stab desc. */
  269. const char *stab_name; /* String for stab type. */
  270. } symbol_info;
  271. /* Get the name of a stabs type code. */
  272. extern const char *bfd_get_stab_name (int);
  273. /* Hash table routines. There is no way to free up a hash table. */
  274. /* An element in the hash table. Most uses will actually use a larger
  275. structure, and an instance of this will be the first field. */
  276. struct bfd_hash_entry
  277. {
  278. /* Next entry for this hash code. */
  279. struct bfd_hash_entry *next;
  280. /* String being hashed. */
  281. const char *string;
  282. /* Hash code. This is the full hash code, not the index into the
  283. table. */
  284. unsigned long hash;
  285. };
  286. /* A hash table. */
  287. struct bfd_hash_table
  288. {
  289. /* The hash array. */
  290. struct bfd_hash_entry **table;
  291. /* A function used to create new elements in the hash table. The
  292. first entry is itself a pointer to an element. When this
  293. function is first invoked, this pointer will be NULL. However,
  294. having the pointer permits a hierarchy of method functions to be
  295. built each of which calls the function in the superclass. Thus
  296. each function should be written to allocate a new block of memory
  297. only if the argument is NULL. */
  298. struct bfd_hash_entry *(*newfunc)
  299. (struct bfd_hash_entry *, struct bfd_hash_table *, const char *);
  300. /* An objalloc for this hash table. This is a struct objalloc *,
  301. but we use void * to avoid requiring the inclusion of objalloc.h. */
  302. void *memory;
  303. /* The number of slots in the hash table. */
  304. unsigned int size;
  305. /* The number of entries in the hash table. */
  306. unsigned int count;
  307. /* The size of elements. */
  308. unsigned int entsize;
  309. /* If non-zero, don't grow the hash table. */
  310. unsigned int frozen:1;
  311. };
  312. /* Initialize a hash table. */
  313. extern bfd_boolean bfd_hash_table_init
  314. (struct bfd_hash_table *,
  315. struct bfd_hash_entry *(*) (struct bfd_hash_entry *,
  316. struct bfd_hash_table *,
  317. const char *),
  318. unsigned int);
  319. /* Initialize a hash table specifying a size. */
  320. extern bfd_boolean bfd_hash_table_init_n
  321. (struct bfd_hash_table *,
  322. struct bfd_hash_entry *(*) (struct bfd_hash_entry *,
  323. struct bfd_hash_table *,
  324. const char *),
  325. unsigned int, unsigned int);
  326. /* Free up a hash table. */
  327. extern void bfd_hash_table_free
  328. (struct bfd_hash_table *);
  329. /* Look up a string in a hash table. If CREATE is TRUE, a new entry
  330. will be created for this string if one does not already exist. The
  331. COPY argument must be TRUE if this routine should copy the string
  332. into newly allocated memory when adding an entry. */
  333. extern struct bfd_hash_entry *bfd_hash_lookup
  334. (struct bfd_hash_table *, const char *, bfd_boolean create,
  335. bfd_boolean copy);
  336. /* Insert an entry in a hash table. */
  337. extern struct bfd_hash_entry *bfd_hash_insert
  338. (struct bfd_hash_table *, const char *, unsigned long);
  339. /* Rename an entry in a hash table. */
  340. extern void bfd_hash_rename
  341. (struct bfd_hash_table *, const char *, struct bfd_hash_entry *);
  342. /* Replace an entry in a hash table. */
  343. extern void bfd_hash_replace
  344. (struct bfd_hash_table *, struct bfd_hash_entry *old,
  345. struct bfd_hash_entry *nw);
  346. /* Base method for creating a hash table entry. */
  347. extern struct bfd_hash_entry *bfd_hash_newfunc
  348. (struct bfd_hash_entry *, struct bfd_hash_table *, const char *);
  349. /* Grab some space for a hash table entry. */
  350. extern void *bfd_hash_allocate
  351. (struct bfd_hash_table *, unsigned int);
  352. /* Traverse a hash table in a random order, calling a function on each
  353. element. If the function returns FALSE, the traversal stops. The
  354. INFO argument is passed to the function. */
  355. extern void bfd_hash_traverse
  356. (struct bfd_hash_table *,
  357. bfd_boolean (*) (struct bfd_hash_entry *, void *),
  358. void *info);
  359. /* Allows the default size of a hash table to be configured. New hash
  360. tables allocated using bfd_hash_table_init will be created with
  361. this size. */
  362. extern unsigned long bfd_hash_set_default_size (unsigned long);
  363. /* Types of compressed DWARF debug sections. We currently support
  364. zlib. */
  365. enum compressed_debug_section_type
  366. {
  367. COMPRESS_DEBUG_NONE = 0,
  368. COMPRESS_DEBUG = 1 << 0,
  369. COMPRESS_DEBUG_GNU_ZLIB = COMPRESS_DEBUG | 1 << 1,
  370. COMPRESS_DEBUG_GABI_ZLIB = COMPRESS_DEBUG | 1 << 2
  371. };
  372. /* This structure is used to keep track of stabs in sections
  373. information while linking. */
  374. struct stab_info
  375. {
  376. /* A hash table used to hold stabs strings. */
  377. struct bfd_strtab_hash *strings;
  378. /* The header file hash table. */
  379. struct bfd_hash_table includes;
  380. /* The first .stabstr section. */
  381. struct bfd_section *stabstr;
  382. };
  383. #define COFF_SWAP_TABLE (void *) &bfd_coff_std_swap_table
  384. /* User program access to BFD facilities. */
  385. /* Direct I/O routines, for programs which know more about the object
  386. file than BFD does. Use higher level routines if possible. */
  387. extern bfd_size_type bfd_bread (void *, bfd_size_type, bfd *);
  388. extern bfd_size_type bfd_bwrite (const void *, bfd_size_type, bfd *);
  389. extern int bfd_seek (bfd *, file_ptr, int);
  390. extern file_ptr bfd_tell (bfd *);
  391. extern int bfd_flush (bfd *);
  392. extern int bfd_stat (bfd *, struct stat *);
  393. /* Deprecated old routines. */
  394. #if __GNUC__
  395. #define bfd_read(BUF, ELTSIZE, NITEMS, ABFD) \
  396. (warn_deprecated ("bfd_read", __FILE__, __LINE__, __FUNCTION__), \
  397. bfd_bread ((BUF), (ELTSIZE) * (NITEMS), (ABFD)))
  398. #define bfd_write(BUF, ELTSIZE, NITEMS, ABFD) \
  399. (warn_deprecated ("bfd_write", __FILE__, __LINE__, __FUNCTION__), \
  400. bfd_bwrite ((BUF), (ELTSIZE) * (NITEMS), (ABFD)))
  401. #else
  402. #define bfd_read(BUF, ELTSIZE, NITEMS, ABFD) \
  403. (warn_deprecated ("bfd_read", (const char *) 0, 0, (const char *) 0), \
  404. bfd_bread ((BUF), (ELTSIZE) * (NITEMS), (ABFD)))
  405. #define bfd_write(BUF, ELTSIZE, NITEMS, ABFD) \
  406. (warn_deprecated ("bfd_write", (const char *) 0, 0, (const char *) 0),\
  407. bfd_bwrite ((BUF), (ELTSIZE) * (NITEMS), (ABFD)))
  408. #endif
  409. extern void warn_deprecated (const char *, const char *, int, const char *);
  410. /* Cast from const char * to char * so that caller can assign to
  411. a char * without a warning. */
  412. #define bfd_get_filename(abfd) ((char *) (abfd)->filename)
  413. #define bfd_get_cacheable(abfd) ((abfd)->cacheable)
  414. #define bfd_get_format(abfd) ((abfd)->format)
  415. #define bfd_get_target(abfd) ((abfd)->xvec->name)
  416. #define bfd_get_flavour(abfd) ((abfd)->xvec->flavour)
  417. #define bfd_family_coff(abfd) \
  418. (bfd_get_flavour (abfd) == bfd_target_coff_flavour || \
  419. bfd_get_flavour (abfd) == bfd_target_xcoff_flavour)
  420. #define bfd_big_endian(abfd) ((abfd)->xvec->byteorder == BFD_ENDIAN_BIG)
  421. #define bfd_little_endian(abfd) ((abfd)->xvec->byteorder == BFD_ENDIAN_LITTLE)
  422. #define bfd_header_big_endian(abfd) \
  423. ((abfd)->xvec->header_byteorder == BFD_ENDIAN_BIG)
  424. #define bfd_header_little_endian(abfd) \
  425. ((abfd)->xvec->header_byteorder == BFD_ENDIAN_LITTLE)
  426. #define bfd_get_file_flags(abfd) ((abfd)->flags)
  427. #define bfd_applicable_file_flags(abfd) ((abfd)->xvec->object_flags)
  428. #define bfd_applicable_section_flags(abfd) ((abfd)->xvec->section_flags)
  429. #define bfd_my_archive(abfd) ((abfd)->my_archive)
  430. #define bfd_has_map(abfd) ((abfd)->has_armap)
  431. #define bfd_is_thin_archive(abfd) ((abfd)->is_thin_archive)
  432. #define bfd_valid_reloc_types(abfd) ((abfd)->xvec->valid_reloc_types)
  433. #define bfd_usrdata(abfd) ((abfd)->usrdata)
  434. #define bfd_get_start_address(abfd) ((abfd)->start_address)
  435. #define bfd_get_symcount(abfd) ((abfd)->symcount)
  436. #define bfd_get_outsymbols(abfd) ((abfd)->outsymbols)
  437. #define bfd_count_sections(abfd) ((abfd)->section_count)
  438. #define bfd_get_dynamic_symcount(abfd) ((abfd)->dynsymcount)
  439. #define bfd_get_symbol_leading_char(abfd) ((abfd)->xvec->symbol_leading_char)
  440. extern bfd_boolean bfd_cache_close
  441. (bfd *abfd);
  442. /* NB: This declaration should match the autogenerated one in libbfd.h. */
  443. extern bfd_boolean bfd_cache_close_all (void);
  444. extern bfd_boolean bfd_record_phdr
  445. (bfd *, unsigned long, bfd_boolean, flagword, bfd_boolean, bfd_vma,
  446. bfd_boolean, bfd_boolean, unsigned int, struct bfd_section **);
  447. /* Byte swapping routines. */
  448. bfd_uint64_t bfd_getb64 (const void *);
  449. bfd_uint64_t bfd_getl64 (const void *);
  450. bfd_int64_t bfd_getb_signed_64 (const void *);
  451. bfd_int64_t bfd_getl_signed_64 (const void *);
  452. bfd_vma bfd_getb32 (const void *);
  453. bfd_vma bfd_getl32 (const void *);
  454. bfd_signed_vma bfd_getb_signed_32 (const void *);
  455. bfd_signed_vma bfd_getl_signed_32 (const void *);
  456. bfd_vma bfd_getb16 (const void *);
  457. bfd_vma bfd_getl16 (const void *);
  458. bfd_signed_vma bfd_getb_signed_16 (const void *);
  459. bfd_signed_vma bfd_getl_signed_16 (const void *);
  460. void bfd_putb64 (bfd_uint64_t, void *);
  461. void bfd_putl64 (bfd_uint64_t, void *);
  462. void bfd_putb32 (bfd_vma, void *);
  463. void bfd_putl32 (bfd_vma, void *);
  464. void bfd_putb16 (bfd_vma, void *);
  465. void bfd_putl16 (bfd_vma, void *);
  466. /* Byte swapping routines which take size and endiannes as arguments. */
  467. bfd_uint64_t bfd_get_bits (const void *, int, bfd_boolean);
  468. void bfd_put_bits (bfd_uint64_t, void *, int, bfd_boolean);
  469. #if defined(__STDC__) || defined(ALMOST_STDC)
  470. struct ecoff_debug_info;
  471. struct ecoff_debug_swap;
  472. struct ecoff_extr;
  473. struct bfd_symbol;
  474. struct bfd_link_info;
  475. struct bfd_link_hash_entry;
  476. struct bfd_section_already_linked;
  477. struct bfd_elf_version_tree;
  478. #endif
  479. extern bfd_boolean bfd_section_already_linked_table_init (void);
  480. extern void bfd_section_already_linked_table_free (void);
  481. extern bfd_boolean _bfd_handle_already_linked
  482. (struct bfd_section *, struct bfd_section_already_linked *,
  483. struct bfd_link_info *);
  484. /* Externally visible ECOFF routines. */
  485. extern bfd_vma bfd_ecoff_get_gp_value
  486. (bfd * abfd);
  487. extern bfd_boolean bfd_ecoff_set_gp_value
  488. (bfd *abfd, bfd_vma gp_value);
  489. extern bfd_boolean bfd_ecoff_set_regmasks
  490. (bfd *abfd, unsigned long gprmask, unsigned long fprmask,
  491. unsigned long *cprmask);
  492. extern void *bfd_ecoff_debug_init
  493. (bfd *output_bfd, struct ecoff_debug_info *output_debug,
  494. const struct ecoff_debug_swap *output_swap, struct bfd_link_info *);
  495. extern void bfd_ecoff_debug_free
  496. (void *handle, bfd *output_bfd, struct ecoff_debug_info *output_debug,
  497. const struct ecoff_debug_swap *output_swap, struct bfd_link_info *);
  498. extern bfd_boolean bfd_ecoff_debug_accumulate
  499. (void *handle, bfd *output_bfd, struct ecoff_debug_info *output_debug,
  500. const struct ecoff_debug_swap *output_swap, bfd *input_bfd,
  501. struct ecoff_debug_info *input_debug,
  502. const struct ecoff_debug_swap *input_swap, struct bfd_link_info *);
  503. extern bfd_boolean bfd_ecoff_debug_accumulate_other
  504. (void *handle, bfd *output_bfd, struct ecoff_debug_info *output_debug,
  505. const struct ecoff_debug_swap *output_swap, bfd *input_bfd,
  506. struct bfd_link_info *);
  507. extern bfd_boolean bfd_ecoff_debug_externals
  508. (bfd *abfd, struct ecoff_debug_info *debug,
  509. const struct ecoff_debug_swap *swap, bfd_boolean relocatable,
  510. bfd_boolean (*get_extr) (struct bfd_symbol *, struct ecoff_extr *),
  511. void (*set_index) (struct bfd_symbol *, bfd_size_type));
  512. extern bfd_boolean bfd_ecoff_debug_one_external
  513. (bfd *abfd, struct ecoff_debug_info *debug,
  514. const struct ecoff_debug_swap *swap, const char *name,
  515. struct ecoff_extr *esym);
  516. extern bfd_size_type bfd_ecoff_debug_size
  517. (bfd *abfd, struct ecoff_debug_info *debug,
  518. const struct ecoff_debug_swap *swap);
  519. extern bfd_boolean bfd_ecoff_write_debug
  520. (bfd *abfd, struct ecoff_debug_info *debug,
  521. const struct ecoff_debug_swap *swap, file_ptr where);
  522. extern bfd_boolean bfd_ecoff_write_accumulated_debug
  523. (void *handle, bfd *abfd, struct ecoff_debug_info *debug,
  524. const struct ecoff_debug_swap *swap,
  525. struct bfd_link_info *info, file_ptr where);
  526. /* Externally visible ELF routines. */
  527. struct bfd_link_needed_list
  528. {
  529. struct bfd_link_needed_list *next;
  530. bfd *by;
  531. const char *name;
  532. };
  533. enum dynamic_lib_link_class {
  534. DYN_NORMAL = 0,
  535. DYN_AS_NEEDED = 1,
  536. DYN_DT_NEEDED = 2,
  537. DYN_NO_ADD_NEEDED = 4,
  538. DYN_NO_NEEDED = 8
  539. };
  540. enum notice_asneeded_action {
  541. notice_as_needed,
  542. notice_not_needed,
  543. notice_needed
  544. };
  545. extern bfd_boolean bfd_elf_record_link_assignment
  546. (bfd *, struct bfd_link_info *, const char *, bfd_boolean,
  547. bfd_boolean);
  548. extern struct bfd_link_needed_list *bfd_elf_get_needed_list
  549. (bfd *, struct bfd_link_info *);
  550. extern bfd_boolean bfd_elf_get_bfd_needed_list
  551. (bfd *, struct bfd_link_needed_list **);
  552. extern bfd_boolean bfd_elf_stack_segment_size (bfd *, struct bfd_link_info *,
  553. const char *, bfd_vma);
  554. extern bfd_boolean bfd_elf_size_dynamic_sections
  555. (bfd *, const char *, const char *, const char *, const char *, const char *,
  556. const char * const *, struct bfd_link_info *, struct bfd_section **);
  557. extern bfd_boolean bfd_elf_size_dynsym_hash_dynstr
  558. (bfd *, struct bfd_link_info *);
  559. extern void bfd_elf_set_dt_needed_name
  560. (bfd *, const char *);
  561. extern const char *bfd_elf_get_dt_soname
  562. (bfd *);
  563. extern void bfd_elf_set_dyn_lib_class
  564. (bfd *, enum dynamic_lib_link_class);
  565. extern int bfd_elf_get_dyn_lib_class
  566. (bfd *);
  567. extern struct bfd_link_needed_list *bfd_elf_get_runpath_list
  568. (bfd *, struct bfd_link_info *);
  569. extern int bfd_elf_discard_info
  570. (bfd *, struct bfd_link_info *);
  571. extern unsigned int _bfd_elf_default_action_discarded
  572. (struct bfd_section *);
  573. /* Return an upper bound on the number of bytes required to store a
  574. copy of ABFD's program header table entries. Return -1 if an error
  575. occurs; bfd_get_error will return an appropriate code. */
  576. extern long bfd_get_elf_phdr_upper_bound
  577. (bfd *abfd);
  578. /* Copy ABFD's program header table entries to *PHDRS. The entries
  579. will be stored as an array of Elf_Internal_Phdr structures, as
  580. defined in include/elf/internal.h. To find out how large the
  581. buffer needs to be, call bfd_get_elf_phdr_upper_bound.
  582. Return the number of program header table entries read, or -1 if an
  583. error occurs; bfd_get_error will return an appropriate code. */
  584. extern int bfd_get_elf_phdrs
  585. (bfd *abfd, void *phdrs);
  586. /* Create a new BFD as if by bfd_openr. Rather than opening a file,
  587. reconstruct an ELF file by reading the segments out of remote
  588. memory based on the ELF file header at EHDR_VMA and the ELF program
  589. headers it points to. If non-zero, SIZE is the known extent of the
  590. object. If not null, *LOADBASEP is filled in with the difference
  591. between the VMAs from which the segments were read, and the VMAs
  592. the file headers (and hence BFD's idea of each section's VMA) put
  593. them at.
  594. The function TARGET_READ_MEMORY is called to copy LEN bytes from
  595. the remote memory at target address VMA into the local buffer at
  596. MYADDR; it should return zero on success or an `errno' code on
  597. failure. TEMPL must be a BFD for a target with the word size and
  598. byte order found in the remote memory. */
  599. extern bfd *bfd_elf_bfd_from_remote_memory
  600. (bfd *templ, bfd_vma ehdr_vma, bfd_size_type size, bfd_vma *loadbasep,
  601. int (*target_read_memory) (bfd_vma vma, bfd_byte *myaddr,
  602. bfd_size_type len));
  603. extern struct bfd_section *_bfd_elf_tls_setup
  604. (bfd *, struct bfd_link_info *);
  605. extern struct bfd_section *
  606. _bfd_nearby_section (bfd *, struct bfd_section *, bfd_vma);
  607. extern void _bfd_fix_excluded_sec_syms
  608. (bfd *, struct bfd_link_info *);
  609. extern unsigned bfd_m68k_mach_to_features (int);
  610. extern int bfd_m68k_features_to_mach (unsigned);
  611. extern bfd_boolean bfd_m68k_elf32_create_embedded_relocs
  612. (bfd *, struct bfd_link_info *, struct bfd_section *, struct bfd_section *,
  613. char **);
  614. extern void bfd_elf_m68k_set_target_options (struct bfd_link_info *, int);
  615. extern bfd_boolean bfd_bfin_elf32_create_embedded_relocs
  616. (bfd *, struct bfd_link_info *, struct bfd_section *, struct bfd_section *,
  617. char **);
  618. extern bfd_boolean bfd_cr16_elf32_create_embedded_relocs
  619. (bfd *, struct bfd_link_info *, struct bfd_section *, struct bfd_section *,
  620. char **);
  621. /* SunOS shared library support routines for the linker. */
  622. extern struct bfd_link_needed_list *bfd_sunos_get_needed_list
  623. (bfd *, struct bfd_link_info *);
  624. extern bfd_boolean bfd_sunos_record_link_assignment
  625. (bfd *, struct bfd_link_info *, const char *);
  626. extern bfd_boolean bfd_sunos_size_dynamic_sections
  627. (bfd *, struct bfd_link_info *, struct bfd_section **,
  628. struct bfd_section **, struct bfd_section **);
  629. /* Linux shared library support routines for the linker. */
  630. extern bfd_boolean bfd_i386linux_size_dynamic_sections
  631. (bfd *, struct bfd_link_info *);
  632. extern bfd_boolean bfd_m68klinux_size_dynamic_sections
  633. (bfd *, struct bfd_link_info *);
  634. extern bfd_boolean bfd_sparclinux_size_dynamic_sections
  635. (bfd *, struct bfd_link_info *);
  636. /* mmap hacks */
  637. struct _bfd_window_internal;
  638. typedef struct _bfd_window_internal bfd_window_internal;
  639. typedef struct _bfd_window
  640. {
  641. /* What the user asked for. */
  642. void *data;
  643. bfd_size_type size;
  644. /* The actual window used by BFD. Small user-requested read-only
  645. regions sharing a page may share a single window into the object
  646. file. Read-write versions shouldn't until I've fixed things to
  647. keep track of which portions have been claimed by the
  648. application; don't want to give the same region back when the
  649. application wants two writable copies! */
  650. struct _bfd_window_internal *i;
  651. }
  652. bfd_window;
  653. extern void bfd_init_window
  654. (bfd_window *);
  655. extern void bfd_free_window
  656. (bfd_window *);
  657. extern bfd_boolean bfd_get_file_window
  658. (bfd *, file_ptr, bfd_size_type, bfd_window *, bfd_boolean);
  659. /* XCOFF support routines for the linker. */
  660. extern bfd_boolean bfd_xcoff_split_import_path
  661. (bfd *, const char *, const char **, const char **);
  662. extern bfd_boolean bfd_xcoff_set_archive_import_path
  663. (struct bfd_link_info *, bfd *, const char *);
  664. extern bfd_boolean bfd_xcoff_link_record_set
  665. (bfd *, struct bfd_link_info *, struct bfd_link_hash_entry *, bfd_size_type);
  666. extern bfd_boolean bfd_xcoff_import_symbol
  667. (bfd *, struct bfd_link_info *, struct bfd_link_hash_entry *, bfd_vma,
  668. const char *, const char *, const char *, unsigned int);
  669. extern bfd_boolean bfd_xcoff_export_symbol
  670. (bfd *, struct bfd_link_info *, struct bfd_link_hash_entry *);
  671. extern bfd_boolean bfd_xcoff_link_count_reloc
  672. (bfd *, struct bfd_link_info *, const char *);
  673. extern bfd_boolean bfd_xcoff_record_link_assignment
  674. (bfd *, struct bfd_link_info *, const char *);
  675. extern bfd_boolean bfd_xcoff_size_dynamic_sections
  676. (bfd *, struct bfd_link_info *, const char *, const char *,
  677. unsigned long, unsigned long, unsigned long, bfd_boolean,
  678. int, bfd_boolean, unsigned int, struct bfd_section **, bfd_boolean);
  679. extern bfd_boolean bfd_xcoff_link_generate_rtinit
  680. (bfd *, const char *, const char *, bfd_boolean);
  681. /* XCOFF support routines for ar. */
  682. extern bfd_boolean bfd_xcoff_ar_archive_set_magic
  683. (bfd *, char *);
  684. /* Externally visible COFF routines. */
  685. #if defined(__STDC__) || defined(ALMOST_STDC)
  686. struct internal_syment;
  687. union internal_auxent;
  688. #endif
  689. extern bfd_boolean bfd_coff_set_symbol_class
  690. (bfd *, struct bfd_symbol *, unsigned int);
  691. extern bfd_boolean bfd_m68k_coff_create_embedded_relocs
  692. (bfd *, struct bfd_link_info *, struct bfd_section *, struct bfd_section *, char **);
  693. /* ARM VFP11 erratum workaround support. */
  694. typedef enum
  695. {
  696. BFD_ARM_VFP11_FIX_DEFAULT,
  697. BFD_ARM_VFP11_FIX_NONE,
  698. BFD_ARM_VFP11_FIX_SCALAR,
  699. BFD_ARM_VFP11_FIX_VECTOR
  700. } bfd_arm_vfp11_fix;
  701. extern void bfd_elf32_arm_init_maps
  702. (bfd *);
  703. extern void bfd_elf32_arm_set_vfp11_fix
  704. (bfd *, struct bfd_link_info *);
  705. extern void bfd_elf32_arm_set_cortex_a8_fix
  706. (bfd *, struct bfd_link_info *);
  707. extern bfd_boolean bfd_elf32_arm_vfp11_erratum_scan
  708. (bfd *, struct bfd_link_info *);
  709. extern void bfd_elf32_arm_vfp11_fix_veneer_locations
  710. (bfd *, struct bfd_link_info *);
  711. /* ARM Interworking support. Called from linker. */
  712. extern bfd_boolean bfd_arm_allocate_interworking_sections
  713. (struct bfd_link_info *);
  714. extern bfd_boolean bfd_arm_process_before_allocation
  715. (bfd *, struct bfd_link_info *, int);
  716. extern bfd_boolean bfd_arm_get_bfd_for_interworking
  717. (bfd *, struct bfd_link_info *);
  718. /* PE ARM Interworking support. Called from linker. */
  719. extern bfd_boolean bfd_arm_pe_allocate_interworking_sections
  720. (struct bfd_link_info *);
  721. extern bfd_boolean bfd_arm_pe_process_before_allocation
  722. (bfd *, struct bfd_link_info *, int);
  723. extern bfd_boolean bfd_arm_pe_get_bfd_for_interworking
  724. (bfd *, struct bfd_link_info *);
  725. /* ELF ARM Interworking support. Called from linker. */
  726. extern bfd_boolean bfd_elf32_arm_allocate_interworking_sections
  727. (struct bfd_link_info *);
  728. extern bfd_boolean bfd_elf32_arm_process_before_allocation
  729. (bfd *, struct bfd_link_info *);
  730. void bfd_elf32_arm_set_target_relocs
  731. (bfd *, struct bfd_link_info *, int, char *, int, int, bfd_arm_vfp11_fix,
  732. int, int, int, int, int);
  733. extern bfd_boolean bfd_elf32_arm_get_bfd_for_interworking
  734. (bfd *, struct bfd_link_info *);
  735. extern bfd_boolean bfd_elf32_arm_add_glue_sections_to_bfd
  736. (bfd *, struct bfd_link_info *);
  737. /* ELF ARM mapping symbol support. */
  738. #define BFD_ARM_SPECIAL_SYM_TYPE_MAP (1 << 0)
  739. #define BFD_ARM_SPECIAL_SYM_TYPE_TAG (1 << 1)
  740. #define BFD_ARM_SPECIAL_SYM_TYPE_OTHER (1 << 2)
  741. #define BFD_ARM_SPECIAL_SYM_TYPE_ANY (~0)
  742. extern bfd_boolean bfd_is_arm_special_symbol_name
  743. (const char *, int);
  744. extern void bfd_elf32_arm_set_byteswap_code
  745. (struct bfd_link_info *, int);
  746. extern void bfd_elf32_arm_use_long_plt (void);
  747. /* ARM Note section processing. */
  748. extern bfd_boolean bfd_arm_merge_machines
  749. (bfd *, bfd *);
  750. extern bfd_boolean bfd_arm_update_notes
  751. (bfd *, const char *);
  752. extern unsigned int bfd_arm_get_mach_from_notes
  753. (bfd *, const char *);
  754. /* ARM stub generation support. Called from the linker. */
  755. extern int elf32_arm_setup_section_lists
  756. (bfd *, struct bfd_link_info *);
  757. extern void elf32_arm_next_input_section
  758. (struct bfd_link_info *, struct bfd_section *);
  759. extern bfd_boolean elf32_arm_size_stubs
  760. (bfd *, bfd *, struct bfd_link_info *, bfd_signed_vma,
  761. struct bfd_section * (*) (const char *, struct bfd_section *, unsigned int),
  762. void (*) (void));
  763. extern bfd_boolean elf32_arm_build_stubs
  764. (struct bfd_link_info *);
  765. /* ARM unwind section editing support. */
  766. extern bfd_boolean elf32_arm_fix_exidx_coverage
  767. (struct bfd_section **, unsigned int, struct bfd_link_info *, bfd_boolean);
  768. /* C6x unwind section editing support. */
  769. extern bfd_boolean elf32_tic6x_fix_exidx_coverage
  770. (struct bfd_section **, unsigned int, struct bfd_link_info *, bfd_boolean);
  771. /* PowerPC @tls opcode transform/validate. */
  772. extern unsigned int _bfd_elf_ppc_at_tls_transform
  773. (unsigned int, unsigned int);
  774. /* PowerPC @tprel opcode transform/validate. */
  775. extern unsigned int _bfd_elf_ppc_at_tprel_transform
  776. (unsigned int, unsigned int);
  777. extern void bfd_elf64_aarch64_init_maps
  778. (bfd *);
  779. extern void bfd_elf32_aarch64_init_maps
  780. (bfd *);
  781. extern void bfd_elf64_aarch64_set_options
  782. (bfd *, struct bfd_link_info *, int, int, int, int, int);
  783. extern void bfd_elf32_aarch64_set_options
  784. (bfd *, struct bfd_link_info *, int, int, int, int, int);
  785. /* ELF AArch64 mapping symbol support. */
  786. #define BFD_AARCH64_SPECIAL_SYM_TYPE_MAP (1 << 0)
  787. #define BFD_AARCH64_SPECIAL_SYM_TYPE_TAG (1 << 1)
  788. #define BFD_AARCH64_SPECIAL_SYM_TYPE_OTHER (1 << 2)
  789. #define BFD_AARCH64_SPECIAL_SYM_TYPE_ANY (~0)
  790. extern bfd_boolean bfd_is_aarch64_special_symbol_name
  791. (const char * name, int type);
  792. /* AArch64 stub generation support for ELF64. Called from the linker. */
  793. extern int elf64_aarch64_setup_section_lists
  794. (bfd *, struct bfd_link_info *);
  795. extern void elf64_aarch64_next_input_section
  796. (struct bfd_link_info *, struct bfd_section *);
  797. extern bfd_boolean elf64_aarch64_size_stubs
  798. (bfd *, bfd *, struct bfd_link_info *, bfd_signed_vma,
  799. struct bfd_section * (*) (const char *, struct bfd_section *),
  800. void (*) (void));
  801. extern bfd_boolean elf64_aarch64_build_stubs
  802. (struct bfd_link_info *);
  803. /* AArch64 stub generation support for ELF32. Called from the linker. */
  804. extern int elf32_aarch64_setup_section_lists
  805. (bfd *, struct bfd_link_info *);
  806. extern void elf32_aarch64_next_input_section
  807. (struct bfd_link_info *, struct bfd_section *);
  808. extern bfd_boolean elf32_aarch64_size_stubs
  809. (bfd *, bfd *, struct bfd_link_info *, bfd_signed_vma,
  810. struct bfd_section * (*) (const char *, struct bfd_section *),
  811. void (*) (void));
  812. extern bfd_boolean elf32_aarch64_build_stubs
  813. (struct bfd_link_info *);
  814. /* TI COFF load page support. */
  815. extern void bfd_ticoff_set_section_load_page
  816. (struct bfd_section *, int);
  817. extern int bfd_ticoff_get_section_load_page
  818. (struct bfd_section *);
  819. /* H8/300 functions. */
  820. extern bfd_vma bfd_h8300_pad_address
  821. (bfd *, bfd_vma);
  822. /* IA64 Itanium code generation. Called from linker. */
  823. extern void bfd_elf32_ia64_after_parse
  824. (int);
  825. extern void bfd_elf64_ia64_after_parse
  826. (int);
  827. /* V850 Note manipulation routines. */
  828. extern bfd_boolean v850_elf_create_sections
  829. (struct bfd_link_info *);
  830. extern bfd_boolean v850_elf_set_note
  831. (bfd *, unsigned int, unsigned int);
  832. /* Extracted from init.c. */
  833. void bfd_init (void);
  834. /* Extracted from opncls.c. */
  835. /* Set to N to open the next N BFDs using an alternate id space. */
  836. extern unsigned int bfd_use_reserved_id;
  837. bfd *bfd_fopen (const char *filename, const char *target,
  838. const char *mode, int fd);
  839. bfd *bfd_openr (const char *filename, const char *target);
  840. bfd *bfd_fdopenr (const char *filename, const char *target, int fd);
  841. bfd *bfd_openstreamr (const char * filename, const char * target, void * stream);
  842. bfd *bfd_openr_iovec (const char *filename, const char *target,
  843. void *(*open_func) (struct bfd *nbfd,
  844. void *open_closure),
  845. void *open_closure,
  846. file_ptr (*pread_func) (struct bfd *nbfd,
  847. void *stream,
  848. void *buf,
  849. file_ptr nbytes,
  850. file_ptr offset),
  851. int (*close_func) (struct bfd *nbfd,
  852. void *stream),
  853. int (*stat_func) (struct bfd *abfd,
  854. void *stream,
  855. struct stat *sb));
  856. bfd *bfd_openw (const char *filename, const char *target);
  857. bfd_boolean bfd_close (bfd *abfd);
  858. bfd_boolean bfd_close_all_done (bfd *);
  859. bfd *bfd_create (const char *filename, bfd *templ);
  860. bfd_boolean bfd_make_writable (bfd *abfd);
  861. bfd_boolean bfd_make_readable (bfd *abfd);
  862. void *bfd_alloc (bfd *abfd, bfd_size_type wanted);
  863. void *bfd_zalloc (bfd *abfd, bfd_size_type wanted);
  864. unsigned long bfd_calc_gnu_debuglink_crc32
  865. (unsigned long crc, const unsigned char *buf, bfd_size_type len);
  866. char *bfd_get_debug_link_info (bfd *abfd, unsigned long *crc32_out);
  867. char *bfd_get_alt_debug_link_info (bfd * abfd,
  868. bfd_size_type *buildid_len,
  869. bfd_byte **buildid_out);
  870. char *bfd_follow_gnu_debuglink (bfd *abfd, const char *dir);
  871. char *bfd_follow_gnu_debugaltlink (bfd *abfd, const char *dir);
  872. struct bfd_section *bfd_create_gnu_debuglink_section
  873. (bfd *abfd, const char *filename);
  874. bfd_boolean bfd_fill_in_gnu_debuglink_section
  875. (bfd *abfd, struct bfd_section *sect, const char *filename);
  876. /* Extracted from libbfd.c. */
  877. /* Byte swapping macros for user section data. */
  878. #define bfd_put_8(abfd, val, ptr) \
  879. ((void) (*((unsigned char *) (ptr)) = (val) & 0xff))
  880. #define bfd_put_signed_8 \
  881. bfd_put_8
  882. #define bfd_get_8(abfd, ptr) \
  883. (*(const unsigned char *) (ptr) & 0xff)
  884. #define bfd_get_signed_8(abfd, ptr) \
  885. (((*(const unsigned char *) (ptr) & 0xff) ^ 0x80) - 0x80)
  886. #define bfd_put_16(abfd, val, ptr) \
  887. BFD_SEND (abfd, bfd_putx16, ((val),(ptr)))
  888. #define bfd_put_signed_16 \
  889. bfd_put_16
  890. #define bfd_get_16(abfd, ptr) \
  891. BFD_SEND (abfd, bfd_getx16, (ptr))
  892. #define bfd_get_signed_16(abfd, ptr) \
  893. BFD_SEND (abfd, bfd_getx_signed_16, (ptr))
  894. #define bfd_put_32(abfd, val, ptr) \
  895. BFD_SEND (abfd, bfd_putx32, ((val),(ptr)))
  896. #define bfd_put_signed_32 \
  897. bfd_put_32
  898. #define bfd_get_32(abfd, ptr) \
  899. BFD_SEND (abfd, bfd_getx32, (ptr))
  900. #define bfd_get_signed_32(abfd, ptr) \
  901. BFD_SEND (abfd, bfd_getx_signed_32, (ptr))
  902. #define bfd_put_64(abfd, val, ptr) \
  903. BFD_SEND (abfd, bfd_putx64, ((val), (ptr)))
  904. #define bfd_put_signed_64 \
  905. bfd_put_64
  906. #define bfd_get_64(abfd, ptr) \
  907. BFD_SEND (abfd, bfd_getx64, (ptr))
  908. #define bfd_get_signed_64(abfd, ptr) \
  909. BFD_SEND (abfd, bfd_getx_signed_64, (ptr))
  910. #define bfd_get(bits, abfd, ptr) \
  911. ((bits) == 8 ? (bfd_vma) bfd_get_8 (abfd, ptr) \
  912. : (bits) == 16 ? bfd_get_16 (abfd, ptr) \
  913. : (bits) == 32 ? bfd_get_32 (abfd, ptr) \
  914. : (bits) == 64 ? bfd_get_64 (abfd, ptr) \
  915. : (abort (), (bfd_vma) - 1))
  916. #define bfd_put(bits, abfd, val, ptr) \
  917. ((bits) == 8 ? bfd_put_8 (abfd, val, ptr) \
  918. : (bits) == 16 ? bfd_put_16 (abfd, val, ptr) \
  919. : (bits) == 32 ? bfd_put_32 (abfd, val, ptr) \
  920. : (bits) == 64 ? bfd_put_64 (abfd, val, ptr) \
  921. : (abort (), (void) 0))
  922. /* Byte swapping macros for file header data. */
  923. #define bfd_h_put_8(abfd, val, ptr) \
  924. bfd_put_8 (abfd, val, ptr)
  925. #define bfd_h_put_signed_8(abfd, val, ptr) \
  926. bfd_put_8 (abfd, val, ptr)
  927. #define bfd_h_get_8(abfd, ptr) \
  928. bfd_get_8 (abfd, ptr)
  929. #define bfd_h_get_signed_8(abfd, ptr) \
  930. bfd_get_signed_8 (abfd, ptr)
  931. #define bfd_h_put_16(abfd, val, ptr) \
  932. BFD_SEND (abfd, bfd_h_putx16, (val, ptr))
  933. #define bfd_h_put_signed_16 \
  934. bfd_h_put_16
  935. #define bfd_h_get_16(abfd, ptr) \
  936. BFD_SEND (abfd, bfd_h_getx16, (ptr))
  937. #define bfd_h_get_signed_16(abfd, ptr) \
  938. BFD_SEND (abfd, bfd_h_getx_signed_16, (ptr))
  939. #define bfd_h_put_32(abfd, val, ptr) \
  940. BFD_SEND (abfd, bfd_h_putx32, (val, ptr))
  941. #define bfd_h_put_signed_32 \
  942. bfd_h_put_32
  943. #define bfd_h_get_32(abfd, ptr) \
  944. BFD_SEND (abfd, bfd_h_getx32, (ptr))
  945. #define bfd_h_get_signed_32(abfd, ptr) \
  946. BFD_SEND (abfd, bfd_h_getx_signed_32, (ptr))
  947. #define bfd_h_put_64(abfd, val, ptr) \
  948. BFD_SEND (abfd, bfd_h_putx64, (val, ptr))
  949. #define bfd_h_put_signed_64 \
  950. bfd_h_put_64
  951. #define bfd_h_get_64(abfd, ptr) \
  952. BFD_SEND (abfd, bfd_h_getx64, (ptr))
  953. #define bfd_h_get_signed_64(abfd, ptr) \
  954. BFD_SEND (abfd, bfd_h_getx_signed_64, (ptr))
  955. /* Aliases for the above, which should eventually go away. */
  956. #define H_PUT_64 bfd_h_put_64
  957. #define H_PUT_32 bfd_h_put_32
  958. #define H_PUT_16 bfd_h_put_16
  959. #define H_PUT_8 bfd_h_put_8
  960. #define H_PUT_S64 bfd_h_put_signed_64
  961. #define H_PUT_S32 bfd_h_put_signed_32
  962. #define H_PUT_S16 bfd_h_put_signed_16
  963. #define H_PUT_S8 bfd_h_put_signed_8
  964. #define H_GET_64 bfd_h_get_64
  965. #define H_GET_32 bfd_h_get_32
  966. #define H_GET_16 bfd_h_get_16
  967. #define H_GET_8 bfd_h_get_8
  968. #define H_GET_S64 bfd_h_get_signed_64
  969. #define H_GET_S32 bfd_h_get_signed_32
  970. #define H_GET_S16 bfd_h_get_signed_16
  971. #define H_GET_S8 bfd_h_get_signed_8
  972. /* Extracted from bfdio.c. */
  973. long bfd_get_mtime (bfd *abfd);
  974. file_ptr bfd_get_size (bfd *abfd);
  975. void *bfd_mmap (bfd *abfd, void *addr, bfd_size_type len,
  976. int prot, int flags, file_ptr offset,
  977. void **map_addr, bfd_size_type *map_len);
  978. /* Extracted from bfdwin.c. */
  979. /* Extracted from section.c. */
  980. typedef struct bfd_section
  981. {
  982. /* The name of the section; the name isn't a copy, the pointer is
  983. the same as that passed to bfd_make_section. */
  984. const char *name;
  985. /* A unique sequence number. */
  986. unsigned int id;
  987. /* Which section in the bfd; 0..n-1 as sections are created in a bfd. */
  988. unsigned int index;
  989. /* The next section in the list belonging to the BFD, or NULL. */
  990. struct bfd_section *next;
  991. /* The previous section in the list belonging to the BFD, or NULL. */
  992. struct bfd_section *prev;
  993. /* The field flags contains attributes of the section. Some
  994. flags are read in from the object file, and some are
  995. synthesized from other information. */
  996. flagword flags;
  997. #define SEC_NO_FLAGS 0x000
  998. /* Tells the OS to allocate space for this section when loading.
  999. This is clear for a section containing debug information only. */
  1000. #define SEC_ALLOC 0x001
  1001. /* Tells the OS to load the section from the file when loading.
  1002. This is clear for a .bss section. */
  1003. #define SEC_LOAD 0x002
  1004. /* The section contains data still to be relocated, so there is
  1005. some relocation information too. */
  1006. #define SEC_RELOC 0x004
  1007. /* A signal to the OS that the section contains read only data. */
  1008. #define SEC_READONLY 0x008
  1009. /* The section contains code only. */
  1010. #define SEC_CODE 0x010
  1011. /* The section contains data only. */
  1012. #define SEC_DATA 0x020
  1013. /* The section will reside in ROM. */
  1014. #define SEC_ROM 0x040
  1015. /* The section contains constructor information. This section
  1016. type is used by the linker to create lists of constructors and
  1017. destructors used by <<g++>>. When a back end sees a symbol
  1018. which should be used in a constructor list, it creates a new
  1019. section for the type of name (e.g., <<__CTOR_LIST__>>), attaches
  1020. the symbol to it, and builds a relocation. To build the lists
  1021. of constructors, all the linker has to do is catenate all the
  1022. sections called <<__CTOR_LIST__>> and relocate the data
  1023. contained within - exactly the operations it would peform on
  1024. standard data. */
  1025. #define SEC_CONSTRUCTOR 0x080
  1026. /* The section has contents - a data section could be
  1027. <<SEC_ALLOC>> | <<SEC_HAS_CONTENTS>>; a debug section could be
  1028. <<SEC_HAS_CONTENTS>> */
  1029. #define SEC_HAS_CONTENTS 0x100
  1030. /* An instruction to the linker to not output the section
  1031. even if it has information which would normally be written. */
  1032. #define SEC_NEVER_LOAD 0x200
  1033. /* The section contains thread local data. */
  1034. #define SEC_THREAD_LOCAL 0x400
  1035. /* The section has GOT references. This flag is only for the
  1036. linker, and is currently only used by the elf32-hppa back end.
  1037. It will be set if global offset table references were detected
  1038. in this section, which indicate to the linker that the section
  1039. contains PIC code, and must be handled specially when doing a
  1040. static link. */
  1041. #define SEC_HAS_GOT_REF 0x800
  1042. /* The section contains common symbols (symbols may be defined
  1043. multiple times, the value of a symbol is the amount of
  1044. space it requires, and the largest symbol value is the one
  1045. used). Most targets have exactly one of these (which we
  1046. translate to bfd_com_section_ptr), but ECOFF has two. */
  1047. #define SEC_IS_COMMON 0x1000
  1048. /* The section contains only debugging information. For
  1049. example, this is set for ELF .debug and .stab sections.
  1050. strip tests this flag to see if a section can be
  1051. discarded. */
  1052. #define SEC_DEBUGGING 0x2000
  1053. /* The contents of this section are held in memory pointed to
  1054. by the contents field. This is checked by bfd_get_section_contents,
  1055. and the data is retrieved from memory if appropriate. */
  1056. #define SEC_IN_MEMORY 0x4000
  1057. /* The contents of this section are to be excluded by the
  1058. linker for executable and shared objects unless those
  1059. objects are to be further relocated. */
  1060. #define SEC_EXCLUDE 0x8000
  1061. /* The contents of this section are to be sorted based on the sum of
  1062. the symbol and addend values specified by the associated relocation
  1063. entries. Entries without associated relocation entries will be
  1064. appended to the end of the section in an unspecified order. */
  1065. #define SEC_SORT_ENTRIES 0x10000
  1066. /* When linking, duplicate sections of the same name should be
  1067. discarded, rather than being combined into a single section as
  1068. is usually done. This is similar to how common symbols are
  1069. handled. See SEC_LINK_DUPLICATES below. */
  1070. #define SEC_LINK_ONCE 0x20000
  1071. /* If SEC_LINK_ONCE is set, this bitfield describes how the linker
  1072. should handle duplicate sections. */
  1073. #define SEC_LINK_DUPLICATES 0xc0000
  1074. /* This value for SEC_LINK_DUPLICATES means that duplicate
  1075. sections with the same name should simply be discarded. */
  1076. #define SEC_LINK_DUPLICATES_DISCARD 0x0
  1077. /* This value for SEC_LINK_DUPLICATES means that the linker
  1078. should warn if there are any duplicate sections, although
  1079. it should still only link one copy. */
  1080. #define SEC_LINK_DUPLICATES_ONE_ONLY 0x40000
  1081. /* This value for SEC_LINK_DUPLICATES means that the linker
  1082. should warn if any duplicate sections are a different size. */
  1083. #define SEC_LINK_DUPLICATES_SAME_SIZE 0x80000
  1084. /* This value for SEC_LINK_DUPLICATES means that the linker
  1085. should warn if any duplicate sections contain different
  1086. contents. */
  1087. #define SEC_LINK_DUPLICATES_SAME_CONTENTS \
  1088. (SEC_LINK_DUPLICATES_ONE_ONLY | SEC_LINK_DUPLICATES_SAME_SIZE)
  1089. /* This section was created by the linker as part of dynamic
  1090. relocation or other arcane processing. It is skipped when
  1091. going through the first-pass output, trusting that someone
  1092. else up the line will take care of it later. */
  1093. #define SEC_LINKER_CREATED 0x100000
  1094. /* This section should not be subject to garbage collection.
  1095. Also set to inform the linker that this section should not be
  1096. listed in the link map as discarded. */
  1097. #define SEC_KEEP 0x200000
  1098. /* This section contains "short" data, and should be placed
  1099. "near" the GP. */
  1100. #define SEC_SMALL_DATA 0x400000
  1101. /* Attempt to merge identical entities in the section.
  1102. Entity size is given in the entsize field. */
  1103. #define SEC_MERGE 0x800000
  1104. /* If given with SEC_MERGE, entities to merge are zero terminated
  1105. strings where entsize specifies character size instead of fixed
  1106. size entries. */
  1107. #define SEC_STRINGS 0x1000000
  1108. /* This section contains data about section groups. */
  1109. #define SEC_GROUP 0x2000000
  1110. /* The section is a COFF shared library section. This flag is
  1111. only for the linker. If this type of section appears in
  1112. the input file, the linker must copy it to the output file
  1113. without changing the vma or size. FIXME: Although this
  1114. was originally intended to be general, it really is COFF
  1115. specific (and the flag was renamed to indicate this). It
  1116. might be cleaner to have some more general mechanism to
  1117. allow the back end to control what the linker does with
  1118. sections. */
  1119. #define SEC_COFF_SHARED_LIBRARY 0x4000000
  1120. /* This input section should be copied to output in reverse order
  1121. as an array of pointers. This is for ELF linker internal use
  1122. only. */
  1123. #define SEC_ELF_REVERSE_COPY 0x4000000
  1124. /* This section contains data which may be shared with other
  1125. executables or shared objects. This is for COFF only. */
  1126. #define SEC_COFF_SHARED 0x8000000
  1127. /* This section should be compressed. This is for ELF linker
  1128. internal use only. */
  1129. #define SEC_ELF_COMPRESS 0x8000000
  1130. /* When a section with this flag is being linked, then if the size of
  1131. the input section is less than a page, it should not cross a page
  1132. boundary. If the size of the input section is one page or more,
  1133. it should be aligned on a page boundary. This is for TI
  1134. TMS320C54X only. */
  1135. #define SEC_TIC54X_BLOCK 0x10000000
  1136. /* This section should be renamed. This is for ELF linker
  1137. internal use only. */
  1138. #define SEC_ELF_RENAME 0x10000000
  1139. /* Conditionally link this section; do not link if there are no
  1140. references found to any symbol in the section. This is for TI
  1141. TMS320C54X only. */
  1142. #define SEC_TIC54X_CLINK 0x20000000
  1143. /* This section contains vliw code. This is for Toshiba MeP only. */
  1144. #define SEC_MEP_VLIW 0x20000000
  1145. /* Indicate that section has the no read flag set. This happens
  1146. when memory read flag isn't set. */
  1147. #define SEC_COFF_NOREAD 0x40000000
  1148. /* End of section flags. */
  1149. /* Some internal packed boolean fields. */
  1150. /* See the vma field. */
  1151. unsigned int user_set_vma : 1;
  1152. /* A mark flag used by some of the linker backends. */
  1153. unsigned int linker_mark : 1;
  1154. /* Another mark flag used by some of the linker backends. Set for
  1155. output sections that have an input section. */
  1156. unsigned int linker_has_input : 1;
  1157. /* Mark flag used by some linker backends for garbage collection. */
  1158. unsigned int gc_mark : 1;
  1159. /* Section compression status. */
  1160. unsigned int compress_status : 2;
  1161. #define COMPRESS_SECTION_NONE 0
  1162. #define COMPRESS_SECTION_DONE 1
  1163. #define DECOMPRESS_SECTION_SIZED 2
  1164. /* The following flags are used by the ELF linker. */
  1165. /* Mark sections which have been allocated to segments. */
  1166. unsigned int segment_mark : 1;
  1167. /* Type of sec_info information. */
  1168. unsigned int sec_info_type:3;
  1169. #define SEC_INFO_TYPE_NONE 0
  1170. #define SEC_INFO_TYPE_STABS 1
  1171. #define SEC_INFO_TYPE_MERGE 2
  1172. #define SEC_INFO_TYPE_EH_FRAME 3
  1173. #define SEC_INFO_TYPE_JUST_SYMS 4
  1174. #define SEC_INFO_TYPE_TARGET 5
  1175. #define SEC_INFO_TYPE_EH_FRAME_ENTRY 6
  1176. /* Nonzero if this section uses RELA relocations, rather than REL. */
  1177. unsigned int use_rela_p:1;
  1178. /* Bits used by various backends. The generic code doesn't touch
  1179. these fields. */
  1180. unsigned int sec_flg0:1;
  1181. unsigned int sec_flg1:1;
  1182. unsigned int sec_flg2:1;
  1183. unsigned int sec_flg3:1;
  1184. unsigned int sec_flg4:1;
  1185. unsigned int sec_flg5:1;
  1186. /* End of internal packed boolean fields. */
  1187. /* The virtual memory address of the section - where it will be
  1188. at run time. The symbols are relocated against this. The
  1189. user_set_vma flag is maintained by bfd; if it's not set, the
  1190. backend can assign addresses (for example, in <<a.out>>, where
  1191. the default address for <<.data>> is dependent on the specific
  1192. target and various flags). */
  1193. bfd_vma vma;
  1194. /* The load address of the section - where it would be in a
  1195. rom image; really only used for writing section header
  1196. information. */
  1197. bfd_vma lma;
  1198. /* The size of the section in octets, as it will be output.
  1199. Contains a value even if the section has no contents (e.g., the
  1200. size of <<.bss>>). */
  1201. bfd_size_type size;
  1202. /* For input sections, the original size on disk of the section, in
  1203. octets. This field should be set for any section whose size is
  1204. changed by linker relaxation. It is required for sections where
  1205. the linker relaxation scheme doesn't cache altered section and
  1206. reloc contents (stabs, eh_frame, SEC_MERGE, some coff relaxing
  1207. targets), and thus the original size needs to be kept to read the
  1208. section multiple times. For output sections, rawsize holds the
  1209. section size calculated on a previous linker relaxation pass. */
  1210. bfd_size_type rawsize;
  1211. /* The compressed size of the section in octets. */
  1212. bfd_size_type compressed_size;
  1213. /* Relaxation table. */
  1214. struct relax_table *relax;
  1215. /* Count of used relaxation table entries. */
  1216. int relax_count;
  1217. /* If this section is going to be output, then this value is the
  1218. offset in *bytes* into the output section of the first byte in the
  1219. input section (byte ==> smallest addressable unit on the
  1220. target). In most cases, if this was going to start at the
  1221. 100th octet (8-bit quantity) in the output section, this value
  1222. would be 100. However, if the target byte size is 16 bits
  1223. (bfd_octets_per_byte is "2"), this value would be 50. */
  1224. bfd_vma output_offset;
  1225. /* The output section through which to map on output. */
  1226. struct bfd_section *output_section;
  1227. /* The alignment requirement of the section, as an exponent of 2 -
  1228. e.g., 3 aligns to 2^3 (or 8). */
  1229. unsigned int alignment_power;
  1230. /* If an input section, a pointer to a vector of relocation
  1231. records for the data in this section. */
  1232. struct reloc_cache_entry *relocation;
  1233. /* If an output section, a pointer to a vector of pointers to
  1234. relocation records for the data in this section. */
  1235. struct reloc_cache_entry **orelocation;
  1236. /* The number of relocation records in one of the above. */
  1237. unsigned reloc_count;
  1238. /* Information below is back end specific - and not always used
  1239. or updated. */
  1240. /* File position of section data. */
  1241. file_ptr filepos;
  1242. /* File position of relocation info. */
  1243. file_ptr rel_filepos;
  1244. /* File position of line data. */
  1245. file_ptr line_filepos;
  1246. /* Pointer to data for applications. */
  1247. void *userdata;
  1248. /* If the SEC_IN_MEMORY flag is set, this points to the actual
  1249. contents. */
  1250. unsigned char *contents;
  1251. /* Attached line number information. */
  1252. alent *lineno;
  1253. /* Number of line number records. */
  1254. unsigned int lineno_count;
  1255. /* Entity size for merging purposes. */
  1256. unsigned int entsize;
  1257. /* Points to the kept section if this section is a link-once section,
  1258. and is discarded. */
  1259. struct bfd_section *kept_section;
  1260. /* When a section is being output, this value changes as more
  1261. linenumbers are written out. */
  1262. file_ptr moving_line_filepos;
  1263. /* What the section number is in the target world. */
  1264. int target_index;
  1265. void *used_by_bfd;
  1266. /* If this is a constructor section then here is a list of the
  1267. relocations created to relocate items within it. */
  1268. struct relent_chain *constructor_chain;
  1269. /* The BFD which owns the section. */
  1270. bfd *owner;
  1271. /* A symbol which points at this section only. */
  1272. struct bfd_symbol *symbol;
  1273. struct bfd_symbol **symbol_ptr_ptr;
  1274. /* Early in the link process, map_head and map_tail are used to build
  1275. a list of input sections attached to an output section. Later,
  1276. output sections use these fields for a list of bfd_link_order
  1277. structs. */
  1278. union {
  1279. struct bfd_link_order *link_order;
  1280. struct bfd_section *s;
  1281. } map_head, map_tail;
  1282. } asection;
  1283. /* Relax table contains information about instructions which can
  1284. be removed by relaxation -- replacing a long address with a
  1285. short address. */
  1286. struct relax_table {
  1287. /* Address where bytes may be deleted. */
  1288. bfd_vma addr;
  1289. /* Number of bytes to be deleted. */
  1290. int size;
  1291. };
  1292. /* Note: the following are provided as inline functions rather than macros
  1293. because not all callers use the return value. A macro implementation
  1294. would use a comma expression, eg: "((ptr)->foo = val, TRUE)" and some
  1295. compilers will complain about comma expressions that have no effect. */
  1296. static inline bfd_boolean
  1297. bfd_set_section_userdata (bfd * abfd ATTRIBUTE_UNUSED, asection * ptr, void * val)
  1298. {
  1299. ptr->userdata = val;
  1300. return TRUE;
  1301. }
  1302. static inline bfd_boolean
  1303. bfd_set_section_vma (bfd * abfd ATTRIBUTE_UNUSED, asection * ptr, bfd_vma val)
  1304. {
  1305. ptr->vma = ptr->lma = val;
  1306. ptr->user_set_vma = TRUE;
  1307. return TRUE;
  1308. }
  1309. static inline bfd_boolean
  1310. bfd_set_section_alignment (bfd * abfd ATTRIBUTE_UNUSED, asection * ptr, unsigned int val)
  1311. {
  1312. ptr->alignment_power = val;
  1313. return TRUE;
  1314. }
  1315. /* These sections are global, and are managed by BFD. The application
  1316. and target back end are not permitted to change the values in
  1317. these sections. */
  1318. extern asection _bfd_std_section[4];
  1319. #define BFD_ABS_SECTION_NAME "*ABS*"
  1320. #define BFD_UND_SECTION_NAME "*UND*"
  1321. #define BFD_COM_SECTION_NAME "*COM*"
  1322. #define BFD_IND_SECTION_NAME "*IND*"
  1323. /* Pointer to the common section. */
  1324. #define bfd_com_section_ptr (&_bfd_std_section[0])
  1325. /* Pointer to the undefined section. */
  1326. #define bfd_und_section_ptr (&_bfd_std_section[1])
  1327. /* Pointer to the absolute section. */
  1328. #define bfd_abs_section_ptr (&_bfd_std_section[2])
  1329. /* Pointer to the indirect section. */
  1330. #define bfd_ind_section_ptr (&_bfd_std_section[3])
  1331. #define bfd_is_und_section(sec) ((sec) == bfd_und_section_ptr)
  1332. #define bfd_is_abs_section(sec) ((sec) == bfd_abs_section_ptr)
  1333. #define bfd_is_ind_section(sec) ((sec) == bfd_ind_section_ptr)
  1334. #define bfd_is_const_section(SEC) \
  1335. ( ((SEC) == bfd_abs_section_ptr) \
  1336. || ((SEC) == bfd_und_section_ptr) \
  1337. || ((SEC) == bfd_com_section_ptr) \
  1338. || ((SEC) == bfd_ind_section_ptr))
  1339. /* Macros to handle insertion and deletion of a bfd's sections. These
  1340. only handle the list pointers, ie. do not adjust section_count,
  1341. target_index etc. */
  1342. #define bfd_section_list_remove(ABFD, S) \
  1343. do \
  1344. { \
  1345. asection *_s = S; \
  1346. asection *_next = _s->next; \
  1347. asection *_prev = _s->prev; \
  1348. if (_prev) \
  1349. _prev->next = _next; \
  1350. else \
  1351. (ABFD)->sections = _next; \
  1352. if (_next) \
  1353. _next->prev = _prev; \
  1354. else \
  1355. (ABFD)->section_last = _prev; \
  1356. } \
  1357. while (0)
  1358. #define bfd_section_list_append(ABFD, S) \
  1359. do \
  1360. { \
  1361. asection *_s = S; \
  1362. bfd *_abfd = ABFD; \
  1363. _s->next = NULL; \
  1364. if (_abfd->section_last) \
  1365. { \
  1366. _s->prev = _abfd->section_last; \
  1367. _abfd->section_last->next = _s; \
  1368. } \
  1369. else \
  1370. { \
  1371. _s->prev = NULL; \
  1372. _abfd->sections = _s; \
  1373. } \
  1374. _abfd->section_last = _s; \
  1375. } \
  1376. while (0)
  1377. #define bfd_section_list_prepend(ABFD, S) \
  1378. do \
  1379. { \
  1380. asection *_s = S; \
  1381. bfd *_abfd = ABFD; \
  1382. _s->prev = NULL; \
  1383. if (_abfd->sections) \
  1384. { \
  1385. _s->next = _abfd->sections; \
  1386. _abfd->sections->prev = _s; \
  1387. } \
  1388. else \
  1389. { \
  1390. _s->next = NULL; \
  1391. _abfd->section_last = _s; \
  1392. } \
  1393. _abfd->sections = _s; \
  1394. } \
  1395. while (0)
  1396. #define bfd_section_list_insert_after(ABFD, A, S) \
  1397. do \
  1398. { \
  1399. asection *_a = A; \
  1400. asection *_s = S; \
  1401. asection *_next = _a->next; \
  1402. _s->next = _next; \
  1403. _s->prev = _a; \
  1404. _a->next = _s; \
  1405. if (_next) \
  1406. _next->prev = _s; \
  1407. else \
  1408. (ABFD)->section_last = _s; \
  1409. } \
  1410. while (0)
  1411. #define bfd_section_list_insert_before(ABFD, B, S) \
  1412. do \
  1413. { \
  1414. asection *_b = B; \
  1415. asection *_s = S; \
  1416. asection *_prev = _b->prev; \
  1417. _s->prev = _prev; \
  1418. _s->next = _b; \
  1419. _b->prev = _s; \
  1420. if (_prev) \
  1421. _prev->next = _s; \
  1422. else \
  1423. (ABFD)->sections = _s; \
  1424. } \
  1425. while (0)
  1426. #define bfd_section_removed_from_list(ABFD, S) \
  1427. ((S)->next == NULL ? (ABFD)->section_last != (S) : (S)->next->prev != (S))
  1428. #define BFD_FAKE_SECTION(SEC, FLAGS, SYM, NAME, IDX) \
  1429. /* name, id, index, next, prev, flags, user_set_vma, */ \
  1430. { NAME, IDX, 0, NULL, NULL, FLAGS, 0, \
  1431. \
  1432. /* linker_mark, linker_has_input, gc_mark, decompress_status, */ \
  1433. 0, 0, 1, 0, \
  1434. \
  1435. /* segment_mark, sec_info_type, use_rela_p, */ \
  1436. 0, 0, 0, \
  1437. \
  1438. /* sec_flg0, sec_flg1, sec_flg2, sec_flg3, sec_flg4, sec_flg5, */ \
  1439. 0, 0, 0, 0, 0, 0, \
  1440. \
  1441. /* vma, lma, size, rawsize, compressed_size, relax, relax_count, */ \
  1442. 0, 0, 0, 0, 0, 0, 0, \
  1443. \
  1444. /* output_offset, output_section, alignment_power, */ \
  1445. 0, &SEC, 0, \
  1446. \
  1447. /* relocation, orelocation, reloc_count, filepos, rel_filepos, */ \
  1448. NULL, NULL, 0, 0, 0, \
  1449. \
  1450. /* line_filepos, userdata, contents, lineno, lineno_count, */ \
  1451. 0, NULL, NULL, NULL, 0, \
  1452. \
  1453. /* entsize, kept_section, moving_line_filepos, */ \
  1454. 0, NULL, 0, \
  1455. \
  1456. /* target_index, used_by_bfd, constructor_chain, owner, */ \
  1457. 0, NULL, NULL, NULL, \
  1458. \
  1459. /* symbol, symbol_ptr_ptr, */ \
  1460. (struct bfd_symbol *) SYM, &SEC.symbol, \
  1461. \
  1462. /* map_head, map_tail */ \
  1463. { NULL }, { NULL } \
  1464. }
  1465. void bfd_section_list_clear (bfd *);
  1466. asection *bfd_get_section_by_name (bfd *abfd, const char *name);
  1467. asection *bfd_get_next_section_by_name (asection *sec);
  1468. asection *bfd_get_linker_section (bfd *abfd, const char *name);
  1469. asection *bfd_get_section_by_name_if
  1470. (bfd *abfd,
  1471. const char *name,
  1472. bfd_boolean (*func) (bfd *abfd, asection *sect, void *obj),
  1473. void *obj);
  1474. char *bfd_get_unique_section_name
  1475. (bfd *abfd, const char *templat, int *count);
  1476. asection *bfd_make_section_old_way (bfd *abfd, const char *name);
  1477. asection *bfd_make_section_anyway_with_flags
  1478. (bfd *abfd, const char *name, flagword flags);
  1479. asection *bfd_make_section_anyway (bfd *abfd, const char *name);
  1480. asection *bfd_make_section_with_flags
  1481. (bfd *, const char *name, flagword flags);
  1482. asection *bfd_make_section (bfd *, const char *name);
  1483. int bfd_get_next_section_id (void);
  1484. bfd_boolean bfd_set_section_flags
  1485. (bfd *abfd, asection *sec, flagword flags);
  1486. void bfd_rename_section
  1487. (bfd *abfd, asection *sec, const char *newname);
  1488. void bfd_map_over_sections
  1489. (bfd *abfd,
  1490. void (*func) (bfd *abfd, asection *sect, void *obj),
  1491. void *obj);
  1492. asection *bfd_sections_find_if
  1493. (bfd *abfd,
  1494. bfd_boolean (*operation) (bfd *abfd, asection *sect, void *obj),
  1495. void *obj);
  1496. bfd_boolean bfd_set_section_size
  1497. (bfd *abfd, asection *sec, bfd_size_type val);
  1498. bfd_boolean bfd_set_section_contents
  1499. (bfd *abfd, asection *section, const void *data,
  1500. file_ptr offset, bfd_size_type count);
  1501. bfd_boolean bfd_get_section_contents
  1502. (bfd *abfd, asection *section, void *location, file_ptr offset,
  1503. bfd_size_type count);
  1504. bfd_boolean bfd_malloc_and_get_section
  1505. (bfd *abfd, asection *section, bfd_byte **buf);
  1506. bfd_boolean bfd_copy_private_section_data
  1507. (bfd *ibfd, asection *isec, bfd *obfd, asection *osec);
  1508. #define bfd_copy_private_section_data(ibfd, isection, obfd, osection) \
  1509. BFD_SEND (obfd, _bfd_copy_private_section_data, \
  1510. (ibfd, isection, obfd, osection))
  1511. bfd_boolean bfd_generic_is_group_section (bfd *, const asection *sec);
  1512. bfd_boolean bfd_generic_discard_group (bfd *abfd, asection *group);
  1513. /* Extracted from archures.c. */
  1514. enum bfd_architecture
  1515. {
  1516. bfd_arch_unknown, /* File arch not known. */
  1517. bfd_arch_obscure, /* Arch known, not one of these. */
  1518. bfd_arch_m68k, /* Motorola 68xxx */
  1519. #define bfd_mach_m68000 1
  1520. #define bfd_mach_m68008 2
  1521. #define bfd_mach_m68010 3
  1522. #define bfd_mach_m68020 4
  1523. #define bfd_mach_m68030 5
  1524. #define bfd_mach_m68040 6
  1525. #define bfd_mach_m68060 7
  1526. #define bfd_mach_cpu32 8
  1527. #define bfd_mach_fido 9
  1528. #define bfd_mach_mcf_isa_a_nodiv 10
  1529. #define bfd_mach_mcf_isa_a 11
  1530. #define bfd_mach_mcf_isa_a_mac 12
  1531. #define bfd_mach_mcf_isa_a_emac 13
  1532. #define bfd_mach_mcf_isa_aplus 14
  1533. #define bfd_mach_mcf_isa_aplus_mac 15
  1534. #define bfd_mach_mcf_isa_aplus_emac 16
  1535. #define bfd_mach_mcf_isa_b_nousp 17
  1536. #define bfd_mach_mcf_isa_b_nousp_mac 18
  1537. #define bfd_mach_mcf_isa_b_nousp_emac 19
  1538. #define bfd_mach_mcf_isa_b 20
  1539. #define bfd_mach_mcf_isa_b_mac 21
  1540. #define bfd_mach_mcf_isa_b_emac 22
  1541. #define bfd_mach_mcf_isa_b_float 23
  1542. #define bfd_mach_mcf_isa_b_float_mac 24
  1543. #define bfd_mach_mcf_isa_b_float_emac 25
  1544. #define bfd_mach_mcf_isa_c 26
  1545. #define bfd_mach_mcf_isa_c_mac 27
  1546. #define bfd_mach_mcf_isa_c_emac 28
  1547. #define bfd_mach_mcf_isa_c_nodiv 29
  1548. #define bfd_mach_mcf_isa_c_nodiv_mac 30
  1549. #define bfd_mach_mcf_isa_c_nodiv_emac 31
  1550. bfd_arch_vax, /* DEC Vax */
  1551. bfd_arch_i960, /* Intel 960 */
  1552. /* The order of the following is important.
  1553. lower number indicates a machine type that
  1554. only accepts a subset of the instructions
  1555. available to machines with higher numbers.
  1556. The exception is the "ca", which is
  1557. incompatible with all other machines except
  1558. "core". */
  1559. #define bfd_mach_i960_core 1
  1560. #define bfd_mach_i960_ka_sa 2
  1561. #define bfd_mach_i960_kb_sb 3
  1562. #define bfd_mach_i960_mc 4
  1563. #define bfd_mach_i960_xa 5
  1564. #define bfd_mach_i960_ca 6
  1565. #define bfd_mach_i960_jx 7
  1566. #define bfd_mach_i960_hx 8
  1567. bfd_arch_or1k, /* OpenRISC 1000 */
  1568. #define bfd_mach_or1k 1
  1569. #define bfd_mach_or1knd 2
  1570. bfd_arch_sparc, /* SPARC */
  1571. #define bfd_mach_sparc 1
  1572. /* The difference between v8plus and v9 is that v9 is a true 64 bit env. */
  1573. #define bfd_mach_sparc_sparclet 2
  1574. #define bfd_mach_sparc_sparclite 3
  1575. #define bfd_mach_sparc_v8plus 4
  1576. #define bfd_mach_sparc_v8plusa 5 /* with ultrasparc add'ns. */
  1577. #define bfd_mach_sparc_sparclite_le 6
  1578. #define bfd_mach_sparc_v9 7
  1579. #define bfd_mach_sparc_v9a 8 /* with ultrasparc add'ns. */
  1580. #define bfd_mach_sparc_v8plusb 9 /* with cheetah add'ns. */
  1581. #define bfd_mach_sparc_v9b 10 /* with cheetah add'ns. */
  1582. /* Nonzero if MACH has the v9 instruction set. */
  1583. #define bfd_mach_sparc_v9_p(mach) \
  1584. ((mach) >= bfd_mach_sparc_v8plus && (mach) <= bfd_mach_sparc_v9b \
  1585. && (mach) != bfd_mach_sparc_sparclite_le)
  1586. /* Nonzero if MACH is a 64 bit sparc architecture. */
  1587. #define bfd_mach_sparc_64bit_p(mach) \
  1588. ((mach) >= bfd_mach_sparc_v9 && (mach) != bfd_mach_sparc_v8plusb)
  1589. bfd_arch_spu, /* PowerPC SPU */
  1590. #define bfd_mach_spu 256
  1591. bfd_arch_mips, /* MIPS Rxxxx */
  1592. #define bfd_mach_mips3000 3000
  1593. #define bfd_mach_mips3900 3900
  1594. #define bfd_mach_mips4000 4000
  1595. #define bfd_mach_mips4010 4010
  1596. #define bfd_mach_mips4100 4100
  1597. #define bfd_mach_mips4111 4111
  1598. #define bfd_mach_mips4120 4120
  1599. #define bfd_mach_mips4300 4300
  1600. #define bfd_mach_mips4400 4400
  1601. #define bfd_mach_mips4600 4600
  1602. #define bfd_mach_mips4650 4650
  1603. #define bfd_mach_mips5000 5000
  1604. #define bfd_mach_mips5400 5400
  1605. #define bfd_mach_mips5500 5500
  1606. #define bfd_mach_mips5900 5900
  1607. #define bfd_mach_mips6000 6000
  1608. #define bfd_mach_mips7000 7000
  1609. #define bfd_mach_mips8000 8000
  1610. #define bfd_mach_mips9000 9000
  1611. #define bfd_mach_mips10000 10000
  1612. #define bfd_mach_mips12000 12000
  1613. #define bfd_mach_mips14000 14000
  1614. #define bfd_mach_mips16000 16000
  1615. #define bfd_mach_mips16 16
  1616. #define bfd_mach_mips5 5
  1617. #define bfd_mach_mips_loongson_2e 3001
  1618. #define bfd_mach_mips_loongson_2f 3002
  1619. #define bfd_mach_mips_loongson_3a 3003
  1620. #define bfd_mach_mips_sb1 12310201 /* octal 'SB', 01 */
  1621. #define bfd_mach_mips_octeon 6501
  1622. #define bfd_mach_mips_octeonp 6601
  1623. #define bfd_mach_mips_octeon2 6502
  1624. #define bfd_mach_mips_octeon3 6503
  1625. #define bfd_mach_mips_xlr 887682 /* decimal 'XLR' */
  1626. #define bfd_mach_mipsisa32 32
  1627. #define bfd_mach_mipsisa32r2 33
  1628. #define bfd_mach_mipsisa32r3 34
  1629. #define bfd_mach_mipsisa32r5 36
  1630. #define bfd_mach_mipsisa32r6 37
  1631. #define bfd_mach_mipsisa64 64
  1632. #define bfd_mach_mipsisa64r2 65
  1633. #define bfd_mach_mipsisa64r3 66
  1634. #define bfd_mach_mipsisa64r5 68
  1635. #define bfd_mach_mipsisa64r6 69
  1636. #define bfd_mach_mips_micromips 96
  1637. bfd_arch_i386, /* Intel 386 */
  1638. #define bfd_mach_i386_intel_syntax (1 << 0)
  1639. #define bfd_mach_i386_i8086 (1 << 1)
  1640. #define bfd_mach_i386_i386 (1 << 2)
  1641. #define bfd_mach_x86_64 (1 << 3)
  1642. #define bfd_mach_x64_32 (1 << 4)
  1643. #define bfd_mach_i386_i386_intel_syntax (bfd_mach_i386_i386 | bfd_mach_i386_intel_syntax)
  1644. #define bfd_mach_x86_64_intel_syntax (bfd_mach_x86_64 | bfd_mach_i386_intel_syntax)
  1645. #define bfd_mach_x64_32_intel_syntax (bfd_mach_x64_32 | bfd_mach_i386_intel_syntax)
  1646. bfd_arch_l1om, /* Intel L1OM */
  1647. #define bfd_mach_l1om (1 << 5)
  1648. #define bfd_mach_l1om_intel_syntax (bfd_mach_l1om | bfd_mach_i386_intel_syntax)
  1649. bfd_arch_k1om, /* Intel K1OM */
  1650. #define bfd_mach_k1om (1 << 6)
  1651. #define bfd_mach_k1om_intel_syntax (bfd_mach_k1om | bfd_mach_i386_intel_syntax)
  1652. #define bfd_mach_i386_nacl (1 << 7)
  1653. #define bfd_mach_i386_i386_nacl (bfd_mach_i386_i386 | bfd_mach_i386_nacl)
  1654. #define bfd_mach_x86_64_nacl (bfd_mach_x86_64 | bfd_mach_i386_nacl)
  1655. #define bfd_mach_x64_32_nacl (bfd_mach_x64_32 | bfd_mach_i386_nacl)
  1656. bfd_arch_iamcu, /* Intel MCU */
  1657. #define bfd_mach_iamcu (1 << 8)
  1658. #define bfd_mach_i386_iamcu (bfd_mach_i386_i386 | bfd_mach_iamcu)
  1659. #define bfd_mach_i386_iamcu_intel_syntax (bfd_mach_i386_iamcu | bfd_mach_i386_intel_syntax)
  1660. bfd_arch_we32k, /* AT&T WE32xxx */
  1661. bfd_arch_tahoe, /* CCI/Harris Tahoe */
  1662. bfd_arch_i860, /* Intel 860 */
  1663. bfd_arch_i370, /* IBM 360/370 Mainframes */
  1664. bfd_arch_romp, /* IBM ROMP PC/RT */
  1665. bfd_arch_convex, /* Convex */
  1666. bfd_arch_m88k, /* Motorola 88xxx */
  1667. bfd_arch_m98k, /* Motorola 98xxx */
  1668. bfd_arch_pyramid, /* Pyramid Technology */
  1669. bfd_arch_h8300, /* Renesas H8/300 (formerly Hitachi H8/300) */
  1670. #define bfd_mach_h8300 1
  1671. #define bfd_mach_h8300h 2
  1672. #define bfd_mach_h8300s 3
  1673. #define bfd_mach_h8300hn 4
  1674. #define bfd_mach_h8300sn 5
  1675. #define bfd_mach_h8300sx 6
  1676. #define bfd_mach_h8300sxn 7
  1677. bfd_arch_pdp11, /* DEC PDP-11 */
  1678. bfd_arch_plugin,
  1679. bfd_arch_powerpc, /* PowerPC */
  1680. #define bfd_mach_ppc 32
  1681. #define bfd_mach_ppc64 64
  1682. #define bfd_mach_ppc_403 403
  1683. #define bfd_mach_ppc_403gc 4030
  1684. #define bfd_mach_ppc_405 405
  1685. #define bfd_mach_ppc_505 505
  1686. #define bfd_mach_ppc_601 601
  1687. #define bfd_mach_ppc_602 602
  1688. #define bfd_mach_ppc_603 603
  1689. #define bfd_mach_ppc_ec603e 6031
  1690. #define bfd_mach_ppc_604 604
  1691. #define bfd_mach_ppc_620 620
  1692. #define bfd_mach_ppc_630 630
  1693. #define bfd_mach_ppc_750 750
  1694. #define bfd_mach_ppc_860 860
  1695. #define bfd_mach_ppc_a35 35
  1696. #define bfd_mach_ppc_rs64ii 642
  1697. #define bfd_mach_ppc_rs64iii 643
  1698. #define bfd_mach_ppc_7400 7400
  1699. #define bfd_mach_ppc_e500 500
  1700. #define bfd_mach_ppc_e500mc 5001
  1701. #define bfd_mach_ppc_e500mc64 5005
  1702. #define bfd_mach_ppc_e5500 5006
  1703. #define bfd_mach_ppc_e6500 5007
  1704. #define bfd_mach_ppc_titan 83
  1705. #define bfd_mach_ppc_vle 84
  1706. bfd_arch_rs6000, /* IBM RS/6000 */
  1707. #define bfd_mach_rs6k 6000
  1708. #define bfd_mach_rs6k_rs1 6001
  1709. #define bfd_mach_rs6k_rsc 6003
  1710. #define bfd_mach_rs6k_rs2 6002
  1711. bfd_arch_hppa, /* HP PA RISC */
  1712. #define bfd_mach_hppa10 10
  1713. #define bfd_mach_hppa11 11
  1714. #define bfd_mach_hppa20 20
  1715. #define bfd_mach_hppa20w 25
  1716. bfd_arch_d10v, /* Mitsubishi D10V */
  1717. #define bfd_mach_d10v 1
  1718. #define bfd_mach_d10v_ts2 2
  1719. #define bfd_mach_d10v_ts3 3
  1720. bfd_arch_d30v, /* Mitsubishi D30V */
  1721. bfd_arch_dlx, /* DLX */
  1722. bfd_arch_m68hc11, /* Motorola 68HC11 */
  1723. bfd_arch_m68hc12, /* Motorola 68HC12 */
  1724. #define bfd_mach_m6812_default 0
  1725. #define bfd_mach_m6812 1
  1726. #define bfd_mach_m6812s 2
  1727. bfd_arch_m9s12x, /* Freescale S12X */
  1728. bfd_arch_m9s12xg, /* Freescale XGATE */
  1729. bfd_arch_z8k, /* Zilog Z8000 */
  1730. #define bfd_mach_z8001 1
  1731. #define bfd_mach_z8002 2
  1732. bfd_arch_h8500, /* Renesas H8/500 (formerly Hitachi H8/500) */
  1733. bfd_arch_sh, /* Renesas / SuperH SH (formerly Hitachi SH) */
  1734. #define bfd_mach_sh 1
  1735. #define bfd_mach_sh2 0x20
  1736. #define bfd_mach_sh_dsp 0x2d
  1737. #define bfd_mach_sh2a 0x2a
  1738. #define bfd_mach_sh2a_nofpu 0x2b
  1739. #define bfd_mach_sh2a_nofpu_or_sh4_nommu_nofpu 0x2a1
  1740. #define bfd_mach_sh2a_nofpu_or_sh3_nommu 0x2a2
  1741. #define bfd_mach_sh2a_or_sh4 0x2a3
  1742. #define bfd_mach_sh2a_or_sh3e 0x2a4
  1743. #define bfd_mach_sh2e 0x2e
  1744. #define bfd_mach_sh3 0x30
  1745. #define bfd_mach_sh3_nommu 0x31
  1746. #define bfd_mach_sh3_dsp 0x3d
  1747. #define bfd_mach_sh3e 0x3e
  1748. #define bfd_mach_sh4 0x40
  1749. #define bfd_mach_sh4_nofpu 0x41
  1750. #define bfd_mach_sh4_nommu_nofpu 0x42
  1751. #define bfd_mach_sh4a 0x4a
  1752. #define bfd_mach_sh4a_nofpu 0x4b
  1753. #define bfd_mach_sh4al_dsp 0x4d
  1754. #define bfd_mach_sh5 0x50
  1755. bfd_arch_alpha, /* Dec Alpha */
  1756. #define bfd_mach_alpha_ev4 0x10
  1757. #define bfd_mach_alpha_ev5 0x20
  1758. #define bfd_mach_alpha_ev6 0x30
  1759. bfd_arch_arm, /* Advanced Risc Machines ARM. */
  1760. #define bfd_mach_arm_unknown 0
  1761. #define bfd_mach_arm_2 1
  1762. #define bfd_mach_arm_2a 2
  1763. #define bfd_mach_arm_3 3
  1764. #define bfd_mach_arm_3M 4
  1765. #define bfd_mach_arm_4 5
  1766. #define bfd_mach_arm_4T 6
  1767. #define bfd_mach_arm_5 7
  1768. #define bfd_mach_arm_5T 8
  1769. #define bfd_mach_arm_5TE 9
  1770. #define bfd_mach_arm_XScale 10
  1771. #define bfd_mach_arm_ep9312 11
  1772. #define bfd_mach_arm_iWMMXt 12
  1773. #define bfd_mach_arm_iWMMXt2 13
  1774. bfd_arch_nds32, /* Andes NDS32 */
  1775. #define bfd_mach_n1 1
  1776. #define bfd_mach_n1h 2
  1777. #define bfd_mach_n1h_v2 3
  1778. #define bfd_mach_n1h_v3 4
  1779. #define bfd_mach_n1h_v3m 5
  1780. bfd_arch_ns32k, /* National Semiconductors ns32000 */
  1781. bfd_arch_w65, /* WDC 65816 */
  1782. bfd_arch_tic30, /* Texas Instruments TMS320C30 */
  1783. bfd_arch_tic4x, /* Texas Instruments TMS320C3X/4X */
  1784. #define bfd_mach_tic3x 30
  1785. #define bfd_mach_tic4x 40
  1786. bfd_arch_tic54x, /* Texas Instruments TMS320C54X */
  1787. bfd_arch_tic6x, /* Texas Instruments TMS320C6X */
  1788. bfd_arch_tic80, /* TI TMS320c80 (MVP) */
  1789. bfd_arch_v850, /* NEC V850 */
  1790. bfd_arch_v850_rh850,/* NEC V850 (using RH850 ABI) */
  1791. #define bfd_mach_v850 1
  1792. #define bfd_mach_v850e 'E'
  1793. #define bfd_mach_v850e1 '1'
  1794. #define bfd_mach_v850e2 0x4532
  1795. #define bfd_mach_v850e2v3 0x45325633
  1796. #define bfd_mach_v850e3v5 0x45335635 /* ('E'|'3'|'V'|'5') */
  1797. bfd_arch_arc, /* ARC Cores */
  1798. #define bfd_mach_arc_a4 0
  1799. #define bfd_mach_arc_a5 1
  1800. #define bfd_mach_arc_arc600 2
  1801. #define bfd_mach_arc_arc601 4
  1802. #define bfd_mach_arc_arc700 3
  1803. #define bfd_mach_arc_arcv2 5
  1804. bfd_arch_m32c, /* Renesas M16C/M32C. */
  1805. #define bfd_mach_m16c 0x75
  1806. #define bfd_mach_m32c 0x78
  1807. bfd_arch_m32r, /* Renesas M32R (formerly Mitsubishi M32R/D) */
  1808. #define bfd_mach_m32r 1 /* For backwards compatibility. */
  1809. #define bfd_mach_m32rx 'x'
  1810. #define bfd_mach_m32r2 '2'
  1811. bfd_arch_mn10200, /* Matsushita MN10200 */
  1812. bfd_arch_mn10300, /* Matsushita MN10300 */
  1813. #define bfd_mach_mn10300 300
  1814. #define bfd_mach_am33 330
  1815. #define bfd_mach_am33_2 332
  1816. bfd_arch_fr30,
  1817. #define bfd_mach_fr30 0x46523330
  1818. bfd_arch_frv,
  1819. #define bfd_mach_frv 1
  1820. #define bfd_mach_frvsimple 2
  1821. #define bfd_mach_fr300 300
  1822. #define bfd_mach_fr400 400
  1823. #define bfd_mach_fr450 450
  1824. #define bfd_mach_frvtomcat 499 /* fr500 prototype */
  1825. #define bfd_mach_fr500 500
  1826. #define bfd_mach_fr550 550
  1827. bfd_arch_moxie, /* The moxie processor */
  1828. #define bfd_mach_moxie 1
  1829. bfd_arch_ft32, /* The ft32 processor */
  1830. #define bfd_mach_ft32 1
  1831. bfd_arch_mcore,
  1832. bfd_arch_mep,
  1833. #define bfd_mach_mep 1
  1834. #define bfd_mach_mep_h1 0x6831
  1835. #define bfd_mach_mep_c5 0x6335
  1836. bfd_arch_metag,
  1837. #define bfd_mach_metag 1
  1838. bfd_arch_ia64, /* HP/Intel ia64 */
  1839. #define bfd_mach_ia64_elf64 64
  1840. #define bfd_mach_ia64_elf32 32
  1841. bfd_arch_ip2k, /* Ubicom IP2K microcontrollers. */
  1842. #define bfd_mach_ip2022 1
  1843. #define bfd_mach_ip2022ext 2
  1844. bfd_arch_iq2000, /* Vitesse IQ2000. */
  1845. #define bfd_mach_iq2000 1
  1846. #define bfd_mach_iq10 2
  1847. bfd_arch_epiphany, /* Adapteva EPIPHANY */
  1848. #define bfd_mach_epiphany16 1
  1849. #define bfd_mach_epiphany32 2
  1850. bfd_arch_mt,
  1851. #define bfd_mach_ms1 1
  1852. #define bfd_mach_mrisc2 2
  1853. #define bfd_mach_ms2 3
  1854. bfd_arch_pj,
  1855. bfd_arch_avr, /* Atmel AVR microcontrollers. */
  1856. #define bfd_mach_avr1 1
  1857. #define bfd_mach_avr2 2
  1858. #define bfd_mach_avr25 25
  1859. #define bfd_mach_avr3 3
  1860. #define bfd_mach_avr31 31
  1861. #define bfd_mach_avr35 35
  1862. #define bfd_mach_avr4 4
  1863. #define bfd_mach_avr5 5
  1864. #define bfd_mach_avr51 51
  1865. #define bfd_mach_avr6 6
  1866. #define bfd_mach_avrtiny 100
  1867. #define bfd_mach_avrxmega1 101
  1868. #define bfd_mach_avrxmega2 102
  1869. #define bfd_mach_avrxmega3 103
  1870. #define bfd_mach_avrxmega4 104
  1871. #define bfd_mach_avrxmega5 105
  1872. #define bfd_mach_avrxmega6 106
  1873. #define bfd_mach_avrxmega7 107
  1874. bfd_arch_bfin, /* ADI Blackfin */
  1875. #define bfd_mach_bfin 1
  1876. bfd_arch_cr16, /* National Semiconductor CompactRISC (ie CR16). */
  1877. #define bfd_mach_cr16 1
  1878. bfd_arch_cr16c, /* National Semiconductor CompactRISC. */
  1879. #define bfd_mach_cr16c 1
  1880. bfd_arch_crx, /* National Semiconductor CRX. */
  1881. #define bfd_mach_crx 1
  1882. bfd_arch_cris, /* Axis CRIS */
  1883. #define bfd_mach_cris_v0_v10 255
  1884. #define bfd_mach_cris_v32 32
  1885. #define bfd_mach_cris_v10_v32 1032
  1886. bfd_arch_rl78,
  1887. #define bfd_mach_rl78 0x75
  1888. bfd_arch_rx, /* Renesas RX. */
  1889. #define bfd_mach_rx 0x75
  1890. bfd_arch_s390, /* IBM s390 */
  1891. #define bfd_mach_s390_31 31
  1892. #define bfd_mach_s390_64 64
  1893. bfd_arch_score, /* Sunplus score */
  1894. #define bfd_mach_score3 3
  1895. #define bfd_mach_score7 7
  1896. bfd_arch_mmix, /* Donald Knuth's educational processor. */
  1897. bfd_arch_xstormy16,
  1898. #define bfd_mach_xstormy16 1
  1899. bfd_arch_msp430, /* Texas Instruments MSP430 architecture. */
  1900. #define bfd_mach_msp11 11
  1901. #define bfd_mach_msp110 110
  1902. #define bfd_mach_msp12 12
  1903. #define bfd_mach_msp13 13
  1904. #define bfd_mach_msp14 14
  1905. #define bfd_mach_msp15 15
  1906. #define bfd_mach_msp16 16
  1907. #define bfd_mach_msp20 20
  1908. #define bfd_mach_msp21 21
  1909. #define bfd_mach_msp22 22
  1910. #define bfd_mach_msp23 23
  1911. #define bfd_mach_msp24 24
  1912. #define bfd_mach_msp26 26
  1913. #define bfd_mach_msp31 31
  1914. #define bfd_mach_msp32 32
  1915. #define bfd_mach_msp33 33
  1916. #define bfd_mach_msp41 41
  1917. #define bfd_mach_msp42 42
  1918. #define bfd_mach_msp43 43
  1919. #define bfd_mach_msp44 44
  1920. #define bfd_mach_msp430x 45
  1921. #define bfd_mach_msp46 46
  1922. #define bfd_mach_msp47 47
  1923. #define bfd_mach_msp54 54
  1924. bfd_arch_xc16x, /* Infineon's XC16X Series. */
  1925. #define bfd_mach_xc16x 1
  1926. #define bfd_mach_xc16xl 2
  1927. #define bfd_mach_xc16xs 3
  1928. bfd_arch_xgate, /* Freescale XGATE */
  1929. #define bfd_mach_xgate 1
  1930. bfd_arch_xtensa, /* Tensilica's Xtensa cores. */
  1931. #define bfd_mach_xtensa 1
  1932. bfd_arch_z80,
  1933. #define bfd_mach_z80strict 1 /* No undocumented opcodes. */
  1934. #define bfd_mach_z80 3 /* With ixl, ixh, iyl, and iyh. */
  1935. #define bfd_mach_z80full 7 /* All undocumented instructions. */
  1936. #define bfd_mach_r800 11 /* R800: successor with multiplication. */
  1937. bfd_arch_lm32, /* Lattice Mico32 */
  1938. #define bfd_mach_lm32 1
  1939. bfd_arch_microblaze,/* Xilinx MicroBlaze. */
  1940. bfd_arch_tilepro, /* Tilera TILEPro */
  1941. bfd_arch_tilegx, /* Tilera TILE-Gx */
  1942. #define bfd_mach_tilepro 1
  1943. #define bfd_mach_tilegx 1
  1944. #define bfd_mach_tilegx32 2
  1945. bfd_arch_aarch64, /* AArch64 */
  1946. #define bfd_mach_aarch64 0
  1947. #define bfd_mach_aarch64_ilp32 32
  1948. bfd_arch_nios2, /* Nios II */
  1949. #define bfd_mach_nios2 0
  1950. #define bfd_mach_nios2r1 1
  1951. #define bfd_mach_nios2r2 2
  1952. bfd_arch_visium, /* Visium */
  1953. #define bfd_mach_visium 1
  1954. bfd_arch_last
  1955. };
  1956. typedef struct bfd_arch_info
  1957. {
  1958. int bits_per_word;
  1959. int bits_per_address;
  1960. int bits_per_byte;
  1961. enum bfd_architecture arch;
  1962. unsigned long mach;
  1963. const char *arch_name;
  1964. const char *printable_name;
  1965. unsigned int section_align_power;
  1966. /* TRUE if this is the default machine for the architecture.
  1967. The default arch should be the first entry for an arch so that
  1968. all the entries for that arch can be accessed via <<next>>. */
  1969. bfd_boolean the_default;
  1970. const struct bfd_arch_info * (*compatible)
  1971. (const struct bfd_arch_info *a, const struct bfd_arch_info *b);
  1972. bfd_boolean (*scan) (const struct bfd_arch_info *, const char *);
  1973. /* Allocate via bfd_malloc and return a fill buffer of size COUNT. If
  1974. IS_BIGENDIAN is TRUE, the order of bytes is big endian. If CODE is
  1975. TRUE, the buffer contains code. */
  1976. void *(*fill) (bfd_size_type count, bfd_boolean is_bigendian,
  1977. bfd_boolean code);
  1978. const struct bfd_arch_info *next;
  1979. }
  1980. bfd_arch_info_type;
  1981. const char *bfd_printable_name (bfd *abfd);
  1982. const bfd_arch_info_type *bfd_scan_arch (const char *string);
  1983. const char **bfd_arch_list (void);
  1984. const bfd_arch_info_type *bfd_arch_get_compatible
  1985. (const bfd *abfd, const bfd *bbfd, bfd_boolean accept_unknowns);
  1986. void bfd_set_arch_info (bfd *abfd, const bfd_arch_info_type *arg);
  1987. enum bfd_architecture bfd_get_arch (bfd *abfd);
  1988. unsigned long bfd_get_mach (bfd *abfd);
  1989. unsigned int bfd_arch_bits_per_byte (bfd *abfd);
  1990. unsigned int bfd_arch_bits_per_address (bfd *abfd);
  1991. const bfd_arch_info_type *bfd_get_arch_info (bfd *abfd);
  1992. const bfd_arch_info_type *bfd_lookup_arch
  1993. (enum bfd_architecture arch, unsigned long machine);
  1994. const char *bfd_printable_arch_mach
  1995. (enum bfd_architecture arch, unsigned long machine);
  1996. unsigned int bfd_octets_per_byte (bfd *abfd);
  1997. unsigned int bfd_arch_mach_octets_per_byte
  1998. (enum bfd_architecture arch, unsigned long machine);
  1999. /* Extracted from reloc.c. */
  2000. typedef enum bfd_reloc_status
  2001. {
  2002. /* No errors detected. */
  2003. bfd_reloc_ok,
  2004. /* The relocation was performed, but there was an overflow. */
  2005. bfd_reloc_overflow,
  2006. /* The address to relocate was not within the section supplied. */
  2007. bfd_reloc_outofrange,
  2008. /* Used by special functions. */
  2009. bfd_reloc_continue,
  2010. /* Unsupported relocation size requested. */
  2011. bfd_reloc_notsupported,
  2012. /* Unused. */
  2013. bfd_reloc_other,
  2014. /* The symbol to relocate against was undefined. */
  2015. bfd_reloc_undefined,
  2016. /* The relocation was performed, but may not be ok - presently
  2017. generated only when linking i960 coff files with i960 b.out
  2018. symbols. If this type is returned, the error_message argument
  2019. to bfd_perform_relocation will be set. */
  2020. bfd_reloc_dangerous
  2021. }
  2022. bfd_reloc_status_type;
  2023. typedef struct reloc_cache_entry
  2024. {
  2025. /* A pointer into the canonical table of pointers. */
  2026. struct bfd_symbol **sym_ptr_ptr;
  2027. /* offset in section. */
  2028. bfd_size_type address;
  2029. /* addend for relocation value. */
  2030. bfd_vma addend;
  2031. /* Pointer to how to perform the required relocation. */
  2032. reloc_howto_type *howto;
  2033. }
  2034. arelent;
  2035. enum complain_overflow
  2036. {
  2037. /* Do not complain on overflow. */
  2038. complain_overflow_dont,
  2039. /* Complain if the value overflows when considered as a signed
  2040. number one bit larger than the field. ie. A bitfield of N bits
  2041. is allowed to represent -2**n to 2**n-1. */
  2042. complain_overflow_bitfield,
  2043. /* Complain if the value overflows when considered as a signed
  2044. number. */
  2045. complain_overflow_signed,
  2046. /* Complain if the value overflows when considered as an
  2047. unsigned number. */
  2048. complain_overflow_unsigned
  2049. };
  2050. struct bfd_symbol; /* Forward declaration. */
  2051. struct reloc_howto_struct
  2052. {
  2053. /* The type field has mainly a documentary use - the back end can
  2054. do what it wants with it, though normally the back end's
  2055. external idea of what a reloc number is stored
  2056. in this field. For example, a PC relative word relocation
  2057. in a coff environment has the type 023 - because that's
  2058. what the outside world calls a R_PCRWORD reloc. */
  2059. unsigned int type;
  2060. /* The value the final relocation is shifted right by. This drops
  2061. unwanted data from the relocation. */
  2062. unsigned int rightshift;
  2063. /* The size of the item to be relocated. This is *not* a
  2064. power-of-two measure. To get the number of bytes operated
  2065. on by a type of relocation, use bfd_get_reloc_size. */
  2066. int size;
  2067. /* The number of bits in the item to be relocated. This is used
  2068. when doing overflow checking. */
  2069. unsigned int bitsize;
  2070. /* The relocation is relative to the field being relocated. */
  2071. bfd_boolean pc_relative;
  2072. /* The bit position of the reloc value in the destination.
  2073. The relocated value is left shifted by this amount. */
  2074. unsigned int bitpos;
  2075. /* What type of overflow error should be checked for when
  2076. relocating. */
  2077. enum complain_overflow complain_on_overflow;
  2078. /* If this field is non null, then the supplied function is
  2079. called rather than the normal function. This allows really
  2080. strange relocation methods to be accommodated (e.g., i960 callj
  2081. instructions). */
  2082. bfd_reloc_status_type (*special_function)
  2083. (bfd *, arelent *, struct bfd_symbol *, void *, asection *,
  2084. bfd *, char **);
  2085. /* The textual name of the relocation type. */
  2086. char *name;
  2087. /* Some formats record a relocation addend in the section contents
  2088. rather than with the relocation. For ELF formats this is the
  2089. distinction between USE_REL and USE_RELA (though the code checks
  2090. for USE_REL == 1/0). The value of this field is TRUE if the
  2091. addend is recorded with the section contents; when performing a
  2092. partial link (ld -r) the section contents (the data) will be
  2093. modified. The value of this field is FALSE if addends are
  2094. recorded with the relocation (in arelent.addend); when performing
  2095. a partial link the relocation will be modified.
  2096. All relocations for all ELF USE_RELA targets should set this field
  2097. to FALSE (values of TRUE should be looked on with suspicion).
  2098. However, the converse is not true: not all relocations of all ELF
  2099. USE_REL targets set this field to TRUE. Why this is so is peculiar
  2100. to each particular target. For relocs that aren't used in partial
  2101. links (e.g. GOT stuff) it doesn't matter what this is set to. */
  2102. bfd_boolean partial_inplace;
  2103. /* src_mask selects the part of the instruction (or data) to be used
  2104. in the relocation sum. If the target relocations don't have an
  2105. addend in the reloc, eg. ELF USE_REL, src_mask will normally equal
  2106. dst_mask to extract the addend from the section contents. If
  2107. relocations do have an addend in the reloc, eg. ELF USE_RELA, this
  2108. field should be zero. Non-zero values for ELF USE_RELA targets are
  2109. bogus as in those cases the value in the dst_mask part of the
  2110. section contents should be treated as garbage. */
  2111. bfd_vma src_mask;
  2112. /* dst_mask selects which parts of the instruction (or data) are
  2113. replaced with a relocated value. */
  2114. bfd_vma dst_mask;
  2115. /* When some formats create PC relative instructions, they leave
  2116. the value of the pc of the place being relocated in the offset
  2117. slot of the instruction, so that a PC relative relocation can
  2118. be made just by adding in an ordinary offset (e.g., sun3 a.out).
  2119. Some formats leave the displacement part of an instruction
  2120. empty (e.g., m88k bcs); this flag signals the fact. */
  2121. bfd_boolean pcrel_offset;
  2122. };
  2123. #define HOWTO(C, R, S, B, P, BI, O, SF, NAME, INPLACE, MASKSRC, MASKDST, PC) \
  2124. { (unsigned) C, R, S, B, P, BI, O, SF, NAME, INPLACE, MASKSRC, MASKDST, PC }
  2125. #define NEWHOWTO(FUNCTION, NAME, SIZE, REL, IN) \
  2126. HOWTO (0, 0, SIZE, 0, REL, 0, complain_overflow_dont, FUNCTION, \
  2127. NAME, FALSE, 0, 0, IN)
  2128. #define EMPTY_HOWTO(C) \
  2129. HOWTO ((C), 0, 0, 0, FALSE, 0, complain_overflow_dont, NULL, \
  2130. NULL, FALSE, 0, 0, FALSE)
  2131. #define HOWTO_PREPARE(relocation, symbol) \
  2132. { \
  2133. if (symbol != NULL) \
  2134. { \
  2135. if (bfd_is_com_section (symbol->section)) \
  2136. { \
  2137. relocation = 0; \
  2138. } \
  2139. else \
  2140. { \
  2141. relocation = symbol->value; \
  2142. } \
  2143. } \
  2144. }
  2145. unsigned int bfd_get_reloc_size (reloc_howto_type *);
  2146. typedef struct relent_chain
  2147. {
  2148. arelent relent;
  2149. struct relent_chain *next;
  2150. }
  2151. arelent_chain;
  2152. bfd_reloc_status_type bfd_check_overflow
  2153. (enum complain_overflow how,
  2154. unsigned int bitsize,
  2155. unsigned int rightshift,
  2156. unsigned int addrsize,
  2157. bfd_vma relocation);
  2158. bfd_reloc_status_type bfd_perform_relocation
  2159. (bfd *abfd,
  2160. arelent *reloc_entry,
  2161. void *data,
  2162. asection *input_section,
  2163. bfd *output_bfd,
  2164. char **error_message);
  2165. bfd_reloc_status_type bfd_install_relocation
  2166. (bfd *abfd,
  2167. arelent *reloc_entry,
  2168. void *data, bfd_vma data_start,
  2169. asection *input_section,
  2170. char **error_message);
  2171. enum bfd_reloc_code_real {
  2172. _dummy_first_bfd_reloc_code_real,
  2173. /* Basic absolute relocations of N bits. */
  2174. BFD_RELOC_64,
  2175. BFD_RELOC_32,
  2176. BFD_RELOC_26,
  2177. BFD_RELOC_24,
  2178. BFD_RELOC_16,
  2179. BFD_RELOC_14,
  2180. BFD_RELOC_8,
  2181. /* PC-relative relocations. Sometimes these are relative to the address
  2182. of the relocation itself; sometimes they are relative to the start of
  2183. the section containing the relocation. It depends on the specific target.
  2184. The 24-bit relocation is used in some Intel 960 configurations. */
  2185. BFD_RELOC_64_PCREL,
  2186. BFD_RELOC_32_PCREL,
  2187. BFD_RELOC_24_PCREL,
  2188. BFD_RELOC_16_PCREL,
  2189. BFD_RELOC_12_PCREL,
  2190. BFD_RELOC_8_PCREL,
  2191. /* Section relative relocations. Some targets need this for DWARF2. */
  2192. BFD_RELOC_32_SECREL,
  2193. /* For ELF. */
  2194. BFD_RELOC_32_GOT_PCREL,
  2195. BFD_RELOC_16_GOT_PCREL,
  2196. BFD_RELOC_8_GOT_PCREL,
  2197. BFD_RELOC_32_GOTOFF,
  2198. BFD_RELOC_16_GOTOFF,
  2199. BFD_RELOC_LO16_GOTOFF,
  2200. BFD_RELOC_HI16_GOTOFF,
  2201. BFD_RELOC_HI16_S_GOTOFF,
  2202. BFD_RELOC_8_GOTOFF,
  2203. BFD_RELOC_64_PLT_PCREL,
  2204. BFD_RELOC_32_PLT_PCREL,
  2205. BFD_RELOC_24_PLT_PCREL,
  2206. BFD_RELOC_16_PLT_PCREL,
  2207. BFD_RELOC_8_PLT_PCREL,
  2208. BFD_RELOC_64_PLTOFF,
  2209. BFD_RELOC_32_PLTOFF,
  2210. BFD_RELOC_16_PLTOFF,
  2211. BFD_RELOC_LO16_PLTOFF,
  2212. BFD_RELOC_HI16_PLTOFF,
  2213. BFD_RELOC_HI16_S_PLTOFF,
  2214. BFD_RELOC_8_PLTOFF,
  2215. /* Size relocations. */
  2216. BFD_RELOC_SIZE32,
  2217. BFD_RELOC_SIZE64,
  2218. /* Relocations used by 68K ELF. */
  2219. BFD_RELOC_68K_GLOB_DAT,
  2220. BFD_RELOC_68K_JMP_SLOT,
  2221. BFD_RELOC_68K_RELATIVE,
  2222. BFD_RELOC_68K_TLS_GD32,
  2223. BFD_RELOC_68K_TLS_GD16,
  2224. BFD_RELOC_68K_TLS_GD8,
  2225. BFD_RELOC_68K_TLS_LDM32,
  2226. BFD_RELOC_68K_TLS_LDM16,
  2227. BFD_RELOC_68K_TLS_LDM8,
  2228. BFD_RELOC_68K_TLS_LDO32,
  2229. BFD_RELOC_68K_TLS_LDO16,
  2230. BFD_RELOC_68K_TLS_LDO8,
  2231. BFD_RELOC_68K_TLS_IE32,
  2232. BFD_RELOC_68K_TLS_IE16,
  2233. BFD_RELOC_68K_TLS_IE8,
  2234. BFD_RELOC_68K_TLS_LE32,
  2235. BFD_RELOC_68K_TLS_LE16,
  2236. BFD_RELOC_68K_TLS_LE8,
  2237. /* Linkage-table relative. */
  2238. BFD_RELOC_32_BASEREL,
  2239. BFD_RELOC_16_BASEREL,
  2240. BFD_RELOC_LO16_BASEREL,
  2241. BFD_RELOC_HI16_BASEREL,
  2242. BFD_RELOC_HI16_S_BASEREL,
  2243. BFD_RELOC_8_BASEREL,
  2244. BFD_RELOC_RVA,
  2245. /* Absolute 8-bit relocation, but used to form an address like 0xFFnn. */
  2246. BFD_RELOC_8_FFnn,
  2247. /* These PC-relative relocations are stored as word displacements --
  2248. i.e., byte displacements shifted right two bits. The 30-bit word
  2249. displacement (<<32_PCREL_S2>> -- 32 bits, shifted 2) is used on the
  2250. SPARC. (SPARC tools generally refer to this as <<WDISP30>>.) The
  2251. signed 16-bit displacement is used on the MIPS, and the 23-bit
  2252. displacement is used on the Alpha. */
  2253. BFD_RELOC_32_PCREL_S2,
  2254. BFD_RELOC_16_PCREL_S2,
  2255. BFD_RELOC_23_PCREL_S2,
  2256. /* High 22 bits and low 10 bits of 32-bit value, placed into lower bits of
  2257. the target word. These are used on the SPARC. */
  2258. BFD_RELOC_HI22,
  2259. BFD_RELOC_LO10,
  2260. /* For systems that allocate a Global Pointer register, these are
  2261. displacements off that register. These relocation types are
  2262. handled specially, because the value the register will have is
  2263. decided relatively late. */
  2264. BFD_RELOC_GPREL16,
  2265. BFD_RELOC_GPREL32,
  2266. /* Reloc types used for i960/b.out. */
  2267. BFD_RELOC_I960_CALLJ,
  2268. /* SPARC ELF relocations. There is probably some overlap with other
  2269. relocation types already defined. */
  2270. BFD_RELOC_NONE,
  2271. BFD_RELOC_SPARC_WDISP22,
  2272. BFD_RELOC_SPARC22,
  2273. BFD_RELOC_SPARC13,
  2274. BFD_RELOC_SPARC_GOT10,
  2275. BFD_RELOC_SPARC_GOT13,
  2276. BFD_RELOC_SPARC_GOT22,
  2277. BFD_RELOC_SPARC_PC10,
  2278. BFD_RELOC_SPARC_PC22,
  2279. BFD_RELOC_SPARC_WPLT30,
  2280. BFD_RELOC_SPARC_COPY,
  2281. BFD_RELOC_SPARC_GLOB_DAT,
  2282. BFD_RELOC_SPARC_JMP_SLOT,
  2283. BFD_RELOC_SPARC_RELATIVE,
  2284. BFD_RELOC_SPARC_UA16,
  2285. BFD_RELOC_SPARC_UA32,
  2286. BFD_RELOC_SPARC_UA64,
  2287. BFD_RELOC_SPARC_GOTDATA_HIX22,
  2288. BFD_RELOC_SPARC_GOTDATA_LOX10,
  2289. BFD_RELOC_SPARC_GOTDATA_OP_HIX22,
  2290. BFD_RELOC_SPARC_GOTDATA_OP_LOX10,
  2291. BFD_RELOC_SPARC_GOTDATA_OP,
  2292. BFD_RELOC_SPARC_JMP_IREL,
  2293. BFD_RELOC_SPARC_IRELATIVE,
  2294. /* I think these are specific to SPARC a.out (e.g., Sun 4). */
  2295. BFD_RELOC_SPARC_BASE13,
  2296. BFD_RELOC_SPARC_BASE22,
  2297. /* SPARC64 relocations */
  2298. #define BFD_RELOC_SPARC_64 BFD_RELOC_64
  2299. BFD_RELOC_SPARC_10,
  2300. BFD_RELOC_SPARC_11,
  2301. BFD_RELOC_SPARC_OLO10,
  2302. BFD_RELOC_SPARC_HH22,
  2303. BFD_RELOC_SPARC_HM10,
  2304. BFD_RELOC_SPARC_LM22,
  2305. BFD_RELOC_SPARC_PC_HH22,
  2306. BFD_RELOC_SPARC_PC_HM10,
  2307. BFD_RELOC_SPARC_PC_LM22,
  2308. BFD_RELOC_SPARC_WDISP16,
  2309. BFD_RELOC_SPARC_WDISP19,
  2310. BFD_RELOC_SPARC_7,
  2311. BFD_RELOC_SPARC_6,
  2312. BFD_RELOC_SPARC_5,
  2313. #define BFD_RELOC_SPARC_DISP64 BFD_RELOC_64_PCREL
  2314. BFD_RELOC_SPARC_PLT32,
  2315. BFD_RELOC_SPARC_PLT64,
  2316. BFD_RELOC_SPARC_HIX22,
  2317. BFD_RELOC_SPARC_LOX10,
  2318. BFD_RELOC_SPARC_H44,
  2319. BFD_RELOC_SPARC_M44,
  2320. BFD_RELOC_SPARC_L44,
  2321. BFD_RELOC_SPARC_REGISTER,
  2322. BFD_RELOC_SPARC_H34,
  2323. BFD_RELOC_SPARC_SIZE32,
  2324. BFD_RELOC_SPARC_SIZE64,
  2325. BFD_RELOC_SPARC_WDISP10,
  2326. /* SPARC little endian relocation */
  2327. BFD_RELOC_SPARC_REV32,
  2328. /* SPARC TLS relocations */
  2329. BFD_RELOC_SPARC_TLS_GD_HI22,
  2330. BFD_RELOC_SPARC_TLS_GD_LO10,
  2331. BFD_RELOC_SPARC_TLS_GD_ADD,
  2332. BFD_RELOC_SPARC_TLS_GD_CALL,
  2333. BFD_RELOC_SPARC_TLS_LDM_HI22,
  2334. BFD_RELOC_SPARC_TLS_LDM_LO10,
  2335. BFD_RELOC_SPARC_TLS_LDM_ADD,
  2336. BFD_RELOC_SPARC_TLS_LDM_CALL,
  2337. BFD_RELOC_SPARC_TLS_LDO_HIX22,
  2338. BFD_RELOC_SPARC_TLS_LDO_LOX10,
  2339. BFD_RELOC_SPARC_TLS_LDO_ADD,
  2340. BFD_RELOC_SPARC_TLS_IE_HI22,
  2341. BFD_RELOC_SPARC_TLS_IE_LO10,
  2342. BFD_RELOC_SPARC_TLS_IE_LD,
  2343. BFD_RELOC_SPARC_TLS_IE_LDX,
  2344. BFD_RELOC_SPARC_TLS_IE_ADD,
  2345. BFD_RELOC_SPARC_TLS_LE_HIX22,
  2346. BFD_RELOC_SPARC_TLS_LE_LOX10,
  2347. BFD_RELOC_SPARC_TLS_DTPMOD32,
  2348. BFD_RELOC_SPARC_TLS_DTPMOD64,
  2349. BFD_RELOC_SPARC_TLS_DTPOFF32,
  2350. BFD_RELOC_SPARC_TLS_DTPOFF64,
  2351. BFD_RELOC_SPARC_TLS_TPOFF32,
  2352. BFD_RELOC_SPARC_TLS_TPOFF64,
  2353. /* SPU Relocations. */
  2354. BFD_RELOC_SPU_IMM7,
  2355. BFD_RELOC_SPU_IMM8,
  2356. BFD_RELOC_SPU_IMM10,
  2357. BFD_RELOC_SPU_IMM10W,
  2358. BFD_RELOC_SPU_IMM16,
  2359. BFD_RELOC_SPU_IMM16W,
  2360. BFD_RELOC_SPU_IMM18,
  2361. BFD_RELOC_SPU_PCREL9a,
  2362. BFD_RELOC_SPU_PCREL9b,
  2363. BFD_RELOC_SPU_PCREL16,
  2364. BFD_RELOC_SPU_LO16,
  2365. BFD_RELOC_SPU_HI16,
  2366. BFD_RELOC_SPU_PPU32,
  2367. BFD_RELOC_SPU_PPU64,
  2368. BFD_RELOC_SPU_ADD_PIC,
  2369. /* Alpha ECOFF and ELF relocations. Some of these treat the symbol or
  2370. "addend" in some special way.
  2371. For GPDISP_HI16 ("gpdisp") relocations, the symbol is ignored when
  2372. writing; when reading, it will be the absolute section symbol. The
  2373. addend is the displacement in bytes of the "lda" instruction from
  2374. the "ldah" instruction (which is at the address of this reloc). */
  2375. BFD_RELOC_ALPHA_GPDISP_HI16,
  2376. /* For GPDISP_LO16 ("ignore") relocations, the symbol is handled as
  2377. with GPDISP_HI16 relocs. The addend is ignored when writing the
  2378. relocations out, and is filled in with the file's GP value on
  2379. reading, for convenience. */
  2380. BFD_RELOC_ALPHA_GPDISP_LO16,
  2381. /* The ELF GPDISP relocation is exactly the same as the GPDISP_HI16
  2382. relocation except that there is no accompanying GPDISP_LO16
  2383. relocation. */
  2384. BFD_RELOC_ALPHA_GPDISP,
  2385. /* The Alpha LITERAL/LITUSE relocs are produced by a symbol reference;
  2386. the assembler turns it into a LDQ instruction to load the address of
  2387. the symbol, and then fills in a register in the real instruction.
  2388. The LITERAL reloc, at the LDQ instruction, refers to the .lita
  2389. section symbol. The addend is ignored when writing, but is filled
  2390. in with the file's GP value on reading, for convenience, as with the
  2391. GPDISP_LO16 reloc.
  2392. The ELF_LITERAL reloc is somewhere between 16_GOTOFF and GPDISP_LO16.
  2393. It should refer to the symbol to be referenced, as with 16_GOTOFF,
  2394. but it generates output not based on the position within the .got
  2395. section, but relative to the GP value chosen for the file during the
  2396. final link stage.
  2397. The LITUSE reloc, on the instruction using the loaded address, gives
  2398. information to the linker that it might be able to use to optimize
  2399. away some literal section references. The symbol is ignored (read
  2400. as the absolute section symbol), and the "addend" indicates the type
  2401. of instruction using the register:
  2402. 1 - "memory" fmt insn
  2403. 2 - byte-manipulation (byte offset reg)
  2404. 3 - jsr (target of branch) */
  2405. BFD_RELOC_ALPHA_LITERAL,
  2406. BFD_RELOC_ALPHA_ELF_LITERAL,
  2407. BFD_RELOC_ALPHA_LITUSE,
  2408. /* The HINT relocation indicates a value that should be filled into the
  2409. "hint" field of a jmp/jsr/ret instruction, for possible branch-
  2410. prediction logic which may be provided on some processors. */
  2411. BFD_RELOC_ALPHA_HINT,
  2412. /* The LINKAGE relocation outputs a linkage pair in the object file,
  2413. which is filled by the linker. */
  2414. BFD_RELOC_ALPHA_LINKAGE,
  2415. /* The CODEADDR relocation outputs a STO_CA in the object file,
  2416. which is filled by the linker. */
  2417. BFD_RELOC_ALPHA_CODEADDR,
  2418. /* The GPREL_HI/LO relocations together form a 32-bit offset from the
  2419. GP register. */
  2420. BFD_RELOC_ALPHA_GPREL_HI16,
  2421. BFD_RELOC_ALPHA_GPREL_LO16,
  2422. /* Like BFD_RELOC_23_PCREL_S2, except that the source and target must
  2423. share a common GP, and the target address is adjusted for
  2424. STO_ALPHA_STD_GPLOAD. */
  2425. BFD_RELOC_ALPHA_BRSGP,
  2426. /* The NOP relocation outputs a NOP if the longword displacement
  2427. between two procedure entry points is < 2^21. */
  2428. BFD_RELOC_ALPHA_NOP,
  2429. /* The BSR relocation outputs a BSR if the longword displacement
  2430. between two procedure entry points is < 2^21. */
  2431. BFD_RELOC_ALPHA_BSR,
  2432. /* The LDA relocation outputs a LDA if the longword displacement
  2433. between two procedure entry points is < 2^16. */
  2434. BFD_RELOC_ALPHA_LDA,
  2435. /* The BOH relocation outputs a BSR if the longword displacement
  2436. between two procedure entry points is < 2^21, or else a hint. */
  2437. BFD_RELOC_ALPHA_BOH,
  2438. /* Alpha thread-local storage relocations. */
  2439. BFD_RELOC_ALPHA_TLSGD,
  2440. BFD_RELOC_ALPHA_TLSLDM,
  2441. BFD_RELOC_ALPHA_DTPMOD64,
  2442. BFD_RELOC_ALPHA_GOTDTPREL16,
  2443. BFD_RELOC_ALPHA_DTPREL64,
  2444. BFD_RELOC_ALPHA_DTPREL_HI16,
  2445. BFD_RELOC_ALPHA_DTPREL_LO16,
  2446. BFD_RELOC_ALPHA_DTPREL16,
  2447. BFD_RELOC_ALPHA_GOTTPREL16,
  2448. BFD_RELOC_ALPHA_TPREL64,
  2449. BFD_RELOC_ALPHA_TPREL_HI16,
  2450. BFD_RELOC_ALPHA_TPREL_LO16,
  2451. BFD_RELOC_ALPHA_TPREL16,
  2452. /* The MIPS jump instruction. */
  2453. BFD_RELOC_MIPS_JMP,
  2454. BFD_RELOC_MICROMIPS_JMP,
  2455. /* The MIPS16 jump instruction. */
  2456. BFD_RELOC_MIPS16_JMP,
  2457. /* MIPS16 GP relative reloc. */
  2458. BFD_RELOC_MIPS16_GPREL,
  2459. /* High 16 bits of 32-bit value; simple reloc. */
  2460. BFD_RELOC_HI16,
  2461. /* High 16 bits of 32-bit value but the low 16 bits will be sign
  2462. extended and added to form the final result. If the low 16
  2463. bits form a negative number, we need to add one to the high value
  2464. to compensate for the borrow when the low bits are added. */
  2465. BFD_RELOC_HI16_S,
  2466. /* Low 16 bits. */
  2467. BFD_RELOC_LO16,
  2468. /* High 16 bits of 32-bit pc-relative value */
  2469. BFD_RELOC_HI16_PCREL,
  2470. /* High 16 bits of 32-bit pc-relative value, adjusted */
  2471. BFD_RELOC_HI16_S_PCREL,
  2472. /* Low 16 bits of pc-relative value */
  2473. BFD_RELOC_LO16_PCREL,
  2474. /* Equivalent of BFD_RELOC_MIPS_*, but with the MIPS16 layout of
  2475. 16-bit immediate fields */
  2476. BFD_RELOC_MIPS16_GOT16,
  2477. BFD_RELOC_MIPS16_CALL16,
  2478. /* MIPS16 high 16 bits of 32-bit value. */
  2479. BFD_RELOC_MIPS16_HI16,
  2480. /* MIPS16 high 16 bits of 32-bit value but the low 16 bits will be sign
  2481. extended and added to form the final result. If the low 16
  2482. bits form a negative number, we need to add one to the high value
  2483. to compensate for the borrow when the low bits are added. */
  2484. BFD_RELOC_MIPS16_HI16_S,
  2485. /* MIPS16 low 16 bits. */
  2486. BFD_RELOC_MIPS16_LO16,
  2487. /* MIPS16 TLS relocations */
  2488. BFD_RELOC_MIPS16_TLS_GD,
  2489. BFD_RELOC_MIPS16_TLS_LDM,
  2490. BFD_RELOC_MIPS16_TLS_DTPREL_HI16,
  2491. BFD_RELOC_MIPS16_TLS_DTPREL_LO16,
  2492. BFD_RELOC_MIPS16_TLS_GOTTPREL,
  2493. BFD_RELOC_MIPS16_TLS_TPREL_HI16,
  2494. BFD_RELOC_MIPS16_TLS_TPREL_LO16,
  2495. /* Relocation against a MIPS literal section. */
  2496. BFD_RELOC_MIPS_LITERAL,
  2497. BFD_RELOC_MICROMIPS_LITERAL,
  2498. /* microMIPS PC-relative relocations. */
  2499. BFD_RELOC_MICROMIPS_7_PCREL_S1,
  2500. BFD_RELOC_MICROMIPS_10_PCREL_S1,
  2501. BFD_RELOC_MICROMIPS_16_PCREL_S1,
  2502. /* MIPS PC-relative relocations. */
  2503. BFD_RELOC_MIPS_21_PCREL_S2,
  2504. BFD_RELOC_MIPS_26_PCREL_S2,
  2505. BFD_RELOC_MIPS_18_PCREL_S3,
  2506. BFD_RELOC_MIPS_19_PCREL_S2,
  2507. /* microMIPS versions of generic BFD relocs. */
  2508. BFD_RELOC_MICROMIPS_GPREL16,
  2509. BFD_RELOC_MICROMIPS_HI16,
  2510. BFD_RELOC_MICROMIPS_HI16_S,
  2511. BFD_RELOC_MICROMIPS_LO16,
  2512. /* MIPS ELF relocations. */
  2513. BFD_RELOC_MIPS_GOT16,
  2514. BFD_RELOC_MICROMIPS_GOT16,
  2515. BFD_RELOC_MIPS_CALL16,
  2516. BFD_RELOC_MICROMIPS_CALL16,
  2517. BFD_RELOC_MIPS_GOT_HI16,
  2518. BFD_RELOC_MICROMIPS_GOT_HI16,
  2519. BFD_RELOC_MIPS_GOT_LO16,
  2520. BFD_RELOC_MICROMIPS_GOT_LO16,
  2521. BFD_RELOC_MIPS_CALL_HI16,
  2522. BFD_RELOC_MICROMIPS_CALL_HI16,
  2523. BFD_RELOC_MIPS_CALL_LO16,
  2524. BFD_RELOC_MICROMIPS_CALL_LO16,
  2525. BFD_RELOC_MIPS_SUB,
  2526. BFD_RELOC_MICROMIPS_SUB,
  2527. BFD_RELOC_MIPS_GOT_PAGE,
  2528. BFD_RELOC_MICROMIPS_GOT_PAGE,
  2529. BFD_RELOC_MIPS_GOT_OFST,
  2530. BFD_RELOC_MICROMIPS_GOT_OFST,
  2531. BFD_RELOC_MIPS_GOT_DISP,
  2532. BFD_RELOC_MICROMIPS_GOT_DISP,
  2533. BFD_RELOC_MIPS_SHIFT5,
  2534. BFD_RELOC_MIPS_SHIFT6,
  2535. BFD_RELOC_MIPS_INSERT_A,
  2536. BFD_RELOC_MIPS_INSERT_B,
  2537. BFD_RELOC_MIPS_DELETE,
  2538. BFD_RELOC_MIPS_HIGHEST,
  2539. BFD_RELOC_MICROMIPS_HIGHEST,
  2540. BFD_RELOC_MIPS_HIGHER,
  2541. BFD_RELOC_MICROMIPS_HIGHER,
  2542. BFD_RELOC_MIPS_SCN_DISP,
  2543. BFD_RELOC_MICROMIPS_SCN_DISP,
  2544. BFD_RELOC_MIPS_REL16,
  2545. BFD_RELOC_MIPS_RELGOT,
  2546. BFD_RELOC_MIPS_JALR,
  2547. BFD_RELOC_MICROMIPS_JALR,
  2548. BFD_RELOC_MIPS_TLS_DTPMOD32,
  2549. BFD_RELOC_MIPS_TLS_DTPREL32,
  2550. BFD_RELOC_MIPS_TLS_DTPMOD64,
  2551. BFD_RELOC_MIPS_TLS_DTPREL64,
  2552. BFD_RELOC_MIPS_TLS_GD,
  2553. BFD_RELOC_MICROMIPS_TLS_GD,
  2554. BFD_RELOC_MIPS_TLS_LDM,
  2555. BFD_RELOC_MICROMIPS_TLS_LDM,
  2556. BFD_RELOC_MIPS_TLS_DTPREL_HI16,
  2557. BFD_RELOC_MICROMIPS_TLS_DTPREL_HI16,
  2558. BFD_RELOC_MIPS_TLS_DTPREL_LO16,
  2559. BFD_RELOC_MICROMIPS_TLS_DTPREL_LO16,
  2560. BFD_RELOC_MIPS_TLS_GOTTPREL,
  2561. BFD_RELOC_MICROMIPS_TLS_GOTTPREL,
  2562. BFD_RELOC_MIPS_TLS_TPREL32,
  2563. BFD_RELOC_MIPS_TLS_TPREL64,
  2564. BFD_RELOC_MIPS_TLS_TPREL_HI16,
  2565. BFD_RELOC_MICROMIPS_TLS_TPREL_HI16,
  2566. BFD_RELOC_MIPS_TLS_TPREL_LO16,
  2567. BFD_RELOC_MICROMIPS_TLS_TPREL_LO16,
  2568. BFD_RELOC_MIPS_EH,
  2569. /* MIPS ELF relocations (VxWorks and PLT extensions). */
  2570. BFD_RELOC_MIPS_COPY,
  2571. BFD_RELOC_MIPS_JUMP_SLOT,
  2572. /* Moxie ELF relocations. */
  2573. BFD_RELOC_MOXIE_10_PCREL,
  2574. /* FT32 ELF relocations. */
  2575. BFD_RELOC_FT32_10,
  2576. BFD_RELOC_FT32_20,
  2577. BFD_RELOC_FT32_17,
  2578. BFD_RELOC_FT32_18,
  2579. /* Fujitsu Frv Relocations. */
  2580. BFD_RELOC_FRV_LABEL16,
  2581. BFD_RELOC_FRV_LABEL24,
  2582. BFD_RELOC_FRV_LO16,
  2583. BFD_RELOC_FRV_HI16,
  2584. BFD_RELOC_FRV_GPREL12,
  2585. BFD_RELOC_FRV_GPRELU12,
  2586. BFD_RELOC_FRV_GPREL32,
  2587. BFD_RELOC_FRV_GPRELHI,
  2588. BFD_RELOC_FRV_GPRELLO,
  2589. BFD_RELOC_FRV_GOT12,
  2590. BFD_RELOC_FRV_GOTHI,
  2591. BFD_RELOC_FRV_GOTLO,
  2592. BFD_RELOC_FRV_FUNCDESC,
  2593. BFD_RELOC_FRV_FUNCDESC_GOT12,
  2594. BFD_RELOC_FRV_FUNCDESC_GOTHI,
  2595. BFD_RELOC_FRV_FUNCDESC_GOTLO,
  2596. BFD_RELOC_FRV_FUNCDESC_VALUE,
  2597. BFD_RELOC_FRV_FUNCDESC_GOTOFF12,
  2598. BFD_RELOC_FRV_FUNCDESC_GOTOFFHI,
  2599. BFD_RELOC_FRV_FUNCDESC_GOTOFFLO,
  2600. BFD_RELOC_FRV_GOTOFF12,
  2601. BFD_RELOC_FRV_GOTOFFHI,
  2602. BFD_RELOC_FRV_GOTOFFLO,
  2603. BFD_RELOC_FRV_GETTLSOFF,
  2604. BFD_RELOC_FRV_TLSDESC_VALUE,
  2605. BFD_RELOC_FRV_GOTTLSDESC12,
  2606. BFD_RELOC_FRV_GOTTLSDESCHI,
  2607. BFD_RELOC_FRV_GOTTLSDESCLO,
  2608. BFD_RELOC_FRV_TLSMOFF12,
  2609. BFD_RELOC_FRV_TLSMOFFHI,
  2610. BFD_RELOC_FRV_TLSMOFFLO,
  2611. BFD_RELOC_FRV_GOTTLSOFF12,
  2612. BFD_RELOC_FRV_GOTTLSOFFHI,
  2613. BFD_RELOC_FRV_GOTTLSOFFLO,
  2614. BFD_RELOC_FRV_TLSOFF,
  2615. BFD_RELOC_FRV_TLSDESC_RELAX,
  2616. BFD_RELOC_FRV_GETTLSOFF_RELAX,
  2617. BFD_RELOC_FRV_TLSOFF_RELAX,
  2618. BFD_RELOC_FRV_TLSMOFF,
  2619. /* This is a 24bit GOT-relative reloc for the mn10300. */
  2620. BFD_RELOC_MN10300_GOTOFF24,
  2621. /* This is a 32bit GOT-relative reloc for the mn10300, offset by two bytes
  2622. in the instruction. */
  2623. BFD_RELOC_MN10300_GOT32,
  2624. /* This is a 24bit GOT-relative reloc for the mn10300, offset by two bytes
  2625. in the instruction. */
  2626. BFD_RELOC_MN10300_GOT24,
  2627. /* This is a 16bit GOT-relative reloc for the mn10300, offset by two bytes
  2628. in the instruction. */
  2629. BFD_RELOC_MN10300_GOT16,
  2630. /* Copy symbol at runtime. */
  2631. BFD_RELOC_MN10300_COPY,
  2632. /* Create GOT entry. */
  2633. BFD_RELOC_MN10300_GLOB_DAT,
  2634. /* Create PLT entry. */
  2635. BFD_RELOC_MN10300_JMP_SLOT,
  2636. /* Adjust by program base. */
  2637. BFD_RELOC_MN10300_RELATIVE,
  2638. /* Together with another reloc targeted at the same location,
  2639. allows for a value that is the difference of two symbols
  2640. in the same section. */
  2641. BFD_RELOC_MN10300_SYM_DIFF,
  2642. /* The addend of this reloc is an alignment power that must
  2643. be honoured at the offset's location, regardless of linker
  2644. relaxation. */
  2645. BFD_RELOC_MN10300_ALIGN,
  2646. /* Various TLS-related relocations. */
  2647. BFD_RELOC_MN10300_TLS_GD,
  2648. BFD_RELOC_MN10300_TLS_LD,
  2649. BFD_RELOC_MN10300_TLS_LDO,
  2650. BFD_RELOC_MN10300_TLS_GOTIE,
  2651. BFD_RELOC_MN10300_TLS_IE,
  2652. BFD_RELOC_MN10300_TLS_LE,
  2653. BFD_RELOC_MN10300_TLS_DTPMOD,
  2654. BFD_RELOC_MN10300_TLS_DTPOFF,
  2655. BFD_RELOC_MN10300_TLS_TPOFF,
  2656. /* This is a 32bit pcrel reloc for the mn10300, offset by two bytes in the
  2657. instruction. */
  2658. BFD_RELOC_MN10300_32_PCREL,
  2659. /* This is a 16bit pcrel reloc for the mn10300, offset by two bytes in the
  2660. instruction. */
  2661. BFD_RELOC_MN10300_16_PCREL,
  2662. /* i386/elf relocations */
  2663. BFD_RELOC_386_GOT32,
  2664. BFD_RELOC_386_PLT32,
  2665. BFD_RELOC_386_COPY,
  2666. BFD_RELOC_386_GLOB_DAT,
  2667. BFD_RELOC_386_JUMP_SLOT,
  2668. BFD_RELOC_386_RELATIVE,
  2669. BFD_RELOC_386_GOTOFF,
  2670. BFD_RELOC_386_GOTPC,
  2671. BFD_RELOC_386_TLS_TPOFF,
  2672. BFD_RELOC_386_TLS_IE,
  2673. BFD_RELOC_386_TLS_GOTIE,
  2674. BFD_RELOC_386_TLS_LE,
  2675. BFD_RELOC_386_TLS_GD,
  2676. BFD_RELOC_386_TLS_LDM,
  2677. BFD_RELOC_386_TLS_LDO_32,
  2678. BFD_RELOC_386_TLS_IE_32,
  2679. BFD_RELOC_386_TLS_LE_32,
  2680. BFD_RELOC_386_TLS_DTPMOD32,
  2681. BFD_RELOC_386_TLS_DTPOFF32,
  2682. BFD_RELOC_386_TLS_TPOFF32,
  2683. BFD_RELOC_386_TLS_GOTDESC,
  2684. BFD_RELOC_386_TLS_DESC_CALL,
  2685. BFD_RELOC_386_TLS_DESC,
  2686. BFD_RELOC_386_IRELATIVE,
  2687. /* x86-64/elf relocations */
  2688. BFD_RELOC_X86_64_GOT32,
  2689. BFD_RELOC_X86_64_PLT32,
  2690. BFD_RELOC_X86_64_COPY,
  2691. BFD_RELOC_X86_64_GLOB_DAT,
  2692. BFD_RELOC_X86_64_JUMP_SLOT,
  2693. BFD_RELOC_X86_64_RELATIVE,
  2694. BFD_RELOC_X86_64_GOTPCREL,
  2695. BFD_RELOC_X86_64_32S,
  2696. BFD_RELOC_X86_64_DTPMOD64,
  2697. BFD_RELOC_X86_64_DTPOFF64,
  2698. BFD_RELOC_X86_64_TPOFF64,
  2699. BFD_RELOC_X86_64_TLSGD,
  2700. BFD_RELOC_X86_64_TLSLD,
  2701. BFD_RELOC_X86_64_DTPOFF32,
  2702. BFD_RELOC_X86_64_GOTTPOFF,
  2703. BFD_RELOC_X86_64_TPOFF32,
  2704. BFD_RELOC_X86_64_GOTOFF64,
  2705. BFD_RELOC_X86_64_GOTPC32,
  2706. BFD_RELOC_X86_64_GOT64,
  2707. BFD_RELOC_X86_64_GOTPCREL64,
  2708. BFD_RELOC_X86_64_GOTPC64,
  2709. BFD_RELOC_X86_64_GOTPLT64,
  2710. BFD_RELOC_X86_64_PLTOFF64,
  2711. BFD_RELOC_X86_64_GOTPC32_TLSDESC,
  2712. BFD_RELOC_X86_64_TLSDESC_CALL,
  2713. BFD_RELOC_X86_64_TLSDESC,
  2714. BFD_RELOC_X86_64_IRELATIVE,
  2715. BFD_RELOC_X86_64_PC32_BND,
  2716. BFD_RELOC_X86_64_PLT32_BND,
  2717. /* ns32k relocations */
  2718. BFD_RELOC_NS32K_IMM_8,
  2719. BFD_RELOC_NS32K_IMM_16,
  2720. BFD_RELOC_NS32K_IMM_32,
  2721. BFD_RELOC_NS32K_IMM_8_PCREL,
  2722. BFD_RELOC_NS32K_IMM_16_PCREL,
  2723. BFD_RELOC_NS32K_IMM_32_PCREL,
  2724. BFD_RELOC_NS32K_DISP_8,
  2725. BFD_RELOC_NS32K_DISP_16,
  2726. BFD_RELOC_NS32K_DISP_32,
  2727. BFD_RELOC_NS32K_DISP_8_PCREL,
  2728. BFD_RELOC_NS32K_DISP_16_PCREL,
  2729. BFD_RELOC_NS32K_DISP_32_PCREL,
  2730. /* PDP11 relocations */
  2731. BFD_RELOC_PDP11_DISP_8_PCREL,
  2732. BFD_RELOC_PDP11_DISP_6_PCREL,
  2733. /* Picojava relocs. Not all of these appear in object files. */
  2734. BFD_RELOC_PJ_CODE_HI16,
  2735. BFD_RELOC_PJ_CODE_LO16,
  2736. BFD_RELOC_PJ_CODE_DIR16,
  2737. BFD_RELOC_PJ_CODE_DIR32,
  2738. BFD_RELOC_PJ_CODE_REL16,
  2739. BFD_RELOC_PJ_CODE_REL32,
  2740. /* Power(rs6000) and PowerPC relocations. */
  2741. BFD_RELOC_PPC_B26,
  2742. BFD_RELOC_PPC_BA26,
  2743. BFD_RELOC_PPC_TOC16,
  2744. BFD_RELOC_PPC_B16,
  2745. BFD_RELOC_PPC_B16_BRTAKEN,
  2746. BFD_RELOC_PPC_B16_BRNTAKEN,
  2747. BFD_RELOC_PPC_BA16,
  2748. BFD_RELOC_PPC_BA16_BRTAKEN,
  2749. BFD_RELOC_PPC_BA16_BRNTAKEN,
  2750. BFD_RELOC_PPC_COPY,
  2751. BFD_RELOC_PPC_GLOB_DAT,
  2752. BFD_RELOC_PPC_JMP_SLOT,
  2753. BFD_RELOC_PPC_RELATIVE,
  2754. BFD_RELOC_PPC_LOCAL24PC,
  2755. BFD_RELOC_PPC_EMB_NADDR32,
  2756. BFD_RELOC_PPC_EMB_NADDR16,
  2757. BFD_RELOC_PPC_EMB_NADDR16_LO,
  2758. BFD_RELOC_PPC_EMB_NADDR16_HI,
  2759. BFD_RELOC_PPC_EMB_NADDR16_HA,
  2760. BFD_RELOC_PPC_EMB_SDAI16,
  2761. BFD_RELOC_PPC_EMB_SDA2I16,
  2762. BFD_RELOC_PPC_EMB_SDA2REL,
  2763. BFD_RELOC_PPC_EMB_SDA21,
  2764. BFD_RELOC_PPC_EMB_MRKREF,
  2765. BFD_RELOC_PPC_EMB_RELSEC16,
  2766. BFD_RELOC_PPC_EMB_RELST_LO,
  2767. BFD_RELOC_PPC_EMB_RELST_HI,
  2768. BFD_RELOC_PPC_EMB_RELST_HA,
  2769. BFD_RELOC_PPC_EMB_BIT_FLD,
  2770. BFD_RELOC_PPC_EMB_RELSDA,
  2771. BFD_RELOC_PPC_VLE_REL8,
  2772. BFD_RELOC_PPC_VLE_REL15,
  2773. BFD_RELOC_PPC_VLE_REL24,
  2774. BFD_RELOC_PPC_VLE_LO16A,
  2775. BFD_RELOC_PPC_VLE_LO16D,
  2776. BFD_RELOC_PPC_VLE_HI16A,
  2777. BFD_RELOC_PPC_VLE_HI16D,
  2778. BFD_RELOC_PPC_VLE_HA16A,
  2779. BFD_RELOC_PPC_VLE_HA16D,
  2780. BFD_RELOC_PPC_VLE_SDA21,
  2781. BFD_RELOC_PPC_VLE_SDA21_LO,
  2782. BFD_RELOC_PPC_VLE_SDAREL_LO16A,
  2783. BFD_RELOC_PPC_VLE_SDAREL_LO16D,
  2784. BFD_RELOC_PPC_VLE_SDAREL_HI16A,
  2785. BFD_RELOC_PPC_VLE_SDAREL_HI16D,
  2786. BFD_RELOC_PPC_VLE_SDAREL_HA16A,
  2787. BFD_RELOC_PPC_VLE_SDAREL_HA16D,
  2788. BFD_RELOC_PPC64_HIGHER,
  2789. BFD_RELOC_PPC64_HIGHER_S,
  2790. BFD_RELOC_PPC64_HIGHEST,
  2791. BFD_RELOC_PPC64_HIGHEST_S,
  2792. BFD_RELOC_PPC64_TOC16_LO,
  2793. BFD_RELOC_PPC64_TOC16_HI,
  2794. BFD_RELOC_PPC64_TOC16_HA,
  2795. BFD_RELOC_PPC64_TOC,
  2796. BFD_RELOC_PPC64_PLTGOT16,
  2797. BFD_RELOC_PPC64_PLTGOT16_LO,
  2798. BFD_RELOC_PPC64_PLTGOT16_HI,
  2799. BFD_RELOC_PPC64_PLTGOT16_HA,
  2800. BFD_RELOC_PPC64_ADDR16_DS,
  2801. BFD_RELOC_PPC64_ADDR16_LO_DS,
  2802. BFD_RELOC_PPC64_GOT16_DS,
  2803. BFD_RELOC_PPC64_GOT16_LO_DS,
  2804. BFD_RELOC_PPC64_PLT16_LO_DS,
  2805. BFD_RELOC_PPC64_SECTOFF_DS,
  2806. BFD_RELOC_PPC64_SECTOFF_LO_DS,
  2807. BFD_RELOC_PPC64_TOC16_DS,
  2808. BFD_RELOC_PPC64_TOC16_LO_DS,
  2809. BFD_RELOC_PPC64_PLTGOT16_DS,
  2810. BFD_RELOC_PPC64_PLTGOT16_LO_DS,
  2811. BFD_RELOC_PPC64_ADDR16_HIGH,
  2812. BFD_RELOC_PPC64_ADDR16_HIGHA,
  2813. BFD_RELOC_PPC64_ADDR64_LOCAL,
  2814. /* PowerPC and PowerPC64 thread-local storage relocations. */
  2815. BFD_RELOC_PPC_TLS,
  2816. BFD_RELOC_PPC_TLSGD,
  2817. BFD_RELOC_PPC_TLSLD,
  2818. BFD_RELOC_PPC_DTPMOD,
  2819. BFD_RELOC_PPC_TPREL16,
  2820. BFD_RELOC_PPC_TPREL16_LO,
  2821. BFD_RELOC_PPC_TPREL16_HI,
  2822. BFD_RELOC_PPC_TPREL16_HA,
  2823. BFD_RELOC_PPC_TPREL,
  2824. BFD_RELOC_PPC_DTPREL16,
  2825. BFD_RELOC_PPC_DTPREL16_LO,
  2826. BFD_RELOC_PPC_DTPREL16_HI,
  2827. BFD_RELOC_PPC_DTPREL16_HA,
  2828. BFD_RELOC_PPC_DTPREL,
  2829. BFD_RELOC_PPC_GOT_TLSGD16,
  2830. BFD_RELOC_PPC_GOT_TLSGD16_LO,
  2831. BFD_RELOC_PPC_GOT_TLSGD16_HI,
  2832. BFD_RELOC_PPC_GOT_TLSGD16_HA,
  2833. BFD_RELOC_PPC_GOT_TLSLD16,
  2834. BFD_RELOC_PPC_GOT_TLSLD16_LO,
  2835. BFD_RELOC_PPC_GOT_TLSLD16_HI,
  2836. BFD_RELOC_PPC_GOT_TLSLD16_HA,
  2837. BFD_RELOC_PPC_GOT_TPREL16,
  2838. BFD_RELOC_PPC_GOT_TPREL16_LO,
  2839. BFD_RELOC_PPC_GOT_TPREL16_HI,
  2840. BFD_RELOC_PPC_GOT_TPREL16_HA,
  2841. BFD_RELOC_PPC_GOT_DTPREL16,
  2842. BFD_RELOC_PPC_GOT_DTPREL16_LO,
  2843. BFD_RELOC_PPC_GOT_DTPREL16_HI,
  2844. BFD_RELOC_PPC_GOT_DTPREL16_HA,
  2845. BFD_RELOC_PPC64_TPREL16_DS,
  2846. BFD_RELOC_PPC64_TPREL16_LO_DS,
  2847. BFD_RELOC_PPC64_TPREL16_HIGHER,
  2848. BFD_RELOC_PPC64_TPREL16_HIGHERA,
  2849. BFD_RELOC_PPC64_TPREL16_HIGHEST,
  2850. BFD_RELOC_PPC64_TPREL16_HIGHESTA,
  2851. BFD_RELOC_PPC64_DTPREL16_DS,
  2852. BFD_RELOC_PPC64_DTPREL16_LO_DS,
  2853. BFD_RELOC_PPC64_DTPREL16_HIGHER,
  2854. BFD_RELOC_PPC64_DTPREL16_HIGHERA,
  2855. BFD_RELOC_PPC64_DTPREL16_HIGHEST,
  2856. BFD_RELOC_PPC64_DTPREL16_HIGHESTA,
  2857. BFD_RELOC_PPC64_TPREL16_HIGH,
  2858. BFD_RELOC_PPC64_TPREL16_HIGHA,
  2859. BFD_RELOC_PPC64_DTPREL16_HIGH,
  2860. BFD_RELOC_PPC64_DTPREL16_HIGHA,
  2861. /* IBM 370/390 relocations */
  2862. BFD_RELOC_I370_D12,
  2863. /* The type of reloc used to build a constructor table - at the moment
  2864. probably a 32 bit wide absolute relocation, but the target can choose.
  2865. It generally does map to one of the other relocation types. */
  2866. BFD_RELOC_CTOR,
  2867. /* ARM 26 bit pc-relative branch. The lowest two bits must be zero and are
  2868. not stored in the instruction. */
  2869. BFD_RELOC_ARM_PCREL_BRANCH,
  2870. /* ARM 26 bit pc-relative branch. The lowest bit must be zero and is
  2871. not stored in the instruction. The 2nd lowest bit comes from a 1 bit
  2872. field in the instruction. */
  2873. BFD_RELOC_ARM_PCREL_BLX,
  2874. /* Thumb 22 bit pc-relative branch. The lowest bit must be zero and is
  2875. not stored in the instruction. The 2nd lowest bit comes from a 1 bit
  2876. field in the instruction. */
  2877. BFD_RELOC_THUMB_PCREL_BLX,
  2878. /* ARM 26-bit pc-relative branch for an unconditional BL or BLX instruction. */
  2879. BFD_RELOC_ARM_PCREL_CALL,
  2880. /* ARM 26-bit pc-relative branch for B or conditional BL instruction. */
  2881. BFD_RELOC_ARM_PCREL_JUMP,
  2882. /* Thumb 7-, 9-, 12-, 20-, 23-, and 25-bit pc-relative branches.
  2883. The lowest bit must be zero and is not stored in the instruction.
  2884. Note that the corresponding ELF R_ARM_THM_JUMPnn constant has an
  2885. "nn" one smaller in all cases. Note further that BRANCH23
  2886. corresponds to R_ARM_THM_CALL. */
  2887. BFD_RELOC_THUMB_PCREL_BRANCH7,
  2888. BFD_RELOC_THUMB_PCREL_BRANCH9,
  2889. BFD_RELOC_THUMB_PCREL_BRANCH12,
  2890. BFD_RELOC_THUMB_PCREL_BRANCH20,
  2891. BFD_RELOC_THUMB_PCREL_BRANCH23,
  2892. BFD_RELOC_THUMB_PCREL_BRANCH25,
  2893. /* 12-bit immediate offset, used in ARM-format ldr and str instructions. */
  2894. BFD_RELOC_ARM_OFFSET_IMM,
  2895. /* 5-bit immediate offset, used in Thumb-format ldr and str instructions. */
  2896. BFD_RELOC_ARM_THUMB_OFFSET,
  2897. /* Pc-relative or absolute relocation depending on target. Used for
  2898. entries in .init_array sections. */
  2899. BFD_RELOC_ARM_TARGET1,
  2900. /* Read-only segment base relative address. */
  2901. BFD_RELOC_ARM_ROSEGREL32,
  2902. /* Data segment base relative address. */
  2903. BFD_RELOC_ARM_SBREL32,
  2904. /* This reloc is used for references to RTTI data from exception handling
  2905. tables. The actual definition depends on the target. It may be a
  2906. pc-relative or some form of GOT-indirect relocation. */
  2907. BFD_RELOC_ARM_TARGET2,
  2908. /* 31-bit PC relative address. */
  2909. BFD_RELOC_ARM_PREL31,
  2910. /* Low and High halfword relocations for MOVW and MOVT instructions. */
  2911. BFD_RELOC_ARM_MOVW,
  2912. BFD_RELOC_ARM_MOVT,
  2913. BFD_RELOC_ARM_MOVW_PCREL,
  2914. BFD_RELOC_ARM_MOVT_PCREL,
  2915. BFD_RELOC_ARM_THUMB_MOVW,
  2916. BFD_RELOC_ARM_THUMB_MOVT,
  2917. BFD_RELOC_ARM_THUMB_MOVW_PCREL,
  2918. BFD_RELOC_ARM_THUMB_MOVT_PCREL,
  2919. /* Relocations for setting up GOTs and PLTs for shared libraries. */
  2920. BFD_RELOC_ARM_JUMP_SLOT,
  2921. BFD_RELOC_ARM_GLOB_DAT,
  2922. BFD_RELOC_ARM_GOT32,
  2923. BFD_RELOC_ARM_PLT32,
  2924. BFD_RELOC_ARM_RELATIVE,
  2925. BFD_RELOC_ARM_GOTOFF,
  2926. BFD_RELOC_ARM_GOTPC,
  2927. BFD_RELOC_ARM_GOT_PREL,
  2928. /* ARM thread-local storage relocations. */
  2929. BFD_RELOC_ARM_TLS_GD32,
  2930. BFD_RELOC_ARM_TLS_LDO32,
  2931. BFD_RELOC_ARM_TLS_LDM32,
  2932. BFD_RELOC_ARM_TLS_DTPOFF32,
  2933. BFD_RELOC_ARM_TLS_DTPMOD32,
  2934. BFD_RELOC_ARM_TLS_TPOFF32,
  2935. BFD_RELOC_ARM_TLS_IE32,
  2936. BFD_RELOC_ARM_TLS_LE32,
  2937. BFD_RELOC_ARM_TLS_GOTDESC,
  2938. BFD_RELOC_ARM_TLS_CALL,
  2939. BFD_RELOC_ARM_THM_TLS_CALL,
  2940. BFD_RELOC_ARM_TLS_DESCSEQ,
  2941. BFD_RELOC_ARM_THM_TLS_DESCSEQ,
  2942. BFD_RELOC_ARM_TLS_DESC,
  2943. /* ARM group relocations. */
  2944. BFD_RELOC_ARM_ALU_PC_G0_NC,
  2945. BFD_RELOC_ARM_ALU_PC_G0,
  2946. BFD_RELOC_ARM_ALU_PC_G1_NC,
  2947. BFD_RELOC_ARM_ALU_PC_G1,
  2948. BFD_RELOC_ARM_ALU_PC_G2,
  2949. BFD_RELOC_ARM_LDR_PC_G0,
  2950. BFD_RELOC_ARM_LDR_PC_G1,
  2951. BFD_RELOC_ARM_LDR_PC_G2,
  2952. BFD_RELOC_ARM_LDRS_PC_G0,
  2953. BFD_RELOC_ARM_LDRS_PC_G1,
  2954. BFD_RELOC_ARM_LDRS_PC_G2,
  2955. BFD_RELOC_ARM_LDC_PC_G0,
  2956. BFD_RELOC_ARM_LDC_PC_G1,
  2957. BFD_RELOC_ARM_LDC_PC_G2,
  2958. BFD_RELOC_ARM_ALU_SB_G0_NC,
  2959. BFD_RELOC_ARM_ALU_SB_G0,
  2960. BFD_RELOC_ARM_ALU_SB_G1_NC,
  2961. BFD_RELOC_ARM_ALU_SB_G1,
  2962. BFD_RELOC_ARM_ALU_SB_G2,
  2963. BFD_RELOC_ARM_LDR_SB_G0,
  2964. BFD_RELOC_ARM_LDR_SB_G1,
  2965. BFD_RELOC_ARM_LDR_SB_G2,
  2966. BFD_RELOC_ARM_LDRS_SB_G0,
  2967. BFD_RELOC_ARM_LDRS_SB_G1,
  2968. BFD_RELOC_ARM_LDRS_SB_G2,
  2969. BFD_RELOC_ARM_LDC_SB_G0,
  2970. BFD_RELOC_ARM_LDC_SB_G1,
  2971. BFD_RELOC_ARM_LDC_SB_G2,
  2972. /* Annotation of BX instructions. */
  2973. BFD_RELOC_ARM_V4BX,
  2974. /* ARM support for STT_GNU_IFUNC. */
  2975. BFD_RELOC_ARM_IRELATIVE,
  2976. /* These relocs are only used within the ARM assembler. They are not
  2977. (at present) written to any object files. */
  2978. BFD_RELOC_ARM_IMMEDIATE,
  2979. BFD_RELOC_ARM_ADRL_IMMEDIATE,
  2980. BFD_RELOC_ARM_T32_IMMEDIATE,
  2981. BFD_RELOC_ARM_T32_ADD_IMM,
  2982. BFD_RELOC_ARM_T32_IMM12,
  2983. BFD_RELOC_ARM_T32_ADD_PC12,
  2984. BFD_RELOC_ARM_SHIFT_IMM,
  2985. BFD_RELOC_ARM_SMC,
  2986. BFD_RELOC_ARM_HVC,
  2987. BFD_RELOC_ARM_SWI,
  2988. BFD_RELOC_ARM_MULTI,
  2989. BFD_RELOC_ARM_CP_OFF_IMM,
  2990. BFD_RELOC_ARM_CP_OFF_IMM_S2,
  2991. BFD_RELOC_ARM_T32_CP_OFF_IMM,
  2992. BFD_RELOC_ARM_T32_CP_OFF_IMM_S2,
  2993. BFD_RELOC_ARM_ADR_IMM,
  2994. BFD_RELOC_ARM_LDR_IMM,
  2995. BFD_RELOC_ARM_LITERAL,
  2996. BFD_RELOC_ARM_IN_POOL,
  2997. BFD_RELOC_ARM_OFFSET_IMM8,
  2998. BFD_RELOC_ARM_T32_OFFSET_U8,
  2999. BFD_RELOC_ARM_T32_OFFSET_IMM,
  3000. BFD_RELOC_ARM_HWLITERAL,
  3001. BFD_RELOC_ARM_THUMB_ADD,
  3002. BFD_RELOC_ARM_THUMB_IMM,
  3003. BFD_RELOC_ARM_THUMB_SHIFT,
  3004. /* Renesas / SuperH SH relocs. Not all of these appear in object files. */
  3005. BFD_RELOC_SH_PCDISP8BY2,
  3006. BFD_RELOC_SH_PCDISP12BY2,
  3007. BFD_RELOC_SH_IMM3,
  3008. BFD_RELOC_SH_IMM3U,
  3009. BFD_RELOC_SH_DISP12,
  3010. BFD_RELOC_SH_DISP12BY2,
  3011. BFD_RELOC_SH_DISP12BY4,
  3012. BFD_RELOC_SH_DISP12BY8,
  3013. BFD_RELOC_SH_DISP20,
  3014. BFD_RELOC_SH_DISP20BY8,
  3015. BFD_RELOC_SH_IMM4,
  3016. BFD_RELOC_SH_IMM4BY2,
  3017. BFD_RELOC_SH_IMM4BY4,
  3018. BFD_RELOC_SH_IMM8,
  3019. BFD_RELOC_SH_IMM8BY2,
  3020. BFD_RELOC_SH_IMM8BY4,
  3021. BFD_RELOC_SH_PCRELIMM8BY2,
  3022. BFD_RELOC_SH_PCRELIMM8BY4,
  3023. BFD_RELOC_SH_SWITCH16,
  3024. BFD_RELOC_SH_SWITCH32,
  3025. BFD_RELOC_SH_USES,
  3026. BFD_RELOC_SH_COUNT,
  3027. BFD_RELOC_SH_ALIGN,
  3028. BFD_RELOC_SH_CODE,
  3029. BFD_RELOC_SH_DATA,
  3030. BFD_RELOC_SH_LABEL,
  3031. BFD_RELOC_SH_LOOP_START,
  3032. BFD_RELOC_SH_LOOP_END,
  3033. BFD_RELOC_SH_COPY,
  3034. BFD_RELOC_SH_GLOB_DAT,
  3035. BFD_RELOC_SH_JMP_SLOT,
  3036. BFD_RELOC_SH_RELATIVE,
  3037. BFD_RELOC_SH_GOTPC,
  3038. BFD_RELOC_SH_GOT_LOW16,
  3039. BFD_RELOC_SH_GOT_MEDLOW16,
  3040. BFD_RELOC_SH_GOT_MEDHI16,
  3041. BFD_RELOC_SH_GOT_HI16,
  3042. BFD_RELOC_SH_GOTPLT_LOW16,
  3043. BFD_RELOC_SH_GOTPLT_MEDLOW16,
  3044. BFD_RELOC_SH_GOTPLT_MEDHI16,
  3045. BFD_RELOC_SH_GOTPLT_HI16,
  3046. BFD_RELOC_SH_PLT_LOW16,
  3047. BFD_RELOC_SH_PLT_MEDLOW16,
  3048. BFD_RELOC_SH_PLT_MEDHI16,
  3049. BFD_RELOC_SH_PLT_HI16,
  3050. BFD_RELOC_SH_GOTOFF_LOW16,
  3051. BFD_RELOC_SH_GOTOFF_MEDLOW16,
  3052. BFD_RELOC_SH_GOTOFF_MEDHI16,
  3053. BFD_RELOC_SH_GOTOFF_HI16,
  3054. BFD_RELOC_SH_GOTPC_LOW16,
  3055. BFD_RELOC_SH_GOTPC_MEDLOW16,
  3056. BFD_RELOC_SH_GOTPC_MEDHI16,
  3057. BFD_RELOC_SH_GOTPC_HI16,
  3058. BFD_RELOC_SH_COPY64,
  3059. BFD_RELOC_SH_GLOB_DAT64,
  3060. BFD_RELOC_SH_JMP_SLOT64,
  3061. BFD_RELOC_SH_RELATIVE64,
  3062. BFD_RELOC_SH_GOT10BY4,
  3063. BFD_RELOC_SH_GOT10BY8,
  3064. BFD_RELOC_SH_GOTPLT10BY4,
  3065. BFD_RELOC_SH_GOTPLT10BY8,
  3066. BFD_RELOC_SH_GOTPLT32,
  3067. BFD_RELOC_SH_SHMEDIA_CODE,
  3068. BFD_RELOC_SH_IMMU5,
  3069. BFD_RELOC_SH_IMMS6,
  3070. BFD_RELOC_SH_IMMS6BY32,
  3071. BFD_RELOC_SH_IMMU6,
  3072. BFD_RELOC_SH_IMMS10,
  3073. BFD_RELOC_SH_IMMS10BY2,
  3074. BFD_RELOC_SH_IMMS10BY4,
  3075. BFD_RELOC_SH_IMMS10BY8,
  3076. BFD_RELOC_SH_IMMS16,
  3077. BFD_RELOC_SH_IMMU16,
  3078. BFD_RELOC_SH_IMM_LOW16,
  3079. BFD_RELOC_SH_IMM_LOW16_PCREL,
  3080. BFD_RELOC_SH_IMM_MEDLOW16,
  3081. BFD_RELOC_SH_IMM_MEDLOW16_PCREL,
  3082. BFD_RELOC_SH_IMM_MEDHI16,
  3083. BFD_RELOC_SH_IMM_MEDHI16_PCREL,
  3084. BFD_RELOC_SH_IMM_HI16,
  3085. BFD_RELOC_SH_IMM_HI16_PCREL,
  3086. BFD_RELOC_SH_PT_16,
  3087. BFD_RELOC_SH_TLS_GD_32,
  3088. BFD_RELOC_SH_TLS_LD_32,
  3089. BFD_RELOC_SH_TLS_LDO_32,
  3090. BFD_RELOC_SH_TLS_IE_32,
  3091. BFD_RELOC_SH_TLS_LE_32,
  3092. BFD_RELOC_SH_TLS_DTPMOD32,
  3093. BFD_RELOC_SH_TLS_DTPOFF32,
  3094. BFD_RELOC_SH_TLS_TPOFF32,
  3095. BFD_RELOC_SH_GOT20,
  3096. BFD_RELOC_SH_GOTOFF20,
  3097. BFD_RELOC_SH_GOTFUNCDESC,
  3098. BFD_RELOC_SH_GOTFUNCDESC20,
  3099. BFD_RELOC_SH_GOTOFFFUNCDESC,
  3100. BFD_RELOC_SH_GOTOFFFUNCDESC20,
  3101. BFD_RELOC_SH_FUNCDESC,
  3102. /* ARC relocs. */
  3103. BFD_RELOC_ARC_NONE,
  3104. BFD_RELOC_ARC_8,
  3105. BFD_RELOC_ARC_16,
  3106. BFD_RELOC_ARC_24,
  3107. BFD_RELOC_ARC_32,
  3108. BFD_RELOC_ARC_N8,
  3109. BFD_RELOC_ARC_N16,
  3110. BFD_RELOC_ARC_N24,
  3111. BFD_RELOC_ARC_N32,
  3112. BFD_RELOC_ARC_SDA,
  3113. BFD_RELOC_ARC_SECTOFF,
  3114. BFD_RELOC_ARC_S21H_PCREL,
  3115. BFD_RELOC_ARC_S21W_PCREL,
  3116. BFD_RELOC_ARC_S25H_PCREL,
  3117. BFD_RELOC_ARC_S25W_PCREL,
  3118. BFD_RELOC_ARC_SDA32,
  3119. BFD_RELOC_ARC_SDA_LDST,
  3120. BFD_RELOC_ARC_SDA_LDST1,
  3121. BFD_RELOC_ARC_SDA_LDST2,
  3122. BFD_RELOC_ARC_SDA16_LD,
  3123. BFD_RELOC_ARC_SDA16_LD1,
  3124. BFD_RELOC_ARC_SDA16_LD2,
  3125. BFD_RELOC_ARC_S13_PCREL,
  3126. BFD_RELOC_ARC_W,
  3127. BFD_RELOC_ARC_32_ME,
  3128. BFD_RELOC_ARC_32_ME_S,
  3129. BFD_RELOC_ARC_N32_ME,
  3130. BFD_RELOC_ARC_SECTOFF_ME,
  3131. BFD_RELOC_ARC_SDA32_ME,
  3132. BFD_RELOC_ARC_W_ME,
  3133. BFD_RELOC_AC_SECTOFF_U8,
  3134. BFD_RELOC_AC_SECTOFF_U8_1,
  3135. BFD_RELOC_AC_SECTOFF_U8_2,
  3136. BFD_RELOC_AC_SECTFOFF_S9,
  3137. BFD_RELOC_AC_SECTFOFF_S9_1,
  3138. BFD_RELOC_AC_SECTFOFF_S9_2,
  3139. BFD_RELOC_ARC_SECTOFF_ME_1,
  3140. BFD_RELOC_ARC_SECTOFF_ME_2,
  3141. BFD_RELOC_ARC_SECTOFF_1,
  3142. BFD_RELOC_ARC_SECTOFF_2,
  3143. BFD_RELOC_ARC_SDA16_ST2,
  3144. BFD_RELOC_ARC_PC32,
  3145. BFD_RELOC_ARC_GOT32,
  3146. BFD_RELOC_ARC_GOTPC32,
  3147. BFD_RELOC_ARC_PLT32,
  3148. BFD_RELOC_ARC_COPY,
  3149. BFD_RELOC_ARC_GLOB_DAT,
  3150. BFD_RELOC_ARC_JMP_SLOT,
  3151. BFD_RELOC_ARC_RELATIVE,
  3152. BFD_RELOC_ARC_GOTOFF,
  3153. BFD_RELOC_ARC_GOTPC,
  3154. BFD_RELOC_ARC_S21W_PCREL_PLT,
  3155. BFD_RELOC_ARC_S25H_PCREL_PLT,
  3156. BFD_RELOC_ARC_TLS_DTPMOD,
  3157. BFD_RELOC_ARC_TLS_TPOFF,
  3158. BFD_RELOC_ARC_TLS_GD_GOT,
  3159. BFD_RELOC_ARC_TLS_GD_LD,
  3160. BFD_RELOC_ARC_TLS_GD_CALL,
  3161. BFD_RELOC_ARC_TLS_IE_GOT,
  3162. BFD_RELOC_ARC_TLS_DTPOFF,
  3163. BFD_RELOC_ARC_TLS_DTPOFF_S9,
  3164. BFD_RELOC_ARC_TLS_LE_S9,
  3165. BFD_RELOC_ARC_TLS_LE_32,
  3166. BFD_RELOC_ARC_S25W_PCREL_PLT,
  3167. BFD_RELOC_ARC_S21H_PCREL_PLT,
  3168. /* ADI Blackfin 16 bit immediate absolute reloc. */
  3169. BFD_RELOC_BFIN_16_IMM,
  3170. /* ADI Blackfin 16 bit immediate absolute reloc higher 16 bits. */
  3171. BFD_RELOC_BFIN_16_HIGH,
  3172. /* ADI Blackfin 'a' part of LSETUP. */
  3173. BFD_RELOC_BFIN_4_PCREL,
  3174. /* ADI Blackfin. */
  3175. BFD_RELOC_BFIN_5_PCREL,
  3176. /* ADI Blackfin 16 bit immediate absolute reloc lower 16 bits. */
  3177. BFD_RELOC_BFIN_16_LOW,
  3178. /* ADI Blackfin. */
  3179. BFD_RELOC_BFIN_10_PCREL,
  3180. /* ADI Blackfin 'b' part of LSETUP. */
  3181. BFD_RELOC_BFIN_11_PCREL,
  3182. /* ADI Blackfin. */
  3183. BFD_RELOC_BFIN_12_PCREL_JUMP,
  3184. /* ADI Blackfin Short jump, pcrel. */
  3185. BFD_RELOC_BFIN_12_PCREL_JUMP_S,
  3186. /* ADI Blackfin Call.x not implemented. */
  3187. BFD_RELOC_BFIN_24_PCREL_CALL_X,
  3188. /* ADI Blackfin Long Jump pcrel. */
  3189. BFD_RELOC_BFIN_24_PCREL_JUMP_L,
  3190. /* ADI Blackfin FD-PIC relocations. */
  3191. BFD_RELOC_BFIN_GOT17M4,
  3192. BFD_RELOC_BFIN_GOTHI,
  3193. BFD_RELOC_BFIN_GOTLO,
  3194. BFD_RELOC_BFIN_FUNCDESC,
  3195. BFD_RELOC_BFIN_FUNCDESC_GOT17M4,
  3196. BFD_RELOC_BFIN_FUNCDESC_GOTHI,
  3197. BFD_RELOC_BFIN_FUNCDESC_GOTLO,
  3198. BFD_RELOC_BFIN_FUNCDESC_VALUE,
  3199. BFD_RELOC_BFIN_FUNCDESC_GOTOFF17M4,
  3200. BFD_RELOC_BFIN_FUNCDESC_GOTOFFHI,
  3201. BFD_RELOC_BFIN_FUNCDESC_GOTOFFLO,
  3202. BFD_RELOC_BFIN_GOTOFF17M4,
  3203. BFD_RELOC_BFIN_GOTOFFHI,
  3204. BFD_RELOC_BFIN_GOTOFFLO,
  3205. /* ADI Blackfin GOT relocation. */
  3206. BFD_RELOC_BFIN_GOT,
  3207. /* ADI Blackfin PLTPC relocation. */
  3208. BFD_RELOC_BFIN_PLTPC,
  3209. /* ADI Blackfin arithmetic relocation. */
  3210. BFD_ARELOC_BFIN_PUSH,
  3211. /* ADI Blackfin arithmetic relocation. */
  3212. BFD_ARELOC_BFIN_CONST,
  3213. /* ADI Blackfin arithmetic relocation. */
  3214. BFD_ARELOC_BFIN_ADD,
  3215. /* ADI Blackfin arithmetic relocation. */
  3216. BFD_ARELOC_BFIN_SUB,
  3217. /* ADI Blackfin arithmetic relocation. */
  3218. BFD_ARELOC_BFIN_MULT,
  3219. /* ADI Blackfin arithmetic relocation. */
  3220. BFD_ARELOC_BFIN_DIV,
  3221. /* ADI Blackfin arithmetic relocation. */
  3222. BFD_ARELOC_BFIN_MOD,
  3223. /* ADI Blackfin arithmetic relocation. */
  3224. BFD_ARELOC_BFIN_LSHIFT,
  3225. /* ADI Blackfin arithmetic relocation. */
  3226. BFD_ARELOC_BFIN_RSHIFT,
  3227. /* ADI Blackfin arithmetic relocation. */
  3228. BFD_ARELOC_BFIN_AND,
  3229. /* ADI Blackfin arithmetic relocation. */
  3230. BFD_ARELOC_BFIN_OR,
  3231. /* ADI Blackfin arithmetic relocation. */
  3232. BFD_ARELOC_BFIN_XOR,
  3233. /* ADI Blackfin arithmetic relocation. */
  3234. BFD_ARELOC_BFIN_LAND,
  3235. /* ADI Blackfin arithmetic relocation. */
  3236. BFD_ARELOC_BFIN_LOR,
  3237. /* ADI Blackfin arithmetic relocation. */
  3238. BFD_ARELOC_BFIN_LEN,
  3239. /* ADI Blackfin arithmetic relocation. */
  3240. BFD_ARELOC_BFIN_NEG,
  3241. /* ADI Blackfin arithmetic relocation. */
  3242. BFD_ARELOC_BFIN_COMP,
  3243. /* ADI Blackfin arithmetic relocation. */
  3244. BFD_ARELOC_BFIN_PAGE,
  3245. /* ADI Blackfin arithmetic relocation. */
  3246. BFD_ARELOC_BFIN_HWPAGE,
  3247. /* ADI Blackfin arithmetic relocation. */
  3248. BFD_ARELOC_BFIN_ADDR,
  3249. /* Mitsubishi D10V relocs.
  3250. This is a 10-bit reloc with the right 2 bits
  3251. assumed to be 0. */
  3252. BFD_RELOC_D10V_10_PCREL_R,
  3253. /* Mitsubishi D10V relocs.
  3254. This is a 10-bit reloc with the right 2 bits
  3255. assumed to be 0. This is the same as the previous reloc
  3256. except it is in the left container, i.e.,
  3257. shifted left 15 bits. */
  3258. BFD_RELOC_D10V_10_PCREL_L,
  3259. /* This is an 18-bit reloc with the right 2 bits
  3260. assumed to be 0. */
  3261. BFD_RELOC_D10V_18,
  3262. /* This is an 18-bit reloc with the right 2 bits
  3263. assumed to be 0. */
  3264. BFD_RELOC_D10V_18_PCREL,
  3265. /* Mitsubishi D30V relocs.
  3266. This is a 6-bit absolute reloc. */
  3267. BFD_RELOC_D30V_6,
  3268. /* This is a 6-bit pc-relative reloc with
  3269. the right 3 bits assumed to be 0. */
  3270. BFD_RELOC_D30V_9_PCREL,
  3271. /* This is a 6-bit pc-relative reloc with
  3272. the right 3 bits assumed to be 0. Same
  3273. as the previous reloc but on the right side
  3274. of the container. */
  3275. BFD_RELOC_D30V_9_PCREL_R,
  3276. /* This is a 12-bit absolute reloc with the
  3277. right 3 bitsassumed to be 0. */
  3278. BFD_RELOC_D30V_15,
  3279. /* This is a 12-bit pc-relative reloc with
  3280. the right 3 bits assumed to be 0. */
  3281. BFD_RELOC_D30V_15_PCREL,
  3282. /* This is a 12-bit pc-relative reloc with
  3283. the right 3 bits assumed to be 0. Same
  3284. as the previous reloc but on the right side
  3285. of the container. */
  3286. BFD_RELOC_D30V_15_PCREL_R,
  3287. /* This is an 18-bit absolute reloc with
  3288. the right 3 bits assumed to be 0. */
  3289. BFD_RELOC_D30V_21,
  3290. /* This is an 18-bit pc-relative reloc with
  3291. the right 3 bits assumed to be 0. */
  3292. BFD_RELOC_D30V_21_PCREL,
  3293. /* This is an 18-bit pc-relative reloc with
  3294. the right 3 bits assumed to be 0. Same
  3295. as the previous reloc but on the right side
  3296. of the container. */
  3297. BFD_RELOC_D30V_21_PCREL_R,
  3298. /* This is a 32-bit absolute reloc. */
  3299. BFD_RELOC_D30V_32,
  3300. /* This is a 32-bit pc-relative reloc. */
  3301. BFD_RELOC_D30V_32_PCREL,
  3302. /* DLX relocs */
  3303. BFD_RELOC_DLX_HI16_S,
  3304. /* DLX relocs */
  3305. BFD_RELOC_DLX_LO16,
  3306. /* DLX relocs */
  3307. BFD_RELOC_DLX_JMP26,
  3308. /* Renesas M16C/M32C Relocations. */
  3309. BFD_RELOC_M32C_HI8,
  3310. BFD_RELOC_M32C_RL_JUMP,
  3311. BFD_RELOC_M32C_RL_1ADDR,
  3312. BFD_RELOC_M32C_RL_2ADDR,
  3313. /* Renesas M32R (formerly Mitsubishi M32R) relocs.
  3314. This is a 24 bit absolute address. */
  3315. BFD_RELOC_M32R_24,
  3316. /* This is a 10-bit pc-relative reloc with the right 2 bits assumed to be 0. */
  3317. BFD_RELOC_M32R_10_PCREL,
  3318. /* This is an 18-bit reloc with the right 2 bits assumed to be 0. */
  3319. BFD_RELOC_M32R_18_PCREL,
  3320. /* This is a 26-bit reloc with the right 2 bits assumed to be 0. */
  3321. BFD_RELOC_M32R_26_PCREL,
  3322. /* This is a 16-bit reloc containing the high 16 bits of an address
  3323. used when the lower 16 bits are treated as unsigned. */
  3324. BFD_RELOC_M32R_HI16_ULO,
  3325. /* This is a 16-bit reloc containing the high 16 bits of an address
  3326. used when the lower 16 bits are treated as signed. */
  3327. BFD_RELOC_M32R_HI16_SLO,
  3328. /* This is a 16-bit reloc containing the lower 16 bits of an address. */
  3329. BFD_RELOC_M32R_LO16,
  3330. /* This is a 16-bit reloc containing the small data area offset for use in
  3331. add3, load, and store instructions. */
  3332. BFD_RELOC_M32R_SDA16,
  3333. /* For PIC. */
  3334. BFD_RELOC_M32R_GOT24,
  3335. BFD_RELOC_M32R_26_PLTREL,
  3336. BFD_RELOC_M32R_COPY,
  3337. BFD_RELOC_M32R_GLOB_DAT,
  3338. BFD_RELOC_M32R_JMP_SLOT,
  3339. BFD_RELOC_M32R_RELATIVE,
  3340. BFD_RELOC_M32R_GOTOFF,
  3341. BFD_RELOC_M32R_GOTOFF_HI_ULO,
  3342. BFD_RELOC_M32R_GOTOFF_HI_SLO,
  3343. BFD_RELOC_M32R_GOTOFF_LO,
  3344. BFD_RELOC_M32R_GOTPC24,
  3345. BFD_RELOC_M32R_GOT16_HI_ULO,
  3346. BFD_RELOC_M32R_GOT16_HI_SLO,
  3347. BFD_RELOC_M32R_GOT16_LO,
  3348. BFD_RELOC_M32R_GOTPC_HI_ULO,
  3349. BFD_RELOC_M32R_GOTPC_HI_SLO,
  3350. BFD_RELOC_M32R_GOTPC_LO,
  3351. /* NDS32 relocs.
  3352. This is a 20 bit absolute address. */
  3353. BFD_RELOC_NDS32_20,
  3354. /* This is a 9-bit pc-relative reloc with the right 1 bit assumed to be 0. */
  3355. BFD_RELOC_NDS32_9_PCREL,
  3356. /* This is a 9-bit pc-relative reloc with the right 1 bit assumed to be 0. */
  3357. BFD_RELOC_NDS32_WORD_9_PCREL,
  3358. /* This is an 15-bit reloc with the right 1 bit assumed to be 0. */
  3359. BFD_RELOC_NDS32_15_PCREL,
  3360. /* This is an 17-bit reloc with the right 1 bit assumed to be 0. */
  3361. BFD_RELOC_NDS32_17_PCREL,
  3362. /* This is a 25-bit reloc with the right 1 bit assumed to be 0. */
  3363. BFD_RELOC_NDS32_25_PCREL,
  3364. /* This is a 20-bit reloc containing the high 20 bits of an address
  3365. used with the lower 12 bits */
  3366. BFD_RELOC_NDS32_HI20,
  3367. /* This is a 12-bit reloc containing the lower 12 bits of an address
  3368. then shift right by 3. This is used with ldi,sdi... */
  3369. BFD_RELOC_NDS32_LO12S3,
  3370. /* This is a 12-bit reloc containing the lower 12 bits of an address
  3371. then shift left by 2. This is used with lwi,swi... */
  3372. BFD_RELOC_NDS32_LO12S2,
  3373. /* This is a 12-bit reloc containing the lower 12 bits of an address
  3374. then shift left by 1. This is used with lhi,shi... */
  3375. BFD_RELOC_NDS32_LO12S1,
  3376. /* This is a 12-bit reloc containing the lower 12 bits of an address
  3377. then shift left by 0. This is used with lbisbi... */
  3378. BFD_RELOC_NDS32_LO12S0,
  3379. /* This is a 12-bit reloc containing the lower 12 bits of an address
  3380. then shift left by 0. This is only used with branch relaxations */
  3381. BFD_RELOC_NDS32_LO12S0_ORI,
  3382. /* This is a 15-bit reloc containing the small data area 18-bit signed offset
  3383. and shift left by 3 for use in ldi, sdi... */
  3384. BFD_RELOC_NDS32_SDA15S3,
  3385. /* This is a 15-bit reloc containing the small data area 17-bit signed offset
  3386. and shift left by 2 for use in lwi, swi... */
  3387. BFD_RELOC_NDS32_SDA15S2,
  3388. /* This is a 15-bit reloc containing the small data area 16-bit signed offset
  3389. and shift left by 1 for use in lhi, shi... */
  3390. BFD_RELOC_NDS32_SDA15S1,
  3391. /* This is a 15-bit reloc containing the small data area 15-bit signed offset
  3392. and shift left by 0 for use in lbi, sbi... */
  3393. BFD_RELOC_NDS32_SDA15S0,
  3394. /* This is a 16-bit reloc containing the small data area 16-bit signed offset
  3395. and shift left by 3 */
  3396. BFD_RELOC_NDS32_SDA16S3,
  3397. /* This is a 17-bit reloc containing the small data area 17-bit signed offset
  3398. and shift left by 2 for use in lwi.gp, swi.gp... */
  3399. BFD_RELOC_NDS32_SDA17S2,
  3400. /* This is a 18-bit reloc containing the small data area 18-bit signed offset
  3401. and shift left by 1 for use in lhi.gp, shi.gp... */
  3402. BFD_RELOC_NDS32_SDA18S1,
  3403. /* This is a 19-bit reloc containing the small data area 19-bit signed offset
  3404. and shift left by 0 for use in lbi.gp, sbi.gp... */
  3405. BFD_RELOC_NDS32_SDA19S0,
  3406. /* for PIC */
  3407. BFD_RELOC_NDS32_GOT20,
  3408. BFD_RELOC_NDS32_9_PLTREL,
  3409. BFD_RELOC_NDS32_25_PLTREL,
  3410. BFD_RELOC_NDS32_COPY,
  3411. BFD_RELOC_NDS32_GLOB_DAT,
  3412. BFD_RELOC_NDS32_JMP_SLOT,
  3413. BFD_RELOC_NDS32_RELATIVE,
  3414. BFD_RELOC_NDS32_GOTOFF,
  3415. BFD_RELOC_NDS32_GOTOFF_HI20,
  3416. BFD_RELOC_NDS32_GOTOFF_LO12,
  3417. BFD_RELOC_NDS32_GOTPC20,
  3418. BFD_RELOC_NDS32_GOT_HI20,
  3419. BFD_RELOC_NDS32_GOT_LO12,
  3420. BFD_RELOC_NDS32_GOTPC_HI20,
  3421. BFD_RELOC_NDS32_GOTPC_LO12,
  3422. /* for relax */
  3423. BFD_RELOC_NDS32_INSN16,
  3424. BFD_RELOC_NDS32_LABEL,
  3425. BFD_RELOC_NDS32_LONGCALL1,
  3426. BFD_RELOC_NDS32_LONGCALL2,
  3427. BFD_RELOC_NDS32_LONGCALL3,
  3428. BFD_RELOC_NDS32_LONGJUMP1,
  3429. BFD_RELOC_NDS32_LONGJUMP2,
  3430. BFD_RELOC_NDS32_LONGJUMP3,
  3431. BFD_RELOC_NDS32_LOADSTORE,
  3432. BFD_RELOC_NDS32_9_FIXED,
  3433. BFD_RELOC_NDS32_15_FIXED,
  3434. BFD_RELOC_NDS32_17_FIXED,
  3435. BFD_RELOC_NDS32_25_FIXED,
  3436. BFD_RELOC_NDS32_LONGCALL4,
  3437. BFD_RELOC_NDS32_LONGCALL5,
  3438. BFD_RELOC_NDS32_LONGCALL6,
  3439. BFD_RELOC_NDS32_LONGJUMP4,
  3440. BFD_RELOC_NDS32_LONGJUMP5,
  3441. BFD_RELOC_NDS32_LONGJUMP6,
  3442. BFD_RELOC_NDS32_LONGJUMP7,
  3443. /* for PIC */
  3444. BFD_RELOC_NDS32_PLTREL_HI20,
  3445. BFD_RELOC_NDS32_PLTREL_LO12,
  3446. BFD_RELOC_NDS32_PLT_GOTREL_HI20,
  3447. BFD_RELOC_NDS32_PLT_GOTREL_LO12,
  3448. /* for floating point */
  3449. BFD_RELOC_NDS32_SDA12S2_DP,
  3450. BFD_RELOC_NDS32_SDA12S2_SP,
  3451. BFD_RELOC_NDS32_LO12S2_DP,
  3452. BFD_RELOC_NDS32_LO12S2_SP,
  3453. /* for dwarf2 debug_line. */
  3454. BFD_RELOC_NDS32_DWARF2_OP1,
  3455. BFD_RELOC_NDS32_DWARF2_OP2,
  3456. BFD_RELOC_NDS32_DWARF2_LEB,
  3457. /* for eliminate 16-bit instructions */
  3458. BFD_RELOC_NDS32_UPDATE_TA,
  3459. /* for PIC object relaxation */
  3460. BFD_RELOC_NDS32_PLT_GOTREL_LO20,
  3461. BFD_RELOC_NDS32_PLT_GOTREL_LO15,
  3462. BFD_RELOC_NDS32_PLT_GOTREL_LO19,
  3463. BFD_RELOC_NDS32_GOT_LO15,
  3464. BFD_RELOC_NDS32_GOT_LO19,
  3465. BFD_RELOC_NDS32_GOTOFF_LO15,
  3466. BFD_RELOC_NDS32_GOTOFF_LO19,
  3467. BFD_RELOC_NDS32_GOT15S2,
  3468. BFD_RELOC_NDS32_GOT17S2,
  3469. /* NDS32 relocs.
  3470. This is a 5 bit absolute address. */
  3471. BFD_RELOC_NDS32_5,
  3472. /* This is a 10-bit unsigned pc-relative reloc with the right 1 bit assumed to be 0. */
  3473. BFD_RELOC_NDS32_10_UPCREL,
  3474. /* If fp were omitted, fp can used as another gp. */
  3475. BFD_RELOC_NDS32_SDA_FP7U2_RELA,
  3476. /* relaxation relative relocation types */
  3477. BFD_RELOC_NDS32_RELAX_ENTRY,
  3478. BFD_RELOC_NDS32_GOT_SUFF,
  3479. BFD_RELOC_NDS32_GOTOFF_SUFF,
  3480. BFD_RELOC_NDS32_PLT_GOT_SUFF,
  3481. BFD_RELOC_NDS32_MULCALL_SUFF,
  3482. BFD_RELOC_NDS32_PTR,
  3483. BFD_RELOC_NDS32_PTR_COUNT,
  3484. BFD_RELOC_NDS32_PTR_RESOLVED,
  3485. BFD_RELOC_NDS32_PLTBLOCK,
  3486. BFD_RELOC_NDS32_RELAX_REGION_BEGIN,
  3487. BFD_RELOC_NDS32_RELAX_REGION_END,
  3488. BFD_RELOC_NDS32_MINUEND,
  3489. BFD_RELOC_NDS32_SUBTRAHEND,
  3490. BFD_RELOC_NDS32_DIFF8,
  3491. BFD_RELOC_NDS32_DIFF16,
  3492. BFD_RELOC_NDS32_DIFF32,
  3493. BFD_RELOC_NDS32_DIFF_ULEB128,
  3494. BFD_RELOC_NDS32_EMPTY,
  3495. /* This is a 25 bit absolute address. */
  3496. BFD_RELOC_NDS32_25_ABS,
  3497. /* For ex9 and ifc using. */
  3498. BFD_RELOC_NDS32_DATA,
  3499. BFD_RELOC_NDS32_TRAN,
  3500. BFD_RELOC_NDS32_17IFC_PCREL,
  3501. BFD_RELOC_NDS32_10IFCU_PCREL,
  3502. /* For TLS. */
  3503. BFD_RELOC_NDS32_TPOFF,
  3504. BFD_RELOC_NDS32_TLS_LE_HI20,
  3505. BFD_RELOC_NDS32_TLS_LE_LO12,
  3506. BFD_RELOC_NDS32_TLS_LE_ADD,
  3507. BFD_RELOC_NDS32_TLS_LE_LS,
  3508. BFD_RELOC_NDS32_GOTTPOFF,
  3509. BFD_RELOC_NDS32_TLS_IE_HI20,
  3510. BFD_RELOC_NDS32_TLS_IE_LO12S2,
  3511. BFD_RELOC_NDS32_TLS_TPOFF,
  3512. BFD_RELOC_NDS32_TLS_LE_20,
  3513. BFD_RELOC_NDS32_TLS_LE_15S0,
  3514. BFD_RELOC_NDS32_TLS_LE_15S1,
  3515. BFD_RELOC_NDS32_TLS_LE_15S2,
  3516. /* This is a 9-bit reloc */
  3517. BFD_RELOC_V850_9_PCREL,
  3518. /* This is a 22-bit reloc */
  3519. BFD_RELOC_V850_22_PCREL,
  3520. /* This is a 16 bit offset from the short data area pointer. */
  3521. BFD_RELOC_V850_SDA_16_16_OFFSET,
  3522. /* This is a 16 bit offset (of which only 15 bits are used) from the
  3523. short data area pointer. */
  3524. BFD_RELOC_V850_SDA_15_16_OFFSET,
  3525. /* This is a 16 bit offset from the zero data area pointer. */
  3526. BFD_RELOC_V850_ZDA_16_16_OFFSET,
  3527. /* This is a 16 bit offset (of which only 15 bits are used) from the
  3528. zero data area pointer. */
  3529. BFD_RELOC_V850_ZDA_15_16_OFFSET,
  3530. /* This is an 8 bit offset (of which only 6 bits are used) from the
  3531. tiny data area pointer. */
  3532. BFD_RELOC_V850_TDA_6_8_OFFSET,
  3533. /* This is an 8bit offset (of which only 7 bits are used) from the tiny
  3534. data area pointer. */
  3535. BFD_RELOC_V850_TDA_7_8_OFFSET,
  3536. /* This is a 7 bit offset from the tiny data area pointer. */
  3537. BFD_RELOC_V850_TDA_7_7_OFFSET,
  3538. /* This is a 16 bit offset from the tiny data area pointer. */
  3539. BFD_RELOC_V850_TDA_16_16_OFFSET,
  3540. /* This is a 5 bit offset (of which only 4 bits are used) from the tiny
  3541. data area pointer. */
  3542. BFD_RELOC_V850_TDA_4_5_OFFSET,
  3543. /* This is a 4 bit offset from the tiny data area pointer. */
  3544. BFD_RELOC_V850_TDA_4_4_OFFSET,
  3545. /* This is a 16 bit offset from the short data area pointer, with the
  3546. bits placed non-contiguously in the instruction. */
  3547. BFD_RELOC_V850_SDA_16_16_SPLIT_OFFSET,
  3548. /* This is a 16 bit offset from the zero data area pointer, with the
  3549. bits placed non-contiguously in the instruction. */
  3550. BFD_RELOC_V850_ZDA_16_16_SPLIT_OFFSET,
  3551. /* This is a 6 bit offset from the call table base pointer. */
  3552. BFD_RELOC_V850_CALLT_6_7_OFFSET,
  3553. /* This is a 16 bit offset from the call table base pointer. */
  3554. BFD_RELOC_V850_CALLT_16_16_OFFSET,
  3555. /* Used for relaxing indirect function calls. */
  3556. BFD_RELOC_V850_LONGCALL,
  3557. /* Used for relaxing indirect jumps. */
  3558. BFD_RELOC_V850_LONGJUMP,
  3559. /* Used to maintain alignment whilst relaxing. */
  3560. BFD_RELOC_V850_ALIGN,
  3561. /* This is a variation of BFD_RELOC_LO16 that can be used in v850e ld.bu
  3562. instructions. */
  3563. BFD_RELOC_V850_LO16_SPLIT_OFFSET,
  3564. /* This is a 16-bit reloc. */
  3565. BFD_RELOC_V850_16_PCREL,
  3566. /* This is a 17-bit reloc. */
  3567. BFD_RELOC_V850_17_PCREL,
  3568. /* This is a 23-bit reloc. */
  3569. BFD_RELOC_V850_23,
  3570. /* This is a 32-bit reloc. */
  3571. BFD_RELOC_V850_32_PCREL,
  3572. /* This is a 32-bit reloc. */
  3573. BFD_RELOC_V850_32_ABS,
  3574. /* This is a 16-bit reloc. */
  3575. BFD_RELOC_V850_16_SPLIT_OFFSET,
  3576. /* This is a 16-bit reloc. */
  3577. BFD_RELOC_V850_16_S1,
  3578. /* Low 16 bits. 16 bit shifted by 1. */
  3579. BFD_RELOC_V850_LO16_S1,
  3580. /* This is a 16 bit offset from the call table base pointer. */
  3581. BFD_RELOC_V850_CALLT_15_16_OFFSET,
  3582. /* DSO relocations. */
  3583. BFD_RELOC_V850_32_GOTPCREL,
  3584. /* DSO relocations. */
  3585. BFD_RELOC_V850_16_GOT,
  3586. /* DSO relocations. */
  3587. BFD_RELOC_V850_32_GOT,
  3588. /* DSO relocations. */
  3589. BFD_RELOC_V850_22_PLT_PCREL,
  3590. /* DSO relocations. */
  3591. BFD_RELOC_V850_32_PLT_PCREL,
  3592. /* DSO relocations. */
  3593. BFD_RELOC_V850_COPY,
  3594. /* DSO relocations. */
  3595. BFD_RELOC_V850_GLOB_DAT,
  3596. /* DSO relocations. */
  3597. BFD_RELOC_V850_JMP_SLOT,
  3598. /* DSO relocations. */
  3599. BFD_RELOC_V850_RELATIVE,
  3600. /* DSO relocations. */
  3601. BFD_RELOC_V850_16_GOTOFF,
  3602. /* DSO relocations. */
  3603. BFD_RELOC_V850_32_GOTOFF,
  3604. /* start code. */
  3605. BFD_RELOC_V850_CODE,
  3606. /* start data in text. */
  3607. BFD_RELOC_V850_DATA,
  3608. /* This is a 8bit DP reloc for the tms320c30, where the most
  3609. significant 8 bits of a 24 bit word are placed into the least
  3610. significant 8 bits of the opcode. */
  3611. BFD_RELOC_TIC30_LDP,
  3612. /* This is a 7bit reloc for the tms320c54x, where the least
  3613. significant 7 bits of a 16 bit word are placed into the least
  3614. significant 7 bits of the opcode. */
  3615. BFD_RELOC_TIC54X_PARTLS7,
  3616. /* This is a 9bit DP reloc for the tms320c54x, where the most
  3617. significant 9 bits of a 16 bit word are placed into the least
  3618. significant 9 bits of the opcode. */
  3619. BFD_RELOC_TIC54X_PARTMS9,
  3620. /* This is an extended address 23-bit reloc for the tms320c54x. */
  3621. BFD_RELOC_TIC54X_23,
  3622. /* This is a 16-bit reloc for the tms320c54x, where the least
  3623. significant 16 bits of a 23-bit extended address are placed into
  3624. the opcode. */
  3625. BFD_RELOC_TIC54X_16_OF_23,
  3626. /* This is a reloc for the tms320c54x, where the most
  3627. significant 7 bits of a 23-bit extended address are placed into
  3628. the opcode. */
  3629. BFD_RELOC_TIC54X_MS7_OF_23,
  3630. /* TMS320C6000 relocations. */
  3631. BFD_RELOC_C6000_PCR_S21,
  3632. BFD_RELOC_C6000_PCR_S12,
  3633. BFD_RELOC_C6000_PCR_S10,
  3634. BFD_RELOC_C6000_PCR_S7,
  3635. BFD_RELOC_C6000_ABS_S16,
  3636. BFD_RELOC_C6000_ABS_L16,
  3637. BFD_RELOC_C6000_ABS_H16,
  3638. BFD_RELOC_C6000_SBR_U15_B,
  3639. BFD_RELOC_C6000_SBR_U15_H,
  3640. BFD_RELOC_C6000_SBR_U15_W,
  3641. BFD_RELOC_C6000_SBR_S16,
  3642. BFD_RELOC_C6000_SBR_L16_B,
  3643. BFD_RELOC_C6000_SBR_L16_H,
  3644. BFD_RELOC_C6000_SBR_L16_W,
  3645. BFD_RELOC_C6000_SBR_H16_B,
  3646. BFD_RELOC_C6000_SBR_H16_H,
  3647. BFD_RELOC_C6000_SBR_H16_W,
  3648. BFD_RELOC_C6000_SBR_GOT_U15_W,
  3649. BFD_RELOC_C6000_SBR_GOT_L16_W,
  3650. BFD_RELOC_C6000_SBR_GOT_H16_W,
  3651. BFD_RELOC_C6000_DSBT_INDEX,
  3652. BFD_RELOC_C6000_PREL31,
  3653. BFD_RELOC_C6000_COPY,
  3654. BFD_RELOC_C6000_JUMP_SLOT,
  3655. BFD_RELOC_C6000_EHTYPE,
  3656. BFD_RELOC_C6000_PCR_H16,
  3657. BFD_RELOC_C6000_PCR_L16,
  3658. BFD_RELOC_C6000_ALIGN,
  3659. BFD_RELOC_C6000_FPHEAD,
  3660. BFD_RELOC_C6000_NOCMP,
  3661. /* This is a 48 bit reloc for the FR30 that stores 32 bits. */
  3662. BFD_RELOC_FR30_48,
  3663. /* This is a 32 bit reloc for the FR30 that stores 20 bits split up into
  3664. two sections. */
  3665. BFD_RELOC_FR30_20,
  3666. /* This is a 16 bit reloc for the FR30 that stores a 6 bit word offset in
  3667. 4 bits. */
  3668. BFD_RELOC_FR30_6_IN_4,
  3669. /* This is a 16 bit reloc for the FR30 that stores an 8 bit byte offset
  3670. into 8 bits. */
  3671. BFD_RELOC_FR30_8_IN_8,
  3672. /* This is a 16 bit reloc for the FR30 that stores a 9 bit short offset
  3673. into 8 bits. */
  3674. BFD_RELOC_FR30_9_IN_8,
  3675. /* This is a 16 bit reloc for the FR30 that stores a 10 bit word offset
  3676. into 8 bits. */
  3677. BFD_RELOC_FR30_10_IN_8,
  3678. /* This is a 16 bit reloc for the FR30 that stores a 9 bit pc relative
  3679. short offset into 8 bits. */
  3680. BFD_RELOC_FR30_9_PCREL,
  3681. /* This is a 16 bit reloc for the FR30 that stores a 12 bit pc relative
  3682. short offset into 11 bits. */
  3683. BFD_RELOC_FR30_12_PCREL,
  3684. /* Motorola Mcore relocations. */
  3685. BFD_RELOC_MCORE_PCREL_IMM8BY4,
  3686. BFD_RELOC_MCORE_PCREL_IMM11BY2,
  3687. BFD_RELOC_MCORE_PCREL_IMM4BY2,
  3688. BFD_RELOC_MCORE_PCREL_32,
  3689. BFD_RELOC_MCORE_PCREL_JSR_IMM11BY2,
  3690. BFD_RELOC_MCORE_RVA,
  3691. /* Toshiba Media Processor Relocations. */
  3692. BFD_RELOC_MEP_8,
  3693. BFD_RELOC_MEP_16,
  3694. BFD_RELOC_MEP_32,
  3695. BFD_RELOC_MEP_PCREL8A2,
  3696. BFD_RELOC_MEP_PCREL12A2,
  3697. BFD_RELOC_MEP_PCREL17A2,
  3698. BFD_RELOC_MEP_PCREL24A2,
  3699. BFD_RELOC_MEP_PCABS24A2,
  3700. BFD_RELOC_MEP_LOW16,
  3701. BFD_RELOC_MEP_HI16U,
  3702. BFD_RELOC_MEP_HI16S,
  3703. BFD_RELOC_MEP_GPREL,
  3704. BFD_RELOC_MEP_TPREL,
  3705. BFD_RELOC_MEP_TPREL7,
  3706. BFD_RELOC_MEP_TPREL7A2,
  3707. BFD_RELOC_MEP_TPREL7A4,
  3708. BFD_RELOC_MEP_UIMM24,
  3709. BFD_RELOC_MEP_ADDR24A4,
  3710. BFD_RELOC_MEP_GNU_VTINHERIT,
  3711. BFD_RELOC_MEP_GNU_VTENTRY,
  3712. /* Imagination Technologies Meta relocations. */
  3713. BFD_RELOC_METAG_HIADDR16,
  3714. BFD_RELOC_METAG_LOADDR16,
  3715. BFD_RELOC_METAG_RELBRANCH,
  3716. BFD_RELOC_METAG_GETSETOFF,
  3717. BFD_RELOC_METAG_HIOG,
  3718. BFD_RELOC_METAG_LOOG,
  3719. BFD_RELOC_METAG_REL8,
  3720. BFD_RELOC_METAG_REL16,
  3721. BFD_RELOC_METAG_HI16_GOTOFF,
  3722. BFD_RELOC_METAG_LO16_GOTOFF,
  3723. BFD_RELOC_METAG_GETSET_GOTOFF,
  3724. BFD_RELOC_METAG_GETSET_GOT,
  3725. BFD_RELOC_METAG_HI16_GOTPC,
  3726. BFD_RELOC_METAG_LO16_GOTPC,
  3727. BFD_RELOC_METAG_HI16_PLT,
  3728. BFD_RELOC_METAG_LO16_PLT,
  3729. BFD_RELOC_METAG_RELBRANCH_PLT,
  3730. BFD_RELOC_METAG_GOTOFF,
  3731. BFD_RELOC_METAG_PLT,
  3732. BFD_RELOC_METAG_COPY,
  3733. BFD_RELOC_METAG_JMP_SLOT,
  3734. BFD_RELOC_METAG_RELATIVE,
  3735. BFD_RELOC_METAG_GLOB_DAT,
  3736. BFD_RELOC_METAG_TLS_GD,
  3737. BFD_RELOC_METAG_TLS_LDM,
  3738. BFD_RELOC_METAG_TLS_LDO_HI16,
  3739. BFD_RELOC_METAG_TLS_LDO_LO16,
  3740. BFD_RELOC_METAG_TLS_LDO,
  3741. BFD_RELOC_METAG_TLS_IE,
  3742. BFD_RELOC_METAG_TLS_IENONPIC,
  3743. BFD_RELOC_METAG_TLS_IENONPIC_HI16,
  3744. BFD_RELOC_METAG_TLS_IENONPIC_LO16,
  3745. BFD_RELOC_METAG_TLS_TPOFF,
  3746. BFD_RELOC_METAG_TLS_DTPMOD,
  3747. BFD_RELOC_METAG_TLS_DTPOFF,
  3748. BFD_RELOC_METAG_TLS_LE,
  3749. BFD_RELOC_METAG_TLS_LE_HI16,
  3750. BFD_RELOC_METAG_TLS_LE_LO16,
  3751. /* These are relocations for the GETA instruction. */
  3752. BFD_RELOC_MMIX_GETA,
  3753. BFD_RELOC_MMIX_GETA_1,
  3754. BFD_RELOC_MMIX_GETA_2,
  3755. BFD_RELOC_MMIX_GETA_3,
  3756. /* These are relocations for a conditional branch instruction. */
  3757. BFD_RELOC_MMIX_CBRANCH,
  3758. BFD_RELOC_MMIX_CBRANCH_J,
  3759. BFD_RELOC_MMIX_CBRANCH_1,
  3760. BFD_RELOC_MMIX_CBRANCH_2,
  3761. BFD_RELOC_MMIX_CBRANCH_3,
  3762. /* These are relocations for the PUSHJ instruction. */
  3763. BFD_RELOC_MMIX_PUSHJ,
  3764. BFD_RELOC_MMIX_PUSHJ_1,
  3765. BFD_RELOC_MMIX_PUSHJ_2,
  3766. BFD_RELOC_MMIX_PUSHJ_3,
  3767. BFD_RELOC_MMIX_PUSHJ_STUBBABLE,
  3768. /* These are relocations for the JMP instruction. */
  3769. BFD_RELOC_MMIX_JMP,
  3770. BFD_RELOC_MMIX_JMP_1,
  3771. BFD_RELOC_MMIX_JMP_2,
  3772. BFD_RELOC_MMIX_JMP_3,
  3773. /* This is a relocation for a relative address as in a GETA instruction or
  3774. a branch. */
  3775. BFD_RELOC_MMIX_ADDR19,
  3776. /* This is a relocation for a relative address as in a JMP instruction. */
  3777. BFD_RELOC_MMIX_ADDR27,
  3778. /* This is a relocation for an instruction field that may be a general
  3779. register or a value 0..255. */
  3780. BFD_RELOC_MMIX_REG_OR_BYTE,
  3781. /* This is a relocation for an instruction field that may be a general
  3782. register. */
  3783. BFD_RELOC_MMIX_REG,
  3784. /* This is a relocation for two instruction fields holding a register and
  3785. an offset, the equivalent of the relocation. */
  3786. BFD_RELOC_MMIX_BASE_PLUS_OFFSET,
  3787. /* This relocation is an assertion that the expression is not allocated as
  3788. a global register. It does not modify contents. */
  3789. BFD_RELOC_MMIX_LOCAL,
  3790. /* This is a 16 bit reloc for the AVR that stores 8 bit pc relative
  3791. short offset into 7 bits. */
  3792. BFD_RELOC_AVR_7_PCREL,
  3793. /* This is a 16 bit reloc for the AVR that stores 13 bit pc relative
  3794. short offset into 12 bits. */
  3795. BFD_RELOC_AVR_13_PCREL,
  3796. /* This is a 16 bit reloc for the AVR that stores 17 bit value (usually
  3797. program memory address) into 16 bits. */
  3798. BFD_RELOC_AVR_16_PM,
  3799. /* This is a 16 bit reloc for the AVR that stores 8 bit value (usually
  3800. data memory address) into 8 bit immediate value of LDI insn. */
  3801. BFD_RELOC_AVR_LO8_LDI,
  3802. /* This is a 16 bit reloc for the AVR that stores 8 bit value (high 8 bit
  3803. of data memory address) into 8 bit immediate value of LDI insn. */
  3804. BFD_RELOC_AVR_HI8_LDI,
  3805. /* This is a 16 bit reloc for the AVR that stores 8 bit value (most high 8 bit
  3806. of program memory address) into 8 bit immediate value of LDI insn. */
  3807. BFD_RELOC_AVR_HH8_LDI,
  3808. /* This is a 16 bit reloc for the AVR that stores 8 bit value (most high 8 bit
  3809. of 32 bit value) into 8 bit immediate value of LDI insn. */
  3810. BFD_RELOC_AVR_MS8_LDI,
  3811. /* This is a 16 bit reloc for the AVR that stores negated 8 bit value
  3812. (usually data memory address) into 8 bit immediate value of SUBI insn. */
  3813. BFD_RELOC_AVR_LO8_LDI_NEG,
  3814. /* This is a 16 bit reloc for the AVR that stores negated 8 bit value
  3815. (high 8 bit of data memory address) into 8 bit immediate value of
  3816. SUBI insn. */
  3817. BFD_RELOC_AVR_HI8_LDI_NEG,
  3818. /* This is a 16 bit reloc for the AVR that stores negated 8 bit value
  3819. (most high 8 bit of program memory address) into 8 bit immediate value
  3820. of LDI or SUBI insn. */
  3821. BFD_RELOC_AVR_HH8_LDI_NEG,
  3822. /* This is a 16 bit reloc for the AVR that stores negated 8 bit value (msb
  3823. of 32 bit value) into 8 bit immediate value of LDI insn. */
  3824. BFD_RELOC_AVR_MS8_LDI_NEG,
  3825. /* This is a 16 bit reloc for the AVR that stores 8 bit value (usually
  3826. command address) into 8 bit immediate value of LDI insn. */
  3827. BFD_RELOC_AVR_LO8_LDI_PM,
  3828. /* This is a 16 bit reloc for the AVR that stores 8 bit value
  3829. (command address) into 8 bit immediate value of LDI insn. If the address
  3830. is beyond the 128k boundary, the linker inserts a jump stub for this reloc
  3831. in the lower 128k. */
  3832. BFD_RELOC_AVR_LO8_LDI_GS,
  3833. /* This is a 16 bit reloc for the AVR that stores 8 bit value (high 8 bit
  3834. of command address) into 8 bit immediate value of LDI insn. */
  3835. BFD_RELOC_AVR_HI8_LDI_PM,
  3836. /* This is a 16 bit reloc for the AVR that stores 8 bit value (high 8 bit
  3837. of command address) into 8 bit immediate value of LDI insn. If the address
  3838. is beyond the 128k boundary, the linker inserts a jump stub for this reloc
  3839. below 128k. */
  3840. BFD_RELOC_AVR_HI8_LDI_GS,
  3841. /* This is a 16 bit reloc for the AVR that stores 8 bit value (most high 8 bit
  3842. of command address) into 8 bit immediate value of LDI insn. */
  3843. BFD_RELOC_AVR_HH8_LDI_PM,
  3844. /* This is a 16 bit reloc for the AVR that stores negated 8 bit value
  3845. (usually command address) into 8 bit immediate value of SUBI insn. */
  3846. BFD_RELOC_AVR_LO8_LDI_PM_NEG,
  3847. /* This is a 16 bit reloc for the AVR that stores negated 8 bit value
  3848. (high 8 bit of 16 bit command address) into 8 bit immediate value
  3849. of SUBI insn. */
  3850. BFD_RELOC_AVR_HI8_LDI_PM_NEG,
  3851. /* This is a 16 bit reloc for the AVR that stores negated 8 bit value
  3852. (high 6 bit of 22 bit command address) into 8 bit immediate
  3853. value of SUBI insn. */
  3854. BFD_RELOC_AVR_HH8_LDI_PM_NEG,
  3855. /* This is a 32 bit reloc for the AVR that stores 23 bit value
  3856. into 22 bits. */
  3857. BFD_RELOC_AVR_CALL,
  3858. /* This is a 16 bit reloc for the AVR that stores all needed bits
  3859. for absolute addressing with ldi with overflow check to linktime */
  3860. BFD_RELOC_AVR_LDI,
  3861. /* This is a 6 bit reloc for the AVR that stores offset for ldd/std
  3862. instructions */
  3863. BFD_RELOC_AVR_6,
  3864. /* This is a 6 bit reloc for the AVR that stores offset for adiw/sbiw
  3865. instructions */
  3866. BFD_RELOC_AVR_6_ADIW,
  3867. /* This is a 8 bit reloc for the AVR that stores bits 0..7 of a symbol
  3868. in .byte lo8(symbol) */
  3869. BFD_RELOC_AVR_8_LO,
  3870. /* This is a 8 bit reloc for the AVR that stores bits 8..15 of a symbol
  3871. in .byte hi8(symbol) */
  3872. BFD_RELOC_AVR_8_HI,
  3873. /* This is a 8 bit reloc for the AVR that stores bits 16..23 of a symbol
  3874. in .byte hlo8(symbol) */
  3875. BFD_RELOC_AVR_8_HLO,
  3876. /* AVR relocations to mark the difference of two local symbols.
  3877. These are only needed to support linker relaxation and can be ignored
  3878. when not relaxing. The field is set to the value of the difference
  3879. assuming no relaxation. The relocation encodes the position of the
  3880. second symbol so the linker can determine whether to adjust the field
  3881. value. */
  3882. BFD_RELOC_AVR_DIFF8,
  3883. BFD_RELOC_AVR_DIFF16,
  3884. BFD_RELOC_AVR_DIFF32,
  3885. /* This is a 7 bit reloc for the AVR that stores SRAM address for 16bit
  3886. lds and sts instructions supported only tiny core. */
  3887. BFD_RELOC_AVR_LDS_STS_16,
  3888. /* This is a 6 bit reloc for the AVR that stores an I/O register
  3889. number for the IN and OUT instructions */
  3890. BFD_RELOC_AVR_PORT6,
  3891. /* This is a 5 bit reloc for the AVR that stores an I/O register
  3892. number for the SBIC, SBIS, SBI and CBI instructions */
  3893. BFD_RELOC_AVR_PORT5,
  3894. /* Renesas RL78 Relocations. */
  3895. BFD_RELOC_RL78_NEG8,
  3896. BFD_RELOC_RL78_NEG16,
  3897. BFD_RELOC_RL78_NEG24,
  3898. BFD_RELOC_RL78_NEG32,
  3899. BFD_RELOC_RL78_16_OP,
  3900. BFD_RELOC_RL78_24_OP,
  3901. BFD_RELOC_RL78_32_OP,
  3902. BFD_RELOC_RL78_8U,
  3903. BFD_RELOC_RL78_16U,
  3904. BFD_RELOC_RL78_24U,
  3905. BFD_RELOC_RL78_DIR3U_PCREL,
  3906. BFD_RELOC_RL78_DIFF,
  3907. BFD_RELOC_RL78_GPRELB,
  3908. BFD_RELOC_RL78_GPRELW,
  3909. BFD_RELOC_RL78_GPRELL,
  3910. BFD_RELOC_RL78_SYM,
  3911. BFD_RELOC_RL78_OP_SUBTRACT,
  3912. BFD_RELOC_RL78_OP_NEG,
  3913. BFD_RELOC_RL78_OP_AND,
  3914. BFD_RELOC_RL78_OP_SHRA,
  3915. BFD_RELOC_RL78_ABS8,
  3916. BFD_RELOC_RL78_ABS16,
  3917. BFD_RELOC_RL78_ABS16_REV,
  3918. BFD_RELOC_RL78_ABS32,
  3919. BFD_RELOC_RL78_ABS32_REV,
  3920. BFD_RELOC_RL78_ABS16U,
  3921. BFD_RELOC_RL78_ABS16UW,
  3922. BFD_RELOC_RL78_ABS16UL,
  3923. BFD_RELOC_RL78_RELAX,
  3924. BFD_RELOC_RL78_HI16,
  3925. BFD_RELOC_RL78_HI8,
  3926. BFD_RELOC_RL78_LO16,
  3927. BFD_RELOC_RL78_CODE,
  3928. BFD_RELOC_RL78_SADDR,
  3929. /* Renesas RX Relocations. */
  3930. BFD_RELOC_RX_NEG8,
  3931. BFD_RELOC_RX_NEG16,
  3932. BFD_RELOC_RX_NEG24,
  3933. BFD_RELOC_RX_NEG32,
  3934. BFD_RELOC_RX_16_OP,
  3935. BFD_RELOC_RX_24_OP,
  3936. BFD_RELOC_RX_32_OP,
  3937. BFD_RELOC_RX_8U,
  3938. BFD_RELOC_RX_16U,
  3939. BFD_RELOC_RX_24U,
  3940. BFD_RELOC_RX_DIR3U_PCREL,
  3941. BFD_RELOC_RX_DIFF,
  3942. BFD_RELOC_RX_GPRELB,
  3943. BFD_RELOC_RX_GPRELW,
  3944. BFD_RELOC_RX_GPRELL,
  3945. BFD_RELOC_RX_SYM,
  3946. BFD_RELOC_RX_OP_SUBTRACT,
  3947. BFD_RELOC_RX_OP_NEG,
  3948. BFD_RELOC_RX_ABS8,
  3949. BFD_RELOC_RX_ABS16,
  3950. BFD_RELOC_RX_ABS16_REV,
  3951. BFD_RELOC_RX_ABS32,
  3952. BFD_RELOC_RX_ABS32_REV,
  3953. BFD_RELOC_RX_ABS16U,
  3954. BFD_RELOC_RX_ABS16UW,
  3955. BFD_RELOC_RX_ABS16UL,
  3956. BFD_RELOC_RX_RELAX,
  3957. /* Direct 12 bit. */
  3958. BFD_RELOC_390_12,
  3959. /* 12 bit GOT offset. */
  3960. BFD_RELOC_390_GOT12,
  3961. /* 32 bit PC relative PLT address. */
  3962. BFD_RELOC_390_PLT32,
  3963. /* Copy symbol at runtime. */
  3964. BFD_RELOC_390_COPY,
  3965. /* Create GOT entry. */
  3966. BFD_RELOC_390_GLOB_DAT,
  3967. /* Create PLT entry. */
  3968. BFD_RELOC_390_JMP_SLOT,
  3969. /* Adjust by program base. */
  3970. BFD_RELOC_390_RELATIVE,
  3971. /* 32 bit PC relative offset to GOT. */
  3972. BFD_RELOC_390_GOTPC,
  3973. /* 16 bit GOT offset. */
  3974. BFD_RELOC_390_GOT16,
  3975. /* PC relative 12 bit shifted by 1. */
  3976. BFD_RELOC_390_PC12DBL,
  3977. /* 12 bit PC rel. PLT shifted by 1. */
  3978. BFD_RELOC_390_PLT12DBL,
  3979. /* PC relative 16 bit shifted by 1. */
  3980. BFD_RELOC_390_PC16DBL,
  3981. /* 16 bit PC rel. PLT shifted by 1. */
  3982. BFD_RELOC_390_PLT16DBL,
  3983. /* PC relative 24 bit shifted by 1. */
  3984. BFD_RELOC_390_PC24DBL,
  3985. /* 24 bit PC rel. PLT shifted by 1. */
  3986. BFD_RELOC_390_PLT24DBL,
  3987. /* PC relative 32 bit shifted by 1. */
  3988. BFD_RELOC_390_PC32DBL,
  3989. /* 32 bit PC rel. PLT shifted by 1. */
  3990. BFD_RELOC_390_PLT32DBL,
  3991. /* 32 bit PC rel. GOT shifted by 1. */
  3992. BFD_RELOC_390_GOTPCDBL,
  3993. /* 64 bit GOT offset. */
  3994. BFD_RELOC_390_GOT64,
  3995. /* 64 bit PC relative PLT address. */
  3996. BFD_RELOC_390_PLT64,
  3997. /* 32 bit rel. offset to GOT entry. */
  3998. BFD_RELOC_390_GOTENT,
  3999. /* 64 bit offset to GOT. */
  4000. BFD_RELOC_390_GOTOFF64,
  4001. /* 12-bit offset to symbol-entry within GOT, with PLT handling. */
  4002. BFD_RELOC_390_GOTPLT12,
  4003. /* 16-bit offset to symbol-entry within GOT, with PLT handling. */
  4004. BFD_RELOC_390_GOTPLT16,
  4005. /* 32-bit offset to symbol-entry within GOT, with PLT handling. */
  4006. BFD_RELOC_390_GOTPLT32,
  4007. /* 64-bit offset to symbol-entry within GOT, with PLT handling. */
  4008. BFD_RELOC_390_GOTPLT64,
  4009. /* 32-bit rel. offset to symbol-entry within GOT, with PLT handling. */
  4010. BFD_RELOC_390_GOTPLTENT,
  4011. /* 16-bit rel. offset from the GOT to a PLT entry. */
  4012. BFD_RELOC_390_PLTOFF16,
  4013. /* 32-bit rel. offset from the GOT to a PLT entry. */
  4014. BFD_RELOC_390_PLTOFF32,
  4015. /* 64-bit rel. offset from the GOT to a PLT entry. */
  4016. BFD_RELOC_390_PLTOFF64,
  4017. /* s390 tls relocations. */
  4018. BFD_RELOC_390_TLS_LOAD,
  4019. BFD_RELOC_390_TLS_GDCALL,
  4020. BFD_RELOC_390_TLS_LDCALL,
  4021. BFD_RELOC_390_TLS_GD32,
  4022. BFD_RELOC_390_TLS_GD64,
  4023. BFD_RELOC_390_TLS_GOTIE12,
  4024. BFD_RELOC_390_TLS_GOTIE32,
  4025. BFD_RELOC_390_TLS_GOTIE64,
  4026. BFD_RELOC_390_TLS_LDM32,
  4027. BFD_RELOC_390_TLS_LDM64,
  4028. BFD_RELOC_390_TLS_IE32,
  4029. BFD_RELOC_390_TLS_IE64,
  4030. BFD_RELOC_390_TLS_IEENT,
  4031. BFD_RELOC_390_TLS_LE32,
  4032. BFD_RELOC_390_TLS_LE64,
  4033. BFD_RELOC_390_TLS_LDO32,
  4034. BFD_RELOC_390_TLS_LDO64,
  4035. BFD_RELOC_390_TLS_DTPMOD,
  4036. BFD_RELOC_390_TLS_DTPOFF,
  4037. BFD_RELOC_390_TLS_TPOFF,
  4038. /* Long displacement extension. */
  4039. BFD_RELOC_390_20,
  4040. BFD_RELOC_390_GOT20,
  4041. BFD_RELOC_390_GOTPLT20,
  4042. BFD_RELOC_390_TLS_GOTIE20,
  4043. /* STT_GNU_IFUNC relocation. */
  4044. BFD_RELOC_390_IRELATIVE,
  4045. /* Score relocations
  4046. Low 16 bit for load/store */
  4047. BFD_RELOC_SCORE_GPREL15,
  4048. /* This is a 24-bit reloc with the right 1 bit assumed to be 0 */
  4049. BFD_RELOC_SCORE_DUMMY2,
  4050. BFD_RELOC_SCORE_JMP,
  4051. /* This is a 19-bit reloc with the right 1 bit assumed to be 0 */
  4052. BFD_RELOC_SCORE_BRANCH,
  4053. /* This is a 32-bit reloc for 48-bit instructions. */
  4054. BFD_RELOC_SCORE_IMM30,
  4055. /* This is a 32-bit reloc for 48-bit instructions. */
  4056. BFD_RELOC_SCORE_IMM32,
  4057. /* This is a 11-bit reloc with the right 1 bit assumed to be 0 */
  4058. BFD_RELOC_SCORE16_JMP,
  4059. /* This is a 8-bit reloc with the right 1 bit assumed to be 0 */
  4060. BFD_RELOC_SCORE16_BRANCH,
  4061. /* This is a 9-bit reloc with the right 1 bit assumed to be 0 */
  4062. BFD_RELOC_SCORE_BCMP,
  4063. /* Undocumented Score relocs */
  4064. BFD_RELOC_SCORE_GOT15,
  4065. BFD_RELOC_SCORE_GOT_LO16,
  4066. BFD_RELOC_SCORE_CALL15,
  4067. BFD_RELOC_SCORE_DUMMY_HI16,
  4068. /* Scenix IP2K - 9-bit register number / data address */
  4069. BFD_RELOC_IP2K_FR9,
  4070. /* Scenix IP2K - 4-bit register/data bank number */
  4071. BFD_RELOC_IP2K_BANK,
  4072. /* Scenix IP2K - low 13 bits of instruction word address */
  4073. BFD_RELOC_IP2K_ADDR16CJP,
  4074. /* Scenix IP2K - high 3 bits of instruction word address */
  4075. BFD_RELOC_IP2K_PAGE3,
  4076. /* Scenix IP2K - ext/low/high 8 bits of data address */
  4077. BFD_RELOC_IP2K_LO8DATA,
  4078. BFD_RELOC_IP2K_HI8DATA,
  4079. BFD_RELOC_IP2K_EX8DATA,
  4080. /* Scenix IP2K - low/high 8 bits of instruction word address */
  4081. BFD_RELOC_IP2K_LO8INSN,
  4082. BFD_RELOC_IP2K_HI8INSN,
  4083. /* Scenix IP2K - even/odd PC modifier to modify snb pcl.0 */
  4084. BFD_RELOC_IP2K_PC_SKIP,
  4085. /* Scenix IP2K - 16 bit word address in text section. */
  4086. BFD_RELOC_IP2K_TEXT,
  4087. /* Scenix IP2K - 7-bit sp or dp offset */
  4088. BFD_RELOC_IP2K_FR_OFFSET,
  4089. /* Scenix VPE4K coprocessor - data/insn-space addressing */
  4090. BFD_RELOC_VPE4KMATH_DATA,
  4091. BFD_RELOC_VPE4KMATH_INSN,
  4092. /* These two relocations are used by the linker to determine which of
  4093. the entries in a C++ virtual function table are actually used. When
  4094. the --gc-sections option is given, the linker will zero out the entries
  4095. that are not used, so that the code for those functions need not be
  4096. included in the output.
  4097. VTABLE_INHERIT is a zero-space relocation used to describe to the
  4098. linker the inheritance tree of a C++ virtual function table. The
  4099. relocation's symbol should be the parent class' vtable, and the
  4100. relocation should be located at the child vtable.
  4101. VTABLE_ENTRY is a zero-space relocation that describes the use of a
  4102. virtual function table entry. The reloc's symbol should refer to the
  4103. table of the class mentioned in the code. Off of that base, an offset
  4104. describes the entry that is being used. For Rela hosts, this offset
  4105. is stored in the reloc's addend. For Rel hosts, we are forced to put
  4106. this offset in the reloc's section offset. */
  4107. BFD_RELOC_VTABLE_INHERIT,
  4108. BFD_RELOC_VTABLE_ENTRY,
  4109. /* Intel IA64 Relocations. */
  4110. BFD_RELOC_IA64_IMM14,
  4111. BFD_RELOC_IA64_IMM22,
  4112. BFD_RELOC_IA64_IMM64,
  4113. BFD_RELOC_IA64_DIR32MSB,
  4114. BFD_RELOC_IA64_DIR32LSB,
  4115. BFD_RELOC_IA64_DIR64MSB,
  4116. BFD_RELOC_IA64_DIR64LSB,
  4117. BFD_RELOC_IA64_GPREL22,
  4118. BFD_RELOC_IA64_GPREL64I,
  4119. BFD_RELOC_IA64_GPREL32MSB,
  4120. BFD_RELOC_IA64_GPREL32LSB,
  4121. BFD_RELOC_IA64_GPREL64MSB,
  4122. BFD_RELOC_IA64_GPREL64LSB,
  4123. BFD_RELOC_IA64_LTOFF22,
  4124. BFD_RELOC_IA64_LTOFF64I,
  4125. BFD_RELOC_IA64_PLTOFF22,
  4126. BFD_RELOC_IA64_PLTOFF64I,
  4127. BFD_RELOC_IA64_PLTOFF64MSB,
  4128. BFD_RELOC_IA64_PLTOFF64LSB,
  4129. BFD_RELOC_IA64_FPTR64I,
  4130. BFD_RELOC_IA64_FPTR32MSB,
  4131. BFD_RELOC_IA64_FPTR32LSB,
  4132. BFD_RELOC_IA64_FPTR64MSB,
  4133. BFD_RELOC_IA64_FPTR64LSB,
  4134. BFD_RELOC_IA64_PCREL21B,
  4135. BFD_RELOC_IA64_PCREL21BI,
  4136. BFD_RELOC_IA64_PCREL21M,
  4137. BFD_RELOC_IA64_PCREL21F,
  4138. BFD_RELOC_IA64_PCREL22,
  4139. BFD_RELOC_IA64_PCREL60B,
  4140. BFD_RELOC_IA64_PCREL64I,
  4141. BFD_RELOC_IA64_PCREL32MSB,
  4142. BFD_RELOC_IA64_PCREL32LSB,
  4143. BFD_RELOC_IA64_PCREL64MSB,
  4144. BFD_RELOC_IA64_PCREL64LSB,
  4145. BFD_RELOC_IA64_LTOFF_FPTR22,
  4146. BFD_RELOC_IA64_LTOFF_FPTR64I,
  4147. BFD_RELOC_IA64_LTOFF_FPTR32MSB,
  4148. BFD_RELOC_IA64_LTOFF_FPTR32LSB,
  4149. BFD_RELOC_IA64_LTOFF_FPTR64MSB,
  4150. BFD_RELOC_IA64_LTOFF_FPTR64LSB,
  4151. BFD_RELOC_IA64_SEGREL32MSB,
  4152. BFD_RELOC_IA64_SEGREL32LSB,
  4153. BFD_RELOC_IA64_SEGREL64MSB,
  4154. BFD_RELOC_IA64_SEGREL64LSB,
  4155. BFD_RELOC_IA64_SECREL32MSB,
  4156. BFD_RELOC_IA64_SECREL32LSB,
  4157. BFD_RELOC_IA64_SECREL64MSB,
  4158. BFD_RELOC_IA64_SECREL64LSB,
  4159. BFD_RELOC_IA64_REL32MSB,
  4160. BFD_RELOC_IA64_REL32LSB,
  4161. BFD_RELOC_IA64_REL64MSB,
  4162. BFD_RELOC_IA64_REL64LSB,
  4163. BFD_RELOC_IA64_LTV32MSB,
  4164. BFD_RELOC_IA64_LTV32LSB,
  4165. BFD_RELOC_IA64_LTV64MSB,
  4166. BFD_RELOC_IA64_LTV64LSB,
  4167. BFD_RELOC_IA64_IPLTMSB,
  4168. BFD_RELOC_IA64_IPLTLSB,
  4169. BFD_RELOC_IA64_COPY,
  4170. BFD_RELOC_IA64_LTOFF22X,
  4171. BFD_RELOC_IA64_LDXMOV,
  4172. BFD_RELOC_IA64_TPREL14,
  4173. BFD_RELOC_IA64_TPREL22,
  4174. BFD_RELOC_IA64_TPREL64I,
  4175. BFD_RELOC_IA64_TPREL64MSB,
  4176. BFD_RELOC_IA64_TPREL64LSB,
  4177. BFD_RELOC_IA64_LTOFF_TPREL22,
  4178. BFD_RELOC_IA64_DTPMOD64MSB,
  4179. BFD_RELOC_IA64_DTPMOD64LSB,
  4180. BFD_RELOC_IA64_LTOFF_DTPMOD22,
  4181. BFD_RELOC_IA64_DTPREL14,
  4182. BFD_RELOC_IA64_DTPREL22,
  4183. BFD_RELOC_IA64_DTPREL64I,
  4184. BFD_RELOC_IA64_DTPREL32MSB,
  4185. BFD_RELOC_IA64_DTPREL32LSB,
  4186. BFD_RELOC_IA64_DTPREL64MSB,
  4187. BFD_RELOC_IA64_DTPREL64LSB,
  4188. BFD_RELOC_IA64_LTOFF_DTPREL22,
  4189. /* Motorola 68HC11 reloc.
  4190. This is the 8 bit high part of an absolute address. */
  4191. BFD_RELOC_M68HC11_HI8,
  4192. /* Motorola 68HC11 reloc.
  4193. This is the 8 bit low part of an absolute address. */
  4194. BFD_RELOC_M68HC11_LO8,
  4195. /* Motorola 68HC11 reloc.
  4196. This is the 3 bit of a value. */
  4197. BFD_RELOC_M68HC11_3B,
  4198. /* Motorola 68HC11 reloc.
  4199. This reloc marks the beginning of a jump/call instruction.
  4200. It is used for linker relaxation to correctly identify beginning
  4201. of instruction and change some branches to use PC-relative
  4202. addressing mode. */
  4203. BFD_RELOC_M68HC11_RL_JUMP,
  4204. /* Motorola 68HC11 reloc.
  4205. This reloc marks a group of several instructions that gcc generates
  4206. and for which the linker relaxation pass can modify and/or remove
  4207. some of them. */
  4208. BFD_RELOC_M68HC11_RL_GROUP,
  4209. /* Motorola 68HC11 reloc.
  4210. This is the 16-bit lower part of an address. It is used for 'call'
  4211. instruction to specify the symbol address without any special
  4212. transformation (due to memory bank window). */
  4213. BFD_RELOC_M68HC11_LO16,
  4214. /* Motorola 68HC11 reloc.
  4215. This is a 8-bit reloc that specifies the page number of an address.
  4216. It is used by 'call' instruction to specify the page number of
  4217. the symbol. */
  4218. BFD_RELOC_M68HC11_PAGE,
  4219. /* Motorola 68HC11 reloc.
  4220. This is a 24-bit reloc that represents the address with a 16-bit
  4221. value and a 8-bit page number. The symbol address is transformed
  4222. to follow the 16K memory bank of 68HC12 (seen as mapped in the window). */
  4223. BFD_RELOC_M68HC11_24,
  4224. /* Motorola 68HC12 reloc.
  4225. This is the 5 bits of a value. */
  4226. BFD_RELOC_M68HC12_5B,
  4227. /* Freescale XGATE reloc.
  4228. This reloc marks the beginning of a bra/jal instruction. */
  4229. BFD_RELOC_XGATE_RL_JUMP,
  4230. /* Freescale XGATE reloc.
  4231. This reloc marks a group of several instructions that gcc generates
  4232. and for which the linker relaxation pass can modify and/or remove
  4233. some of them. */
  4234. BFD_RELOC_XGATE_RL_GROUP,
  4235. /* Freescale XGATE reloc.
  4236. This is the 16-bit lower part of an address. It is used for the '16-bit'
  4237. instructions. */
  4238. BFD_RELOC_XGATE_LO16,
  4239. /* Freescale XGATE reloc. */
  4240. BFD_RELOC_XGATE_GPAGE,
  4241. /* Freescale XGATE reloc. */
  4242. BFD_RELOC_XGATE_24,
  4243. /* Freescale XGATE reloc.
  4244. This is a 9-bit pc-relative reloc. */
  4245. BFD_RELOC_XGATE_PCREL_9,
  4246. /* Freescale XGATE reloc.
  4247. This is a 10-bit pc-relative reloc. */
  4248. BFD_RELOC_XGATE_PCREL_10,
  4249. /* Freescale XGATE reloc.
  4250. This is the 16-bit lower part of an address. It is used for the '16-bit'
  4251. instructions. */
  4252. BFD_RELOC_XGATE_IMM8_LO,
  4253. /* Freescale XGATE reloc.
  4254. This is the 16-bit higher part of an address. It is used for the '16-bit'
  4255. instructions. */
  4256. BFD_RELOC_XGATE_IMM8_HI,
  4257. /* Freescale XGATE reloc.
  4258. This is a 3-bit pc-relative reloc. */
  4259. BFD_RELOC_XGATE_IMM3,
  4260. /* Freescale XGATE reloc.
  4261. This is a 4-bit pc-relative reloc. */
  4262. BFD_RELOC_XGATE_IMM4,
  4263. /* Freescale XGATE reloc.
  4264. This is a 5-bit pc-relative reloc. */
  4265. BFD_RELOC_XGATE_IMM5,
  4266. /* Motorola 68HC12 reloc.
  4267. This is the 9 bits of a value. */
  4268. BFD_RELOC_M68HC12_9B,
  4269. /* Motorola 68HC12 reloc.
  4270. This is the 16 bits of a value. */
  4271. BFD_RELOC_M68HC12_16B,
  4272. /* Motorola 68HC12/XGATE reloc.
  4273. This is a PCREL9 branch. */
  4274. BFD_RELOC_M68HC12_9_PCREL,
  4275. /* Motorola 68HC12/XGATE reloc.
  4276. This is a PCREL10 branch. */
  4277. BFD_RELOC_M68HC12_10_PCREL,
  4278. /* Motorola 68HC12/XGATE reloc.
  4279. This is the 8 bit low part of an absolute address and immediately precedes
  4280. a matching HI8XG part. */
  4281. BFD_RELOC_M68HC12_LO8XG,
  4282. /* Motorola 68HC12/XGATE reloc.
  4283. This is the 8 bit high part of an absolute address and immediately follows
  4284. a matching LO8XG part. */
  4285. BFD_RELOC_M68HC12_HI8XG,
  4286. /* NS CR16C Relocations. */
  4287. BFD_RELOC_16C_NUM08,
  4288. BFD_RELOC_16C_NUM08_C,
  4289. BFD_RELOC_16C_NUM16,
  4290. BFD_RELOC_16C_NUM16_C,
  4291. BFD_RELOC_16C_NUM32,
  4292. BFD_RELOC_16C_NUM32_C,
  4293. BFD_RELOC_16C_DISP04,
  4294. BFD_RELOC_16C_DISP04_C,
  4295. BFD_RELOC_16C_DISP08,
  4296. BFD_RELOC_16C_DISP08_C,
  4297. BFD_RELOC_16C_DISP16,
  4298. BFD_RELOC_16C_DISP16_C,
  4299. BFD_RELOC_16C_DISP24,
  4300. BFD_RELOC_16C_DISP24_C,
  4301. BFD_RELOC_16C_DISP24a,
  4302. BFD_RELOC_16C_DISP24a_C,
  4303. BFD_RELOC_16C_REG04,
  4304. BFD_RELOC_16C_REG04_C,
  4305. BFD_RELOC_16C_REG04a,
  4306. BFD_RELOC_16C_REG04a_C,
  4307. BFD_RELOC_16C_REG14,
  4308. BFD_RELOC_16C_REG14_C,
  4309. BFD_RELOC_16C_REG16,
  4310. BFD_RELOC_16C_REG16_C,
  4311. BFD_RELOC_16C_REG20,
  4312. BFD_RELOC_16C_REG20_C,
  4313. BFD_RELOC_16C_ABS20,
  4314. BFD_RELOC_16C_ABS20_C,
  4315. BFD_RELOC_16C_ABS24,
  4316. BFD_RELOC_16C_ABS24_C,
  4317. BFD_RELOC_16C_IMM04,
  4318. BFD_RELOC_16C_IMM04_C,
  4319. BFD_RELOC_16C_IMM16,
  4320. BFD_RELOC_16C_IMM16_C,
  4321. BFD_RELOC_16C_IMM20,
  4322. BFD_RELOC_16C_IMM20_C,
  4323. BFD_RELOC_16C_IMM24,
  4324. BFD_RELOC_16C_IMM24_C,
  4325. BFD_RELOC_16C_IMM32,
  4326. BFD_RELOC_16C_IMM32_C,
  4327. /* NS CR16 Relocations. */
  4328. BFD_RELOC_CR16_NUM8,
  4329. BFD_RELOC_CR16_NUM16,
  4330. BFD_RELOC_CR16_NUM32,
  4331. BFD_RELOC_CR16_NUM32a,
  4332. BFD_RELOC_CR16_REGREL0,
  4333. BFD_RELOC_CR16_REGREL4,
  4334. BFD_RELOC_CR16_REGREL4a,
  4335. BFD_RELOC_CR16_REGREL14,
  4336. BFD_RELOC_CR16_REGREL14a,
  4337. BFD_RELOC_CR16_REGREL16,
  4338. BFD_RELOC_CR16_REGREL20,
  4339. BFD_RELOC_CR16_REGREL20a,
  4340. BFD_RELOC_CR16_ABS20,
  4341. BFD_RELOC_CR16_ABS24,
  4342. BFD_RELOC_CR16_IMM4,
  4343. BFD_RELOC_CR16_IMM8,
  4344. BFD_RELOC_CR16_IMM16,
  4345. BFD_RELOC_CR16_IMM20,
  4346. BFD_RELOC_CR16_IMM24,
  4347. BFD_RELOC_CR16_IMM32,
  4348. BFD_RELOC_CR16_IMM32a,
  4349. BFD_RELOC_CR16_DISP4,
  4350. BFD_RELOC_CR16_DISP8,
  4351. BFD_RELOC_CR16_DISP16,
  4352. BFD_RELOC_CR16_DISP20,
  4353. BFD_RELOC_CR16_DISP24,
  4354. BFD_RELOC_CR16_DISP24a,
  4355. BFD_RELOC_CR16_SWITCH8,
  4356. BFD_RELOC_CR16_SWITCH16,
  4357. BFD_RELOC_CR16_SWITCH32,
  4358. BFD_RELOC_CR16_GOT_REGREL20,
  4359. BFD_RELOC_CR16_GOTC_REGREL20,
  4360. BFD_RELOC_CR16_GLOB_DAT,
  4361. /* NS CRX Relocations. */
  4362. BFD_RELOC_CRX_REL4,
  4363. BFD_RELOC_CRX_REL8,
  4364. BFD_RELOC_CRX_REL8_CMP,
  4365. BFD_RELOC_CRX_REL16,
  4366. BFD_RELOC_CRX_REL24,
  4367. BFD_RELOC_CRX_REL32,
  4368. BFD_RELOC_CRX_REGREL12,
  4369. BFD_RELOC_CRX_REGREL22,
  4370. BFD_RELOC_CRX_REGREL28,
  4371. BFD_RELOC_CRX_REGREL32,
  4372. BFD_RELOC_CRX_ABS16,
  4373. BFD_RELOC_CRX_ABS32,
  4374. BFD_RELOC_CRX_NUM8,
  4375. BFD_RELOC_CRX_NUM16,
  4376. BFD_RELOC_CRX_NUM32,
  4377. BFD_RELOC_CRX_IMM16,
  4378. BFD_RELOC_CRX_IMM32,
  4379. BFD_RELOC_CRX_SWITCH8,
  4380. BFD_RELOC_CRX_SWITCH16,
  4381. BFD_RELOC_CRX_SWITCH32,
  4382. /* These relocs are only used within the CRIS assembler. They are not
  4383. (at present) written to any object files. */
  4384. BFD_RELOC_CRIS_BDISP8,
  4385. BFD_RELOC_CRIS_UNSIGNED_5,
  4386. BFD_RELOC_CRIS_SIGNED_6,
  4387. BFD_RELOC_CRIS_UNSIGNED_6,
  4388. BFD_RELOC_CRIS_SIGNED_8,
  4389. BFD_RELOC_CRIS_UNSIGNED_8,
  4390. BFD_RELOC_CRIS_SIGNED_16,
  4391. BFD_RELOC_CRIS_UNSIGNED_16,
  4392. BFD_RELOC_CRIS_LAPCQ_OFFSET,
  4393. BFD_RELOC_CRIS_UNSIGNED_4,
  4394. /* Relocs used in ELF shared libraries for CRIS. */
  4395. BFD_RELOC_CRIS_COPY,
  4396. BFD_RELOC_CRIS_GLOB_DAT,
  4397. BFD_RELOC_CRIS_JUMP_SLOT,
  4398. BFD_RELOC_CRIS_RELATIVE,
  4399. /* 32-bit offset to symbol-entry within GOT. */
  4400. BFD_RELOC_CRIS_32_GOT,
  4401. /* 16-bit offset to symbol-entry within GOT. */
  4402. BFD_RELOC_CRIS_16_GOT,
  4403. /* 32-bit offset to symbol-entry within GOT, with PLT handling. */
  4404. BFD_RELOC_CRIS_32_GOTPLT,
  4405. /* 16-bit offset to symbol-entry within GOT, with PLT handling. */
  4406. BFD_RELOC_CRIS_16_GOTPLT,
  4407. /* 32-bit offset to symbol, relative to GOT. */
  4408. BFD_RELOC_CRIS_32_GOTREL,
  4409. /* 32-bit offset to symbol with PLT entry, relative to GOT. */
  4410. BFD_RELOC_CRIS_32_PLT_GOTREL,
  4411. /* 32-bit offset to symbol with PLT entry, relative to this relocation. */
  4412. BFD_RELOC_CRIS_32_PLT_PCREL,
  4413. /* Relocs used in TLS code for CRIS. */
  4414. BFD_RELOC_CRIS_32_GOT_GD,
  4415. BFD_RELOC_CRIS_16_GOT_GD,
  4416. BFD_RELOC_CRIS_32_GD,
  4417. BFD_RELOC_CRIS_DTP,
  4418. BFD_RELOC_CRIS_32_DTPREL,
  4419. BFD_RELOC_CRIS_16_DTPREL,
  4420. BFD_RELOC_CRIS_32_GOT_TPREL,
  4421. BFD_RELOC_CRIS_16_GOT_TPREL,
  4422. BFD_RELOC_CRIS_32_TPREL,
  4423. BFD_RELOC_CRIS_16_TPREL,
  4424. BFD_RELOC_CRIS_DTPMOD,
  4425. BFD_RELOC_CRIS_32_IE,
  4426. /* Intel i860 Relocations. */
  4427. BFD_RELOC_860_COPY,
  4428. BFD_RELOC_860_GLOB_DAT,
  4429. BFD_RELOC_860_JUMP_SLOT,
  4430. BFD_RELOC_860_RELATIVE,
  4431. BFD_RELOC_860_PC26,
  4432. BFD_RELOC_860_PLT26,
  4433. BFD_RELOC_860_PC16,
  4434. BFD_RELOC_860_LOW0,
  4435. BFD_RELOC_860_SPLIT0,
  4436. BFD_RELOC_860_LOW1,
  4437. BFD_RELOC_860_SPLIT1,
  4438. BFD_RELOC_860_LOW2,
  4439. BFD_RELOC_860_SPLIT2,
  4440. BFD_RELOC_860_LOW3,
  4441. BFD_RELOC_860_LOGOT0,
  4442. BFD_RELOC_860_SPGOT0,
  4443. BFD_RELOC_860_LOGOT1,
  4444. BFD_RELOC_860_SPGOT1,
  4445. BFD_RELOC_860_LOGOTOFF0,
  4446. BFD_RELOC_860_SPGOTOFF0,
  4447. BFD_RELOC_860_LOGOTOFF1,
  4448. BFD_RELOC_860_SPGOTOFF1,
  4449. BFD_RELOC_860_LOGOTOFF2,
  4450. BFD_RELOC_860_LOGOTOFF3,
  4451. BFD_RELOC_860_LOPC,
  4452. BFD_RELOC_860_HIGHADJ,
  4453. BFD_RELOC_860_HAGOT,
  4454. BFD_RELOC_860_HAGOTOFF,
  4455. BFD_RELOC_860_HAPC,
  4456. BFD_RELOC_860_HIGH,
  4457. BFD_RELOC_860_HIGOT,
  4458. BFD_RELOC_860_HIGOTOFF,
  4459. /* OpenRISC 1000 Relocations. */
  4460. BFD_RELOC_OR1K_REL_26,
  4461. BFD_RELOC_OR1K_GOTPC_HI16,
  4462. BFD_RELOC_OR1K_GOTPC_LO16,
  4463. BFD_RELOC_OR1K_GOT16,
  4464. BFD_RELOC_OR1K_PLT26,
  4465. BFD_RELOC_OR1K_GOTOFF_HI16,
  4466. BFD_RELOC_OR1K_GOTOFF_LO16,
  4467. BFD_RELOC_OR1K_COPY,
  4468. BFD_RELOC_OR1K_GLOB_DAT,
  4469. BFD_RELOC_OR1K_JMP_SLOT,
  4470. BFD_RELOC_OR1K_RELATIVE,
  4471. BFD_RELOC_OR1K_TLS_GD_HI16,
  4472. BFD_RELOC_OR1K_TLS_GD_LO16,
  4473. BFD_RELOC_OR1K_TLS_LDM_HI16,
  4474. BFD_RELOC_OR1K_TLS_LDM_LO16,
  4475. BFD_RELOC_OR1K_TLS_LDO_HI16,
  4476. BFD_RELOC_OR1K_TLS_LDO_LO16,
  4477. BFD_RELOC_OR1K_TLS_IE_HI16,
  4478. BFD_RELOC_OR1K_TLS_IE_LO16,
  4479. BFD_RELOC_OR1K_TLS_LE_HI16,
  4480. BFD_RELOC_OR1K_TLS_LE_LO16,
  4481. BFD_RELOC_OR1K_TLS_TPOFF,
  4482. BFD_RELOC_OR1K_TLS_DTPOFF,
  4483. BFD_RELOC_OR1K_TLS_DTPMOD,
  4484. /* H8 elf Relocations. */
  4485. BFD_RELOC_H8_DIR16A8,
  4486. BFD_RELOC_H8_DIR16R8,
  4487. BFD_RELOC_H8_DIR24A8,
  4488. BFD_RELOC_H8_DIR24R8,
  4489. BFD_RELOC_H8_DIR32A16,
  4490. BFD_RELOC_H8_DISP32A16,
  4491. /* Sony Xstormy16 Relocations. */
  4492. BFD_RELOC_XSTORMY16_REL_12,
  4493. BFD_RELOC_XSTORMY16_12,
  4494. BFD_RELOC_XSTORMY16_24,
  4495. BFD_RELOC_XSTORMY16_FPTR16,
  4496. /* Self-describing complex relocations. */
  4497. BFD_RELOC_RELC,
  4498. /* Infineon Relocations. */
  4499. BFD_RELOC_XC16X_PAG,
  4500. BFD_RELOC_XC16X_POF,
  4501. BFD_RELOC_XC16X_SEG,
  4502. BFD_RELOC_XC16X_SOF,
  4503. /* Relocations used by VAX ELF. */
  4504. BFD_RELOC_VAX_GLOB_DAT,
  4505. BFD_RELOC_VAX_JMP_SLOT,
  4506. BFD_RELOC_VAX_RELATIVE,
  4507. /* Morpho MT - 16 bit immediate relocation. */
  4508. BFD_RELOC_MT_PC16,
  4509. /* Morpho MT - Hi 16 bits of an address. */
  4510. BFD_RELOC_MT_HI16,
  4511. /* Morpho MT - Low 16 bits of an address. */
  4512. BFD_RELOC_MT_LO16,
  4513. /* Morpho MT - Used to tell the linker which vtable entries are used. */
  4514. BFD_RELOC_MT_GNU_VTINHERIT,
  4515. /* Morpho MT - Used to tell the linker which vtable entries are used. */
  4516. BFD_RELOC_MT_GNU_VTENTRY,
  4517. /* Morpho MT - 8 bit immediate relocation. */
  4518. BFD_RELOC_MT_PCINSN8,
  4519. /* msp430 specific relocation codes */
  4520. BFD_RELOC_MSP430_10_PCREL,
  4521. BFD_RELOC_MSP430_16_PCREL,
  4522. BFD_RELOC_MSP430_16,
  4523. BFD_RELOC_MSP430_16_PCREL_BYTE,
  4524. BFD_RELOC_MSP430_16_BYTE,
  4525. BFD_RELOC_MSP430_2X_PCREL,
  4526. BFD_RELOC_MSP430_RL_PCREL,
  4527. BFD_RELOC_MSP430_ABS8,
  4528. BFD_RELOC_MSP430X_PCR20_EXT_SRC,
  4529. BFD_RELOC_MSP430X_PCR20_EXT_DST,
  4530. BFD_RELOC_MSP430X_PCR20_EXT_ODST,
  4531. BFD_RELOC_MSP430X_ABS20_EXT_SRC,
  4532. BFD_RELOC_MSP430X_ABS20_EXT_DST,
  4533. BFD_RELOC_MSP430X_ABS20_EXT_ODST,
  4534. BFD_RELOC_MSP430X_ABS20_ADR_SRC,
  4535. BFD_RELOC_MSP430X_ABS20_ADR_DST,
  4536. BFD_RELOC_MSP430X_PCR16,
  4537. BFD_RELOC_MSP430X_PCR20_CALL,
  4538. BFD_RELOC_MSP430X_ABS16,
  4539. BFD_RELOC_MSP430_ABS_HI16,
  4540. BFD_RELOC_MSP430_PREL31,
  4541. BFD_RELOC_MSP430_SYM_DIFF,
  4542. /* Relocations used by the Altera Nios II core. */
  4543. BFD_RELOC_NIOS2_S16,
  4544. BFD_RELOC_NIOS2_U16,
  4545. BFD_RELOC_NIOS2_CALL26,
  4546. BFD_RELOC_NIOS2_IMM5,
  4547. BFD_RELOC_NIOS2_CACHE_OPX,
  4548. BFD_RELOC_NIOS2_IMM6,
  4549. BFD_RELOC_NIOS2_IMM8,
  4550. BFD_RELOC_NIOS2_HI16,
  4551. BFD_RELOC_NIOS2_LO16,
  4552. BFD_RELOC_NIOS2_HIADJ16,
  4553. BFD_RELOC_NIOS2_GPREL,
  4554. BFD_RELOC_NIOS2_UJMP,
  4555. BFD_RELOC_NIOS2_CJMP,
  4556. BFD_RELOC_NIOS2_CALLR,
  4557. BFD_RELOC_NIOS2_ALIGN,
  4558. BFD_RELOC_NIOS2_GOT16,
  4559. BFD_RELOC_NIOS2_CALL16,
  4560. BFD_RELOC_NIOS2_GOTOFF_LO,
  4561. BFD_RELOC_NIOS2_GOTOFF_HA,
  4562. BFD_RELOC_NIOS2_PCREL_LO,
  4563. BFD_RELOC_NIOS2_PCREL_HA,
  4564. BFD_RELOC_NIOS2_TLS_GD16,
  4565. BFD_RELOC_NIOS2_TLS_LDM16,
  4566. BFD_RELOC_NIOS2_TLS_LDO16,
  4567. BFD_RELOC_NIOS2_TLS_IE16,
  4568. BFD_RELOC_NIOS2_TLS_LE16,
  4569. BFD_RELOC_NIOS2_TLS_DTPMOD,
  4570. BFD_RELOC_NIOS2_TLS_DTPREL,
  4571. BFD_RELOC_NIOS2_TLS_TPREL,
  4572. BFD_RELOC_NIOS2_COPY,
  4573. BFD_RELOC_NIOS2_GLOB_DAT,
  4574. BFD_RELOC_NIOS2_JUMP_SLOT,
  4575. BFD_RELOC_NIOS2_RELATIVE,
  4576. BFD_RELOC_NIOS2_GOTOFF,
  4577. BFD_RELOC_NIOS2_CALL26_NOAT,
  4578. BFD_RELOC_NIOS2_GOT_LO,
  4579. BFD_RELOC_NIOS2_GOT_HA,
  4580. BFD_RELOC_NIOS2_CALL_LO,
  4581. BFD_RELOC_NIOS2_CALL_HA,
  4582. BFD_RELOC_NIOS2_R2_S12,
  4583. BFD_RELOC_NIOS2_R2_I10_1_PCREL,
  4584. BFD_RELOC_NIOS2_R2_T1I7_1_PCREL,
  4585. BFD_RELOC_NIOS2_R2_T1I7_2,
  4586. BFD_RELOC_NIOS2_R2_T2I4,
  4587. BFD_RELOC_NIOS2_R2_T2I4_1,
  4588. BFD_RELOC_NIOS2_R2_T2I4_2,
  4589. BFD_RELOC_NIOS2_R2_X1I7_2,
  4590. BFD_RELOC_NIOS2_R2_X2L5,
  4591. BFD_RELOC_NIOS2_R2_F1I5_2,
  4592. BFD_RELOC_NIOS2_R2_L5I4X1,
  4593. BFD_RELOC_NIOS2_R2_T1X1I6,
  4594. BFD_RELOC_NIOS2_R2_T1X1I6_2,
  4595. /* IQ2000 Relocations. */
  4596. BFD_RELOC_IQ2000_OFFSET_16,
  4597. BFD_RELOC_IQ2000_OFFSET_21,
  4598. BFD_RELOC_IQ2000_UHI16,
  4599. /* Special Xtensa relocation used only by PLT entries in ELF shared
  4600. objects to indicate that the runtime linker should set the value
  4601. to one of its own internal functions or data structures. */
  4602. BFD_RELOC_XTENSA_RTLD,
  4603. /* Xtensa relocations for ELF shared objects. */
  4604. BFD_RELOC_XTENSA_GLOB_DAT,
  4605. BFD_RELOC_XTENSA_JMP_SLOT,
  4606. BFD_RELOC_XTENSA_RELATIVE,
  4607. /* Xtensa relocation used in ELF object files for symbols that may require
  4608. PLT entries. Otherwise, this is just a generic 32-bit relocation. */
  4609. BFD_RELOC_XTENSA_PLT,
  4610. /* Xtensa relocations to mark the difference of two local symbols.
  4611. These are only needed to support linker relaxation and can be ignored
  4612. when not relaxing. The field is set to the value of the difference
  4613. assuming no relaxation. The relocation encodes the position of the
  4614. first symbol so the linker can determine whether to adjust the field
  4615. value. */
  4616. BFD_RELOC_XTENSA_DIFF8,
  4617. BFD_RELOC_XTENSA_DIFF16,
  4618. BFD_RELOC_XTENSA_DIFF32,
  4619. /* Generic Xtensa relocations for instruction operands. Only the slot
  4620. number is encoded in the relocation. The relocation applies to the
  4621. last PC-relative immediate operand, or if there are no PC-relative
  4622. immediates, to the last immediate operand. */
  4623. BFD_RELOC_XTENSA_SLOT0_OP,
  4624. BFD_RELOC_XTENSA_SLOT1_OP,
  4625. BFD_RELOC_XTENSA_SLOT2_OP,
  4626. BFD_RELOC_XTENSA_SLOT3_OP,
  4627. BFD_RELOC_XTENSA_SLOT4_OP,
  4628. BFD_RELOC_XTENSA_SLOT5_OP,
  4629. BFD_RELOC_XTENSA_SLOT6_OP,
  4630. BFD_RELOC_XTENSA_SLOT7_OP,
  4631. BFD_RELOC_XTENSA_SLOT8_OP,
  4632. BFD_RELOC_XTENSA_SLOT9_OP,
  4633. BFD_RELOC_XTENSA_SLOT10_OP,
  4634. BFD_RELOC_XTENSA_SLOT11_OP,
  4635. BFD_RELOC_XTENSA_SLOT12_OP,
  4636. BFD_RELOC_XTENSA_SLOT13_OP,
  4637. BFD_RELOC_XTENSA_SLOT14_OP,
  4638. /* Alternate Xtensa relocations. Only the slot is encoded in the
  4639. relocation. The meaning of these relocations is opcode-specific. */
  4640. BFD_RELOC_XTENSA_SLOT0_ALT,
  4641. BFD_RELOC_XTENSA_SLOT1_ALT,
  4642. BFD_RELOC_XTENSA_SLOT2_ALT,
  4643. BFD_RELOC_XTENSA_SLOT3_ALT,
  4644. BFD_RELOC_XTENSA_SLOT4_ALT,
  4645. BFD_RELOC_XTENSA_SLOT5_ALT,
  4646. BFD_RELOC_XTENSA_SLOT6_ALT,
  4647. BFD_RELOC_XTENSA_SLOT7_ALT,
  4648. BFD_RELOC_XTENSA_SLOT8_ALT,
  4649. BFD_RELOC_XTENSA_SLOT9_ALT,
  4650. BFD_RELOC_XTENSA_SLOT10_ALT,
  4651. BFD_RELOC_XTENSA_SLOT11_ALT,
  4652. BFD_RELOC_XTENSA_SLOT12_ALT,
  4653. BFD_RELOC_XTENSA_SLOT13_ALT,
  4654. BFD_RELOC_XTENSA_SLOT14_ALT,
  4655. /* Xtensa relocations for backward compatibility. These have all been
  4656. replaced by BFD_RELOC_XTENSA_SLOT0_OP. */
  4657. BFD_RELOC_XTENSA_OP0,
  4658. BFD_RELOC_XTENSA_OP1,
  4659. BFD_RELOC_XTENSA_OP2,
  4660. /* Xtensa relocation to mark that the assembler expanded the
  4661. instructions from an original target. The expansion size is
  4662. encoded in the reloc size. */
  4663. BFD_RELOC_XTENSA_ASM_EXPAND,
  4664. /* Xtensa relocation to mark that the linker should simplify
  4665. assembler-expanded instructions. This is commonly used
  4666. internally by the linker after analysis of a
  4667. BFD_RELOC_XTENSA_ASM_EXPAND. */
  4668. BFD_RELOC_XTENSA_ASM_SIMPLIFY,
  4669. /* Xtensa TLS relocations. */
  4670. BFD_RELOC_XTENSA_TLSDESC_FN,
  4671. BFD_RELOC_XTENSA_TLSDESC_ARG,
  4672. BFD_RELOC_XTENSA_TLS_DTPOFF,
  4673. BFD_RELOC_XTENSA_TLS_TPOFF,
  4674. BFD_RELOC_XTENSA_TLS_FUNC,
  4675. BFD_RELOC_XTENSA_TLS_ARG,
  4676. BFD_RELOC_XTENSA_TLS_CALL,
  4677. /* 8 bit signed offset in (ix+d) or (iy+d). */
  4678. BFD_RELOC_Z80_DISP8,
  4679. /* DJNZ offset. */
  4680. BFD_RELOC_Z8K_DISP7,
  4681. /* CALR offset. */
  4682. BFD_RELOC_Z8K_CALLR,
  4683. /* 4 bit value. */
  4684. BFD_RELOC_Z8K_IMM4L,
  4685. /* Lattice Mico32 relocations. */
  4686. BFD_RELOC_LM32_CALL,
  4687. BFD_RELOC_LM32_BRANCH,
  4688. BFD_RELOC_LM32_16_GOT,
  4689. BFD_RELOC_LM32_GOTOFF_HI16,
  4690. BFD_RELOC_LM32_GOTOFF_LO16,
  4691. BFD_RELOC_LM32_COPY,
  4692. BFD_RELOC_LM32_GLOB_DAT,
  4693. BFD_RELOC_LM32_JMP_SLOT,
  4694. BFD_RELOC_LM32_RELATIVE,
  4695. /* Difference between two section addreses. Must be followed by a
  4696. BFD_RELOC_MACH_O_PAIR. */
  4697. BFD_RELOC_MACH_O_SECTDIFF,
  4698. /* Like BFD_RELOC_MACH_O_SECTDIFF but with a local symbol. */
  4699. BFD_RELOC_MACH_O_LOCAL_SECTDIFF,
  4700. /* Pair of relocation. Contains the first symbol. */
  4701. BFD_RELOC_MACH_O_PAIR,
  4702. /* PCREL relocations. They are marked as branch to create PLT entry if
  4703. required. */
  4704. BFD_RELOC_MACH_O_X86_64_BRANCH32,
  4705. BFD_RELOC_MACH_O_X86_64_BRANCH8,
  4706. /* Used when referencing a GOT entry. */
  4707. BFD_RELOC_MACH_O_X86_64_GOT,
  4708. /* Used when loading a GOT entry with movq. It is specially marked so that
  4709. the linker could optimize the movq to a leaq if possible. */
  4710. BFD_RELOC_MACH_O_X86_64_GOT_LOAD,
  4711. /* Symbol will be substracted. Must be followed by a BFD_RELOC_64. */
  4712. BFD_RELOC_MACH_O_X86_64_SUBTRACTOR32,
  4713. /* Symbol will be substracted. Must be followed by a BFD_RELOC_64. */
  4714. BFD_RELOC_MACH_O_X86_64_SUBTRACTOR64,
  4715. /* Same as BFD_RELOC_32_PCREL but with an implicit -1 addend. */
  4716. BFD_RELOC_MACH_O_X86_64_PCREL32_1,
  4717. /* Same as BFD_RELOC_32_PCREL but with an implicit -2 addend. */
  4718. BFD_RELOC_MACH_O_X86_64_PCREL32_2,
  4719. /* Same as BFD_RELOC_32_PCREL but with an implicit -4 addend. */
  4720. BFD_RELOC_MACH_O_X86_64_PCREL32_4,
  4721. /* This is a 32 bit reloc for the microblaze that stores the
  4722. low 16 bits of a value */
  4723. BFD_RELOC_MICROBLAZE_32_LO,
  4724. /* This is a 32 bit pc-relative reloc for the microblaze that
  4725. stores the low 16 bits of a value */
  4726. BFD_RELOC_MICROBLAZE_32_LO_PCREL,
  4727. /* This is a 32 bit reloc for the microblaze that stores a
  4728. value relative to the read-only small data area anchor */
  4729. BFD_RELOC_MICROBLAZE_32_ROSDA,
  4730. /* This is a 32 bit reloc for the microblaze that stores a
  4731. value relative to the read-write small data area anchor */
  4732. BFD_RELOC_MICROBLAZE_32_RWSDA,
  4733. /* This is a 32 bit reloc for the microblaze to handle
  4734. expressions of the form "Symbol Op Symbol" */
  4735. BFD_RELOC_MICROBLAZE_32_SYM_OP_SYM,
  4736. /* This is a 64 bit reloc that stores the 32 bit pc relative
  4737. value in two words (with an imm instruction). No relocation is
  4738. done here - only used for relaxing */
  4739. BFD_RELOC_MICROBLAZE_64_NONE,
  4740. /* This is a 64 bit reloc that stores the 32 bit pc relative
  4741. value in two words (with an imm instruction). The relocation is
  4742. PC-relative GOT offset */
  4743. BFD_RELOC_MICROBLAZE_64_GOTPC,
  4744. /* This is a 64 bit reloc that stores the 32 bit pc relative
  4745. value in two words (with an imm instruction). The relocation is
  4746. GOT offset */
  4747. BFD_RELOC_MICROBLAZE_64_GOT,
  4748. /* This is a 64 bit reloc that stores the 32 bit pc relative
  4749. value in two words (with an imm instruction). The relocation is
  4750. PC-relative offset into PLT */
  4751. BFD_RELOC_MICROBLAZE_64_PLT,
  4752. /* This is a 64 bit reloc that stores the 32 bit GOT relative
  4753. value in two words (with an imm instruction). The relocation is
  4754. relative offset from _GLOBAL_OFFSET_TABLE_ */
  4755. BFD_RELOC_MICROBLAZE_64_GOTOFF,
  4756. /* This is a 32 bit reloc that stores the 32 bit GOT relative
  4757. value in a word. The relocation is relative offset from */
  4758. BFD_RELOC_MICROBLAZE_32_GOTOFF,
  4759. /* This is used to tell the dynamic linker to copy the value out of
  4760. the dynamic object into the runtime process image. */
  4761. BFD_RELOC_MICROBLAZE_COPY,
  4762. /* Unused Reloc */
  4763. BFD_RELOC_MICROBLAZE_64_TLS,
  4764. /* This is a 64 bit reloc that stores the 32 bit GOT relative value
  4765. of the GOT TLS GD info entry in two words (with an imm instruction). The
  4766. relocation is GOT offset. */
  4767. BFD_RELOC_MICROBLAZE_64_TLSGD,
  4768. /* This is a 64 bit reloc that stores the 32 bit GOT relative value
  4769. of the GOT TLS LD info entry in two words (with an imm instruction). The
  4770. relocation is GOT offset. */
  4771. BFD_RELOC_MICROBLAZE_64_TLSLD,
  4772. /* This is a 32 bit reloc that stores the Module ID to GOT(n). */
  4773. BFD_RELOC_MICROBLAZE_32_TLSDTPMOD,
  4774. /* This is a 32 bit reloc that stores TLS offset to GOT(n+1). */
  4775. BFD_RELOC_MICROBLAZE_32_TLSDTPREL,
  4776. /* This is a 32 bit reloc for storing TLS offset to two words (uses imm
  4777. instruction) */
  4778. BFD_RELOC_MICROBLAZE_64_TLSDTPREL,
  4779. /* This is a 64 bit reloc that stores 32-bit thread pointer relative offset
  4780. to two words (uses imm instruction). */
  4781. BFD_RELOC_MICROBLAZE_64_TLSGOTTPREL,
  4782. /* This is a 64 bit reloc that stores 32-bit thread pointer relative offset
  4783. to two words (uses imm instruction). */
  4784. BFD_RELOC_MICROBLAZE_64_TLSTPREL,
  4785. /* AArch64 pseudo relocation code to mark the start of the AArch64
  4786. relocation enumerators. N.B. the order of the enumerators is
  4787. important as several tables in the AArch64 bfd backend are indexed
  4788. by these enumerators; make sure they are all synced. */
  4789. BFD_RELOC_AARCH64_RELOC_START,
  4790. /* AArch64 null relocation code. */
  4791. BFD_RELOC_AARCH64_NONE,
  4792. /* Basic absolute relocations of N bits. These are equivalent to
  4793. BFD_RELOC_N and they were added to assist the indexing of the howto
  4794. table. */
  4795. BFD_RELOC_AARCH64_64,
  4796. BFD_RELOC_AARCH64_32,
  4797. BFD_RELOC_AARCH64_16,
  4798. /* PC-relative relocations. These are equivalent to BFD_RELOC_N_PCREL
  4799. and they were added to assist the indexing of the howto table. */
  4800. BFD_RELOC_AARCH64_64_PCREL,
  4801. BFD_RELOC_AARCH64_32_PCREL,
  4802. BFD_RELOC_AARCH64_16_PCREL,
  4803. /* AArch64 MOV[NZK] instruction with most significant bits 0 to 15
  4804. of an unsigned address/value. */
  4805. BFD_RELOC_AARCH64_MOVW_G0,
  4806. /* AArch64 MOV[NZK] instruction with less significant bits 0 to 15 of
  4807. an address/value. No overflow checking. */
  4808. BFD_RELOC_AARCH64_MOVW_G0_NC,
  4809. /* AArch64 MOV[NZK] instruction with most significant bits 16 to 31
  4810. of an unsigned address/value. */
  4811. BFD_RELOC_AARCH64_MOVW_G1,
  4812. /* AArch64 MOV[NZK] instruction with less significant bits 16 to 31
  4813. of an address/value. No overflow checking. */
  4814. BFD_RELOC_AARCH64_MOVW_G1_NC,
  4815. /* AArch64 MOV[NZK] instruction with most significant bits 32 to 47
  4816. of an unsigned address/value. */
  4817. BFD_RELOC_AARCH64_MOVW_G2,
  4818. /* AArch64 MOV[NZK] instruction with less significant bits 32 to 47
  4819. of an address/value. No overflow checking. */
  4820. BFD_RELOC_AARCH64_MOVW_G2_NC,
  4821. /* AArch64 MOV[NZK] instruction with most signficant bits 48 to 64
  4822. of a signed or unsigned address/value. */
  4823. BFD_RELOC_AARCH64_MOVW_G3,
  4824. /* AArch64 MOV[NZ] instruction with most significant bits 0 to 15
  4825. of a signed value. Changes instruction to MOVZ or MOVN depending on the
  4826. value's sign. */
  4827. BFD_RELOC_AARCH64_MOVW_G0_S,
  4828. /* AArch64 MOV[NZ] instruction with most significant bits 16 to 31
  4829. of a signed value. Changes instruction to MOVZ or MOVN depending on the
  4830. value's sign. */
  4831. BFD_RELOC_AARCH64_MOVW_G1_S,
  4832. /* AArch64 MOV[NZ] instruction with most significant bits 32 to 47
  4833. of a signed value. Changes instruction to MOVZ or MOVN depending on the
  4834. value's sign. */
  4835. BFD_RELOC_AARCH64_MOVW_G2_S,
  4836. /* AArch64 Load Literal instruction, holding a 19 bit pc-relative word
  4837. offset. The lowest two bits must be zero and are not stored in the
  4838. instruction, giving a 21 bit signed byte offset. */
  4839. BFD_RELOC_AARCH64_LD_LO19_PCREL,
  4840. /* AArch64 ADR instruction, holding a simple 21 bit pc-relative byte offset. */
  4841. BFD_RELOC_AARCH64_ADR_LO21_PCREL,
  4842. /* AArch64 ADRP instruction, with bits 12 to 32 of a pc-relative page
  4843. offset, giving a 4KB aligned page base address. */
  4844. BFD_RELOC_AARCH64_ADR_HI21_PCREL,
  4845. /* AArch64 ADRP instruction, with bits 12 to 32 of a pc-relative page
  4846. offset, giving a 4KB aligned page base address, but with no overflow
  4847. checking. */
  4848. BFD_RELOC_AARCH64_ADR_HI21_NC_PCREL,
  4849. /* AArch64 ADD immediate instruction, holding bits 0 to 11 of the address.
  4850. Used in conjunction with BFD_RELOC_AARCH64_ADR_HI21_PCREL. */
  4851. BFD_RELOC_AARCH64_ADD_LO12,
  4852. /* AArch64 8-bit load/store instruction, holding bits 0 to 11 of the
  4853. address. Used in conjunction with BFD_RELOC_AARCH64_ADR_HI21_PCREL. */
  4854. BFD_RELOC_AARCH64_LDST8_LO12,
  4855. /* AArch64 14 bit pc-relative test bit and branch.
  4856. The lowest two bits must be zero and are not stored in the instruction,
  4857. giving a 16 bit signed byte offset. */
  4858. BFD_RELOC_AARCH64_TSTBR14,
  4859. /* AArch64 19 bit pc-relative conditional branch and compare & branch.
  4860. The lowest two bits must be zero and are not stored in the instruction,
  4861. giving a 21 bit signed byte offset. */
  4862. BFD_RELOC_AARCH64_BRANCH19,
  4863. /* AArch64 26 bit pc-relative unconditional branch.
  4864. The lowest two bits must be zero and are not stored in the instruction,
  4865. giving a 28 bit signed byte offset. */
  4866. BFD_RELOC_AARCH64_JUMP26,
  4867. /* AArch64 26 bit pc-relative unconditional branch and link.
  4868. The lowest two bits must be zero and are not stored in the instruction,
  4869. giving a 28 bit signed byte offset. */
  4870. BFD_RELOC_AARCH64_CALL26,
  4871. /* AArch64 16-bit load/store instruction, holding bits 0 to 11 of the
  4872. address. Used in conjunction with BFD_RELOC_AARCH64_ADR_HI21_PCREL. */
  4873. BFD_RELOC_AARCH64_LDST16_LO12,
  4874. /* AArch64 32-bit load/store instruction, holding bits 0 to 11 of the
  4875. address. Used in conjunction with BFD_RELOC_AARCH64_ADR_HI21_PCREL. */
  4876. BFD_RELOC_AARCH64_LDST32_LO12,
  4877. /* AArch64 64-bit load/store instruction, holding bits 0 to 11 of the
  4878. address. Used in conjunction with BFD_RELOC_AARCH64_ADR_HI21_PCREL. */
  4879. BFD_RELOC_AARCH64_LDST64_LO12,
  4880. /* AArch64 128-bit load/store instruction, holding bits 0 to 11 of the
  4881. address. Used in conjunction with BFD_RELOC_AARCH64_ADR_HI21_PCREL. */
  4882. BFD_RELOC_AARCH64_LDST128_LO12,
  4883. /* AArch64 Load Literal instruction, holding a 19 bit PC relative word
  4884. offset of the global offset table entry for a symbol. The lowest two
  4885. bits must be zero and are not stored in the instruction, giving a 21
  4886. bit signed byte offset. This relocation type requires signed overflow
  4887. checking. */
  4888. BFD_RELOC_AARCH64_GOT_LD_PREL19,
  4889. /* Get to the page base of the global offset table entry for a symbol as
  4890. part of an ADRP instruction using a 21 bit PC relative value.Used in
  4891. conjunction with BFD_RELOC_AARCH64_LD64_GOT_LO12_NC. */
  4892. BFD_RELOC_AARCH64_ADR_GOT_PAGE,
  4893. /* Unsigned 12 bit byte offset for 64 bit load/store from the page of
  4894. the GOT entry for this symbol. Used in conjunction with
  4895. BFD_RELOC_AARCH64_ADR_GOTPAGE. Valid in LP64 ABI only. */
  4896. BFD_RELOC_AARCH64_LD64_GOT_LO12_NC,
  4897. /* Unsigned 12 bit byte offset for 32 bit load/store from the page of
  4898. the GOT entry for this symbol. Used in conjunction with
  4899. BFD_RELOC_AARCH64_ADR_GOTPAGE. Valid in ILP32 ABI only. */
  4900. BFD_RELOC_AARCH64_LD32_GOT_LO12_NC,
  4901. /* Unsigned 16 bit byte offset for 64 bit load/store from the GOT entry
  4902. for this symbol. Valid in LP64 ABI only. */
  4903. BFD_RELOC_AARCH64_MOVW_GOTOFF_G0_NC,
  4904. /* Unsigned 16 bit byte higher offset for 64 bit load/store from the GOT entry
  4905. for this symbol. Valid in LP64 ABI only. */
  4906. BFD_RELOC_AARCH64_MOVW_GOTOFF_G1,
  4907. /* Unsigned 15 bit byte offset for 64 bit load/store from the page of
  4908. the GOT entry for this symbol. Valid in LP64 ABI only. */
  4909. BFD_RELOC_AARCH64_LD64_GOTOFF_LO15,
  4910. /* Scaled 14 bit byte offset to the page base of the global offset table. */
  4911. BFD_RELOC_AARCH64_LD32_GOTPAGE_LO14,
  4912. /* Scaled 15 bit byte offset to the page base of the global offset table. */
  4913. BFD_RELOC_AARCH64_LD64_GOTPAGE_LO15,
  4914. /* Get to the page base of the global offset table entry for a symbols
  4915. tls_index structure as part of an adrp instruction using a 21 bit PC
  4916. relative value. Used in conjunction with
  4917. BFD_RELOC_AARCH64_TLSGD_ADD_LO12_NC. */
  4918. BFD_RELOC_AARCH64_TLSGD_ADR_PAGE21,
  4919. /* AArch64 TLS General Dynamic */
  4920. BFD_RELOC_AARCH64_TLSGD_ADR_PREL21,
  4921. /* Unsigned 12 bit byte offset to global offset table entry for a symbols
  4922. tls_index structure. Used in conjunction with
  4923. BFD_RELOC_AARCH64_TLSGD_ADR_PAGE21. */
  4924. BFD_RELOC_AARCH64_TLSGD_ADD_LO12_NC,
  4925. /* AArch64 TLS General Dynamic relocation. */
  4926. BFD_RELOC_AARCH64_TLSGD_MOVW_G0_NC,
  4927. /* AArch64 TLS General Dynamic relocation. */
  4928. BFD_RELOC_AARCH64_TLSGD_MOVW_G1,
  4929. /* AArch64 TLS INITIAL EXEC relocation. */
  4930. BFD_RELOC_AARCH64_TLSIE_ADR_GOTTPREL_PAGE21,
  4931. /* AArch64 TLS INITIAL EXEC relocation. */
  4932. BFD_RELOC_AARCH64_TLSIE_LD64_GOTTPREL_LO12_NC,
  4933. /* AArch64 TLS INITIAL EXEC relocation. */
  4934. BFD_RELOC_AARCH64_TLSIE_LD32_GOTTPREL_LO12_NC,
  4935. /* AArch64 TLS INITIAL EXEC relocation. */
  4936. BFD_RELOC_AARCH64_TLSIE_LD_GOTTPREL_PREL19,
  4937. /* AArch64 TLS INITIAL EXEC relocation. */
  4938. BFD_RELOC_AARCH64_TLSIE_MOVW_GOTTPREL_G0_NC,
  4939. /* AArch64 TLS INITIAL EXEC relocation. */
  4940. BFD_RELOC_AARCH64_TLSIE_MOVW_GOTTPREL_G1,
  4941. /* bit[23:12] of byte offset to module TLS base address. */
  4942. BFD_RELOC_AARCH64_TLSLD_ADD_DTPREL_HI12,
  4943. /* Unsigned 12 bit byte offset to module TLS base address. */
  4944. BFD_RELOC_AARCH64_TLSLD_ADD_DTPREL_LO12,
  4945. /* No overflow check version of BFD_RELOC_AARCH64_TLSLD_ADD_DTPREL_LO12. */
  4946. BFD_RELOC_AARCH64_TLSLD_ADD_DTPREL_LO12_NC,
  4947. /* Unsigned 12 bit byte offset to global offset table entry for a symbols
  4948. tls_index structure. Used in conjunction with
  4949. BFD_RELOC_AARCH64_TLSLD_ADR_PAGE21. */
  4950. BFD_RELOC_AARCH64_TLSLD_ADD_LO12_NC,
  4951. /* GOT entry page address for AArch64 TLS Local Dynamic, used with ADRP
  4952. instruction. */
  4953. BFD_RELOC_AARCH64_TLSLD_ADR_PAGE21,
  4954. /* GOT entry address for AArch64 TLS Local Dynamic, used with ADR instruction. */
  4955. BFD_RELOC_AARCH64_TLSLD_ADR_PREL21,
  4956. /* bit[11:1] of byte offset to module TLS base address, encoded in ldst
  4957. instructions. */
  4958. BFD_RELOC_AARCH64_TLSLD_LDST16_DTPREL_LO12,
  4959. /* Similar as BFD_RELOC_AARCH64_TLSLD_LDST16_DTPREL_LO12, but no overflow check. */
  4960. BFD_RELOC_AARCH64_TLSLD_LDST16_DTPREL_LO12_NC,
  4961. /* bit[11:2] of byte offset to module TLS base address, encoded in ldst
  4962. instructions. */
  4963. BFD_RELOC_AARCH64_TLSLD_LDST32_DTPREL_LO12,
  4964. /* Similar as BFD_RELOC_AARCH64_TLSLD_LDST32_DTPREL_LO12, but no overflow check. */
  4965. BFD_RELOC_AARCH64_TLSLD_LDST32_DTPREL_LO12_NC,
  4966. /* bit[11:3] of byte offset to module TLS base address, encoded in ldst
  4967. instructions. */
  4968. BFD_RELOC_AARCH64_TLSLD_LDST64_DTPREL_LO12,
  4969. /* Similar as BFD_RELOC_AARCH64_TLSLD_LDST64_DTPREL_LO12, but no overflow check. */
  4970. BFD_RELOC_AARCH64_TLSLD_LDST64_DTPREL_LO12_NC,
  4971. /* bit[11:0] of byte offset to module TLS base address, encoded in ldst
  4972. instructions. */
  4973. BFD_RELOC_AARCH64_TLSLD_LDST8_DTPREL_LO12,
  4974. /* Similar as BFD_RELOC_AARCH64_TLSLD_LDST8_DTPREL_LO12, but no overflow check. */
  4975. BFD_RELOC_AARCH64_TLSLD_LDST8_DTPREL_LO12_NC,
  4976. /* bit[15:0] of byte offset to module TLS base address. */
  4977. BFD_RELOC_AARCH64_TLSLD_MOVW_DTPREL_G0,
  4978. /* No overflow check version of BFD_RELOC_AARCH64_TLSLD_MOVW_DTPREL_G0 */
  4979. BFD_RELOC_AARCH64_TLSLD_MOVW_DTPREL_G0_NC,
  4980. /* bit[31:16] of byte offset to module TLS base address. */
  4981. BFD_RELOC_AARCH64_TLSLD_MOVW_DTPREL_G1,
  4982. /* No overflow check version of BFD_RELOC_AARCH64_TLSLD_MOVW_DTPREL_G1 */
  4983. BFD_RELOC_AARCH64_TLSLD_MOVW_DTPREL_G1_NC,
  4984. /* bit[47:32] of byte offset to module TLS base address. */
  4985. BFD_RELOC_AARCH64_TLSLD_MOVW_DTPREL_G2,
  4986. /* AArch64 TLS LOCAL EXEC relocation. */
  4987. BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G2,
  4988. /* AArch64 TLS LOCAL EXEC relocation. */
  4989. BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G1,
  4990. /* AArch64 TLS LOCAL EXEC relocation. */
  4991. BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G1_NC,
  4992. /* AArch64 TLS LOCAL EXEC relocation. */
  4993. BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G0,
  4994. /* AArch64 TLS LOCAL EXEC relocation. */
  4995. BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G0_NC,
  4996. /* AArch64 TLS LOCAL EXEC relocation. */
  4997. BFD_RELOC_AARCH64_TLSLE_ADD_TPREL_HI12,
  4998. /* AArch64 TLS LOCAL EXEC relocation. */
  4999. BFD_RELOC_AARCH64_TLSLE_ADD_TPREL_LO12,
  5000. /* AArch64 TLS LOCAL EXEC relocation. */
  5001. BFD_RELOC_AARCH64_TLSLE_ADD_TPREL_LO12_NC,
  5002. /* AArch64 TLS DESC relocation. */
  5003. BFD_RELOC_AARCH64_TLSDESC_LD_PREL19,
  5004. /* AArch64 TLS DESC relocation. */
  5005. BFD_RELOC_AARCH64_TLSDESC_ADR_PREL21,
  5006. /* AArch64 TLS DESC relocation. */
  5007. BFD_RELOC_AARCH64_TLSDESC_ADR_PAGE21,
  5008. /* AArch64 TLS DESC relocation. */
  5009. BFD_RELOC_AARCH64_TLSDESC_LD64_LO12_NC,
  5010. /* AArch64 TLS DESC relocation. */
  5011. BFD_RELOC_AARCH64_TLSDESC_LD32_LO12_NC,
  5012. /* AArch64 TLS DESC relocation. */
  5013. BFD_RELOC_AARCH64_TLSDESC_ADD_LO12_NC,
  5014. /* AArch64 TLS DESC relocation. */
  5015. BFD_RELOC_AARCH64_TLSDESC_OFF_G1,
  5016. /* AArch64 TLS DESC relocation. */
  5017. BFD_RELOC_AARCH64_TLSDESC_OFF_G0_NC,
  5018. /* AArch64 TLS DESC relocation. */
  5019. BFD_RELOC_AARCH64_TLSDESC_LDR,
  5020. /* AArch64 TLS DESC relocation. */
  5021. BFD_RELOC_AARCH64_TLSDESC_ADD,
  5022. /* AArch64 TLS DESC relocation. */
  5023. BFD_RELOC_AARCH64_TLSDESC_CALL,
  5024. /* AArch64 TLS relocation. */
  5025. BFD_RELOC_AARCH64_COPY,
  5026. /* AArch64 TLS relocation. */
  5027. BFD_RELOC_AARCH64_GLOB_DAT,
  5028. /* AArch64 TLS relocation. */
  5029. BFD_RELOC_AARCH64_JUMP_SLOT,
  5030. /* AArch64 TLS relocation. */
  5031. BFD_RELOC_AARCH64_RELATIVE,
  5032. /* AArch64 TLS relocation. */
  5033. BFD_RELOC_AARCH64_TLS_DTPMOD,
  5034. /* AArch64 TLS relocation. */
  5035. BFD_RELOC_AARCH64_TLS_DTPREL,
  5036. /* AArch64 TLS relocation. */
  5037. BFD_RELOC_AARCH64_TLS_TPREL,
  5038. /* AArch64 TLS relocation. */
  5039. BFD_RELOC_AARCH64_TLSDESC,
  5040. /* AArch64 support for STT_GNU_IFUNC. */
  5041. BFD_RELOC_AARCH64_IRELATIVE,
  5042. /* AArch64 pseudo relocation code to mark the end of the AArch64
  5043. relocation enumerators that have direct mapping to ELF reloc codes.
  5044. There are a few more enumerators after this one; those are mainly
  5045. used by the AArch64 assembler for the internal fixup or to select
  5046. one of the above enumerators. */
  5047. BFD_RELOC_AARCH64_RELOC_END,
  5048. /* AArch64 pseudo relocation code to be used internally by the AArch64
  5049. assembler and not (currently) written to any object files. */
  5050. BFD_RELOC_AARCH64_GAS_INTERNAL_FIXUP,
  5051. /* AArch64 unspecified load/store instruction, holding bits 0 to 11 of the
  5052. address. Used in conjunction with BFD_RELOC_AARCH64_ADR_HI21_PCREL. */
  5053. BFD_RELOC_AARCH64_LDST_LO12,
  5054. /* AArch64 pseudo relocation code for TLS local dynamic mode. It's to be
  5055. used internally by the AArch64 assembler and not (currently) written to
  5056. any object files. */
  5057. BFD_RELOC_AARCH64_TLSLD_LDST_DTPREL_LO12,
  5058. /* Similar as BFD_RELOC_AARCH64_TLSLD_LDST_DTPREL_LO12, but no overflow check. */
  5059. BFD_RELOC_AARCH64_TLSLD_LDST_DTPREL_LO12_NC,
  5060. /* AArch64 pseudo relocation code to be used internally by the AArch64
  5061. assembler and not (currently) written to any object files. */
  5062. BFD_RELOC_AARCH64_LD_GOT_LO12_NC,
  5063. /* AArch64 pseudo relocation code to be used internally by the AArch64
  5064. assembler and not (currently) written to any object files. */
  5065. BFD_RELOC_AARCH64_TLSIE_LD_GOTTPREL_LO12_NC,
  5066. /* AArch64 pseudo relocation code to be used internally by the AArch64
  5067. assembler and not (currently) written to any object files. */
  5068. BFD_RELOC_AARCH64_TLSDESC_LD_LO12_NC,
  5069. /* Tilera TILEPro Relocations. */
  5070. BFD_RELOC_TILEPRO_COPY,
  5071. BFD_RELOC_TILEPRO_GLOB_DAT,
  5072. BFD_RELOC_TILEPRO_JMP_SLOT,
  5073. BFD_RELOC_TILEPRO_RELATIVE,
  5074. BFD_RELOC_TILEPRO_BROFF_X1,
  5075. BFD_RELOC_TILEPRO_JOFFLONG_X1,
  5076. BFD_RELOC_TILEPRO_JOFFLONG_X1_PLT,
  5077. BFD_RELOC_TILEPRO_IMM8_X0,
  5078. BFD_RELOC_TILEPRO_IMM8_Y0,
  5079. BFD_RELOC_TILEPRO_IMM8_X1,
  5080. BFD_RELOC_TILEPRO_IMM8_Y1,
  5081. BFD_RELOC_TILEPRO_DEST_IMM8_X1,
  5082. BFD_RELOC_TILEPRO_MT_IMM15_X1,
  5083. BFD_RELOC_TILEPRO_MF_IMM15_X1,
  5084. BFD_RELOC_TILEPRO_IMM16_X0,
  5085. BFD_RELOC_TILEPRO_IMM16_X1,
  5086. BFD_RELOC_TILEPRO_IMM16_X0_LO,
  5087. BFD_RELOC_TILEPRO_IMM16_X1_LO,
  5088. BFD_RELOC_TILEPRO_IMM16_X0_HI,
  5089. BFD_RELOC_TILEPRO_IMM16_X1_HI,
  5090. BFD_RELOC_TILEPRO_IMM16_X0_HA,
  5091. BFD_RELOC_TILEPRO_IMM16_X1_HA,
  5092. BFD_RELOC_TILEPRO_IMM16_X0_PCREL,
  5093. BFD_RELOC_TILEPRO_IMM16_X1_PCREL,
  5094. BFD_RELOC_TILEPRO_IMM16_X0_LO_PCREL,
  5095. BFD_RELOC_TILEPRO_IMM16_X1_LO_PCREL,
  5096. BFD_RELOC_TILEPRO_IMM16_X0_HI_PCREL,
  5097. BFD_RELOC_TILEPRO_IMM16_X1_HI_PCREL,
  5098. BFD_RELOC_TILEPRO_IMM16_X0_HA_PCREL,
  5099. BFD_RELOC_TILEPRO_IMM16_X1_HA_PCREL,
  5100. BFD_RELOC_TILEPRO_IMM16_X0_GOT,
  5101. BFD_RELOC_TILEPRO_IMM16_X1_GOT,
  5102. BFD_RELOC_TILEPRO_IMM16_X0_GOT_LO,
  5103. BFD_RELOC_TILEPRO_IMM16_X1_GOT_LO,
  5104. BFD_RELOC_TILEPRO_IMM16_X0_GOT_HI,
  5105. BFD_RELOC_TILEPRO_IMM16_X1_GOT_HI,
  5106. BFD_RELOC_TILEPRO_IMM16_X0_GOT_HA,
  5107. BFD_RELOC_TILEPRO_IMM16_X1_GOT_HA,
  5108. BFD_RELOC_TILEPRO_MMSTART_X0,
  5109. BFD_RELOC_TILEPRO_MMEND_X0,
  5110. BFD_RELOC_TILEPRO_MMSTART_X1,
  5111. BFD_RELOC_TILEPRO_MMEND_X1,
  5112. BFD_RELOC_TILEPRO_SHAMT_X0,
  5113. BFD_RELOC_TILEPRO_SHAMT_X1,
  5114. BFD_RELOC_TILEPRO_SHAMT_Y0,
  5115. BFD_RELOC_TILEPRO_SHAMT_Y1,
  5116. BFD_RELOC_TILEPRO_TLS_GD_CALL,
  5117. BFD_RELOC_TILEPRO_IMM8_X0_TLS_GD_ADD,
  5118. BFD_RELOC_TILEPRO_IMM8_X1_TLS_GD_ADD,
  5119. BFD_RELOC_TILEPRO_IMM8_Y0_TLS_GD_ADD,
  5120. BFD_RELOC_TILEPRO_IMM8_Y1_TLS_GD_ADD,
  5121. BFD_RELOC_TILEPRO_TLS_IE_LOAD,
  5122. BFD_RELOC_TILEPRO_IMM16_X0_TLS_GD,
  5123. BFD_RELOC_TILEPRO_IMM16_X1_TLS_GD,
  5124. BFD_RELOC_TILEPRO_IMM16_X0_TLS_GD_LO,
  5125. BFD_RELOC_TILEPRO_IMM16_X1_TLS_GD_LO,
  5126. BFD_RELOC_TILEPRO_IMM16_X0_TLS_GD_HI,
  5127. BFD_RELOC_TILEPRO_IMM16_X1_TLS_GD_HI,
  5128. BFD_RELOC_TILEPRO_IMM16_X0_TLS_GD_HA,
  5129. BFD_RELOC_TILEPRO_IMM16_X1_TLS_GD_HA,
  5130. BFD_RELOC_TILEPRO_IMM16_X0_TLS_IE,
  5131. BFD_RELOC_TILEPRO_IMM16_X1_TLS_IE,
  5132. BFD_RELOC_TILEPRO_IMM16_X0_TLS_IE_LO,
  5133. BFD_RELOC_TILEPRO_IMM16_X1_TLS_IE_LO,
  5134. BFD_RELOC_TILEPRO_IMM16_X0_TLS_IE_HI,
  5135. BFD_RELOC_TILEPRO_IMM16_X1_TLS_IE_HI,
  5136. BFD_RELOC_TILEPRO_IMM16_X0_TLS_IE_HA,
  5137. BFD_RELOC_TILEPRO_IMM16_X1_TLS_IE_HA,
  5138. BFD_RELOC_TILEPRO_TLS_DTPMOD32,
  5139. BFD_RELOC_TILEPRO_TLS_DTPOFF32,
  5140. BFD_RELOC_TILEPRO_TLS_TPOFF32,
  5141. BFD_RELOC_TILEPRO_IMM16_X0_TLS_LE,
  5142. BFD_RELOC_TILEPRO_IMM16_X1_TLS_LE,
  5143. BFD_RELOC_TILEPRO_IMM16_X0_TLS_LE_LO,
  5144. BFD_RELOC_TILEPRO_IMM16_X1_TLS_LE_LO,
  5145. BFD_RELOC_TILEPRO_IMM16_X0_TLS_LE_HI,
  5146. BFD_RELOC_TILEPRO_IMM16_X1_TLS_LE_HI,
  5147. BFD_RELOC_TILEPRO_IMM16_X0_TLS_LE_HA,
  5148. BFD_RELOC_TILEPRO_IMM16_X1_TLS_LE_HA,
  5149. /* Tilera TILE-Gx Relocations. */
  5150. BFD_RELOC_TILEGX_HW0,
  5151. BFD_RELOC_TILEGX_HW1,
  5152. BFD_RELOC_TILEGX_HW2,
  5153. BFD_RELOC_TILEGX_HW3,
  5154. BFD_RELOC_TILEGX_HW0_LAST,
  5155. BFD_RELOC_TILEGX_HW1_LAST,
  5156. BFD_RELOC_TILEGX_HW2_LAST,
  5157. BFD_RELOC_TILEGX_COPY,
  5158. BFD_RELOC_TILEGX_GLOB_DAT,
  5159. BFD_RELOC_TILEGX_JMP_SLOT,
  5160. BFD_RELOC_TILEGX_RELATIVE,
  5161. BFD_RELOC_TILEGX_BROFF_X1,
  5162. BFD_RELOC_TILEGX_JUMPOFF_X1,
  5163. BFD_RELOC_TILEGX_JUMPOFF_X1_PLT,
  5164. BFD_RELOC_TILEGX_IMM8_X0,
  5165. BFD_RELOC_TILEGX_IMM8_Y0,
  5166. BFD_RELOC_TILEGX_IMM8_X1,
  5167. BFD_RELOC_TILEGX_IMM8_Y1,
  5168. BFD_RELOC_TILEGX_DEST_IMM8_X1,
  5169. BFD_RELOC_TILEGX_MT_IMM14_X1,
  5170. BFD_RELOC_TILEGX_MF_IMM14_X1,
  5171. BFD_RELOC_TILEGX_MMSTART_X0,
  5172. BFD_RELOC_TILEGX_MMEND_X0,
  5173. BFD_RELOC_TILEGX_SHAMT_X0,
  5174. BFD_RELOC_TILEGX_SHAMT_X1,
  5175. BFD_RELOC_TILEGX_SHAMT_Y0,
  5176. BFD_RELOC_TILEGX_SHAMT_Y1,
  5177. BFD_RELOC_TILEGX_IMM16_X0_HW0,
  5178. BFD_RELOC_TILEGX_IMM16_X1_HW0,
  5179. BFD_RELOC_TILEGX_IMM16_X0_HW1,
  5180. BFD_RELOC_TILEGX_IMM16_X1_HW1,
  5181. BFD_RELOC_TILEGX_IMM16_X0_HW2,
  5182. BFD_RELOC_TILEGX_IMM16_X1_HW2,
  5183. BFD_RELOC_TILEGX_IMM16_X0_HW3,
  5184. BFD_RELOC_TILEGX_IMM16_X1_HW3,
  5185. BFD_RELOC_TILEGX_IMM16_X0_HW0_LAST,
  5186. BFD_RELOC_TILEGX_IMM16_X1_HW0_LAST,
  5187. BFD_RELOC_TILEGX_IMM16_X0_HW1_LAST,
  5188. BFD_RELOC_TILEGX_IMM16_X1_HW1_LAST,
  5189. BFD_RELOC_TILEGX_IMM16_X0_HW2_LAST,
  5190. BFD_RELOC_TILEGX_IMM16_X1_HW2_LAST,
  5191. BFD_RELOC_TILEGX_IMM16_X0_HW0_PCREL,
  5192. BFD_RELOC_TILEGX_IMM16_X1_HW0_PCREL,
  5193. BFD_RELOC_TILEGX_IMM16_X0_HW1_PCREL,
  5194. BFD_RELOC_TILEGX_IMM16_X1_HW1_PCREL,
  5195. BFD_RELOC_TILEGX_IMM16_X0_HW2_PCREL,
  5196. BFD_RELOC_TILEGX_IMM16_X1_HW2_PCREL,
  5197. BFD_RELOC_TILEGX_IMM16_X0_HW3_PCREL,
  5198. BFD_RELOC_TILEGX_IMM16_X1_HW3_PCREL,
  5199. BFD_RELOC_TILEGX_IMM16_X0_HW0_LAST_PCREL,
  5200. BFD_RELOC_TILEGX_IMM16_X1_HW0_LAST_PCREL,
  5201. BFD_RELOC_TILEGX_IMM16_X0_HW1_LAST_PCREL,
  5202. BFD_RELOC_TILEGX_IMM16_X1_HW1_LAST_PCREL,
  5203. BFD_RELOC_TILEGX_IMM16_X0_HW2_LAST_PCREL,
  5204. BFD_RELOC_TILEGX_IMM16_X1_HW2_LAST_PCREL,
  5205. BFD_RELOC_TILEGX_IMM16_X0_HW0_GOT,
  5206. BFD_RELOC_TILEGX_IMM16_X1_HW0_GOT,
  5207. BFD_RELOC_TILEGX_IMM16_X0_HW0_PLT_PCREL,
  5208. BFD_RELOC_TILEGX_IMM16_X1_HW0_PLT_PCREL,
  5209. BFD_RELOC_TILEGX_IMM16_X0_HW1_PLT_PCREL,
  5210. BFD_RELOC_TILEGX_IMM16_X1_HW1_PLT_PCREL,
  5211. BFD_RELOC_TILEGX_IMM16_X0_HW2_PLT_PCREL,
  5212. BFD_RELOC_TILEGX_IMM16_X1_HW2_PLT_PCREL,
  5213. BFD_RELOC_TILEGX_IMM16_X0_HW0_LAST_GOT,
  5214. BFD_RELOC_TILEGX_IMM16_X1_HW0_LAST_GOT,
  5215. BFD_RELOC_TILEGX_IMM16_X0_HW1_LAST_GOT,
  5216. BFD_RELOC_TILEGX_IMM16_X1_HW1_LAST_GOT,
  5217. BFD_RELOC_TILEGX_IMM16_X0_HW3_PLT_PCREL,
  5218. BFD_RELOC_TILEGX_IMM16_X1_HW3_PLT_PCREL,
  5219. BFD_RELOC_TILEGX_IMM16_X0_HW0_TLS_GD,
  5220. BFD_RELOC_TILEGX_IMM16_X1_HW0_TLS_GD,
  5221. BFD_RELOC_TILEGX_IMM16_X0_HW0_TLS_LE,
  5222. BFD_RELOC_TILEGX_IMM16_X1_HW0_TLS_LE,
  5223. BFD_RELOC_TILEGX_IMM16_X0_HW0_LAST_TLS_LE,
  5224. BFD_RELOC_TILEGX_IMM16_X1_HW0_LAST_TLS_LE,
  5225. BFD_RELOC_TILEGX_IMM16_X0_HW1_LAST_TLS_LE,
  5226. BFD_RELOC_TILEGX_IMM16_X1_HW1_LAST_TLS_LE,
  5227. BFD_RELOC_TILEGX_IMM16_X0_HW0_LAST_TLS_GD,
  5228. BFD_RELOC_TILEGX_IMM16_X1_HW0_LAST_TLS_GD,
  5229. BFD_RELOC_TILEGX_IMM16_X0_HW1_LAST_TLS_GD,
  5230. BFD_RELOC_TILEGX_IMM16_X1_HW1_LAST_TLS_GD,
  5231. BFD_RELOC_TILEGX_IMM16_X0_HW0_TLS_IE,
  5232. BFD_RELOC_TILEGX_IMM16_X1_HW0_TLS_IE,
  5233. BFD_RELOC_TILEGX_IMM16_X0_HW0_LAST_PLT_PCREL,
  5234. BFD_RELOC_TILEGX_IMM16_X1_HW0_LAST_PLT_PCREL,
  5235. BFD_RELOC_TILEGX_IMM16_X0_HW1_LAST_PLT_PCREL,
  5236. BFD_RELOC_TILEGX_IMM16_X1_HW1_LAST_PLT_PCREL,
  5237. BFD_RELOC_TILEGX_IMM16_X0_HW2_LAST_PLT_PCREL,
  5238. BFD_RELOC_TILEGX_IMM16_X1_HW2_LAST_PLT_PCREL,
  5239. BFD_RELOC_TILEGX_IMM16_X0_HW0_LAST_TLS_IE,
  5240. BFD_RELOC_TILEGX_IMM16_X1_HW0_LAST_TLS_IE,
  5241. BFD_RELOC_TILEGX_IMM16_X0_HW1_LAST_TLS_IE,
  5242. BFD_RELOC_TILEGX_IMM16_X1_HW1_LAST_TLS_IE,
  5243. BFD_RELOC_TILEGX_TLS_DTPMOD64,
  5244. BFD_RELOC_TILEGX_TLS_DTPOFF64,
  5245. BFD_RELOC_TILEGX_TLS_TPOFF64,
  5246. BFD_RELOC_TILEGX_TLS_DTPMOD32,
  5247. BFD_RELOC_TILEGX_TLS_DTPOFF32,
  5248. BFD_RELOC_TILEGX_TLS_TPOFF32,
  5249. BFD_RELOC_TILEGX_TLS_GD_CALL,
  5250. BFD_RELOC_TILEGX_IMM8_X0_TLS_GD_ADD,
  5251. BFD_RELOC_TILEGX_IMM8_X1_TLS_GD_ADD,
  5252. BFD_RELOC_TILEGX_IMM8_Y0_TLS_GD_ADD,
  5253. BFD_RELOC_TILEGX_IMM8_Y1_TLS_GD_ADD,
  5254. BFD_RELOC_TILEGX_TLS_IE_LOAD,
  5255. BFD_RELOC_TILEGX_IMM8_X0_TLS_ADD,
  5256. BFD_RELOC_TILEGX_IMM8_X1_TLS_ADD,
  5257. BFD_RELOC_TILEGX_IMM8_Y0_TLS_ADD,
  5258. BFD_RELOC_TILEGX_IMM8_Y1_TLS_ADD,
  5259. /* Adapteva EPIPHANY - 8 bit signed pc-relative displacement */
  5260. BFD_RELOC_EPIPHANY_SIMM8,
  5261. /* Adapteva EPIPHANY - 24 bit signed pc-relative displacement */
  5262. BFD_RELOC_EPIPHANY_SIMM24,
  5263. /* Adapteva EPIPHANY - 16 most-significant bits of absolute address */
  5264. BFD_RELOC_EPIPHANY_HIGH,
  5265. /* Adapteva EPIPHANY - 16 least-significant bits of absolute address */
  5266. BFD_RELOC_EPIPHANY_LOW,
  5267. /* Adapteva EPIPHANY - 11 bit signed number - add/sub immediate */
  5268. BFD_RELOC_EPIPHANY_SIMM11,
  5269. /* Adapteva EPIPHANY - 11 bit sign-magnitude number (ld/st displacement) */
  5270. BFD_RELOC_EPIPHANY_IMM11,
  5271. /* Adapteva EPIPHANY - 8 bit immediate for 16 bit mov instruction. */
  5272. BFD_RELOC_EPIPHANY_IMM8,
  5273. /* Visium Relocations. */
  5274. BFD_RELOC_VISIUM_HI16,
  5275. BFD_RELOC_VISIUM_LO16,
  5276. BFD_RELOC_VISIUM_IM16,
  5277. BFD_RELOC_VISIUM_REL16,
  5278. BFD_RELOC_VISIUM_HI16_PCREL,
  5279. BFD_RELOC_VISIUM_LO16_PCREL,
  5280. BFD_RELOC_VISIUM_IM16_PCREL,
  5281. BFD_RELOC_UNUSED };
  5282. typedef enum bfd_reloc_code_real bfd_reloc_code_real_type;
  5283. reloc_howto_type *bfd_reloc_type_lookup
  5284. (bfd *abfd, bfd_reloc_code_real_type code);
  5285. reloc_howto_type *bfd_reloc_name_lookup
  5286. (bfd *abfd, const char *reloc_name);
  5287. const char *bfd_get_reloc_code_name (bfd_reloc_code_real_type code);
  5288. /* Extracted from syms.c. */
  5289. typedef struct bfd_symbol
  5290. {
  5291. /* A pointer to the BFD which owns the symbol. This information
  5292. is necessary so that a back end can work out what additional
  5293. information (invisible to the application writer) is carried
  5294. with the symbol.
  5295. This field is *almost* redundant, since you can use section->owner
  5296. instead, except that some symbols point to the global sections
  5297. bfd_{abs,com,und}_section. This could be fixed by making
  5298. these globals be per-bfd (or per-target-flavor). FIXME. */
  5299. struct bfd *the_bfd; /* Use bfd_asymbol_bfd(sym) to access this field. */
  5300. /* The text of the symbol. The name is left alone, and not copied; the
  5301. application may not alter it. */
  5302. const char *name;
  5303. /* The value of the symbol. This really should be a union of a
  5304. numeric value with a pointer, since some flags indicate that
  5305. a pointer to another symbol is stored here. */
  5306. symvalue value;
  5307. /* Attributes of a symbol. */
  5308. #define BSF_NO_FLAGS 0x00
  5309. /* The symbol has local scope; <<static>> in <<C>>. The value
  5310. is the offset into the section of the data. */
  5311. #define BSF_LOCAL (1 << 0)
  5312. /* The symbol has global scope; initialized data in <<C>>. The
  5313. value is the offset into the section of the data. */
  5314. #define BSF_GLOBAL (1 << 1)
  5315. /* The symbol has global scope and is exported. The value is
  5316. the offset into the section of the data. */
  5317. #define BSF_EXPORT BSF_GLOBAL /* No real difference. */
  5318. /* A normal C symbol would be one of:
  5319. <<BSF_LOCAL>>, <<BSF_COMMON>>, <<BSF_UNDEFINED>> or
  5320. <<BSF_GLOBAL>>. */
  5321. /* The symbol is a debugging record. The value has an arbitrary
  5322. meaning, unless BSF_DEBUGGING_RELOC is also set. */
  5323. #define BSF_DEBUGGING (1 << 2)
  5324. /* The symbol denotes a function entry point. Used in ELF,
  5325. perhaps others someday. */
  5326. #define BSF_FUNCTION (1 << 3)
  5327. /* Used by the linker. */
  5328. #define BSF_KEEP (1 << 5)
  5329. #define BSF_KEEP_G (1 << 6)
  5330. /* A weak global symbol, overridable without warnings by
  5331. a regular global symbol of the same name. */
  5332. #define BSF_WEAK (1 << 7)
  5333. /* This symbol was created to point to a section, e.g. ELF's
  5334. STT_SECTION symbols. */
  5335. #define BSF_SECTION_SYM (1 << 8)
  5336. /* The symbol used to be a common symbol, but now it is
  5337. allocated. */
  5338. #define BSF_OLD_COMMON (1 << 9)
  5339. /* In some files the type of a symbol sometimes alters its
  5340. location in an output file - ie in coff a <<ISFCN>> symbol
  5341. which is also <<C_EXT>> symbol appears where it was
  5342. declared and not at the end of a section. This bit is set
  5343. by the target BFD part to convey this information. */
  5344. #define BSF_NOT_AT_END (1 << 10)
  5345. /* Signal that the symbol is the label of constructor section. */
  5346. #define BSF_CONSTRUCTOR (1 << 11)
  5347. /* Signal that the symbol is a warning symbol. The name is a
  5348. warning. The name of the next symbol is the one to warn about;
  5349. if a reference is made to a symbol with the same name as the next
  5350. symbol, a warning is issued by the linker. */
  5351. #define BSF_WARNING (1 << 12)
  5352. /* Signal that the symbol is indirect. This symbol is an indirect
  5353. pointer to the symbol with the same name as the next symbol. */
  5354. #define BSF_INDIRECT (1 << 13)
  5355. /* BSF_FILE marks symbols that contain a file name. This is used
  5356. for ELF STT_FILE symbols. */
  5357. #define BSF_FILE (1 << 14)
  5358. /* Symbol is from dynamic linking information. */
  5359. #define BSF_DYNAMIC (1 << 15)
  5360. /* The symbol denotes a data object. Used in ELF, and perhaps
  5361. others someday. */
  5362. #define BSF_OBJECT (1 << 16)
  5363. /* This symbol is a debugging symbol. The value is the offset
  5364. into the section of the data. BSF_DEBUGGING should be set
  5365. as well. */
  5366. #define BSF_DEBUGGING_RELOC (1 << 17)
  5367. /* This symbol is thread local. Used in ELF. */
  5368. #define BSF_THREAD_LOCAL (1 << 18)
  5369. /* This symbol represents a complex relocation expression,
  5370. with the expression tree serialized in the symbol name. */
  5371. #define BSF_RELC (1 << 19)
  5372. /* This symbol represents a signed complex relocation expression,
  5373. with the expression tree serialized in the symbol name. */
  5374. #define BSF_SRELC (1 << 20)
  5375. /* This symbol was created by bfd_get_synthetic_symtab. */
  5376. #define BSF_SYNTHETIC (1 << 21)
  5377. /* This symbol is an indirect code object. Unrelated to BSF_INDIRECT.
  5378. The dynamic linker will compute the value of this symbol by
  5379. calling the function that it points to. BSF_FUNCTION must
  5380. also be also set. */
  5381. #define BSF_GNU_INDIRECT_FUNCTION (1 << 22)
  5382. /* This symbol is a globally unique data object. The dynamic linker
  5383. will make sure that in the entire process there is just one symbol
  5384. with this name and type in use. BSF_OBJECT must also be set. */
  5385. #define BSF_GNU_UNIQUE (1 << 23)
  5386. flagword flags;
  5387. /* A pointer to the section to which this symbol is
  5388. relative. This will always be non NULL, there are special
  5389. sections for undefined and absolute symbols. */
  5390. struct bfd_section *section;
  5391. /* Back end special data. */
  5392. union
  5393. {
  5394. void *p;
  5395. bfd_vma i;
  5396. }
  5397. udata;
  5398. }
  5399. asymbol;
  5400. #define bfd_get_symtab_upper_bound(abfd) \
  5401. BFD_SEND (abfd, _bfd_get_symtab_upper_bound, (abfd))
  5402. bfd_boolean bfd_is_local_label (bfd *abfd, asymbol *sym);
  5403. bfd_boolean bfd_is_local_label_name (bfd *abfd, const char *name);
  5404. #define bfd_is_local_label_name(abfd, name) \
  5405. BFD_SEND (abfd, _bfd_is_local_label_name, (abfd, name))
  5406. bfd_boolean bfd_is_target_special_symbol (bfd *abfd, asymbol *sym);
  5407. #define bfd_is_target_special_symbol(abfd, sym) \
  5408. BFD_SEND (abfd, _bfd_is_target_special_symbol, (abfd, sym))
  5409. #define bfd_canonicalize_symtab(abfd, location) \
  5410. BFD_SEND (abfd, _bfd_canonicalize_symtab, (abfd, location))
  5411. bfd_boolean bfd_set_symtab
  5412. (bfd *abfd, asymbol **location, unsigned int count);
  5413. void bfd_print_symbol_vandf (bfd *abfd, void *file, asymbol *symbol);
  5414. #define bfd_make_empty_symbol(abfd) \
  5415. BFD_SEND (abfd, _bfd_make_empty_symbol, (abfd))
  5416. asymbol *_bfd_generic_make_empty_symbol (bfd *);
  5417. #define bfd_make_debug_symbol(abfd,ptr,size) \
  5418. BFD_SEND (abfd, _bfd_make_debug_symbol, (abfd, ptr, size))
  5419. int bfd_decode_symclass (asymbol *symbol);
  5420. bfd_boolean bfd_is_undefined_symclass (int symclass);
  5421. void bfd_symbol_info (asymbol *symbol, symbol_info *ret);
  5422. bfd_boolean bfd_copy_private_symbol_data
  5423. (bfd *ibfd, asymbol *isym, bfd *obfd, asymbol *osym);
  5424. #define bfd_copy_private_symbol_data(ibfd, isymbol, obfd, osymbol) \
  5425. BFD_SEND (obfd, _bfd_copy_private_symbol_data, \
  5426. (ibfd, isymbol, obfd, osymbol))
  5427. /* Extracted from bfd.c. */
  5428. enum bfd_direction
  5429. {
  5430. no_direction = 0,
  5431. read_direction = 1,
  5432. write_direction = 2,
  5433. both_direction = 3
  5434. };
  5435. enum bfd_plugin_format
  5436. {
  5437. bfd_plugin_uknown = 0,
  5438. bfd_plugin_yes = 1,
  5439. bfd_plugin_no = 2
  5440. };
  5441. struct bfd_build_id
  5442. {
  5443. bfd_size_type size;
  5444. bfd_byte data[1];
  5445. };
  5446. struct bfd
  5447. {
  5448. /* The filename the application opened the BFD with. */
  5449. const char *filename;
  5450. /* A pointer to the target jump table. */
  5451. const struct bfd_target *xvec;
  5452. /* The IOSTREAM, and corresponding IO vector that provide access
  5453. to the file backing the BFD. */
  5454. void *iostream;
  5455. const struct bfd_iovec *iovec;
  5456. /* The caching routines use these to maintain a
  5457. least-recently-used list of BFDs. */
  5458. struct bfd *lru_prev, *lru_next;
  5459. /* When a file is closed by the caching routines, BFD retains
  5460. state information on the file here... */
  5461. ufile_ptr where;
  5462. /* File modified time, if mtime_set is TRUE. */
  5463. long mtime;
  5464. /* A unique identifier of the BFD */
  5465. unsigned int id;
  5466. /* The format which belongs to the BFD. (object, core, etc.) */
  5467. ENUM_BITFIELD (bfd_format) format : 3;
  5468. /* The direction with which the BFD was opened. */
  5469. ENUM_BITFIELD (bfd_direction) direction : 2;
  5470. /* Format_specific flags. */
  5471. flagword flags : 18;
  5472. /* Values that may appear in the flags field of a BFD. These also
  5473. appear in the object_flags field of the bfd_target structure, where
  5474. they indicate the set of flags used by that backend (not all flags
  5475. are meaningful for all object file formats) (FIXME: at the moment,
  5476. the object_flags values have mostly just been copied from backend
  5477. to another, and are not necessarily correct). */
  5478. #define BFD_NO_FLAGS 0x00
  5479. /* BFD contains relocation entries. */
  5480. #define HAS_RELOC 0x01
  5481. /* BFD is directly executable. */
  5482. #define EXEC_P 0x02
  5483. /* BFD has line number information (basically used for F_LNNO in a
  5484. COFF header). */
  5485. #define HAS_LINENO 0x04
  5486. /* BFD has debugging information. */
  5487. #define HAS_DEBUG 0x08
  5488. /* BFD has symbols. */
  5489. #define HAS_SYMS 0x10
  5490. /* BFD has local symbols (basically used for F_LSYMS in a COFF
  5491. header). */
  5492. #define HAS_LOCALS 0x20
  5493. /* BFD is a dynamic object. */
  5494. #define DYNAMIC 0x40
  5495. /* Text section is write protected (if D_PAGED is not set, this is
  5496. like an a.out NMAGIC file) (the linker sets this by default, but
  5497. clears it for -r or -N). */
  5498. #define WP_TEXT 0x80
  5499. /* BFD is dynamically paged (this is like an a.out ZMAGIC file) (the
  5500. linker sets this by default, but clears it for -r or -n or -N). */
  5501. #define D_PAGED 0x100
  5502. /* BFD is relaxable (this means that bfd_relax_section may be able to
  5503. do something) (sometimes bfd_relax_section can do something even if
  5504. this is not set). */
  5505. #define BFD_IS_RELAXABLE 0x200
  5506. /* This may be set before writing out a BFD to request using a
  5507. traditional format. For example, this is used to request that when
  5508. writing out an a.out object the symbols not be hashed to eliminate
  5509. duplicates. */
  5510. #define BFD_TRADITIONAL_FORMAT 0x400
  5511. /* This flag indicates that the BFD contents are actually cached
  5512. in memory. If this is set, iostream points to a bfd_in_memory
  5513. struct. */
  5514. #define BFD_IN_MEMORY 0x800
  5515. /* This BFD has been created by the linker and doesn't correspond
  5516. to any input file. */
  5517. #define BFD_LINKER_CREATED 0x1000
  5518. /* This may be set before writing out a BFD to request that it
  5519. be written using values for UIDs, GIDs, timestamps, etc. that
  5520. will be consistent from run to run. */
  5521. #define BFD_DETERMINISTIC_OUTPUT 0x2000
  5522. /* Compress sections in this BFD. */
  5523. #define BFD_COMPRESS 0x4000
  5524. /* Decompress sections in this BFD. */
  5525. #define BFD_DECOMPRESS 0x8000
  5526. /* BFD is a dummy, for plugins. */
  5527. #define BFD_PLUGIN 0x10000
  5528. /* Compress sections in this BFD with SHF_COMPRESSED from gABI. */
  5529. #define BFD_COMPRESS_GABI 0x20000
  5530. /* Flags bits to be saved in bfd_preserve_save. */
  5531. #define BFD_FLAGS_SAVED \
  5532. (BFD_IN_MEMORY | BFD_COMPRESS | BFD_DECOMPRESS | BFD_PLUGIN \
  5533. | BFD_COMPRESS_GABI)
  5534. /* Flags bits which are for BFD use only. */
  5535. #define BFD_FLAGS_FOR_BFD_USE_MASK \
  5536. (BFD_IN_MEMORY | BFD_COMPRESS | BFD_DECOMPRESS | BFD_LINKER_CREATED \
  5537. | BFD_PLUGIN | BFD_TRADITIONAL_FORMAT | BFD_DETERMINISTIC_OUTPUT \
  5538. | BFD_COMPRESS_GABI)
  5539. /* Is the file descriptor being cached? That is, can it be closed as
  5540. needed, and re-opened when accessed later? */
  5541. unsigned int cacheable : 1;
  5542. /* Marks whether there was a default target specified when the
  5543. BFD was opened. This is used to select which matching algorithm
  5544. to use to choose the back end. */
  5545. unsigned int target_defaulted : 1;
  5546. /* ... and here: (``once'' means at least once). */
  5547. unsigned int opened_once : 1;
  5548. /* Set if we have a locally maintained mtime value, rather than
  5549. getting it from the file each time. */
  5550. unsigned int mtime_set : 1;
  5551. /* Flag set if symbols from this BFD should not be exported. */
  5552. unsigned int no_export : 1;
  5553. /* Remember when output has begun, to stop strange things
  5554. from happening. */
  5555. unsigned int output_has_begun : 1;
  5556. /* Have archive map. */
  5557. unsigned int has_armap : 1;
  5558. /* Set if this is a thin archive. */
  5559. unsigned int is_thin_archive : 1;
  5560. /* Set if only required symbols should be added in the link hash table for
  5561. this object. Used by VMS linkers. */
  5562. unsigned int selective_search : 1;
  5563. /* Set if this is the linker output BFD. */
  5564. unsigned int is_linker_output : 1;
  5565. /* Set if this is the linker input BFD. */
  5566. unsigned int is_linker_input : 1;
  5567. /* If this is an input for a compiler plug-in library. */
  5568. ENUM_BITFIELD (bfd_plugin_format) plugin_format : 2;
  5569. /* Set if this is a plugin output file. */
  5570. unsigned int lto_output : 1;
  5571. /* Set to dummy BFD created when claimed by a compiler plug-in
  5572. library. */
  5573. bfd *plugin_dummy_bfd;
  5574. /* Currently my_archive is tested before adding origin to
  5575. anything. I believe that this can become always an add of
  5576. origin, with origin set to 0 for non archive files. */
  5577. ufile_ptr origin;
  5578. /* The origin in the archive of the proxy entry. This will
  5579. normally be the same as origin, except for thin archives,
  5580. when it will contain the current offset of the proxy in the
  5581. thin archive rather than the offset of the bfd in its actual
  5582. container. */
  5583. ufile_ptr proxy_origin;
  5584. /* A hash table for section names. */
  5585. struct bfd_hash_table section_htab;
  5586. /* Pointer to linked list of sections. */
  5587. struct bfd_section *sections;
  5588. /* The last section on the section list. */
  5589. struct bfd_section *section_last;
  5590. /* The number of sections. */
  5591. unsigned int section_count;
  5592. /* A field used by _bfd_generic_link_add_archive_symbols. This will
  5593. be used only for archive elements. */
  5594. int archive_pass;
  5595. /* Stuff only useful for object files:
  5596. The start address. */
  5597. bfd_vma start_address;
  5598. /* Symbol table for output BFD (with symcount entries).
  5599. Also used by the linker to cache input BFD symbols. */
  5600. struct bfd_symbol **outsymbols;
  5601. /* Used for input and output. */
  5602. unsigned int symcount;
  5603. /* Used for slurped dynamic symbol tables. */
  5604. unsigned int dynsymcount;
  5605. /* Pointer to structure which contains architecture information. */
  5606. const struct bfd_arch_info *arch_info;
  5607. /* Stuff only useful for archives. */
  5608. void *arelt_data;
  5609. struct bfd *my_archive; /* The containing archive BFD. */
  5610. struct bfd *archive_next; /* The next BFD in the archive. */
  5611. struct bfd *archive_head; /* The first BFD in the archive. */
  5612. struct bfd *nested_archives; /* List of nested archive in a flattened
  5613. thin archive. */
  5614. union {
  5615. /* For input BFDs, a chain of BFDs involved in a link. */
  5616. struct bfd *next;
  5617. /* For output BFD, the linker hash table. */
  5618. struct bfd_link_hash_table *hash;
  5619. } link;
  5620. /* Used by the back end to hold private data. */
  5621. union
  5622. {
  5623. struct aout_data_struct *aout_data;
  5624. struct artdata *aout_ar_data;
  5625. struct _oasys_data *oasys_obj_data;
  5626. struct _oasys_ar_data *oasys_ar_data;
  5627. struct coff_tdata *coff_obj_data;
  5628. struct pe_tdata *pe_obj_data;
  5629. struct xcoff_tdata *xcoff_obj_data;
  5630. struct ecoff_tdata *ecoff_obj_data;
  5631. struct ieee_data_struct *ieee_data;
  5632. struct ieee_ar_data_struct *ieee_ar_data;
  5633. struct srec_data_struct *srec_data;
  5634. struct verilog_data_struct *verilog_data;
  5635. struct ihex_data_struct *ihex_data;
  5636. struct tekhex_data_struct *tekhex_data;
  5637. struct elf_obj_tdata *elf_obj_data;
  5638. struct nlm_obj_tdata *nlm_obj_data;
  5639. struct bout_data_struct *bout_data;
  5640. struct mmo_data_struct *mmo_data;
  5641. struct sun_core_struct *sun_core_data;
  5642. struct sco5_core_struct *sco5_core_data;
  5643. struct trad_core_struct *trad_core_data;
  5644. struct som_data_struct *som_data;
  5645. struct hpux_core_struct *hpux_core_data;
  5646. struct hppabsd_core_struct *hppabsd_core_data;
  5647. struct sgi_core_struct *sgi_core_data;
  5648. struct lynx_core_struct *lynx_core_data;
  5649. struct osf_core_struct *osf_core_data;
  5650. struct cisco_core_struct *cisco_core_data;
  5651. struct versados_data_struct *versados_data;
  5652. struct netbsd_core_struct *netbsd_core_data;
  5653. struct mach_o_data_struct *mach_o_data;
  5654. struct mach_o_fat_data_struct *mach_o_fat_data;
  5655. struct plugin_data_struct *plugin_data;
  5656. struct bfd_pef_data_struct *pef_data;
  5657. struct bfd_pef_xlib_data_struct *pef_xlib_data;
  5658. struct bfd_sym_data_struct *sym_data;
  5659. void *any;
  5660. }
  5661. tdata;
  5662. /* Used by the application to hold private data. */
  5663. void *usrdata;
  5664. /* Where all the allocated stuff under this BFD goes. This is a
  5665. struct objalloc *, but we use void * to avoid requiring the inclusion
  5666. of objalloc.h. */
  5667. void *memory;
  5668. /* For input BFDs, the build ID, if the object has one. */
  5669. const struct bfd_build_id *build_id;
  5670. };
  5671. /* See note beside bfd_set_section_userdata. */
  5672. static inline bfd_boolean
  5673. bfd_set_cacheable (bfd * abfd, bfd_boolean val)
  5674. {
  5675. abfd->cacheable = val;
  5676. return TRUE;
  5677. }
  5678. typedef enum bfd_error
  5679. {
  5680. bfd_error_no_error = 0,
  5681. bfd_error_system_call,
  5682. bfd_error_invalid_target,
  5683. bfd_error_wrong_format,
  5684. bfd_error_wrong_object_format,
  5685. bfd_error_invalid_operation,
  5686. bfd_error_no_memory,
  5687. bfd_error_no_symbols,
  5688. bfd_error_no_armap,
  5689. bfd_error_no_more_archived_files,
  5690. bfd_error_malformed_archive,
  5691. bfd_error_missing_dso,
  5692. bfd_error_file_not_recognized,
  5693. bfd_error_file_ambiguously_recognized,
  5694. bfd_error_no_contents,
  5695. bfd_error_nonrepresentable_section,
  5696. bfd_error_no_debug_section,
  5697. bfd_error_bad_value,
  5698. bfd_error_file_truncated,
  5699. bfd_error_file_too_big,
  5700. bfd_error_on_input,
  5701. bfd_error_invalid_error_code
  5702. }
  5703. bfd_error_type;
  5704. bfd_error_type bfd_get_error (void);
  5705. void bfd_set_error (bfd_error_type error_tag, ...);
  5706. const char *bfd_errmsg (bfd_error_type error_tag);
  5707. void bfd_perror (const char *message);
  5708. typedef void (*bfd_error_handler_type) (const char *, ...);
  5709. bfd_error_handler_type bfd_set_error_handler (bfd_error_handler_type);
  5710. void bfd_set_error_program_name (const char *);
  5711. bfd_error_handler_type bfd_get_error_handler (void);
  5712. typedef void (*bfd_assert_handler_type) (const char *bfd_formatmsg,
  5713. const char *bfd_version,
  5714. const char *bfd_file,
  5715. int bfd_line);
  5716. bfd_assert_handler_type bfd_set_assert_handler (bfd_assert_handler_type);
  5717. bfd_assert_handler_type bfd_get_assert_handler (void);
  5718. long bfd_get_reloc_upper_bound (bfd *abfd, asection *sect);
  5719. long bfd_canonicalize_reloc
  5720. (bfd *abfd, asection *sec, arelent **loc, asymbol **syms);
  5721. void bfd_set_reloc
  5722. (bfd *abfd, asection *sec, arelent **rel, unsigned int count);
  5723. bfd_boolean bfd_set_file_flags (bfd *abfd, flagword flags);
  5724. int bfd_get_arch_size (bfd *abfd);
  5725. int bfd_get_sign_extend_vma (bfd *abfd);
  5726. bfd_boolean bfd_set_start_address (bfd *abfd, bfd_vma vma);
  5727. unsigned int bfd_get_gp_size (bfd *abfd);
  5728. void bfd_set_gp_size (bfd *abfd, unsigned int i);
  5729. bfd_vma bfd_scan_vma (const char *string, const char **end, int base);
  5730. bfd_boolean bfd_copy_private_header_data (bfd *ibfd, bfd *obfd);
  5731. #define bfd_copy_private_header_data(ibfd, obfd) \
  5732. BFD_SEND (obfd, _bfd_copy_private_header_data, \
  5733. (ibfd, obfd))
  5734. bfd_boolean bfd_copy_private_bfd_data (bfd *ibfd, bfd *obfd);
  5735. #define bfd_copy_private_bfd_data(ibfd, obfd) \
  5736. BFD_SEND (obfd, _bfd_copy_private_bfd_data, \
  5737. (ibfd, obfd))
  5738. bfd_boolean bfd_merge_private_bfd_data (bfd *ibfd, bfd *obfd);
  5739. #define bfd_merge_private_bfd_data(ibfd, obfd) \
  5740. BFD_SEND (obfd, _bfd_merge_private_bfd_data, \
  5741. (ibfd, obfd))
  5742. bfd_boolean bfd_set_private_flags (bfd *abfd, flagword flags);
  5743. #define bfd_set_private_flags(abfd, flags) \
  5744. BFD_SEND (abfd, _bfd_set_private_flags, (abfd, flags))
  5745. #define bfd_sizeof_headers(abfd, info) \
  5746. BFD_SEND (abfd, _bfd_sizeof_headers, (abfd, info))
  5747. #define bfd_find_nearest_line(abfd, sec, syms, off, file, func, line) \
  5748. BFD_SEND (abfd, _bfd_find_nearest_line, \
  5749. (abfd, syms, sec, off, file, func, line, NULL))
  5750. #define bfd_find_nearest_line_discriminator(abfd, sec, syms, off, file, func, \
  5751. line, disc) \
  5752. BFD_SEND (abfd, _bfd_find_nearest_line, \
  5753. (abfd, syms, sec, off, file, func, line, disc))
  5754. #define bfd_find_line(abfd, syms, sym, file, line) \
  5755. BFD_SEND (abfd, _bfd_find_line, \
  5756. (abfd, syms, sym, file, line))
  5757. #define bfd_find_inliner_info(abfd, file, func, line) \
  5758. BFD_SEND (abfd, _bfd_find_inliner_info, \
  5759. (abfd, file, func, line))
  5760. #define bfd_debug_info_start(abfd) \
  5761. BFD_SEND (abfd, _bfd_debug_info_start, (abfd))
  5762. #define bfd_debug_info_end(abfd) \
  5763. BFD_SEND (abfd, _bfd_debug_info_end, (abfd))
  5764. #define bfd_debug_info_accumulate(abfd, section) \
  5765. BFD_SEND (abfd, _bfd_debug_info_accumulate, (abfd, section))
  5766. #define bfd_stat_arch_elt(abfd, stat) \
  5767. BFD_SEND (abfd, _bfd_stat_arch_elt,(abfd, stat))
  5768. #define bfd_update_armap_timestamp(abfd) \
  5769. BFD_SEND (abfd, _bfd_update_armap_timestamp, (abfd))
  5770. #define bfd_set_arch_mach(abfd, arch, mach)\
  5771. BFD_SEND ( abfd, _bfd_set_arch_mach, (abfd, arch, mach))
  5772. #define bfd_relax_section(abfd, section, link_info, again) \
  5773. BFD_SEND (abfd, _bfd_relax_section, (abfd, section, link_info, again))
  5774. #define bfd_gc_sections(abfd, link_info) \
  5775. BFD_SEND (abfd, _bfd_gc_sections, (abfd, link_info))
  5776. #define bfd_lookup_section_flags(link_info, flag_info, section) \
  5777. BFD_SEND (abfd, _bfd_lookup_section_flags, (link_info, flag_info, section))
  5778. #define bfd_merge_sections(abfd, link_info) \
  5779. BFD_SEND (abfd, _bfd_merge_sections, (abfd, link_info))
  5780. #define bfd_is_group_section(abfd, sec) \
  5781. BFD_SEND (abfd, _bfd_is_group_section, (abfd, sec))
  5782. #define bfd_discard_group(abfd, sec) \
  5783. BFD_SEND (abfd, _bfd_discard_group, (abfd, sec))
  5784. #define bfd_link_hash_table_create(abfd) \
  5785. BFD_SEND (abfd, _bfd_link_hash_table_create, (abfd))
  5786. #define bfd_link_add_symbols(abfd, info) \
  5787. BFD_SEND (abfd, _bfd_link_add_symbols, (abfd, info))
  5788. #define bfd_link_just_syms(abfd, sec, info) \
  5789. BFD_SEND (abfd, _bfd_link_just_syms, (sec, info))
  5790. #define bfd_final_link(abfd, info) \
  5791. BFD_SEND (abfd, _bfd_final_link, (abfd, info))
  5792. #define bfd_free_cached_info(abfd) \
  5793. BFD_SEND (abfd, _bfd_free_cached_info, (abfd))
  5794. #define bfd_get_dynamic_symtab_upper_bound(abfd) \
  5795. BFD_SEND (abfd, _bfd_get_dynamic_symtab_upper_bound, (abfd))
  5796. #define bfd_print_private_bfd_data(abfd, file)\
  5797. BFD_SEND (abfd, _bfd_print_private_bfd_data, (abfd, file))
  5798. #define bfd_canonicalize_dynamic_symtab(abfd, asymbols) \
  5799. BFD_SEND (abfd, _bfd_canonicalize_dynamic_symtab, (abfd, asymbols))
  5800. #define bfd_get_synthetic_symtab(abfd, count, syms, dyncount, dynsyms, ret) \
  5801. BFD_SEND (abfd, _bfd_get_synthetic_symtab, (abfd, count, syms, \
  5802. dyncount, dynsyms, ret))
  5803. #define bfd_get_dynamic_reloc_upper_bound(abfd) \
  5804. BFD_SEND (abfd, _bfd_get_dynamic_reloc_upper_bound, (abfd))
  5805. #define bfd_canonicalize_dynamic_reloc(abfd, arels, asyms) \
  5806. BFD_SEND (abfd, _bfd_canonicalize_dynamic_reloc, (abfd, arels, asyms))
  5807. extern bfd_byte *bfd_get_relocated_section_contents
  5808. (bfd *, struct bfd_link_info *, struct bfd_link_order *, bfd_byte *,
  5809. bfd_boolean, asymbol **);
  5810. bfd_boolean bfd_alt_mach_code (bfd *abfd, int alternative);
  5811. bfd_vma bfd_emul_get_maxpagesize (const char *);
  5812. void bfd_emul_set_maxpagesize (const char *, bfd_vma);
  5813. bfd_vma bfd_emul_get_commonpagesize (const char *);
  5814. void bfd_emul_set_commonpagesize (const char *, bfd_vma);
  5815. char *bfd_demangle (bfd *, const char *, int);
  5816. void bfd_update_compression_header
  5817. (bfd *abfd, bfd_byte *contents, asection *sec);
  5818. bfd_boolean bfd_check_compression_header
  5819. (bfd *abfd, bfd_byte *contents, asection *sec,
  5820. bfd_size_type *uncompressed_size);
  5821. int bfd_get_compression_header_size (bfd *abfd, asection *sec);
  5822. bfd_size_type bfd_convert_section_size
  5823. (bfd *ibfd, asection *isec, bfd *obfd, bfd_size_type size);
  5824. bfd_boolean bfd_convert_section_contents
  5825. (bfd *ibfd, asection *isec, bfd *obfd,
  5826. bfd_byte **ptr, bfd_size_type *ptr_size);
  5827. /* Extracted from archive.c. */
  5828. symindex bfd_get_next_mapent
  5829. (bfd *abfd, symindex previous, carsym **sym);
  5830. bfd_boolean bfd_set_archive_head (bfd *output, bfd *new_head);
  5831. bfd *bfd_openr_next_archived_file (bfd *archive, bfd *previous);
  5832. /* Extracted from corefile.c. */
  5833. const char *bfd_core_file_failing_command (bfd *abfd);
  5834. int bfd_core_file_failing_signal (bfd *abfd);
  5835. int bfd_core_file_pid (bfd *abfd);
  5836. bfd_boolean core_file_matches_executable_p
  5837. (bfd *core_bfd, bfd *exec_bfd);
  5838. bfd_boolean generic_core_file_matches_executable_p
  5839. (bfd *core_bfd, bfd *exec_bfd);
  5840. /* Extracted from targets.c. */
  5841. #define BFD_SEND(bfd, message, arglist) \
  5842. ((*((bfd)->xvec->message)) arglist)
  5843. #ifdef DEBUG_BFD_SEND
  5844. #undef BFD_SEND
  5845. #define BFD_SEND(bfd, message, arglist) \
  5846. (((bfd) && (bfd)->xvec && (bfd)->xvec->message) ? \
  5847. ((*((bfd)->xvec->message)) arglist) : \
  5848. (bfd_assert (__FILE__,__LINE__), NULL))
  5849. #endif
  5850. #define BFD_SEND_FMT(bfd, message, arglist) \
  5851. (((bfd)->xvec->message[(int) ((bfd)->format)]) arglist)
  5852. #ifdef DEBUG_BFD_SEND
  5853. #undef BFD_SEND_FMT
  5854. #define BFD_SEND_FMT(bfd, message, arglist) \
  5855. (((bfd) && (bfd)->xvec && (bfd)->xvec->message) ? \
  5856. (((bfd)->xvec->message[(int) ((bfd)->format)]) arglist) : \
  5857. (bfd_assert (__FILE__,__LINE__), NULL))
  5858. #endif
  5859. enum bfd_flavour
  5860. {
  5861. /* N.B. Update bfd_flavour_name if you change this. */
  5862. bfd_target_unknown_flavour,
  5863. bfd_target_aout_flavour,
  5864. bfd_target_coff_flavour,
  5865. bfd_target_ecoff_flavour,
  5866. bfd_target_xcoff_flavour,
  5867. bfd_target_elf_flavour,
  5868. bfd_target_ieee_flavour,
  5869. bfd_target_nlm_flavour,
  5870. bfd_target_oasys_flavour,
  5871. bfd_target_tekhex_flavour,
  5872. bfd_target_srec_flavour,
  5873. bfd_target_verilog_flavour,
  5874. bfd_target_ihex_flavour,
  5875. bfd_target_som_flavour,
  5876. bfd_target_os9k_flavour,
  5877. bfd_target_versados_flavour,
  5878. bfd_target_msdos_flavour,
  5879. bfd_target_ovax_flavour,
  5880. bfd_target_evax_flavour,
  5881. bfd_target_mmo_flavour,
  5882. bfd_target_mach_o_flavour,
  5883. bfd_target_pef_flavour,
  5884. bfd_target_pef_xlib_flavour,
  5885. bfd_target_sym_flavour
  5886. };
  5887. enum bfd_endian { BFD_ENDIAN_BIG, BFD_ENDIAN_LITTLE, BFD_ENDIAN_UNKNOWN };
  5888. /* Forward declaration. */
  5889. typedef struct bfd_link_info _bfd_link_info;
  5890. /* Forward declaration. */
  5891. typedef struct flag_info flag_info;
  5892. typedef struct bfd_target
  5893. {
  5894. /* Identifies the kind of target, e.g., SunOS4, Ultrix, etc. */
  5895. char *name;
  5896. /* The "flavour" of a back end is a general indication about
  5897. the contents of a file. */
  5898. enum bfd_flavour flavour;
  5899. /* The order of bytes within the data area of a file. */
  5900. enum bfd_endian byteorder;
  5901. /* The order of bytes within the header parts of a file. */
  5902. enum bfd_endian header_byteorder;
  5903. /* A mask of all the flags which an executable may have set -
  5904. from the set <<BFD_NO_FLAGS>>, <<HAS_RELOC>>, ...<<D_PAGED>>. */
  5905. flagword object_flags;
  5906. /* A mask of all the flags which a section may have set - from
  5907. the set <<SEC_NO_FLAGS>>, <<SEC_ALLOC>>, ...<<SET_NEVER_LOAD>>. */
  5908. flagword section_flags;
  5909. /* The character normally found at the front of a symbol.
  5910. (if any), perhaps `_'. */
  5911. char symbol_leading_char;
  5912. /* The pad character for file names within an archive header. */
  5913. char ar_pad_char;
  5914. /* The maximum number of characters in an archive header. */
  5915. unsigned char ar_max_namelen;
  5916. /* How well this target matches, used to select between various
  5917. possible targets when more than one target matches. */
  5918. unsigned char match_priority;
  5919. /* Entries for byte swapping for data. These are different from the
  5920. other entry points, since they don't take a BFD as the first argument.
  5921. Certain other handlers could do the same. */
  5922. bfd_uint64_t (*bfd_getx64) (const void *);
  5923. bfd_int64_t (*bfd_getx_signed_64) (const void *);
  5924. void (*bfd_putx64) (bfd_uint64_t, void *);
  5925. bfd_vma (*bfd_getx32) (const void *);
  5926. bfd_signed_vma (*bfd_getx_signed_32) (const void *);
  5927. void (*bfd_putx32) (bfd_vma, void *);
  5928. bfd_vma (*bfd_getx16) (const void *);
  5929. bfd_signed_vma (*bfd_getx_signed_16) (const void *);
  5930. void (*bfd_putx16) (bfd_vma, void *);
  5931. /* Byte swapping for the headers. */
  5932. bfd_uint64_t (*bfd_h_getx64) (const void *);
  5933. bfd_int64_t (*bfd_h_getx_signed_64) (const void *);
  5934. void (*bfd_h_putx64) (bfd_uint64_t, void *);
  5935. bfd_vma (*bfd_h_getx32) (const void *);
  5936. bfd_signed_vma (*bfd_h_getx_signed_32) (const void *);
  5937. void (*bfd_h_putx32) (bfd_vma, void *);
  5938. bfd_vma (*bfd_h_getx16) (const void *);
  5939. bfd_signed_vma (*bfd_h_getx_signed_16) (const void *);
  5940. void (*bfd_h_putx16) (bfd_vma, void *);
  5941. /* Format dependent routines: these are vectors of entry points
  5942. within the target vector structure, one for each format to check. */
  5943. /* Check the format of a file being read. Return a <<bfd_target *>> or zero. */
  5944. const struct bfd_target *(*_bfd_check_format[bfd_type_end]) (bfd *);
  5945. /* Set the format of a file being written. */
  5946. bfd_boolean (*_bfd_set_format[bfd_type_end]) (bfd *);
  5947. /* Write cached information into a file being written, at <<bfd_close>>. */
  5948. bfd_boolean (*_bfd_write_contents[bfd_type_end]) (bfd *);
  5949. /* Generic entry points. */
  5950. #define BFD_JUMP_TABLE_GENERIC(NAME) \
  5951. NAME##_close_and_cleanup, \
  5952. NAME##_bfd_free_cached_info, \
  5953. NAME##_new_section_hook, \
  5954. NAME##_get_section_contents, \
  5955. NAME##_get_section_contents_in_window
  5956. /* Called when the BFD is being closed to do any necessary cleanup. */
  5957. bfd_boolean (*_close_and_cleanup) (bfd *);
  5958. /* Ask the BFD to free all cached information. */
  5959. bfd_boolean (*_bfd_free_cached_info) (bfd *);
  5960. /* Called when a new section is created. */
  5961. bfd_boolean (*_new_section_hook) (bfd *, sec_ptr);
  5962. /* Read the contents of a section. */
  5963. bfd_boolean (*_bfd_get_section_contents)
  5964. (bfd *, sec_ptr, void *, file_ptr, bfd_size_type);
  5965. bfd_boolean (*_bfd_get_section_contents_in_window)
  5966. (bfd *, sec_ptr, bfd_window *, file_ptr, bfd_size_type);
  5967. /* Entry points to copy private data. */
  5968. #define BFD_JUMP_TABLE_COPY(NAME) \
  5969. NAME##_bfd_copy_private_bfd_data, \
  5970. NAME##_bfd_merge_private_bfd_data, \
  5971. _bfd_generic_init_private_section_data, \
  5972. NAME##_bfd_copy_private_section_data, \
  5973. NAME##_bfd_copy_private_symbol_data, \
  5974. NAME##_bfd_copy_private_header_data, \
  5975. NAME##_bfd_set_private_flags, \
  5976. NAME##_bfd_print_private_bfd_data
  5977. /* Called to copy BFD general private data from one object file
  5978. to another. */
  5979. bfd_boolean (*_bfd_copy_private_bfd_data) (bfd *, bfd *);
  5980. /* Called to merge BFD general private data from one object file
  5981. to a common output file when linking. */
  5982. bfd_boolean (*_bfd_merge_private_bfd_data) (bfd *, bfd *);
  5983. /* Called to initialize BFD private section data from one object file
  5984. to another. */
  5985. #define bfd_init_private_section_data(ibfd, isec, obfd, osec, link_info) \
  5986. BFD_SEND (obfd, _bfd_init_private_section_data, (ibfd, isec, obfd, osec, link_info))
  5987. bfd_boolean (*_bfd_init_private_section_data)
  5988. (bfd *, sec_ptr, bfd *, sec_ptr, struct bfd_link_info *);
  5989. /* Called to copy BFD private section data from one object file
  5990. to another. */
  5991. bfd_boolean (*_bfd_copy_private_section_data)
  5992. (bfd *, sec_ptr, bfd *, sec_ptr);
  5993. /* Called to copy BFD private symbol data from one symbol
  5994. to another. */
  5995. bfd_boolean (*_bfd_copy_private_symbol_data)
  5996. (bfd *, asymbol *, bfd *, asymbol *);
  5997. /* Called to copy BFD private header data from one object file
  5998. to another. */
  5999. bfd_boolean (*_bfd_copy_private_header_data)
  6000. (bfd *, bfd *);
  6001. /* Called to set private backend flags. */
  6002. bfd_boolean (*_bfd_set_private_flags) (bfd *, flagword);
  6003. /* Called to print private BFD data. */
  6004. bfd_boolean (*_bfd_print_private_bfd_data) (bfd *, void *);
  6005. /* Core file entry points. */
  6006. #define BFD_JUMP_TABLE_CORE(NAME) \
  6007. NAME##_core_file_failing_command, \
  6008. NAME##_core_file_failing_signal, \
  6009. NAME##_core_file_matches_executable_p, \
  6010. NAME##_core_file_pid
  6011. char * (*_core_file_failing_command) (bfd *);
  6012. int (*_core_file_failing_signal) (bfd *);
  6013. bfd_boolean (*_core_file_matches_executable_p) (bfd *, bfd *);
  6014. int (*_core_file_pid) (bfd *);
  6015. /* Archive entry points. */
  6016. #define BFD_JUMP_TABLE_ARCHIVE(NAME) \
  6017. NAME##_slurp_armap, \
  6018. NAME##_slurp_extended_name_table, \
  6019. NAME##_construct_extended_name_table, \
  6020. NAME##_truncate_arname, \
  6021. NAME##_write_armap, \
  6022. NAME##_read_ar_hdr, \
  6023. NAME##_write_ar_hdr, \
  6024. NAME##_openr_next_archived_file, \
  6025. NAME##_get_elt_at_index, \
  6026. NAME##_generic_stat_arch_elt, \
  6027. NAME##_update_armap_timestamp
  6028. bfd_boolean (*_bfd_slurp_armap) (bfd *);
  6029. bfd_boolean (*_bfd_slurp_extended_name_table) (bfd *);
  6030. bfd_boolean (*_bfd_construct_extended_name_table)
  6031. (bfd *, char **, bfd_size_type *, const char **);
  6032. void (*_bfd_truncate_arname) (bfd *, const char *, char *);
  6033. bfd_boolean (*write_armap)
  6034. (bfd *, unsigned int, struct orl *, unsigned int, int);
  6035. void * (*_bfd_read_ar_hdr_fn) (bfd *);
  6036. bfd_boolean (*_bfd_write_ar_hdr_fn) (bfd *, bfd *);
  6037. bfd * (*openr_next_archived_file) (bfd *, bfd *);
  6038. #define bfd_get_elt_at_index(b,i) BFD_SEND (b, _bfd_get_elt_at_index, (b,i))
  6039. bfd * (*_bfd_get_elt_at_index) (bfd *, symindex);
  6040. int (*_bfd_stat_arch_elt) (bfd *, struct stat *);
  6041. bfd_boolean (*_bfd_update_armap_timestamp) (bfd *);
  6042. /* Entry points used for symbols. */
  6043. #define BFD_JUMP_TABLE_SYMBOLS(NAME) \
  6044. NAME##_get_symtab_upper_bound, \
  6045. NAME##_canonicalize_symtab, \
  6046. NAME##_make_empty_symbol, \
  6047. NAME##_print_symbol, \
  6048. NAME##_get_symbol_info, \
  6049. NAME##_get_symbol_version_string, \
  6050. NAME##_bfd_is_local_label_name, \
  6051. NAME##_bfd_is_target_special_symbol, \
  6052. NAME##_get_lineno, \
  6053. NAME##_find_nearest_line, \
  6054. NAME##_find_line, \
  6055. NAME##_find_inliner_info, \
  6056. NAME##_bfd_make_debug_symbol, \
  6057. NAME##_read_minisymbols, \
  6058. NAME##_minisymbol_to_symbol
  6059. long (*_bfd_get_symtab_upper_bound) (bfd *);
  6060. long (*_bfd_canonicalize_symtab)
  6061. (bfd *, struct bfd_symbol **);
  6062. struct bfd_symbol *
  6063. (*_bfd_make_empty_symbol) (bfd *);
  6064. void (*_bfd_print_symbol)
  6065. (bfd *, void *, struct bfd_symbol *, bfd_print_symbol_type);
  6066. #define bfd_print_symbol(b,p,s,e) BFD_SEND (b, _bfd_print_symbol, (b,p,s,e))
  6067. void (*_bfd_get_symbol_info)
  6068. (bfd *, struct bfd_symbol *, symbol_info *);
  6069. #define bfd_get_symbol_info(b,p,e) BFD_SEND (b, _bfd_get_symbol_info, (b,p,e))
  6070. const char *(*_bfd_get_symbol_version_string)
  6071. (bfd *, struct bfd_symbol *, bfd_boolean *);
  6072. #define bfd_get_symbol_version_string(b,s,h) BFD_SEND (b, _bfd_get_symbol_version_string, (b,s,h))
  6073. bfd_boolean (*_bfd_is_local_label_name) (bfd *, const char *);
  6074. bfd_boolean (*_bfd_is_target_special_symbol) (bfd *, asymbol *);
  6075. alent * (*_get_lineno) (bfd *, struct bfd_symbol *);
  6076. bfd_boolean (*_bfd_find_nearest_line)
  6077. (bfd *, struct bfd_symbol **, struct bfd_section *, bfd_vma,
  6078. const char **, const char **, unsigned int *, unsigned int *);
  6079. bfd_boolean (*_bfd_find_line)
  6080. (bfd *, struct bfd_symbol **, struct bfd_symbol *,
  6081. const char **, unsigned int *);
  6082. bfd_boolean (*_bfd_find_inliner_info)
  6083. (bfd *, const char **, const char **, unsigned int *);
  6084. /* Back-door to allow format-aware applications to create debug symbols
  6085. while using BFD for everything else. Currently used by the assembler
  6086. when creating COFF files. */
  6087. asymbol * (*_bfd_make_debug_symbol)
  6088. (bfd *, void *, unsigned long size);
  6089. #define bfd_read_minisymbols(b, d, m, s) \
  6090. BFD_SEND (b, _read_minisymbols, (b, d, m, s))
  6091. long (*_read_minisymbols)
  6092. (bfd *, bfd_boolean, void **, unsigned int *);
  6093. #define bfd_minisymbol_to_symbol(b, d, m, f) \
  6094. BFD_SEND (b, _minisymbol_to_symbol, (b, d, m, f))
  6095. asymbol * (*_minisymbol_to_symbol)
  6096. (bfd *, bfd_boolean, const void *, asymbol *);
  6097. /* Routines for relocs. */
  6098. #define BFD_JUMP_TABLE_RELOCS(NAME) \
  6099. NAME##_get_reloc_upper_bound, \
  6100. NAME##_canonicalize_reloc, \
  6101. NAME##_bfd_reloc_type_lookup, \
  6102. NAME##_bfd_reloc_name_lookup
  6103. long (*_get_reloc_upper_bound) (bfd *, sec_ptr);
  6104. long (*_bfd_canonicalize_reloc)
  6105. (bfd *, sec_ptr, arelent **, struct bfd_symbol **);
  6106. /* See documentation on reloc types. */
  6107. reloc_howto_type *
  6108. (*reloc_type_lookup) (bfd *, bfd_reloc_code_real_type);
  6109. reloc_howto_type *
  6110. (*reloc_name_lookup) (bfd *, const char *);
  6111. /* Routines used when writing an object file. */
  6112. #define BFD_JUMP_TABLE_WRITE(NAME) \
  6113. NAME##_set_arch_mach, \
  6114. NAME##_set_section_contents
  6115. bfd_boolean (*_bfd_set_arch_mach)
  6116. (bfd *, enum bfd_architecture, unsigned long);
  6117. bfd_boolean (*_bfd_set_section_contents)
  6118. (bfd *, sec_ptr, const void *, file_ptr, bfd_size_type);
  6119. /* Routines used by the linker. */
  6120. #define BFD_JUMP_TABLE_LINK(NAME) \
  6121. NAME##_sizeof_headers, \
  6122. NAME##_bfd_get_relocated_section_contents, \
  6123. NAME##_bfd_relax_section, \
  6124. NAME##_bfd_link_hash_table_create, \
  6125. NAME##_bfd_link_add_symbols, \
  6126. NAME##_bfd_link_just_syms, \
  6127. NAME##_bfd_copy_link_hash_symbol_type, \
  6128. NAME##_bfd_final_link, \
  6129. NAME##_bfd_link_split_section, \
  6130. NAME##_bfd_gc_sections, \
  6131. NAME##_bfd_lookup_section_flags, \
  6132. NAME##_bfd_merge_sections, \
  6133. NAME##_bfd_is_group_section, \
  6134. NAME##_bfd_discard_group, \
  6135. NAME##_section_already_linked, \
  6136. NAME##_bfd_define_common_symbol
  6137. int (*_bfd_sizeof_headers) (bfd *, struct bfd_link_info *);
  6138. bfd_byte * (*_bfd_get_relocated_section_contents)
  6139. (bfd *, struct bfd_link_info *, struct bfd_link_order *,
  6140. bfd_byte *, bfd_boolean, struct bfd_symbol **);
  6141. bfd_boolean (*_bfd_relax_section)
  6142. (bfd *, struct bfd_section *, struct bfd_link_info *, bfd_boolean *);
  6143. /* Create a hash table for the linker. Different backends store
  6144. different information in this table. */
  6145. struct bfd_link_hash_table *
  6146. (*_bfd_link_hash_table_create) (bfd *);
  6147. /* Add symbols from this object file into the hash table. */
  6148. bfd_boolean (*_bfd_link_add_symbols) (bfd *, struct bfd_link_info *);
  6149. /* Indicate that we are only retrieving symbol values from this section. */
  6150. void (*_bfd_link_just_syms) (asection *, struct bfd_link_info *);
  6151. /* Copy the symbol type and other attributes for a linker script
  6152. assignment of one symbol to another. */
  6153. #define bfd_copy_link_hash_symbol_type(b, t, f) \
  6154. BFD_SEND (b, _bfd_copy_link_hash_symbol_type, (b, t, f))
  6155. void (*_bfd_copy_link_hash_symbol_type)
  6156. (bfd *, struct bfd_link_hash_entry *, struct bfd_link_hash_entry *);
  6157. /* Do a link based on the link_order structures attached to each
  6158. section of the BFD. */
  6159. bfd_boolean (*_bfd_final_link) (bfd *, struct bfd_link_info *);
  6160. /* Should this section be split up into smaller pieces during linking. */
  6161. bfd_boolean (*_bfd_link_split_section) (bfd *, struct bfd_section *);
  6162. /* Remove sections that are not referenced from the output. */
  6163. bfd_boolean (*_bfd_gc_sections) (bfd *, struct bfd_link_info *);
  6164. /* Sets the bitmask of allowed and disallowed section flags. */
  6165. bfd_boolean (*_bfd_lookup_section_flags) (struct bfd_link_info *,
  6166. struct flag_info *,
  6167. asection *);
  6168. /* Attempt to merge SEC_MERGE sections. */
  6169. bfd_boolean (*_bfd_merge_sections) (bfd *, struct bfd_link_info *);
  6170. /* Is this section a member of a group? */
  6171. bfd_boolean (*_bfd_is_group_section) (bfd *, const struct bfd_section *);
  6172. /* Discard members of a group. */
  6173. bfd_boolean (*_bfd_discard_group) (bfd *, struct bfd_section *);
  6174. /* Check if SEC has been already linked during a reloceatable or
  6175. final link. */
  6176. bfd_boolean (*_section_already_linked) (bfd *, asection *,
  6177. struct bfd_link_info *);
  6178. /* Define a common symbol. */
  6179. bfd_boolean (*_bfd_define_common_symbol) (bfd *, struct bfd_link_info *,
  6180. struct bfd_link_hash_entry *);
  6181. /* Routines to handle dynamic symbols and relocs. */
  6182. #define BFD_JUMP_TABLE_DYNAMIC(NAME) \
  6183. NAME##_get_dynamic_symtab_upper_bound, \
  6184. NAME##_canonicalize_dynamic_symtab, \
  6185. NAME##_get_synthetic_symtab, \
  6186. NAME##_get_dynamic_reloc_upper_bound, \
  6187. NAME##_canonicalize_dynamic_reloc
  6188. /* Get the amount of memory required to hold the dynamic symbols. */
  6189. long (*_bfd_get_dynamic_symtab_upper_bound) (bfd *);
  6190. /* Read in the dynamic symbols. */
  6191. long (*_bfd_canonicalize_dynamic_symtab)
  6192. (bfd *, struct bfd_symbol **);
  6193. /* Create synthetized symbols. */
  6194. long (*_bfd_get_synthetic_symtab)
  6195. (bfd *, long, struct bfd_symbol **, long, struct bfd_symbol **,
  6196. struct bfd_symbol **);
  6197. /* Get the amount of memory required to hold the dynamic relocs. */
  6198. long (*_bfd_get_dynamic_reloc_upper_bound) (bfd *);
  6199. /* Read in the dynamic relocs. */
  6200. long (*_bfd_canonicalize_dynamic_reloc)
  6201. (bfd *, arelent **, struct bfd_symbol **);
  6202. /* Opposite endian version of this target. */
  6203. const struct bfd_target * alternative_target;
  6204. /* Data for use by back-end routines, which isn't
  6205. generic enough to belong in this structure. */
  6206. const void *backend_data;
  6207. } bfd_target;
  6208. bfd_boolean bfd_set_default_target (const char *name);
  6209. const bfd_target *bfd_find_target (const char *target_name, bfd *abfd);
  6210. const bfd_target *bfd_get_target_info (const char *target_name,
  6211. bfd *abfd,
  6212. bfd_boolean *is_bigendian,
  6213. int *underscoring,
  6214. const char **def_target_arch);
  6215. const char ** bfd_target_list (void);
  6216. const bfd_target *bfd_search_for_target
  6217. (int (*search_func) (const bfd_target *, void *),
  6218. void *);
  6219. const char *bfd_flavour_name (enum bfd_flavour flavour);
  6220. /* Extracted from format.c. */
  6221. bfd_boolean bfd_check_format (bfd *abfd, bfd_format format);
  6222. bfd_boolean bfd_check_format_matches
  6223. (bfd *abfd, bfd_format format, char ***matching);
  6224. bfd_boolean bfd_set_format (bfd *abfd, bfd_format format);
  6225. const char *bfd_format_string (bfd_format format);
  6226. /* Extracted from linker.c. */
  6227. bfd_boolean bfd_link_split_section (bfd *abfd, asection *sec);
  6228. #define bfd_link_split_section(abfd, sec) \
  6229. BFD_SEND (abfd, _bfd_link_split_section, (abfd, sec))
  6230. bfd_boolean bfd_section_already_linked (bfd *abfd,
  6231. asection *sec,
  6232. struct bfd_link_info *info);
  6233. #define bfd_section_already_linked(abfd, sec, info) \
  6234. BFD_SEND (abfd, _section_already_linked, (abfd, sec, info))
  6235. bfd_boolean bfd_generic_define_common_symbol
  6236. (bfd *output_bfd, struct bfd_link_info *info,
  6237. struct bfd_link_hash_entry *h);
  6238. #define bfd_define_common_symbol(output_bfd, info, h) \
  6239. BFD_SEND (output_bfd, _bfd_define_common_symbol, (output_bfd, info, h))
  6240. struct bfd_elf_version_tree * bfd_find_version_for_sym
  6241. (struct bfd_elf_version_tree *verdefs,
  6242. const char *sym_name, bfd_boolean *hide);
  6243. bfd_boolean bfd_hide_sym_by_version
  6244. (struct bfd_elf_version_tree *verdefs, const char *sym_name);
  6245. /* Extracted from simple.c. */
  6246. bfd_byte *bfd_simple_get_relocated_section_contents
  6247. (bfd *abfd, asection *sec, bfd_byte *outbuf, asymbol **symbol_table);
  6248. /* Extracted from compress.c. */
  6249. bfd_boolean bfd_get_full_section_contents
  6250. (bfd *abfd, asection *section, bfd_byte **ptr);
  6251. void bfd_cache_section_contents
  6252. (asection *sec, void *contents);
  6253. bfd_boolean bfd_is_section_compressed_with_header
  6254. (bfd *abfd, asection *section,
  6255. int *compression_header_size_p,
  6256. bfd_size_type *uncompressed_size_p);
  6257. bfd_boolean bfd_is_section_compressed
  6258. (bfd *abfd, asection *section);
  6259. bfd_boolean bfd_init_section_decompress_status
  6260. (bfd *abfd, asection *section);
  6261. bfd_boolean bfd_init_section_compress_status
  6262. (bfd *abfd, asection *section);
  6263. bfd_boolean bfd_compress_section
  6264. (bfd *abfd, asection *section, bfd_byte *uncompressed_buffer);
  6265. #ifdef __cplusplus
  6266. }
  6267. #endif
  6268. #endif