bfd.h 249 KB

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