bfd.pas 118 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001
  1. unit BFD;
  2. {$mode Delphi}
  3. interface
  4. {
  5. Object Pascal Translation of bfd.h,
  6. used in the Binary File Descriptor library
  7. found in the GNU Binutils
  8. This translation itself is in the public domain, but don't ignore
  9. the copyright of the BFD lib itself (see 'original comments' below)
  10. History:
  11. 07.08.2001: [email protected] (UT) (started translation)
  12. - the structs, defines and functions are separated to different
  13. blocks to have one large type block (since type forwards are not
  14. possible across different type blocks)
  15. - Maybe some comments were removed or are at wrong places: while
  16. the codelines were sorted I did not check everything
  17. - I did a lot of Search and Replace, so don't wonder if comments
  18. were changed a bit, too.
  19. - I renamed bfd to TBFD and a few other minor changes to keep the
  20. namespace a bit cleaner
  21. }
  22. {
  23. Original comments and copyrights:
  24. }
  25. (* Main header file for the bfd library -- portable access to object files.
  26. Copyright 1990, 91, 92, 93, 94, 95, 96, 97, 98, 99, 2000
  27. Free Software Foundation, Inc.
  28. Contributed by Cygnus Support.
  29. ** NOTE: bfd.h and bfd-in2.h are GENERATED files. Don't change them;
  30. ** instead, change bfd-in.h or the other BFD source files processed to
  31. ** generate these files.
  32. This file is part of BFD, the Binary File Descriptor library.
  33. This program is free software; you can redistribute it and/or modify
  34. it under the terms of the GNU General Public License as published by
  35. the Free Software Foundation; either version 2 of the License, or
  36. (at your option) any later version.
  37. This program is distributed in the hope that it will be useful,
  38. but WITHOUT ANY WARRANTY; without even the implied warranty of
  39. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  40. GNU General Public License for more details.
  41. You should have received a copy of the GNU General Public License
  42. along with this program; if not, write to the Free Software
  43. Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *)
  44. (* bfd.h -- The only header file required by users of the bfd library
  45. The bfd.h file is generated from bfd-in.h and various .c files; if you
  46. change it, your changes will probably be lost.
  47. All the prototypes and definitions following the comment "THE FOLLOWING
  48. IS EXTRACTED FROM THE SOURCE" are extracted from the source files for
  49. BFD. If you change it, someone oneday will extract it from the source
  50. again, and your changes will be lost. To save yourself from this bind,
  51. change the definitions in the source in the bfd directory. Type "make
  52. docs" and then "make headers" in that directory, and magically this file
  53. will change to reflect your changes.
  54. If you don't have the tools to perform the extraction, then you are
  55. safe from someone on your system trampling over your header files.
  56. You should still maintain the equivalence between the source and this
  57. file though; every change you make to the .c file should be reflected
  58. here. *)
  59. {UT: these settings create matching records: }
  60. {$packrecords 4}
  61. {$ifndef ver1_0}
  62. {$ALIGN 4}
  63. {$endif}
  64. {$MINENUMSIZE 4}
  65. {$ifdef ver1_0}
  66. Type
  67. PBoolean = ^Boolean;
  68. PLongWord = ^LongWord;
  69. {$endif}
  70. const
  71. BFD_VERSION = '2.10.91';
  72. BFD_ARCH_SIZE = 32;
  73. BFD_LIB_NAME = 'libbfd-'+BFD_VERSION+'.dll';
  74. type
  75. (* forward declaration *)
  76. PBFD = ^TBFD;
  77. PPsymbol_cache_entry = ^Psymbol_cache_entry;
  78. Psymbol_cache_entry = ^symbol_cache_entry;
  79. PSec = ^sec;
  80. PPSec = ^PSec;
  81. Pbfd_target = ^bfd_target;
  82. Pbfd_arch_info = ^bfd_arch_info;
  83. PPreloc_cache_entry = ^Preloc_cache_entry;
  84. Preloc_cache_entry = ^reloc_cache_entry;
  85. Palent = ^alent;
  86. Pbfd_comdat_info = ^bfd_comdat_info;
  87. Prelent_chain = ^relent_chain;
  88. Pbfd_window = ^bfd_window;
  89. Pasymbol = ^asymbol;
  90. Pbfd_size_type = ^bfd_size_type;
  91. Porl = ^orl;
  92. Psymbol_info = ^symbol_info;
  93. PParelent = ^Parelent;
  94. Parelent = ^arelent;
  95. Pasection = ^asection;
  96. PPreloc_howto = ^Preloc_howto;
  97. Preloc_howto = ^reloc_howto;
  98. Pbfd_link_info = pointer; //^bfd_link_info;
  99. Pbfd_link_hash_table = pointer; //^bfd_link_hash_table;
  100. (* A pointer to a position in a file. *)
  101. file_ptr = LongInt;
  102. (* Represent a target address. Also used as a generic unsigned type
  103. which is guaranteed to be big enough to hold any arithmetic types
  104. we need to deal with. *)
  105. bfd_vma = LongWord;
  106. (* A generic signed type which is guaranteed to be big enough to hold any
  107. arithmetic types we need to deal with. Can be assumed to be compatible
  108. with bfd_vma in the same way that signed and LongWords are compatible
  109. (as parameters, in assignment, etc). *)
  110. bfd_signed_vma = LongInt;
  111. symvalue = LongWord;
  112. bfd_size_type = LongWord;
  113. flagword = LongWord; (* 32 bits of flags *)
  114. pppchar = ^ppchar;
  115. Pbfd_byte = ^bfd_byte;
  116. bfd_byte = Byte;
  117. bfd_boolean = LongBool;
  118. (** File formats *)
  119. (* MvdV: FPC 1.0 doesn't support the construct below, but the first ordinal
  120. is in practice already 0 *)
  121. bfd_format = (
  122. bfd_unknown {$ifndef ver1_0}= 0{$endif}, (* file format is unknown *)
  123. bfd_object, (* linker/assember/compiler output *)
  124. bfd_archive, (* object archive file *)
  125. bfd_core (* core dump *)
  126. //UT: to use this enum in arrays the following is not needed:
  127. //bfd_type_end (* marks the end; don't use it! *)
  128. );
  129. (* symbols and relocation *)
  130. (* A count of carsyms (canonical archive symbols). *)
  131. symindex = LongWord;
  132. (* A canonical archive symbol. *)
  133. (* This is a type pun with struct ranlib on purpose! *)
  134. carsym = record
  135. name: pchar;
  136. file_offset: file_ptr; (* look here to find the file *)
  137. end; (* to make these you call a carsymogen *)
  138. (* Used in generating armaps (archive tables of contents).
  139. Perhaps just a forward definition would do? *)
  140. orl = record (* output ranlib *)
  141. name: ppchar; (* symbol name *)
  142. pos: file_ptr; (* TBFD* or file position *)
  143. nameidx: integer; (* index into string table *)
  144. end;
  145. (* Linenumber stuff *)
  146. lineno_cache_entry = record
  147. line_number: LongWord; (* Linenumber from start of function*)
  148. u: record
  149. case integer of
  150. 0: (sym: Psymbol_cache_entry); (* Function name *)
  151. 1: (offset: LongWord); (* Offset into section *)
  152. end;
  153. end;
  154. alent = lineno_cache_entry;
  155. Pstat = pointer; // todo?
  156. bfd_print_symbol = (
  157. bfd_print_symbol_name,
  158. bfd_print_symbol_more,
  159. bfd_print_symbol_all
  160. );
  161. (* Information about a symbol that nm needs. *)
  162. symbol_info = record
  163. value: symvalue;
  164. typ: ShortInt;
  165. name: pchar; (* Symbol name. *)
  166. stab_type: Byte; (* Stab type. *)
  167. stab_other:ShortInt; (* Stab other. *)
  168. stab_desc: SmallInt; (* Stab desc. *)
  169. stab_name: pchar; (* String for stab type. *)
  170. end;
  171. (* Hash table routines. There is no way to free up a hash table. *)
  172. (* An element in the hash table. Most uses will actually use a larger
  173. structure, and an instance of this will be the first field. *)
  174. Pbfd_hash_entry = ^bfd_hash_entry;
  175. bfd_hash_entry = record
  176. (* Next entry for this hash code. *)
  177. next: Pbfd_hash_entry;
  178. (* String being hashed. *)
  179. strng: pchar;
  180. (* Hash code. This is the full hash code, not the index into the
  181. table. *)
  182. hash: LongWord;
  183. end;
  184. (* A hash table. *)
  185. Pbfd_hash_table = ^bfd_hash_table;
  186. bfd_hash_table_newfunc = function( entry: Pbfd_hash_entry;
  187. table: Pbfd_hash_table; v: pchar): Pbfd_hash_entry;
  188. bfd_hash_table = record
  189. (* The hash array. *)
  190. table: ^Pbfd_hash_entry;
  191. (* The number of slots in the hash table. *)
  192. size: LongWord ;
  193. (* A function used to create new elements in the hash table. The
  194. first entry is itself a pointer to an element. When this
  195. function is first invoked, this pointer will be NULL. However,
  196. having the pointer permits a hierarchy of method functions to be
  197. built each of which calls the function in the superclass. Thus
  198. each function should be written to allocate a new block of memory
  199. only if the argument is NULL. *)
  200. newfunc: bfd_hash_table_newfunc;
  201. (* An objalloc for this hash table. This is a struct objalloc *,
  202. but we use pointer to avoid requiring the inclusion of objalloc.h. *)
  203. memory: pointer;
  204. end;
  205. Pbfd_window_internal = pointer;
  206. bfd_window = record
  207. (* What the user asked for. *)
  208. data: pointer;
  209. size: bfd_size_type;
  210. (* The actual window used by BFD. Small user-requested read-only
  211. regions sharing a page may share a single window into the object
  212. file. Read-write versions shouldn't until I've fixed things to
  213. keep track of which portions have been claimed by the
  214. application; don't want to give the same region back when the
  215. application wants two writable copies! *)
  216. i: Pbfd_window_internal;
  217. end;
  218. Pbfd_link_needed_lists = ^bfd_link_needed_lists;
  219. bfd_link_needed_lists = record
  220. next: Pbfd_link_needed_lists;
  221. by: PBFD;
  222. name: pchar;
  223. end;
  224. bfd_direction = (no_direction {$ifndef ver1_0}= 0{$endif},
  225. read_direction {$ifndef ver1_0}= 1{$endif},
  226. write_direction {$ifndef ver1_0}= 2{$endif},
  227. both_direction {$ifndef ver1_0}= 3{$endif});
  228. TBFD = record
  229. (* The filename the application opened the BFD with. *)
  230. filename: pchar;
  231. (* A pointer to the target jump table. *)
  232. xvec: Pbfd_target;
  233. (* To avoid dragging too many header files into every file that
  234. includes `<<bfd.h>>', IOSTREAM has been declared as a "ShortInt
  235. *", and MTIME as a "LongInt". Their correct types, to which they
  236. are cast when used, are "FILE *" and "time_t". The iostream
  237. is the result of an fopen on the filename. However, if the
  238. BFD_IN_MEMORY flag is set, then iostream is actually a pointer
  239. to a bfd_in_memory struct. *)
  240. iostream: pointer ;
  241. (* Is the file descriptor being cached? That is, can it be closed as
  242. needed, and re-opened when accessed later? *)
  243. cacheable: bfd_boolean ;
  244. (* Marks whether there was a default target specified when the
  245. BFD was opened. This is used to select which matching algorithm
  246. to use to choose the back end. *)
  247. target_defaulted: bfd_boolean ;
  248. (* The caching routines use these to maintain a
  249. least-recently-used list of BFDs *)
  250. lru_prev, lru_next: PBFD;
  251. (* When a file is closed by the caching routines, BFD retains
  252. state information on the file here: *)
  253. where: file_ptr;
  254. (* and here: (``once'' means at least once) *)
  255. opened_once: bfd_boolean;
  256. (* Set if we have a locally maintained mtime value, rather than
  257. getting it from the file each time: *)
  258. mtime_set: bfd_boolean;
  259. (* File modified time, if mtime_set is true: *)
  260. mtime: LongInt;
  261. (* Reserved for an unimplemented file locking extension.*)
  262. ifd: integer ;
  263. (* The format which belongs to the BFD. (object, core, etc.) *)
  264. format: bfd_format;
  265. (* The direction the BFD was opened with*)
  266. direction: bfd_direction;
  267. (* Format_specific flags*)
  268. flags: flagword;
  269. (* Currently my_archive is tested before adding origin to
  270. anything. I believe that this can become always an add of
  271. origin, with origin set to 0 for non archive files. *)
  272. origin: file_ptr;
  273. (* Remember when output has begun, to stop strange things
  274. from happening. *)
  275. output_has_begun: bfd_boolean ;
  276. (* Pointer to linked list of sections*)
  277. sections: Psec;
  278. (* The number of sections *)
  279. section_count: LongWord ;
  280. (* Stuff only useful for object files:
  281. The start address. *)
  282. start_address: bfd_vma ;
  283. (* Used for input and output*)
  284. symcount: LongWord ;
  285. (* Symbol table for output BFD (with symcount entries) *)
  286. outsymbols: PPsymbol_cache_entry;
  287. (* Pointer to structure which contains architecture information*)
  288. arch_info: Pbfd_arch_info;
  289. (* Stuff only useful for archives:*)
  290. arelt_data: pointer ;
  291. my_archive: PBFD ; (* The containing archive BFD. *)
  292. next: PBFD ; (* The next BFD in the archive. *)
  293. archive_head: PBFD ; (* The first BFD in the archive. *)
  294. has_armap: bfd_boolean ;
  295. (* A chain of BFD structures involved in a link. *)
  296. link_next: PBFD ;
  297. (* A field used by _bfd_generic_link_add_archive_symbols. This will
  298. be used only for archive elements. *)
  299. archive_pass: integer ;
  300. (* Used by the back end to hold private data. *)
  301. tdata: record
  302. case integer of
  303. { TODO: (?)
  304. struct aout_data_struct *aout_data;
  305. struct artdata *aout_ar_data;
  306. struct _oasys_data *oasys_obj_data;
  307. struct _oasys_ar_data *oasys_ar_data;
  308. struct coff_tdata *coff_obj_data;
  309. struct pe_tdata *pe_obj_data;
  310. struct xcoff_tdata *xcoff_obj_data;
  311. struct ecoff_tdata *ecoff_obj_data;
  312. struct ieee_data_struct *ieee_data;
  313. struct ieee_ar_data_struct *ieee_ar_data;
  314. struct srec_data_struct *srec_data;
  315. struct ihex_data_struct *ihex_data;
  316. struct tekhex_data_struct *tekhex_data;
  317. struct elf_obj_tdata *elf_obj_data;
  318. struct nlm_obj_tdata *nlm_obj_data;
  319. struct bout_data_struct *bout_data;
  320. struct sun_core_struct *sun_core_data;
  321. struct sco5_core_struct *sco5_core_data;
  322. struct trad_core_struct *trad_core_data;
  323. struct som_data_struct *som_data;
  324. struct hpux_core_struct *hpux_core_data;
  325. struct hppabsd_core_struct *hppabsd_core_data;
  326. struct sgi_core_struct *sgi_core_data;
  327. struct lynx_core_struct *lynx_core_data;
  328. struct osf_core_struct *osf_core_data;
  329. struct cisco_core_struct *cisco_core_data;
  330. struct versados_data_struct *versados_data;
  331. struct netbsd_core_struct *netbsd_core_data;}
  332. -1:(any: pointer);
  333. end;
  334. (* Used by the application to hold private data*)
  335. usrdata: pointer ;
  336. (* Where all the allocated stuff under this BFD goes. This is a
  337. struct objalloc *, but we use pointer to avoid requiring the inclusion of
  338. objalloc.h. *)
  339. memory: pointer ;
  340. end; { TBFD }
  341. symbol_cache_entry = record
  342. (* A pointer to the BFD which owns the symbol. This information
  343. is necessary so that a back end can work out what additional
  344. information (invisible to the application writer) is carried
  345. with the symbol.
  346. This field is *almost* redundant, since you can use section->owner
  347. instead, except that some symbols point to the global sections
  348. bfd_{abs,com,und}_section. This could be fixed by making
  349. these globals be per-bfd (or per-target-flavor). FIXME. *)
  350. the_bfd: PBFD; (* Use bfd_asymbol_bfd(sym) to access this field. *)
  351. (* The text of the symbol. The name is left alone, and not copied; the
  352. application may not alter it. *)
  353. name: pchar;
  354. (* The value of the symbol. This really should be a union of a
  355. numeric value with a pointer, since some flags indicate that
  356. a pointer to another symbol is stored here. *)
  357. value: symvalue;
  358. flags: flagword;
  359. (* A pointer to the section to which this symbol is
  360. relative. This will always be non NULL, there are special
  361. sections for undefined and absolute symbols. *)
  362. section: Psec;
  363. (* Back end special data. *)
  364. udata: record
  365. case bfd_boolean of
  366. false: (p: pointer);
  367. true: (i: bfd_vma);
  368. end;
  369. end; { symbol_cache_entry }
  370. asymbol = symbol_cache_entry;
  371. Pbfd_link_order = pointer; // todo?
  372. sec = record
  373. (* The name of the section; the name isn't a copy, the pointer is
  374. the same as that passed to bfd_make_section. *)
  375. name: pchar;
  376. (* A unique sequence number. *)
  377. id: integer;
  378. (* Which section is it; 0..nth. *)
  379. index: integer;
  380. (* The next section in the list belonging to the BFD, or NULL. *)
  381. next: Psec ;
  382. (* The field flags contains attributes of the section. Some
  383. flags are read in from the object file, and some are
  384. synthesized from other information. *)
  385. flags: flagword;
  386. (* Some internal packed bfd_boolean fields. *)
  387. { UT: I replaced this bitfield with a Pascal 'set'!
  388. the code was
  389. user_set_vma: LongWord : 1;
  390. reloc_done: LongWord : 1;
  391. linker_mark: LongWord : 1;
  392. gc_mark: LongWord : 1;
  393. segment_mark: LongWord : 1; }
  394. bitfield: set of (
  395. user_set_vma, (* See the vma field. *)
  396. reloc_done, (* Whether relocations have been processed. *)
  397. linker_mark, (* A mark flag used by some of the linker backends. *)
  398. gc_mark, (* A mark flag used by some linker backends for garbage collection. *)
  399. segment_mark (* Used by the ELF code to mark sections which have been allocated to segments. *)
  400. );
  401. (* End of internal packed bfd_boolean fields. *)
  402. (* The virtual memory address of the section - where it will be
  403. at run time. The symbols are relocated against this. The
  404. user_set_vma flag is maintained by bfd; if it's not set, the
  405. backend can assign addresses (for example, in <<a.out>>, where
  406. the default address for <<.data>> is dependent on the specific
  407. target and various flags). *)
  408. vma: bfd_vma;
  409. (* The load address of the section - where it would be in a
  410. rom image; really only used for writing section header
  411. information. *)
  412. lma: bfd_vma;
  413. (* The size of the section in octets, as it will be output.
  414. Contains a value even if the section has no contents (e.g., the
  415. size of <<.bss>>). This will be filled in after relocation. *)
  416. _cooked_size: bfd_size_type;
  417. (* The original size on disk of the section, in octets. Normally this
  418. value is the same as the size, but if some relaxing has
  419. been done, then this value will be bigger. *)
  420. _raw_size: bfd_size_type;
  421. (* If this section is going to be output, then this value is the
  422. offset in *bytes* into the output section of the first byte in the
  423. input section (byte ==> smallest addressable unit on the
  424. target). In most cases, if this was going to start at the
  425. 100th octet (8-bit quantity) in the output section, this value
  426. would be 100. However, if the target byte size is 16 bits
  427. (bfd_octets_per_byte is "2"), this value would be 50. *)
  428. output_offset: bfd_vma;
  429. (* The output section through which to map on output. *)
  430. output_section: Psec ;
  431. (* The alignment requirement of the section, as an exponent of 2 -
  432. e.g., 3 aligns to 2^3 (or 8). *)
  433. alignment_power: LongWord;
  434. (* If an input section, a pointer to a vector of relocation
  435. records for the data in this section. *)
  436. relocation: Preloc_cache_entry;
  437. (* If an output section, a pointer to a vector of pointers to
  438. relocation records for the data in this section. *)
  439. orelocation: PPreloc_cache_entry;
  440. (* The number of relocation records in one of the above *)
  441. reloc_count: LongWord;
  442. (* Information below is back end specific - and not always used
  443. or updated. *)
  444. (* File position of section data. *)
  445. filepos: file_ptr;
  446. (* File position of relocation info. *)
  447. rel_filepos: file_ptr;
  448. (* File position of line data. *)
  449. line_filepos: file_ptr;
  450. (* Pointer to data for applications. *)
  451. userdata: pointer;
  452. (* If the SEC_IN_MEMORY flag is set, this points to the actual
  453. contents. *)
  454. contents: PByte;
  455. (* Attached line number information. *)
  456. lineno: Palent;
  457. (* Number of line number records. *)
  458. lineno_count: LongWord;
  459. (* Optional information about a COMDAT entry; NULL if not COMDAT. *)
  460. comdat: Pbfd_comdat_info;
  461. (* Points to the kept section if this section is a link-once section,
  462. and is discarded. *)
  463. kept_section: Psec;
  464. (* When a section is being output, this value changes as more
  465. linenumbers are written out. *)
  466. moving_line_filepos: file_ptr;
  467. (* What the section number is in the target world. *)
  468. target_index: integer;
  469. used_by_bfd: pointer;
  470. (* If this is a constructor section then here is a list of the
  471. relocations created to relocate items within it. *)
  472. constructor_chain: Prelent_chain;
  473. (* The BFD which owns the section. *)
  474. owner: PBFD;
  475. (* A symbol which points at this section only *)
  476. symbol: Psymbol_cache_entry;
  477. symbol_ptr_ptr: PPsymbol_cache_entry;
  478. link_order_head: Pbfd_link_order;
  479. link_order_tail: Pbfd_link_order;
  480. end; { sec }
  481. asection = sec;
  482. bfd_flavour = (
  483. bfd_target_unknown_flavour,
  484. bfd_target_aout_flavour,
  485. bfd_target_coff_flavour,
  486. bfd_target_ecoff_flavour,
  487. bfd_target_xcoff_flavour,
  488. bfd_target_elf_flavour,
  489. bfd_target_ieee_flavour,
  490. bfd_target_nlm_flavour,
  491. bfd_target_oasys_flavour,
  492. bfd_target_tekhex_flavour,
  493. bfd_target_srec_flavour,
  494. bfd_target_ihex_flavour,
  495. bfd_target_som_flavour,
  496. bfd_target_os9k_flavour,
  497. bfd_target_versados_flavour,
  498. bfd_target_msdos_flavour,
  499. bfd_target_ovax_flavour,
  500. bfd_target_evax_flavour
  501. ); { bfd_flavour }
  502. bfd_endian = ( BFD_ENDIAN_BIG, BFD_ENDIAN_LITTLE, BFD_ENDIAN_UNKNOWN );
  503. bfd_reloc_code_real = (
  504. _dummy_first_bfd_reloc_code_real,
  505. (* Basic absolute relocations of N bits. *)
  506. BFD_RELOC_64,
  507. BFD_RELOC_32,
  508. BFD_RELOC_26,
  509. BFD_RELOC_24,
  510. BFD_RELOC_16,
  511. BFD_RELOC_14,
  512. BFD_RELOC_8,
  513. (* PC-relative relocations. Sometimes these are relative to the address
  514. of the relocation itself; sometimes they are relative to the start of
  515. the section containing the relocation. It depends on the specific target.
  516. The 24-bit relocation is used in some Intel 960 configurations. *)
  517. BFD_RELOC_64_PCREL,
  518. BFD_RELOC_32_PCREL,
  519. BFD_RELOC_24_PCREL,
  520. BFD_RELOC_16_PCREL,
  521. BFD_RELOC_12_PCREL,
  522. BFD_RELOC_8_PCREL,
  523. (* For ELF. *)
  524. BFD_RELOC_32_GOT_PCREL,
  525. BFD_RELOC_16_GOT_PCREL,
  526. BFD_RELOC_8_GOT_PCREL,
  527. BFD_RELOC_32_GOTOFF,
  528. BFD_RELOC_16_GOTOFF,
  529. BFD_RELOC_LO16_GOTOFF,
  530. BFD_RELOC_HI16_GOTOFF,
  531. BFD_RELOC_HI16_S_GOTOFF,
  532. BFD_RELOC_8_GOTOFF,
  533. BFD_RELOC_32_PLT_PCREL,
  534. BFD_RELOC_24_PLT_PCREL,
  535. BFD_RELOC_16_PLT_PCREL,
  536. BFD_RELOC_8_PLT_PCREL,
  537. BFD_RELOC_32_PLTOFF,
  538. BFD_RELOC_16_PLTOFF,
  539. BFD_RELOC_LO16_PLTOFF,
  540. BFD_RELOC_HI16_PLTOFF,
  541. BFD_RELOC_HI16_S_PLTOFF,
  542. BFD_RELOC_8_PLTOFF,
  543. (* Relocations used by 68K ELF. *)
  544. BFD_RELOC_68K_GLOB_DAT,
  545. BFD_RELOC_68K_JMP_SLOT,
  546. BFD_RELOC_68K_RELATIVE,
  547. (* Linkage-table relative. *)
  548. BFD_RELOC_32_BASEREL,
  549. BFD_RELOC_16_BASEREL,
  550. BFD_RELOC_LO16_BASEREL,
  551. BFD_RELOC_HI16_BASEREL,
  552. BFD_RELOC_HI16_S_BASEREL,
  553. BFD_RELOC_8_BASEREL,
  554. BFD_RELOC_RVA,
  555. (* Absolute 8-bit relocation, but used to form an address like $FFnn. *)
  556. BFD_RELOC_8_FFnn,
  557. (* These PC-relative relocations are stored as word displacements --
  558. i.e., byte displacements shifted right two bits. The 30-bit word
  559. displacement (<<32_PCREL_S2>> -- 32 bits, shifted 2) is used on the
  560. SPARC. (SPARC tools generally refer to this as <<WDISP30>>.) The
  561. signed 16-bit displacement is used on the MIPS, and the 23-bit
  562. displacement is used on the Alpha. *)
  563. BFD_RELOC_32_PCREL_S2,
  564. BFD_RELOC_16_PCREL_S2,
  565. BFD_RELOC_23_PCREL_S2,
  566. (* High 22 bits and low 10 bits of 32-bit value, placed into lower bits of
  567. the target word. These are used on the SPARC. *)
  568. BFD_RELOC_HI22,
  569. BFD_RELOC_LO10,
  570. (* For systems that allocate a Global Pointer register, these are
  571. displacements off that register. These relocation types are
  572. handled specially, because the value the register will have is
  573. decided relatively late. *)
  574. BFD_RELOC_GPREL16,
  575. BFD_RELOC_GPREL32,
  576. (* Reloc types used for i960/b.out. *)
  577. BFD_RELOC_I960_CALLJ,
  578. (* SPARC ELF relocations. There is probably some overlap with other
  579. relocation types already defined. *)
  580. BFD_RELOC_NONE,
  581. BFD_RELOC_SPARC_WDISP22,
  582. BFD_RELOC_SPARC22,
  583. BFD_RELOC_SPARC13,
  584. BFD_RELOC_SPARC_GOT10,
  585. BFD_RELOC_SPARC_GOT13,
  586. BFD_RELOC_SPARC_GOT22,
  587. BFD_RELOC_SPARC_PC10,
  588. BFD_RELOC_SPARC_PC22,
  589. BFD_RELOC_SPARC_WPLT30,
  590. BFD_RELOC_SPARC_COPY,
  591. BFD_RELOC_SPARC_GLOB_DAT,
  592. BFD_RELOC_SPARC_JMP_SLOT,
  593. BFD_RELOC_SPARC_RELATIVE,
  594. BFD_RELOC_SPARC_UA32,
  595. (* I think these are specific to SPARC a.out (e.g., Sun 4). *)
  596. BFD_RELOC_SPARC_BASE13,
  597. BFD_RELOC_SPARC_BASE22,
  598. (* SPARC64 relocations *)
  599. BFD_RELOC_SPARC_10,
  600. BFD_RELOC_SPARC_11,
  601. BFD_RELOC_SPARC_OLO10,
  602. BFD_RELOC_SPARC_HH22,
  603. BFD_RELOC_SPARC_HM10,
  604. BFD_RELOC_SPARC_LM22,
  605. BFD_RELOC_SPARC_PC_HH22,
  606. BFD_RELOC_SPARC_PC_HM10,
  607. BFD_RELOC_SPARC_PC_LM22,
  608. BFD_RELOC_SPARC_WDISP16,
  609. BFD_RELOC_SPARC_WDISP19,
  610. BFD_RELOC_SPARC_7,
  611. BFD_RELOC_SPARC_6,
  612. BFD_RELOC_SPARC_5,
  613. BFD_RELOC_SPARC_PLT64,
  614. BFD_RELOC_SPARC_HIX22,
  615. BFD_RELOC_SPARC_LOX10,
  616. BFD_RELOC_SPARC_H44,
  617. BFD_RELOC_SPARC_M44,
  618. BFD_RELOC_SPARC_L44,
  619. BFD_RELOC_SPARC_REGISTER,
  620. (* SPARC little endian relocation *)
  621. BFD_RELOC_SPARC_REV32,
  622. (* Alpha ECOFF and ELF relocations. Some of these treat the symbol or
  623. "addend" in some special way.
  624. For GPDISP_HI16 ("gpdisp") relocations, the symbol is ignored when
  625. writing; when reading, it will be the absolute section symbol. The
  626. addend is the displacement in bytes of the "lda" instruction from
  627. the "ldah" instruction (which is at the address of this reloc). *)
  628. BFD_RELOC_ALPHA_GPDISP_HI16,
  629. (* For GPDISP_LO16 ("ignore") relocations, the symbol is handled as
  630. with GPDISP_HI16 relocs. The addend is ignored when writing the
  631. relocations out, and is filled in with the file's GP value on
  632. reading, for convenience. *)
  633. BFD_RELOC_ALPHA_GPDISP_LO16,
  634. (* The ELF GPDISP relocation is exactly the same as the GPDISP_HI16
  635. relocation except that there is no accompanying GPDISP_LO16
  636. relocation. *)
  637. BFD_RELOC_ALPHA_GPDISP,
  638. (* The Alpha LITERAL/LITUSE relocs are produced by a symbol reference;
  639. the assembler turns it into a LDQ instruction to load the address of
  640. the symbol, and then fills in a register in the real instruction.
  641. The LITERAL reloc, at the LDQ instruction, refers to the .lita
  642. section symbol. The addend is ignored when writing, but is filled
  643. in with the file's GP value on reading, for convenience, as with the
  644. GPDISP_LO16 reloc.
  645. The ELF_LITERAL reloc is somewhere between 16_GOTOFF and GPDISP_LO16.
  646. It should refer to the symbol to be referenced, as with 16_GOTOFF,
  647. but it generates output not based on the position within the .got
  648. section, but relative to the GP value chosen for the file during the
  649. final link stage.
  650. The LITUSE reloc, on the instruction using the loaded address, gives
  651. information to the linker that it might be able to use to optimize
  652. away some literal section references. The symbol is ignored (read
  653. as the absolute section symbol), and the "addend" indicates the type
  654. of instruction using the register:
  655. 1 - "memory" fmt insn
  656. 2 - byte-manipulation (byte offset reg)
  657. 3 - jsr (target of branch)
  658. The GNU linker currently doesn't do any of this optimizing. *)
  659. BFD_RELOC_ALPHA_LITERAL,
  660. BFD_RELOC_ALPHA_ELF_LITERAL,
  661. BFD_RELOC_ALPHA_LITUSE,
  662. (* The BFD_RELOC_ALPHA_USER_* relocations are used by the assembler to
  663. process the explicit !<reloc>!sequence relocations, and are mapped
  664. into the normal relocations at the end of processing. *)
  665. BFD_RELOC_ALPHA_USER_LITERAL,
  666. BFD_RELOC_ALPHA_USER_LITUSE_BASE,
  667. BFD_RELOC_ALPHA_USER_LITUSE_BYTOFF,
  668. BFD_RELOC_ALPHA_USER_LITUSE_JSR,
  669. BFD_RELOC_ALPHA_USER_GPDISP,
  670. BFD_RELOC_ALPHA_USER_GPRELHIGH,
  671. BFD_RELOC_ALPHA_USER_GPRELLOW,
  672. (* The HINT relocation indicates a value that should be filled into the
  673. "hint" field of a jmp/jsr/ret instruction, for possible branch-
  674. prediction logic which may be provided on some processors. *)
  675. BFD_RELOC_ALPHA_HINT,
  676. (* The LINKAGE relocation outputs a linkage pair in the object file,
  677. which is filled by the linker. *)
  678. BFD_RELOC_ALPHA_LINKAGE,
  679. (* The CODEADDR relocation outputs a STO_CA in the object file,
  680. which is filled by the linker. *)
  681. BFD_RELOC_ALPHA_CODEADDR,
  682. (* Bits 27..2 of the relocation address shifted right 2 bits;
  683. simple reloc otherwise. *)
  684. BFD_RELOC_MIPS_JMP,
  685. (* The MIPS16 jump instruction. *)
  686. BFD_RELOC_MIPS16_JMP,
  687. (* MIPS16 GP relative reloc. *)
  688. BFD_RELOC_MIPS16_GPREL,
  689. (* High 16 bits of 32-bit value; simple reloc. *)
  690. BFD_RELOC_HI16,
  691. (* High 16 bits of 32-bit value but the low 16 bits will be sign
  692. extended and added to form the final result. If the low 16
  693. bits form a negative number, we need to add one to the high value
  694. to compensate for the borrow when the low bits are added. *)
  695. BFD_RELOC_HI16_S,
  696. (* Low 16 bits. *)
  697. BFD_RELOC_LO16,
  698. (* Like BFD_RELOC_HI16_S, but PC relative. *)
  699. BFD_RELOC_PCREL_HI16_S,
  700. (* Like BFD_RELOC_LO16, but PC relative. *)
  701. BFD_RELOC_PCREL_LO16,
  702. (* Relocation relative to the global pointer. *)
  703. (* Relocation against a MIPS literal section. *)
  704. BFD_RELOC_MIPS_LITERAL,
  705. (* MIPS ELF relocations. *)
  706. BFD_RELOC_MIPS_GOT16,
  707. BFD_RELOC_MIPS_CALL16,
  708. BFD_RELOC_MIPS_GOT_HI16,
  709. BFD_RELOC_MIPS_GOT_LO16,
  710. BFD_RELOC_MIPS_CALL_HI16,
  711. BFD_RELOC_MIPS_CALL_LO16,
  712. BFD_RELOC_MIPS_SUB,
  713. BFD_RELOC_MIPS_GOT_PAGE,
  714. BFD_RELOC_MIPS_GOT_OFST,
  715. BFD_RELOC_MIPS_GOT_DISP,
  716. (* i386/elf relocations *)
  717. BFD_RELOC_386_GOT32,
  718. BFD_RELOC_386_PLT32,
  719. BFD_RELOC_386_COPY,
  720. BFD_RELOC_386_GLOB_DAT,
  721. BFD_RELOC_386_JUMP_SLOT,
  722. BFD_RELOC_386_RELATIVE,
  723. BFD_RELOC_386_GOTOFF,
  724. BFD_RELOC_386_GOTPC,
  725. (* x86-64/elf relocations *)
  726. BFD_RELOC_X86_64_GOT32,
  727. BFD_RELOC_X86_64_PLT32,
  728. BFD_RELOC_X86_64_COPY,
  729. BFD_RELOC_X86_64_GLOB_DAT,
  730. BFD_RELOC_X86_64_JUMP_SLOT,
  731. BFD_RELOC_X86_64_RELATIVE,
  732. BFD_RELOC_X86_64_GOTPCREL,
  733. BFD_RELOC_X86_64_32S,
  734. (* ns32k relocations *)
  735. BFD_RELOC_NS32K_IMM_8,
  736. BFD_RELOC_NS32K_IMM_16,
  737. BFD_RELOC_NS32K_IMM_32,
  738. BFD_RELOC_NS32K_IMM_8_PCREL,
  739. BFD_RELOC_NS32K_IMM_16_PCREL,
  740. BFD_RELOC_NS32K_IMM_32_PCREL,
  741. BFD_RELOC_NS32K_DISP_8,
  742. BFD_RELOC_NS32K_DISP_16,
  743. BFD_RELOC_NS32K_DISP_32,
  744. BFD_RELOC_NS32K_DISP_8_PCREL,
  745. BFD_RELOC_NS32K_DISP_16_PCREL,
  746. BFD_RELOC_NS32K_DISP_32_PCREL,
  747. (* Picojava relocs. Not all of these appear in object files. *)
  748. BFD_RELOC_PJ_CODE_HI16,
  749. BFD_RELOC_PJ_CODE_LO16,
  750. BFD_RELOC_PJ_CODE_DIR16,
  751. BFD_RELOC_PJ_CODE_DIR32,
  752. BFD_RELOC_PJ_CODE_REL16,
  753. BFD_RELOC_PJ_CODE_REL32,
  754. (* Power(rs6000) and PowerPC relocations. *)
  755. BFD_RELOC_PPC_B26,
  756. BFD_RELOC_PPC_BA26,
  757. BFD_RELOC_PPC_TOC16,
  758. BFD_RELOC_PPC_B16,
  759. BFD_RELOC_PPC_B16_BRTAKEN,
  760. BFD_RELOC_PPC_B16_BRNTAKEN,
  761. BFD_RELOC_PPC_BA16,
  762. BFD_RELOC_PPC_BA16_BRTAKEN,
  763. BFD_RELOC_PPC_BA16_BRNTAKEN,
  764. BFD_RELOC_PPC_COPY,
  765. BFD_RELOC_PPC_GLOB_DAT,
  766. BFD_RELOC_PPC_JMP_SLOT,
  767. BFD_RELOC_PPC_RELATIVE,
  768. BFD_RELOC_PPC_LOCAL24PC,
  769. BFD_RELOC_PPC_EMB_NADDR32,
  770. BFD_RELOC_PPC_EMB_NADDR16,
  771. BFD_RELOC_PPC_EMB_NADDR16_LO,
  772. BFD_RELOC_PPC_EMB_NADDR16_HI,
  773. BFD_RELOC_PPC_EMB_NADDR16_HA,
  774. BFD_RELOC_PPC_EMB_SDAI16,
  775. BFD_RELOC_PPC_EMB_SDA2I16,
  776. BFD_RELOC_PPC_EMB_SDA2REL,
  777. BFD_RELOC_PPC_EMB_SDA21,
  778. BFD_RELOC_PPC_EMB_MRKREF,
  779. BFD_RELOC_PPC_EMB_RELSEC16,
  780. BFD_RELOC_PPC_EMB_RELST_LO,
  781. BFD_RELOC_PPC_EMB_RELST_HI,
  782. BFD_RELOC_PPC_EMB_RELST_HA,
  783. BFD_RELOC_PPC_EMB_BIT_FLD,
  784. BFD_RELOC_PPC_EMB_RELSDA,
  785. (* IBM 370/390 relocations *)
  786. BFD_RELOC_I370_D12,
  787. (* The type of reloc used to build a contructor table - at the moment
  788. probably a 32 bit wide absolute relocation, but the target can choose.
  789. It generally does map to one of the other relocation types. *)
  790. BFD_RELOC_CTOR,
  791. (* ARM 26 bit pc-relative branch. The lowest two bits must be zero and are
  792. not stored in the instruction. *)
  793. BFD_RELOC_ARM_PCREL_BRANCH,
  794. (* ARM 26 bit pc-relative branch. The lowest bit must be zero and is
  795. not stored in the instruction. The 2nd lowest bit comes from a 1 bit
  796. field in the instruction. *)
  797. BFD_RELOC_ARM_PCREL_BLX,
  798. (* Thumb 22 bit pc-relative branch. The lowest bit must be zero and is
  799. not stored in the instruction. The 2nd lowest bit comes from a 1 bit
  800. field in the instruction. *)
  801. BFD_RELOC_THUMB_PCREL_BLX,
  802. (* These relocs are only used within the ARM assembler. They are not
  803. (at present) written to any object files. *)
  804. BFD_RELOC_ARM_IMMEDIATE,
  805. BFD_RELOC_ARM_ADRL_IMMEDIATE,
  806. BFD_RELOC_ARM_OFFSET_IMM,
  807. BFD_RELOC_ARM_SHIFT_IMM,
  808. BFD_RELOC_ARM_SWI,
  809. BFD_RELOC_ARM_MULTI,
  810. BFD_RELOC_ARM_CP_OFF_IMM,
  811. BFD_RELOC_ARM_ADR_IMM,
  812. BFD_RELOC_ARM_LDR_IMM,
  813. BFD_RELOC_ARM_LITERAL,
  814. BFD_RELOC_ARM_IN_POOL,
  815. BFD_RELOC_ARM_OFFSET_IMM8,
  816. BFD_RELOC_ARM_HWLITERAL,
  817. BFD_RELOC_ARM_THUMB_ADD,
  818. BFD_RELOC_ARM_THUMB_IMM,
  819. BFD_RELOC_ARM_THUMB_SHIFT,
  820. BFD_RELOC_ARM_THUMB_OFFSET,
  821. BFD_RELOC_ARM_GOT12,
  822. BFD_RELOC_ARM_GOT32,
  823. BFD_RELOC_ARM_JUMP_SLOT,
  824. BFD_RELOC_ARM_COPY,
  825. BFD_RELOC_ARM_GLOB_DAT,
  826. BFD_RELOC_ARM_PLT32,
  827. BFD_RELOC_ARM_RELATIVE,
  828. BFD_RELOC_ARM_GOTOFF,
  829. BFD_RELOC_ARM_GOTPC,
  830. (* Hitachi SH relocs. Not all of these appear in object files. *)
  831. BFD_RELOC_SH_PCDISP8BY2,
  832. BFD_RELOC_SH_PCDISP12BY2,
  833. BFD_RELOC_SH_IMM4,
  834. BFD_RELOC_SH_IMM4BY2,
  835. BFD_RELOC_SH_IMM4BY4,
  836. BFD_RELOC_SH_IMM8,
  837. BFD_RELOC_SH_IMM8BY2,
  838. BFD_RELOC_SH_IMM8BY4,
  839. BFD_RELOC_SH_PCRELIMM8BY2,
  840. BFD_RELOC_SH_PCRELIMM8BY4,
  841. BFD_RELOC_SH_SWITCH16,
  842. BFD_RELOC_SH_SWITCH32,
  843. BFD_RELOC_SH_USES,
  844. BFD_RELOC_SH_COUNT,
  845. BFD_RELOC_SH_ALIGN,
  846. BFD_RELOC_SH_CODE,
  847. BFD_RELOC_SH_DATA,
  848. BFD_RELOC_SH_LABEL,
  849. BFD_RELOC_SH_LOOP_START,
  850. BFD_RELOC_SH_LOOP_END,
  851. BFD_RELOC_SH_COPY,
  852. BFD_RELOC_SH_GLOB_DAT,
  853. BFD_RELOC_SH_JMP_SLOT,
  854. BFD_RELOC_SH_RELATIVE,
  855. BFD_RELOC_SH_GOTPC,
  856. (* Thumb 23-, 12- and 9-bit pc-relative branches. The lowest bit must
  857. be zero and is not stored in the instruction. *)
  858. BFD_RELOC_THUMB_PCREL_BRANCH9,
  859. BFD_RELOC_THUMB_PCREL_BRANCH12,
  860. BFD_RELOC_THUMB_PCREL_BRANCH23,
  861. (* ARC Cores relocs.
  862. ARC 22 bit pc-relative branch. The lowest two bits must be zero and are
  863. not stored in the instruction. The high 20 bits are installed in bits 26
  864. through 7 of the instruction. *)
  865. BFD_RELOC_ARC_B22_PCREL,
  866. (* ARC 26 bit absolute branch. The lowest two bits must be zero and are not
  867. stored in the instruction. The high 24 bits are installed in bits 23
  868. through 0. *)
  869. BFD_RELOC_ARC_B26,
  870. (* Mitsubishi D10V relocs.
  871. This is a 10-bit reloc with the right 2 bits
  872. assumed to be 0. *)
  873. BFD_RELOC_D10V_10_PCREL_R,
  874. (* Mitsubishi D10V relocs.
  875. This is a 10-bit reloc with the right 2 bits
  876. assumed to be 0. This is the same as the previous reloc
  877. except it is in the left container, i.e.,
  878. shifted left 15 bits. *)
  879. BFD_RELOC_D10V_10_PCREL_L,
  880. (* This is an 18-bit reloc with the right 2 bits
  881. assumed to be 0. *)
  882. BFD_RELOC_D10V_18,
  883. (* This is an 18-bit reloc with the right 2 bits
  884. assumed to be 0. *)
  885. BFD_RELOC_D10V_18_PCREL,
  886. (* Mitsubishi D30V relocs.
  887. This is a 6-bit absolute reloc. *)
  888. BFD_RELOC_D30V_6,
  889. (* This is a 6-bit pc-relative reloc with
  890. the right 3 bits assumed to be 0. *)
  891. BFD_RELOC_D30V_9_PCREL,
  892. (* This is a 6-bit pc-relative reloc with
  893. the right 3 bits assumed to be 0. Same
  894. as the previous reloc but on the right side
  895. of the container. *)
  896. BFD_RELOC_D30V_9_PCREL_R,
  897. (* This is a 12-bit absolute reloc with the
  898. right 3 bitsassumed to be 0. *)
  899. BFD_RELOC_D30V_15,
  900. (* This is a 12-bit pc-relative reloc with
  901. the right 3 bits assumed to be 0. *)
  902. BFD_RELOC_D30V_15_PCREL,
  903. (* This is a 12-bit pc-relative reloc with
  904. the right 3 bits assumed to be 0. Same
  905. as the previous reloc but on the right side
  906. of the container. *)
  907. BFD_RELOC_D30V_15_PCREL_R,
  908. (* This is an 18-bit absolute reloc with
  909. the right 3 bits assumed to be 0. *)
  910. BFD_RELOC_D30V_21,
  911. (* This is an 18-bit pc-relative reloc with
  912. the right 3 bits assumed to be 0. *)
  913. BFD_RELOC_D30V_21_PCREL,
  914. (* This is an 18-bit pc-relative reloc with
  915. the right 3 bits assumed to be 0. Same
  916. as the previous reloc but on the right side
  917. of the container. *)
  918. BFD_RELOC_D30V_21_PCREL_R,
  919. (* This is a 32-bit absolute reloc. *)
  920. BFD_RELOC_D30V_32,
  921. (* This is a 32-bit pc-relative reloc. *)
  922. BFD_RELOC_D30V_32_PCREL,
  923. (* Mitsubishi M32R relocs.
  924. This is a 24 bit absolute address. *)
  925. BFD_RELOC_M32R_24,
  926. (* This is a 10-bit pc-relative reloc with the right 2 bits assumed to be 0. *)
  927. BFD_RELOC_M32R_10_PCREL,
  928. (* This is an 18-bit reloc with the right 2 bits assumed to be 0. *)
  929. BFD_RELOC_M32R_18_PCREL,
  930. (* This is a 26-bit reloc with the right 2 bits assumed to be 0. *)
  931. BFD_RELOC_M32R_26_PCREL,
  932. (* This is a 16-bit reloc containing the high 16 bits of an address
  933. used when the lower 16 bits are treated as unsigned. *)
  934. BFD_RELOC_M32R_HI16_ULO,
  935. (* This is a 16-bit reloc containing the high 16 bits of an address
  936. used when the lower 16 bits are treated as signed. *)
  937. BFD_RELOC_M32R_HI16_SLO,
  938. (* This is a 16-bit reloc containing the lower 16 bits of an address. *)
  939. BFD_RELOC_M32R_LO16,
  940. (* This is a 16-bit reloc containing the small data area offset for use in
  941. add3, load, and store instructions. *)
  942. BFD_RELOC_M32R_SDA16,
  943. (* This is a 9-bit reloc *)
  944. BFD_RELOC_V850_9_PCREL,
  945. (* This is a 22-bit reloc *)
  946. BFD_RELOC_V850_22_PCREL,
  947. (* This is a 16 bit offset from the SmallInt data area pointer. *)
  948. BFD_RELOC_V850_SDA_16_16_OFFSET,
  949. (* This is a 16 bit offset (of which only 15 bits are used) from the
  950. SmallInt data area pointer. *)
  951. BFD_RELOC_V850_SDA_15_16_OFFSET,
  952. (* This is a 16 bit offset from the zero data area pointer. *)
  953. BFD_RELOC_V850_ZDA_16_16_OFFSET,
  954. (* This is a 16 bit offset (of which only 15 bits are used) from the
  955. zero data area pointer. *)
  956. BFD_RELOC_V850_ZDA_15_16_OFFSET,
  957. (* This is an 8 bit offset (of which only 6 bits are used) from the
  958. tiny data area pointer. *)
  959. BFD_RELOC_V850_TDA_6_8_OFFSET,
  960. (* This is an 8bit offset (of which only 7 bits are used) from the tiny
  961. data area pointer. *)
  962. BFD_RELOC_V850_TDA_7_8_OFFSET,
  963. (* This is a 7 bit offset from the tiny data area pointer. *)
  964. BFD_RELOC_V850_TDA_7_7_OFFSET,
  965. (* This is a 16 bit offset from the tiny data area pointer. *)
  966. BFD_RELOC_V850_TDA_16_16_OFFSET,
  967. (* This is a 5 bit offset (of which only 4 bits are used) from the tiny
  968. data area pointer. *)
  969. BFD_RELOC_V850_TDA_4_5_OFFSET,
  970. (* This is a 4 bit offset from the tiny data area pointer. *)
  971. BFD_RELOC_V850_TDA_4_4_OFFSET,
  972. (* This is a 16 bit offset from the SmallInt data area pointer, with the
  973. bits placed non-contigously in the instruction. *)
  974. BFD_RELOC_V850_SDA_16_16_SPLIT_OFFSET,
  975. (* This is a 16 bit offset from the zero data area pointer, with the
  976. bits placed non-contigously in the instruction. *)
  977. BFD_RELOC_V850_ZDA_16_16_SPLIT_OFFSET,
  978. (* This is a 6 bit offset from the call table base pointer. *)
  979. BFD_RELOC_V850_CALLT_6_7_OFFSET,
  980. (* This is a 16 bit offset from the call table base pointer. *)
  981. BFD_RELOC_V850_CALLT_16_16_OFFSET,
  982. (* This is a 32bit pcrel reloc for the mn10300, offset by two bytes in the
  983. instruction. *)
  984. BFD_RELOC_MN10300_32_PCREL,
  985. (* This is a 16bit pcrel reloc for the mn10300, offset by two bytes in the
  986. instruction. *)
  987. BFD_RELOC_MN10300_16_PCREL,
  988. (* This is a 8bit DP reloc for the tms320c30, where the most
  989. significant 8 bits of a 24 bit word are placed into the least
  990. significant 8 bits of the opcode. *)
  991. BFD_RELOC_TIC30_LDP,
  992. (* This is a 7bit reloc for the tms320c54x, where the least
  993. significant 7 bits of a 16 bit word are placed into the least
  994. significant 7 bits of the opcode. *)
  995. BFD_RELOC_TIC54X_PARTLS7,
  996. (* This is a 9bit DP reloc for the tms320c54x, where the most
  997. significant 9 bits of a 16 bit word are placed into the least
  998. significant 9 bits of the opcode. *)
  999. BFD_RELOC_TIC54X_PARTMS9,
  1000. (* This is an extended address 23-bit reloc for the tms320c54x. *)
  1001. BFD_RELOC_TIC54X_23,
  1002. (* This is a 16-bit reloc for the tms320c54x, where the least
  1003. significant 16 bits of a 23-bit extended address are placed into
  1004. the opcode. *)
  1005. BFD_RELOC_TIC54X_16_OF_23,
  1006. (* This is a reloc for the tms320c54x, where the most
  1007. significant 7 bits of a 23-bit extended address are placed into
  1008. the opcode. *)
  1009. BFD_RELOC_TIC54X_MS7_OF_23,
  1010. (* This is a 48 bit reloc for the FR30 that stores 32 bits. *)
  1011. BFD_RELOC_FR30_48,
  1012. (* This is a 32 bit reloc for the FR30 that stores 20 bits split up into
  1013. two sections. *)
  1014. BFD_RELOC_FR30_20,
  1015. (* This is a 16 bit reloc for the FR30 that stores a 6 bit word offset in
  1016. 4 bits. *)
  1017. BFD_RELOC_FR30_6_IN_4,
  1018. (* This is a 16 bit reloc for the FR30 that stores an 8 bit byte offset
  1019. into 8 bits. *)
  1020. BFD_RELOC_FR30_8_IN_8,
  1021. (* This is a 16 bit reloc for the FR30 that stores a 9 bit SmallInt offset
  1022. into 8 bits. *)
  1023. BFD_RELOC_FR30_9_IN_8,
  1024. (* This is a 16 bit reloc for the FR30 that stores a 10 bit word offset
  1025. into 8 bits. *)
  1026. BFD_RELOC_FR30_10_IN_8,
  1027. (* This is a 16 bit reloc for the FR30 that stores a 9 bit pc relative
  1028. SmallInt offset into 8 bits. *)
  1029. BFD_RELOC_FR30_9_PCREL,
  1030. (* This is a 16 bit reloc for the FR30 that stores a 12 bit pc relative
  1031. SmallInt offset into 11 bits. *)
  1032. BFD_RELOC_FR30_12_PCREL,
  1033. (* Motorola Mcore relocations. *)
  1034. BFD_RELOC_MCORE_PCREL_IMM8BY4,
  1035. BFD_RELOC_MCORE_PCREL_IMM11BY2,
  1036. BFD_RELOC_MCORE_PCREL_IMM4BY2,
  1037. BFD_RELOC_MCORE_PCREL_32,
  1038. BFD_RELOC_MCORE_PCREL_JSR_IMM11BY2,
  1039. BFD_RELOC_MCORE_RVA,
  1040. (* This is a 16 bit reloc for the AVR that stores 8 bit pc relative
  1041. SmallInt offset into 7 bits. *)
  1042. BFD_RELOC_AVR_7_PCREL,
  1043. (* This is a 16 bit reloc for the AVR that stores 13 bit pc relative
  1044. SmallInt offset into 12 bits. *)
  1045. BFD_RELOC_AVR_13_PCREL,
  1046. (* This is a 16 bit reloc for the AVR that stores 17 bit value (usually
  1047. program memory address) into 16 bits. *)
  1048. BFD_RELOC_AVR_16_PM,
  1049. (* This is a 16 bit reloc for the AVR that stores 8 bit value (usually
  1050. data memory address) into 8 bit immediate value of LDI insn. *)
  1051. BFD_RELOC_AVR_LO8_LDI,
  1052. (* This is a 16 bit reloc for the AVR that stores 8 bit value (high 8 bit
  1053. of data memory address) into 8 bit immediate value of LDI insn. *)
  1054. BFD_RELOC_AVR_HI8_LDI,
  1055. (* This is a 16 bit reloc for the AVR that stores 8 bit value (most high 8 bit
  1056. of program memory address) into 8 bit immediate value of LDI insn. *)
  1057. BFD_RELOC_AVR_HH8_LDI,
  1058. (* This is a 16 bit reloc for the AVR that stores negated 8 bit value
  1059. (usually data memory address) into 8 bit immediate value of SUBI insn. *)
  1060. BFD_RELOC_AVR_LO8_LDI_NEG,
  1061. (* This is a 16 bit reloc for the AVR that stores negated 8 bit value
  1062. (high 8 bit of data memory address) into 8 bit immediate value of
  1063. SUBI insn. *)
  1064. BFD_RELOC_AVR_HI8_LDI_NEG,
  1065. (* This is a 16 bit reloc for the AVR that stores negated 8 bit value
  1066. (most high 8 bit of program memory address) into 8 bit immediate value
  1067. of LDI or SUBI insn. *)
  1068. BFD_RELOC_AVR_HH8_LDI_NEG,
  1069. (* This is a 16 bit reloc for the AVR that stores 8 bit value (usually
  1070. command address) into 8 bit immediate value of LDI insn. *)
  1071. BFD_RELOC_AVR_LO8_LDI_PM,
  1072. (* This is a 16 bit reloc for the AVR that stores 8 bit value (high 8 bit
  1073. of command address) into 8 bit immediate value of LDI insn. *)
  1074. BFD_RELOC_AVR_HI8_LDI_PM,
  1075. (* This is a 16 bit reloc for the AVR that stores 8 bit value (most high 8 bit
  1076. of command address) into 8 bit immediate value of LDI insn. *)
  1077. BFD_RELOC_AVR_HH8_LDI_PM,
  1078. (* This is a 16 bit reloc for the AVR that stores negated 8 bit value
  1079. (usually command address) into 8 bit immediate value of SUBI insn. *)
  1080. BFD_RELOC_AVR_LO8_LDI_PM_NEG,
  1081. (* This is a 16 bit reloc for the AVR that stores negated 8 bit value
  1082. (high 8 bit of 16 bit command address) into 8 bit immediate value
  1083. of SUBI insn. *)
  1084. BFD_RELOC_AVR_HI8_LDI_PM_NEG,
  1085. (* This is a 16 bit reloc for the AVR that stores negated 8 bit value
  1086. (high 6 bit of 22 bit command address) into 8 bit immediate
  1087. value of SUBI insn. *)
  1088. BFD_RELOC_AVR_HH8_LDI_PM_NEG,
  1089. (* This is a 32 bit reloc for the AVR that stores 23 bit value
  1090. into 22 bits. *)
  1091. BFD_RELOC_AVR_CALL,
  1092. (* These two relocations are used by the linker to determine which of
  1093. the entries in a C++ virtual function table are actually used. When
  1094. the --gc-sections option is given, the linker will zero out the entries
  1095. that are not used, so that the code for those functions need not be
  1096. included in the output.
  1097. VTABLE_INHERIT is a zero-space relocation used to describe to the
  1098. linker the inheritence tree of a C++ virtual function table. The
  1099. relocation's symbol should be the parent class' vtable, and the
  1100. relocation should be located at the child vtable.
  1101. VTABLE_ENTRY is a zero-space relocation that describes the use of a
  1102. virtual function table entry. The reloc's symbol should refer to the
  1103. table of the class mentioned in the code. Off of that base, an offset
  1104. describes the entry that is being used. For Rela hosts, this offset
  1105. is stored in the reloc's addend. For Rel hosts, we are forced to put
  1106. this offset in the reloc's section offset. *)
  1107. BFD_RELOC_VTABLE_INHERIT,
  1108. BFD_RELOC_VTABLE_ENTRY,
  1109. (* Intel IA64 Relocations. *)
  1110. BFD_RELOC_IA64_IMM14,
  1111. BFD_RELOC_IA64_IMM22,
  1112. BFD_RELOC_IA64_IMM64,
  1113. BFD_RELOC_IA64_DIR32MSB,
  1114. BFD_RELOC_IA64_DIR32LSB,
  1115. BFD_RELOC_IA64_DIR64MSB,
  1116. BFD_RELOC_IA64_DIR64LSB,
  1117. BFD_RELOC_IA64_GPREL22,
  1118. BFD_RELOC_IA64_GPREL64I,
  1119. BFD_RELOC_IA64_GPREL32MSB,
  1120. BFD_RELOC_IA64_GPREL32LSB,
  1121. BFD_RELOC_IA64_GPREL64MSB,
  1122. BFD_RELOC_IA64_GPREL64LSB,
  1123. BFD_RELOC_IA64_LTOFF22,
  1124. BFD_RELOC_IA64_LTOFF64I,
  1125. BFD_RELOC_IA64_PLTOFF22,
  1126. BFD_RELOC_IA64_PLTOFF64I,
  1127. BFD_RELOC_IA64_PLTOFF64MSB,
  1128. BFD_RELOC_IA64_PLTOFF64LSB,
  1129. BFD_RELOC_IA64_FPTR64I,
  1130. BFD_RELOC_IA64_FPTR32MSB,
  1131. BFD_RELOC_IA64_FPTR32LSB,
  1132. BFD_RELOC_IA64_FPTR64MSB,
  1133. BFD_RELOC_IA64_FPTR64LSB,
  1134. BFD_RELOC_IA64_PCREL21B,
  1135. BFD_RELOC_IA64_PCREL21BI,
  1136. BFD_RELOC_IA64_PCREL21M,
  1137. BFD_RELOC_IA64_PCREL21F,
  1138. BFD_RELOC_IA64_PCREL22,
  1139. BFD_RELOC_IA64_PCREL60B,
  1140. BFD_RELOC_IA64_PCREL64I,
  1141. BFD_RELOC_IA64_PCREL32MSB,
  1142. BFD_RELOC_IA64_PCREL32LSB,
  1143. BFD_RELOC_IA64_PCREL64MSB,
  1144. BFD_RELOC_IA64_PCREL64LSB,
  1145. BFD_RELOC_IA64_LTOFF_FPTR22,
  1146. BFD_RELOC_IA64_LTOFF_FPTR64I,
  1147. BFD_RELOC_IA64_LTOFF_FPTR64MSB,
  1148. BFD_RELOC_IA64_LTOFF_FPTR64LSB,
  1149. BFD_RELOC_IA64_SEGREL32MSB,
  1150. BFD_RELOC_IA64_SEGREL32LSB,
  1151. BFD_RELOC_IA64_SEGREL64MSB,
  1152. BFD_RELOC_IA64_SEGREL64LSB,
  1153. BFD_RELOC_IA64_SECREL32MSB,
  1154. BFD_RELOC_IA64_SECREL32LSB,
  1155. BFD_RELOC_IA64_SECREL64MSB,
  1156. BFD_RELOC_IA64_SECREL64LSB,
  1157. BFD_RELOC_IA64_REL32MSB,
  1158. BFD_RELOC_IA64_REL32LSB,
  1159. BFD_RELOC_IA64_REL64MSB,
  1160. BFD_RELOC_IA64_REL64LSB,
  1161. BFD_RELOC_IA64_LTV32MSB,
  1162. BFD_RELOC_IA64_LTV32LSB,
  1163. BFD_RELOC_IA64_LTV64MSB,
  1164. BFD_RELOC_IA64_LTV64LSB,
  1165. BFD_RELOC_IA64_IPLTMSB,
  1166. BFD_RELOC_IA64_IPLTLSB,
  1167. BFD_RELOC_IA64_COPY,
  1168. BFD_RELOC_IA64_TPREL22,
  1169. BFD_RELOC_IA64_TPREL64MSB,
  1170. BFD_RELOC_IA64_TPREL64LSB,
  1171. BFD_RELOC_IA64_LTOFF_TP22,
  1172. BFD_RELOC_IA64_LTOFF22X,
  1173. BFD_RELOC_IA64_LDXMOV,
  1174. (* Motorola 68HC11 reloc.
  1175. This is the 8 bits high part of an absolute address. *)
  1176. BFD_RELOC_M68HC11_HI8,
  1177. (* Motorola 68HC11 reloc.
  1178. This is the 8 bits low part of an absolute address. *)
  1179. BFD_RELOC_M68HC11_LO8,
  1180. (* Motorola 68HC11 reloc.
  1181. This is the 3 bits of a value. *)
  1182. BFD_RELOC_M68HC11_3B,
  1183. (* These relocs are only used within the CRIS assembler. They are not
  1184. (at present) written to any object files. *)
  1185. BFD_RELOC_CRIS_BDISP8,
  1186. BFD_RELOC_CRIS_UNSIGNED_5,
  1187. BFD_RELOC_CRIS_SIGNED_6,
  1188. BFD_RELOC_CRIS_UNSIGNED_6,
  1189. BFD_RELOC_CRIS_UNSIGNED_4,
  1190. (* Intel i860 Relocations. *)
  1191. BFD_RELOC_860_COPY,
  1192. BFD_RELOC_860_GLOB_DAT,
  1193. BFD_RELOC_860_JUMP_SLOT,
  1194. BFD_RELOC_860_RELATIVE,
  1195. BFD_RELOC_860_PC26,
  1196. BFD_RELOC_860_PLT26,
  1197. BFD_RELOC_860_PC16,
  1198. BFD_RELOC_860_LOW0,
  1199. BFD_RELOC_860_SPLIT0,
  1200. BFD_RELOC_860_LOW1,
  1201. BFD_RELOC_860_SPLIT1,
  1202. BFD_RELOC_860_LOW2,
  1203. BFD_RELOC_860_SPLIT2,
  1204. BFD_RELOC_860_LOW3,
  1205. BFD_RELOC_860_LOGOT0,
  1206. BFD_RELOC_860_SPGOT0,
  1207. BFD_RELOC_860_LOGOT1,
  1208. BFD_RELOC_860_SPGOT1,
  1209. BFD_RELOC_860_LOGOTOFF0,
  1210. BFD_RELOC_860_SPGOTOFF0,
  1211. BFD_RELOC_860_LOGOTOFF1,
  1212. BFD_RELOC_860_SPGOTOFF1,
  1213. BFD_RELOC_860_LOGOTOFF2,
  1214. BFD_RELOC_860_LOGOTOFF3,
  1215. BFD_RELOC_860_LOPC,
  1216. BFD_RELOC_860_HIGHADJ,
  1217. BFD_RELOC_860_HAGOT,
  1218. BFD_RELOC_860_HAGOTOFF,
  1219. BFD_RELOC_860_HAPC,
  1220. BFD_RELOC_860_HIGH,
  1221. BFD_RELOC_860_HIGOT,
  1222. BFD_RELOC_860_HIGOTOFF,
  1223. BFD_RELOC_UNUSED
  1224. ); { bfd_reloc_code_real }
  1225. bfd_architecture = (
  1226. bfd_arch_unknown, (* File arch not known *)
  1227. bfd_arch_obscure, (* Arch known, not one of these *)
  1228. bfd_arch_m68k, (* Motorola 68xxx *)
  1229. bfd_arch_vax, (* DEC Vax *)
  1230. bfd_arch_i960, (* Intel 960 *)
  1231. (* The order of the following is important.
  1232. lower number indicates a machine type that
  1233. only accepts a subset of the instructions
  1234. available to machines with higher numbers.
  1235. The exception is the "ca", which is
  1236. incompatible with all other machines except
  1237. "core". *)
  1238. bfd_arch_a29k, (* AMD 29000 *)
  1239. bfd_arch_sparc, (* SPARC *)
  1240. (* The difference between v8plus and v9 is that v9 is a true 64 bit env. *)
  1241. (* Nonzero if MACH has the v9 instruction set. *)
  1242. bfd_arch_mips, (* MIPS Rxxxx *)
  1243. bfd_arch_i386, (* Intel 386 *)
  1244. bfd_arch_we32k, (* AT&T WE32xxx *)
  1245. bfd_arch_tahoe, (* CCI/Harris Tahoe *)
  1246. bfd_arch_i860, (* Intel 860 *)
  1247. bfd_arch_i370, (* IBM 360/370 Mainframes *)
  1248. bfd_arch_romp, (* IBM ROMP PC/RT *)
  1249. bfd_arch_alliant, (* Alliant *)
  1250. bfd_arch_convex, (* Convex *)
  1251. bfd_arch_m88k, (* Motorola 88xxx *)
  1252. bfd_arch_pyramid, (* Pyramid Technology *)
  1253. bfd_arch_h8300, (* Hitachi H8/300 *)
  1254. bfd_arch_powerpc, (* PowerPC *)
  1255. bfd_arch_rs6000, (* IBM RS/6000 *)
  1256. bfd_arch_hppa, (* HP PA RISC *)
  1257. bfd_arch_d10v, (* Mitsubishi D10V *)
  1258. bfd_arch_d30v, (* Mitsubishi D30V *)
  1259. bfd_arch_m68hc11, (* Motorola 68HC11 *)
  1260. bfd_arch_m68hc12, (* Motorola 68HC12 *)
  1261. bfd_arch_z8k, (* Zilog Z8000 *)
  1262. bfd_arch_h8500, (* Hitachi H8/500 *)
  1263. bfd_arch_sh, (* Hitachi SH *)
  1264. bfd_arch_alpha, (* Dec Alpha *)
  1265. bfd_arch_arm, (* Advanced Risc Machines ARM *)
  1266. bfd_arch_ns32k, (* National Semiconductors ns32000 *)
  1267. bfd_arch_w65, (* WDC 65816 *)
  1268. bfd_arch_tic30, (* Texas Instruments TMS320C30 *)
  1269. bfd_arch_tic54x, (* Texas Instruments TMS320C54X *)
  1270. bfd_arch_tic80, (* TI TMS320c80 (MVP) *)
  1271. bfd_arch_v850, (* NEC V850 *)
  1272. bfd_arch_arc, (* ARC Cores *)
  1273. bfd_arch_m32r, (* Mitsubishi M32R/D *)
  1274. bfd_arch_mn10200, (* Matsushita MN10200 *)
  1275. bfd_arch_mn10300, (* Matsushita MN10300 *)
  1276. bfd_arch_fr30,
  1277. bfd_arch_mcore,
  1278. bfd_arch_ia64, (* HP/Intel ia64 *)
  1279. bfd_arch_pj,
  1280. bfd_arch_avr, (* Atmel AVR microcontrollers *)
  1281. bfd_arch_cris, (* Axis CRIS *)
  1282. bfd_arch_last
  1283. ); { bfd_architecture }
  1284. check_format_proc = function (a:PBFD):pbfd_target;cdecl;
  1285. set_format_proc = function (a:PBFD):bfd_boolean;cdecl;
  1286. write_contents_proc = function (a:PBFD):bfd_boolean;cdecl;
  1287. bfd_target = record
  1288. name: pchar;
  1289. flavour: bfd_flavour;
  1290. byteorder: bfd_endian;
  1291. header_byteorder: bfd_endian;
  1292. object_flags: flagword;
  1293. section_flags: flagword;
  1294. symbol_leading_char: ShortInt;
  1295. ar_pad_char: ShortInt;
  1296. ar_max_namelen: Word;
  1297. bfd_getx64: function (const Pbfd_byte): bfd_vma; cdecl;
  1298. bfd_getx_signed_64: function (const Pbfd_byte):bfd_signed_vma; cdecl;
  1299. bfd_putx64: procedure(a: bfd_vma; b: Pbfd_byte); cdecl;
  1300. bfd_getx32: function (const Pbfd_byte):bfd_vma; cdecl;
  1301. bfd_getx_signed_32: function (const Pbfd_byte):bfd_signed_vma; cdecl;
  1302. bfd_putx32: procedure(a: bfd_vma; b: Pbfd_byte); cdecl;
  1303. bfd_getx16: function (const Pbfd_byte):bfd_vma; cdecl;
  1304. bfd_getx_signed_16: function (const Pbfd_byte):bfd_signed_vma; cdecl;
  1305. bfd_putx16: procedure(a: bfd_vma; b: Pbfd_byte); cdecl;
  1306. bfd_h_getx64: function (const Pbfd_byte):bfd_vma; cdecl;
  1307. bfd_h_getx_signed_64: function (const Pbfd_byte):bfd_signed_vma; cdecl;
  1308. bfd_h_putx64: procedure(a: bfd_vma; b: Pbfd_byte); cdecl;
  1309. bfd_h_getx32: function (const Pbfd_byte):bfd_vma; cdecl;
  1310. bfd_h_getx_signed_32: function (const Pbfd_byte):bfd_signed_vma; cdecl;
  1311. bfd_h_putx32: procedure(a: bfd_vma; b: Pbfd_byte); cdecl;
  1312. bfd_h_getx16: function (const Pbfd_byte):bfd_vma; cdecl;
  1313. bfd_h_getx_signed_16: function (const Pbfd_byte):bfd_signed_vma; cdecl;
  1314. bfd_h_putx16: procedure(a: bfd_vma; b: Pbfd_byte); cdecl;
  1315. _bfd_check_format: array [bfd_format] of check_format_proc;
  1316. _bfd_set_format: array [bfd_format] of set_format_proc;
  1317. _bfd_write_contents: array [bfd_format] of write_contents_proc;
  1318. (* Generic entry points. *)
  1319. (* Called when the BFD is being closed to do any necessary cleanup. *)
  1320. _close_and_cleanup: function(a: PBFD ):bfd_boolean;cdecl;
  1321. (* Ask the BFD to free all cached information. *)
  1322. _bfd_free_cached_info: function(a: PBFD ):bfd_boolean;cdecl;
  1323. (* Called when a new section is created. *)
  1324. _new_section_hook: function(a: PBFD; b: PSec):bfd_boolean;cdecl;
  1325. (* Read the contents of a section. *)
  1326. _bfd_get_section_contents: function(a: PBFD; b: PSec; c: pointer; d: file_ptr; e: bfd_size_type):bfd_boolean;cdecl;
  1327. _bfd_get_section_contents_in_window: function(a: PBFD; b: PSec; c: Pbfd_window; d:file_ptr; e: bfd_size_type):bfd_boolean;cdecl;
  1328. (* Entry points to copy private data. *)
  1329. (* Called to copy BFD general private data from one object file
  1330. to another. *)
  1331. _bfd_copy_private_bfd_data: function(a: PBFD; b: PBFD ):bfd_boolean;cdecl;
  1332. (* Called to merge BFD general private data from one object file
  1333. to a common output file when linking. *)
  1334. _bfd_merge_private_bfd_data: function(a: PBFD; b: PBFD ):bfd_boolean;cdecl;
  1335. (* Called to copy BFD private section data from one object file
  1336. to another. *)
  1337. _bfd_copy_private_section_data: function(a: PBFD; b:PSec; c: PBFD; d: PSec):bfd_boolean;cdecl;
  1338. (* Called to copy BFD private symbol data from one symbol
  1339. to another. *)
  1340. _bfd_copy_private_symbol_data: function(a: PBFD; b: Pasymbol; c: PBFD; d: Pasymbol):bfd_boolean;cdecl;
  1341. (* Called to set private backend flags *)
  1342. _bfd_set_private_flags: function(a: PBFD; b:flagword):bfd_boolean; cdecl;
  1343. (* Called to print private BFD data *)
  1344. _bfd_print_private_bfd_data: function(a: PBFD; b: pointer):bfd_boolean; cdecl;
  1345. (* Core file entry points. *)
  1346. (* Archive entry points. *)
  1347. _bfd_slurp_armap: function(a: PBFD):bfd_boolean;cdecl;
  1348. _bfd_slurp_extended_name_table: function(a: PBFD ):bfd_boolean;cdecl;
  1349. _bfd_construct_extended_name_table: function(a: PBFD; b: Ppchar; c: Pbfd_size_type; d: Ppchar):bfd_boolean;cdecl;
  1350. _bfd_truncate_arname: procedure (a: PBFD; b: pchar; c: pchar);cdecl;
  1351. write_armap: function(arch: PBFD; elength: LongWord; map: Porl; orl_count: LongWord; stridx: integer):bfd_boolean;cdecl;
  1352. _bfd_read_ar_hdr_fn: function(a: PBFD ):pointer;cdecl;
  1353. openr_next_archived_file: function(arch: PBFD; prev: PBFD):PBFD;cdecl;
  1354. _bfd_get_elt_at_index: function(a: PBFD; b: symindex):PBFD;cdecl;
  1355. _bfd_stat_arch_elt: function(a: PBFD; b: Pstat ):integer;cdecl;
  1356. _bfd_update_armap_timestamp: function(a: PBFD ):bfd_boolean;cdecl;
  1357. (* Entry points used for symbols. *)
  1358. _bfd_get_symtab_upper_bound: function(a: PBFD ):LongInt;cdecl;
  1359. _bfd_canonicalize_symtab: function(a: PBFD; b: PPsymbol_cache_entry):LongInt;cdecl;
  1360. _bfd_make_empty_symbol: function(a: PBFD ): PPsymbol_cache_entry;cdecl;
  1361. _bfd_print_symbol: procedure(a: PBFD; b: pointer; c: Psymbol_cache_entry; d: bfd_print_symbol);cdecl;
  1362. _bfd_get_symbol_info: procedure (a: PBFD; b: Psymbol_cache_entry; c:Psymbol_info);cdecl;
  1363. _bfd_is_local_label_name: function(a: PBFD; b: pchar):bfd_boolean;cdecl;
  1364. _get_lineno: function( a: PBFD; b: Psymbol_cache_entry):Palent;cdecl;
  1365. _bfd_find_nearest_line: function(abfd: PBFD; section: Psec; symbols: PPsymbol_cache_entry; offset: bfd_vma; fil: pchar; func: Ppchar; lin: PLongWord):bfd_boolean;cdecl;
  1366. (* Back-door to allow format-aware applications to create debug symbols
  1367. while using BFD for everything else. Currently used by the assembler
  1368. when creating COFF files. *)
  1369. _bfd_make_debug_symbol: function( abfd: PBFD ; ptr: pointer; size: LongWord ):Pasymbol;cdecl;
  1370. _read_minisymbols: function(a: PBFD; b: bfd_boolean; c: PPointer; d: PLongWord):LongInt;cdecl;
  1371. _minisymbol_to_symbol: function(a: PBFD; b:bfd_boolean; c: pointer; d: Pasymbol):Pasymbol;cdecl;
  1372. (* Routines for relocs. *)
  1373. _get_reloc_upper_bound: function(a: PBFD; b: PSec):LongInt;cdecl;
  1374. _bfd_canonicalize_reloc: function(a: PBFD; b: PSec;c: PParelent; d: PPsymbol_cache_entry ):LongInt;cdecl;
  1375. (* See documentation on reloc types. *)
  1376. reloc_type_lookup: function(abfd: PBFD ; code: bfd_reloc_code_real): PPreloc_howto;cdecl;
  1377. (* Routines used when writing an object file. *)
  1378. _bfd_set_arch_mach: function( a: PBFD; b:bfd_architecture; c:LongWord): bfd_boolean;cdecl;
  1379. _bfd_set_section_contents: function(a: PBFD; b: PSec; c: pointer; d: file_ptr; e: bfd_size_type):bfd_boolean;cdecl;
  1380. (* Routines used by the linker. *)
  1381. _bfd_sizeof_headers: function(a: PBFD ; b: bfd_boolean):integer;cdecl;
  1382. _bfd_get_relocated_section_contents: function(a: PBFD ; b: Pbfd_link_info; c: Pbfd_link_order; data: Pbfd_byte; relocateable: bfd_boolean; ce: PPsymbol_cache_entry):Pbfd_byte;cdecl;
  1383. _bfd_relax_section: function(a: PBFD ; b: Psec; c: Pbfd_link_info; again: Pboolean):bfd_boolean;cdecl;
  1384. (* Create a hash table for the linker. Different backends store
  1385. different information in this table. *)
  1386. _bfd_link_hash_table_create: function( a: PBFD ):Pbfd_link_hash_table;cdecl;
  1387. (* Add symbols from this object file into the hash table. *)
  1388. _bfd_link_add_symbols: function(a: PBFD ; b: Pbfd_link_info):bfd_boolean;cdecl;
  1389. (* Do a link based on the link_order structures attached to each
  1390. section of the BFD. *)
  1391. _bfd_final_link: function(a: PBFD; b: Pbfd_link_info):bfd_boolean;cdecl;
  1392. (* Should this section be split up into smaller pieces during linking. *)
  1393. _bfd_link_split_section: function(a: PBFD; b: Psec):bfd_boolean;cdecl;
  1394. (* Remove sections that are not referenced from the output. *)
  1395. _bfd_gc_sections: function(a: PBFD ; b: Pbfd_link_info):bfd_boolean;cdecl;
  1396. (* Routines to handle dynamic symbols and relocs. *)
  1397. (* Get the amount of memory required to hold the dynamic symbols. *)
  1398. _bfd_get_dynamic_symtab_upper_bound: function(a: PBFD ):LongInt;cdecl;
  1399. (* Read in the dynamic symbols. *)
  1400. _bfd_canonicalize_dynamic_symtab: function(a: PBFD ; b: PPsymbol_cache_entry):LongInt;cdecl;
  1401. (* Get the amount of memory required to hold the dynamic relocs. *)
  1402. _bfd_get_dynamic_reloc_upper_bound: function(a: PBFD ):LongInt;cdecl;
  1403. (* Read in the dynamic relocs. *)
  1404. _bfd_canonicalize_dynamic_reloc: function(a: PBFD ; b: PParelent; c: PPsymbol_cache_entry):LongInt;cdecl;
  1405. (* Opposite endian version of this target. *)
  1406. alternative_target: Pbfd_target;
  1407. backend_data: pointer;
  1408. end; { bfd_target }
  1409. complain_overflow = (
  1410. (* Do not complain on overflow. *)
  1411. complain_overflow_dont,
  1412. (* Complain if the bitfield overflows, whether it is considered
  1413. as signed or unsigned. *)
  1414. complain_overflow_bitfield,
  1415. (* Complain if the value overflows when considered as signed
  1416. number. *)
  1417. complain_overflow_signed,
  1418. (* Complain if the value overflows when considered as an
  1419. unsigned number. *)
  1420. complain_overflow_unsigned
  1421. ); { complain_overflow }
  1422. bfd_reloc_status = (
  1423. (* No errors detected *)
  1424. bfd_reloc_ok,
  1425. (* The relocation was performed, but there was an overflow. *)
  1426. bfd_reloc_overflow,
  1427. (* The address to relocate was not within the section supplied. *)
  1428. bfd_reloc_outofrange,
  1429. (* Used by special functions *)
  1430. bfd_reloc_continue,
  1431. (* Unsupported relocation size requested. *)
  1432. bfd_reloc_notsupported,
  1433. (* Unused *)
  1434. bfd_reloc_other,
  1435. (* The symbol to relocate against was undefined. *)
  1436. bfd_reloc_undefined,
  1437. (* The relocation was performed, but may not be ok - presently
  1438. generated only when linking i960 coff files with i960 b.out
  1439. symbols. If this type is returned, the error_message argument
  1440. to bfd_perform_relocation will be set. *)
  1441. bfd_reloc_dangerous
  1442. ); { bfd_reloc_status }
  1443. reloc_howto = record
  1444. (* The type field has mainly a documentary use - the back end can
  1445. do what it wants with it, though normally the back end's
  1446. external idea of what a reloc number is stored
  1447. in this field. For example, a PC relative word relocation
  1448. in a coff environment has the type 023 - because that's
  1449. what the outside world calls a R_PCRWORD reloc. *)
  1450. typ: LongWord;
  1451. (* The value the final relocation is shifted right by. This drops
  1452. unwanted data from the relocation. *)
  1453. rightshift: LongWord;
  1454. (* The size of the item to be relocated. This is *not* a
  1455. power-of-two measure. To get the number of bytes operated
  1456. on by a type of relocation, use bfd_get_reloc_size. *)
  1457. size: integer;
  1458. (* The number of bits in the item to be relocated. This is used
  1459. when doing overflow checking. *)
  1460. bitsize: LongWord;
  1461. (* Notes that the relocation is relative to the location in the
  1462. data section of the addend. The relocation function will
  1463. subtract from the relocation value the address of the location
  1464. being relocated. *)
  1465. pc_relative: bfd_boolean;
  1466. (* The bit position of the reloc value in the destination.
  1467. The relocated value is left shifted by this amount. *)
  1468. bitpos: LongWord;
  1469. (* What type of overflow error should be checked for when
  1470. relocating. *)
  1471. complain_on_overflow: complain_overflow;
  1472. (* If this field is non null, then the supplied function is
  1473. called rather than the normal function. This allows really
  1474. strange relocation methods to be accomodated (e.g., i960 callj
  1475. instructions). *)
  1476. special_function: function( abfd: PBFD;
  1477. reloc_entry: Parelent;
  1478. symbol: Psymbol_cache_entry;
  1479. data: pointer;
  1480. input_section: Pasection;
  1481. output_bfd: PBFD;
  1482. error_message: ppchar): bfd_reloc_status;cdecl;
  1483. (* The textual name of the relocation type. *)
  1484. name: pchar;
  1485. (* Some formats record a relocation addend in the section contents
  1486. rather than with the relocation. For ELF formats this is the
  1487. distinction between USE_REL and USE_RELA (though the code checks
  1488. for USE_REL == 1/0). The value of this field is TRUE if the
  1489. addend is recorded with the section contents; when performing a
  1490. partial link (ld -r) the section contents (the data) will be
  1491. modified. The value of this field is FALSE if addends are
  1492. recorded with the relocation (in arelent.addend); when performing
  1493. a partial link the relocation will be modified.
  1494. All relocations for all ELF USE_RELA targets should set this field
  1495. to FALSE (values of TRUE should be looked on with suspicion).
  1496. However, the converse is not true: not all relocations of all ELF
  1497. USE_REL targets set this field to TRUE. Why this is so is peculiar
  1498. to each particular target. For relocs that aren't used in partial
  1499. links (e.g. GOT stuff) it doesn't matter what this is set to. *)
  1500. partial_inplace: bfd_boolean;
  1501. (* The src_mask selects which parts of the read in data
  1502. are to be used in the relocation sum. E.g., if this was an 8 bit
  1503. byte of data which we read and relocated, this would be
  1504. $000000ff. When we have relocs which have an addend, such as
  1505. sun4 extended relocs, the value in the offset part of a
  1506. relocating field is garbage so we never use it. In this case
  1507. the mask would be $00000000. *)
  1508. src_mask: bfd_vma;
  1509. (* The dst_mask selects which parts of the instruction are replaced
  1510. into the instruction. In most cases src_mask == dst_mask,
  1511. except in the above special case, where dst_mask would be
  1512. $000000ff, and src_mask would be $00000000. *)
  1513. dst_mask: bfd_vma;
  1514. (* When some formats create PC relative instructions, they leave
  1515. the value of the pc of the place being relocated in the offset
  1516. slot of the instruction, so that a PC relative relocation can
  1517. be made just by adding in an ordinary offset (e.g., sun3 a.out).
  1518. Some formats leave the displacement part of an instruction
  1519. empty (e.g., m88k bcs); this flag signals the fact.*)
  1520. pcrel_offset: bfd_boolean;
  1521. end; { reloc_howto }
  1522. bfd_arch_info = record
  1523. bits_per_word: integer;
  1524. bits_per_address: integer;
  1525. bits_per_byte: integer;
  1526. arch: bfd_architecture;
  1527. mach: LongWord;
  1528. arch_name: pchar;
  1529. printable_name: pchar;
  1530. section_align_power: LongWord;
  1531. (* True if this is the default machine for the architecture. *)
  1532. the_default: bfd_boolean;
  1533. compatible: function(a: Pbfd_arch_info; b: Pbfd_arch_info):Pbfd_arch_info;cdecl;
  1534. scan: function(a: Pbfd_arch_info; b: pchar): bfd_boolean;cdecl;
  1535. next: Pbfd_arch_info;
  1536. end; { bfd_arch_info }
  1537. reloc_cache_entry = record
  1538. (* A pointer into the canonical table of pointers *)
  1539. sym_ptr_ptr: Psymbol_cache_entry;
  1540. (* offset in section *)
  1541. address: bfd_size_type;
  1542. (* addend for relocation value *)
  1543. addend: bfd_vma;
  1544. (* Pointer to how to perform the required relocation *)
  1545. howto: reloc_howto;
  1546. end; { reloc_cache_entry }
  1547. arelent = reloc_cache_entry;
  1548. (* This structure is used for a comdat section, as in PE. A comdat
  1549. section is associated with a particular symbol. When the linker
  1550. sees a comdat section, it keeps only one of the sections with a
  1551. given name and associated with a given symbol. *)
  1552. bfd_comdat_info = record
  1553. (* The name of the symbol associated with a comdat section. *)
  1554. name: pchar;
  1555. (* The local symbol table index of the symbol associated with a
  1556. comdat section. This is only meaningful to the object file format
  1557. specific code; it is not an index into the list returned by
  1558. bfd_canonicalize_symtab. *)
  1559. symbol: LongInt;
  1560. end; { bfd_comdat_info }
  1561. relent_chain = record
  1562. relent: arelent;
  1563. next: Prelent_chain;
  1564. end;
  1565. arelent_chain = relent_chain;
  1566. bfd_error = (
  1567. bfd_error_no_error {$ifndef Ver1_0} = 0 {$endif},
  1568. bfd_error_system_call,
  1569. bfd_error_invalid_target,
  1570. bfd_error_wrong_format,
  1571. bfd_error_invalid_operation,
  1572. bfd_error_no_memory,
  1573. bfd_error_no_symbols,
  1574. bfd_error_no_armap,
  1575. bfd_error_no_more_archived_files,
  1576. bfd_error_malformed_archive,
  1577. bfd_error_file_not_recognized,
  1578. bfd_error_file_ambiguously_recognized,
  1579. bfd_error_no_contents,
  1580. bfd_error_nonrepresentable_section,
  1581. bfd_error_no_debug_section,
  1582. bfd_error_bad_value,
  1583. bfd_error_file_truncated,
  1584. bfd_error_file_too_big,
  1585. bfd_error_invalid_error_code
  1586. ); { bfd_error }
  1587. const
  1588. BFD_NO_MORE_SYMBOLS: symindex = not symindex(0);
  1589. bfd_mach_m68000 = 1;
  1590. bfd_mach_m68008 = 2;
  1591. bfd_mach_m68010 = 3;
  1592. bfd_mach_m68020 = 4;
  1593. bfd_mach_m68030 = 5;
  1594. bfd_mach_m68040 = 6;
  1595. bfd_mach_m68060 = 7;
  1596. bfd_mach_cpu32 = 8;
  1597. bfd_mach_i960_core = 1;
  1598. bfd_mach_i960_ka_sa = 2;
  1599. bfd_mach_i960_kb_sb = 3;
  1600. bfd_mach_i960_mc = 4;
  1601. bfd_mach_i960_xa = 5;
  1602. bfd_mach_i960_ca = 6;
  1603. bfd_mach_i960_jx = 7;
  1604. bfd_mach_i960_hx = 8;
  1605. bfd_mach_sparc = 1;
  1606. bfd_mach_sparc_sparclet = 2;
  1607. bfd_mach_sparc_sparclite = 3;
  1608. bfd_mach_sparc_v8plus = 4;
  1609. bfd_mach_sparc_v8plusa = 5 (* with ultrasparc add'ns *);
  1610. bfd_mach_sparc_sparclite_le = 6;
  1611. bfd_mach_sparc_v9 = 7;
  1612. bfd_mach_sparc_v9a = 8 (* with ultrasparc add'ns *);
  1613. bfd_mach_sparc_v8plusb = 9 (* with cheetah add'ns *);
  1614. bfd_mach_sparc_v9b = 10 (* with cheetah add'ns *);
  1615. bfd_mach_mips3000 = 3000;
  1616. bfd_mach_mips3900 = 3900;
  1617. bfd_mach_mips4000 = 4000;
  1618. bfd_mach_mips4010 = 4010;
  1619. bfd_mach_mips4100 = 4100;
  1620. bfd_mach_mips4111 = 4111;
  1621. bfd_mach_mips4300 = 4300;
  1622. bfd_mach_mips4400 = 4400;
  1623. bfd_mach_mips4600 = 4600;
  1624. bfd_mach_mips4650 = 4650;
  1625. bfd_mach_mips5000 = 5000;
  1626. bfd_mach_mips6000 = 6000;
  1627. bfd_mach_mips8000 = 8000;
  1628. bfd_mach_mips10000 = 10000;
  1629. bfd_mach_mips16 = 16;
  1630. bfd_mach_mips32 = 32;
  1631. bfd_mach_mips32_4k = 3204113 (* 32, 04, octal 'K' *);
  1632. bfd_mach_mips5 = 5;
  1633. bfd_mach_mips64 = 64;
  1634. bfd_mach_mips_sb1 = 12310201 (* octal 'SB', 01 *);
  1635. bfd_mach_i386_i386 = 0;
  1636. bfd_mach_i386_i8086 = 1;
  1637. bfd_mach_i386_i386_intel_syntax = 2;
  1638. bfd_mach_x86_64 = 3;
  1639. bfd_mach_x86_64_intel_syntax = 4;
  1640. bfd_mach_h8300 = 1;
  1641. bfd_mach_h8300h = 2;
  1642. bfd_mach_h8300s = 3;
  1643. bfd_mach_ppc = 0;
  1644. bfd_mach_ppc_403 = 403;
  1645. bfd_mach_ppc_403gc = 4030;
  1646. bfd_mach_ppc_505 = 505;
  1647. bfd_mach_ppc_601 = 601;
  1648. bfd_mach_ppc_602 = 602;
  1649. bfd_mach_ppc_603 = 603;
  1650. bfd_mach_ppc_ec603e = 6031;
  1651. bfd_mach_ppc_604 = 604;
  1652. bfd_mach_ppc_620 = 620;
  1653. bfd_mach_ppc_630 = 630;
  1654. bfd_mach_ppc_750 = 750;
  1655. bfd_mach_ppc_860 = 860;
  1656. bfd_mach_ppc_a35 = 35;
  1657. bfd_mach_ppc_rs64ii = 642;
  1658. bfd_mach_ppc_rs64iii = 643;
  1659. bfd_mach_ppc_7400 = 7400;
  1660. bfd_mach_rs6k = 0;
  1661. bfd_mach_rs6k_rs1 = 6001;
  1662. bfd_mach_rs6k_rsc = 6003;
  1663. bfd_mach_rs6k_rs2 = 6002;
  1664. bfd_mach_d10v = 0;
  1665. bfd_mach_d10v_ts2 = 2;
  1666. bfd_mach_d10v_ts3 = 3;
  1667. bfd_mach_z8001 = 1;
  1668. bfd_mach_z8002 = 2;
  1669. bfd_mach_sh = 0;
  1670. bfd_mach_sh2 = $20;
  1671. bfd_mach_sh_dsp = $2d;
  1672. bfd_mach_sh3 = $30;
  1673. bfd_mach_sh3_dsp = $3d;
  1674. bfd_mach_sh3e = $3e;
  1675. bfd_mach_sh4 = $40;
  1676. bfd_mach_alpha_ev4 = $10;
  1677. bfd_mach_alpha_ev5 = $20;
  1678. bfd_mach_alpha_ev6 = $30;
  1679. bfd_mach_arm_2 = 1;
  1680. bfd_mach_arm_2a = 2;
  1681. bfd_mach_arm_3 = 3;
  1682. bfd_mach_arm_3M = 4;
  1683. bfd_mach_arm_4 = 5;
  1684. bfd_mach_arm_4T = 6;
  1685. bfd_mach_arm_5 = 7;
  1686. bfd_mach_arm_5T = 8;
  1687. bfd_mach_arm_5TE = 9;
  1688. bfd_mach_arm_XScale = 10;
  1689. bfd_mach_v850 = 0;
  1690. bfd_mach_v850e = ord('E');
  1691. bfd_mach_v850ea = ord('A');
  1692. bfd_mach_arc_5 = 0;
  1693. bfd_mach_arc_6 = 1;
  1694. bfd_mach_arc_7 = 2;
  1695. bfd_mach_arc_8 = 3;
  1696. bfd_mach_m32r = 0 (* backwards compatibility *);
  1697. bfd_mach_m32rx = ord('x');
  1698. bfd_mach_mn10300 = 300;
  1699. bfd_mach_am33 = 330;
  1700. bfd_mach_fr30 = $46523330;
  1701. bfd_mach_ia64_elf64 = 0;
  1702. bfd_mach_ia64_elf32 = 1;
  1703. bfd_mach_avr1 = 1;
  1704. bfd_mach_avr2 = 2;
  1705. bfd_mach_avr3 = 3;
  1706. bfd_mach_avr4 = 4;
  1707. bfd_mach_avr5 = 5;
  1708. BFD_RELOC_SPARC_64 = BFD_RELOC_64;
  1709. BFD_RELOC_SPARC_DISP64 = BFD_RELOC_64_PCREL;
  1710. BFD_RELOC_MIPS_GPREL = BFD_RELOC_GPREL16;
  1711. BFD_RELOC_MIPS_GPREL32 = BFD_RELOC_GPREL32;
  1712. SEC_NO_FLAGS = $000;
  1713. (* Tells the OS to allocate space for this section when loading.
  1714. This is clear for a section containing debug information only. *)
  1715. SEC_ALLOC = $001;
  1716. (* Tells the OS to load the section from the file when loading.
  1717. This is clear for a .bss section. *)
  1718. SEC_LOAD = $002;
  1719. (* The section contains data still to be relocated, so there is
  1720. some relocation information too. *)
  1721. SEC_RELOC = $004;
  1722. { (* Obsolete ? *)
  1723. SEC_BALIGN = $008;
  1724. }
  1725. (* A signal to the OS that the section contains read only data. *)
  1726. SEC_READONLY = $010;
  1727. (* The section contains code only. *)
  1728. SEC_CODE = $020;
  1729. (* The section contains data only. *)
  1730. SEC_DATA = $040;
  1731. (* The section will reside in ROM. *)
  1732. SEC_ROM = $080;
  1733. (* The section contains constructor information. This section
  1734. type is used by the linker to create lists of constructors and
  1735. destructors used by <<g++>>. When a back end sees a symbol
  1736. which should be used in a constructor list, it creates a new
  1737. section for the type of name (e.g., <<__CTOR_LIST__>>), attaches
  1738. the symbol to it, and builds a relocation. To build the lists
  1739. of constructors, all the linker has to do is catenate all the
  1740. sections called <<__CTOR_LIST__>> and relocate the data
  1741. contained within - exactly the operations it would peform on
  1742. standard data. *)
  1743. SEC_CONSTRUCTOR = $100;
  1744. (* The section is a constructor, and should be placed at the
  1745. end of the text, data, or bss section(?). *)
  1746. SEC_CONSTRUCTOR_TEXT = $1100;
  1747. SEC_CONSTRUCTOR_DATA = $2100;
  1748. SEC_CONSTRUCTOR_BSS = $3100;
  1749. (* The section has contents - a data section could be
  1750. <<SEC_ALLOC>> | <<SEC_HAS_CONTENTS>>; a debug section could be
  1751. <<SEC_HAS_CONTENTS>> *)
  1752. SEC_HAS_CONTENTS = $200;
  1753. (* An instruction to the linker to not output the section
  1754. even if it has information which would normally be written. *)
  1755. SEC_NEVER_LOAD = $400;
  1756. (* The section is a COFF shared library section. This flag is
  1757. only for the linker. If this type of section appears in
  1758. the input file, the linker must copy it to the output file
  1759. without changing the vma or size. FIXME: Although this
  1760. was originally intended to be general, it really is COFF
  1761. specific (and the flag was renamed to indicate this). It
  1762. might be cleaner to have some more general mechanism to
  1763. allow the back end to control what the linker does with
  1764. sections. *)
  1765. SEC_COFF_SHARED_LIBRARY = $800;
  1766. (* The section has GOT references. This flag is only for the
  1767. linker, and is currently only used by the elf32-1 back end.
  1768. It will be set if global offset table references were detected
  1769. in this section, which indicate to the linker that the section
  1770. contains PIC code, and must be handled specially when doing a
  1771. static link. *)
  1772. SEC_HAS_GOT_REF = $4000;
  1773. (* The section contains common symbols (symbols may be defined
  1774. multiple times, the value of a symbol is the amount of
  1775. space it requires, and the largest symbol value is the one
  1776. used). Most targets have exactly one of these (which we
  1777. translate to bfd_com_section_ptr), but ECOFF has two. *)
  1778. SEC_IS_COMMON = $8000;
  1779. (* The section contains only debugging information. For
  1780. example, this is set for ELF .debug and .stab sections.
  1781. strip tests this flag to see if a section can be
  1782. discarded. *)
  1783. SEC_DEBUGGING = $10000;
  1784. (* The contents of this section are held in memory pointed to
  1785. by the contents field. This is checked by bfd_get_section_contents,
  1786. and the data is retrieved from memory if appropriate. *)
  1787. SEC_IN_MEMORY = $20000;
  1788. (* The contents of this section are to be excluded by the
  1789. linker for executable and shared objects unless those
  1790. objects are to be further relocated. *)
  1791. SEC_EXCLUDE = $40000;
  1792. (* The contents of this section are to be sorted by the
  1793. based on the address specified in the associated symbol
  1794. table. *)
  1795. SEC_SORT_ENTRIES = $80000;
  1796. (* When linking, duplicate sections of the same name should be
  1797. discarded, rather than being combined into a single section as
  1798. is usually done. This is similar to how common symbols are
  1799. handled. See SEC_LINK_DUPLICATES below. *)
  1800. SEC_LINK_ONCE = $100000;
  1801. (* If SEC_LINK_ONCE is set, this bitfield describes how the linker
  1802. should handle duplicate sections. *)
  1803. SEC_LINK_DUPLICATES = $600000;
  1804. (* This value for SEC_LINK_DUPLICATES means that duplicate
  1805. sections with the same name should simply be discarded. *)
  1806. SEC_LINK_DUPLICATES_DISCARD = $0;
  1807. (* This value for SEC_LINK_DUPLICATES means that the linker
  1808. should warn if there are any duplicate sections, although
  1809. it should still only link one copy. *)
  1810. SEC_LINK_DUPLICATES_ONE_ONLY = $200000;
  1811. (* This value for SEC_LINK_DUPLICATES means that the linker
  1812. should warn if any duplicate sections are a different size. *)
  1813. SEC_LINK_DUPLICATES_SAME_SIZE = $400000;
  1814. (* This value for SEC_LINK_DUPLICATES means that the linker
  1815. should warn if any duplicate sections contain different
  1816. contents. *)
  1817. SEC_LINK_DUPLICATES_SAME_CONTENTS = $600000;
  1818. (* This section was created by the linker as part of dynamic
  1819. relocation or other arcane processing. It is skipped when
  1820. going through the first-pass output, trusting that someone
  1821. else up the line will take care of it later. *)
  1822. SEC_LINKER_CREATED = $800000;
  1823. (* This section should not be subject to garbage collection. *)
  1824. SEC_KEEP = $1000000;
  1825. (* This section contains "SmallInt" data, and should be placed
  1826. "near" the GP. *)
  1827. SEC_SMALL_DATA = $2000000;
  1828. (* This section contains data which may be shared with other
  1829. executables or shared objects. *)
  1830. SEC_SHARED = $4000000;
  1831. (* When a section with this flag is being linked, then if the size of
  1832. the input section is less than a page, it should not cross a page
  1833. boundary. If the size of the input section is one page or more, it
  1834. should be aligned on a page boundary. *)
  1835. SEC_BLOCK = $8000000;
  1836. (* Conditionally link this section; do not link if there are no
  1837. references found to any symbol in the section. *)
  1838. SEC_CLINK = $10000000;
  1839. (* End of section flags. *)
  1840. (* Attributes of a symbol: *)
  1841. BSF_NO_FLAGS = $00;
  1842. (* The symbol has local scope; <<static>> in <<C>>. The value
  1843. is the offset into the section of the data. *)
  1844. BSF_LOCAL = $01;
  1845. (* The symbol has global scope; initialized data in <<C>>. The
  1846. value is the offset into the section of the data. *)
  1847. BSF_GLOBAL = $02;
  1848. (* The symbol has global scope and is exported. The value is
  1849. the offset into the section of the data. *)
  1850. BSF_EXPORT = BSF_GLOBAL (* no real difference *);
  1851. (* A normal C symbol would be one of:
  1852. <<BSF_LOCAL>>, <<BSF_FORT_COMM>>, <<BSF_UNDEFINED>> or
  1853. <<BSF_GLOBAL>> *)
  1854. (* The symbol is a debugging record. The value has an arbitary
  1855. meaning, unless BSF_DEBUGGING_RELOC is also set. *)
  1856. BSF_DEBUGGING = $08;
  1857. (* The symbol denotes a function entry point. Used in ELF,
  1858. perhaps others someday. *)
  1859. BSF_FUNCTION = $10;
  1860. (* Used by the linker. *)
  1861. BSF_KEEP = $20;
  1862. BSF_KEEP_G = $40;
  1863. (* A weak global symbol, overridable without warnings by
  1864. a regular global symbol of the same name. *)
  1865. BSF_WEAK = $80;
  1866. (* This symbol was created to point to a section, e.g. ELF's
  1867. STT_SECTION symbols. *)
  1868. BSF_SECTION_SYM = $100;
  1869. (* The symbol used to be a common symbol, but now it is
  1870. allocated. *)
  1871. BSF_OLD_COMMON = $200;
  1872. (* The default value for common data. *)
  1873. BFD_FORT_COMM_DEFAULT_VALUE = 0;
  1874. (* In some files the type of a symbol sometimes alters its
  1875. location in an output file - ie in coff a <<ISFCN>> symbol
  1876. which is also <<C_EXT>> symbol appears where it was
  1877. declared and not at the end of a section. This bit is set
  1878. by the target BFD part to convey this information. *)
  1879. BSF_NOT_AT_END = $400;
  1880. (* Signal that the symbol is the label of constructor section. *)
  1881. BSF_CONSTRUCTOR = $800;
  1882. (* Signal that the symbol is a warning symbol. The name is a
  1883. warning. The name of the next symbol is the one to warn about;
  1884. if a reference is made to a symbol with the same name as the next
  1885. symbol, a warning is issued by the linker. *)
  1886. BSF_WARNING = $1000;
  1887. (* Signal that the symbol is indirect. This symbol is an indirect
  1888. pointer to the symbol with the same name as the next symbol. *)
  1889. BSF_INDIRECT = $2000;
  1890. (* BSF_FILE marks symbols that contain a file name. This is used
  1891. for ELF STT_FILE symbols. *)
  1892. BSF_FILE = $4000;
  1893. (* Symbol is from dynamic linking information. *)
  1894. BSF_DYNAMIC = $8000;
  1895. (* The symbol denotes a data object. Used in ELF, and perhaps
  1896. others someday. *)
  1897. BSF_OBJECT = $10000;
  1898. (* This symbol is a debugging symbol. The value is the offset
  1899. into the section of the data. BSF_DEBUGGING should be set
  1900. as well. *)
  1901. BSF_DEBUGGING_RELOC = $20000;
  1902. (* User program access to BFD facilities *)
  1903. (* Direct I/O routines, for programs which know more about the object
  1904. file than BFD does. Use higher level routines if possible. *)
  1905. function bfd_read (var data; size: bfd_size_type; nitems: bfd_size_type; abfd: PBFD): bfd_size_type;cdecl; external BFD_LIB_NAME;
  1906. function bfd_write (const data; size: bfd_size_type; nitems: bfd_size_type; abfd: PBFD): bfd_size_type;cdecl; external BFD_LIB_NAME;
  1907. function bfd_seek (abfd: PBFD; fp: file_ptr; direction: integer): integer;cdecl; external BFD_LIB_NAME;
  1908. function bfd_tell (abfd: PBFD): LongInt;cdecl; external BFD_LIB_NAME;
  1909. function bfd_flush (abfd: PBFD): integer;cdecl; external BFD_LIB_NAME;
  1910. function bfd_stat (abfd: PBFD; a: Pstat): integer;cdecl; external BFD_LIB_NAME;
  1911. (* Cast from const pchar to pchar so that caller can assign to
  1912. a pchar without a warning. *)
  1913. function bfd_get_filename(abfd: PBFD): pchar;
  1914. function bfd_record_phdr(abfd: PBFD; a: LongWord; b: bfd_boolean; c: flagword; d: bfd_boolean; e: bfd_vma;
  1915. f: bfd_boolean; g: bfd_boolean; h: LongWord; i: PPsec):bfd_boolean;cdecl; external BFD_LIB_NAME;
  1916. (* Byte swapping routines. *)
  1917. function bfd_getb64 (const val):bfd_vma;cdecl; external BFD_LIB_NAME;
  1918. function bfd_getl64 (const val):bfd_vma;cdecl; external BFD_LIB_NAME;
  1919. function bfd_getb_signed_64 (const val):bfd_signed_vma;cdecl; external BFD_LIB_NAME;
  1920. function bfd_getl_signed_64 (const val):bfd_signed_vma;cdecl; external BFD_LIB_NAME;
  1921. function bfd_getb32 (const val):bfd_vma;cdecl; external BFD_LIB_NAME;
  1922. function bfd_getl32 (const val):bfd_vma;cdecl; external BFD_LIB_NAME;
  1923. function bfd_getb_signed_32 (const val):bfd_signed_vma;cdecl; external BFD_LIB_NAME;
  1924. function bfd_getl_signed_32 (const val):bfd_signed_vma;cdecl; external BFD_LIB_NAME;
  1925. function bfd_getb16 (const val):bfd_vma;cdecl; external BFD_LIB_NAME;
  1926. function bfd_getl16 (const val):bfd_vma;cdecl; external BFD_LIB_NAME;
  1927. function bfd_getb_signed_16 (const val):bfd_signed_vma;cdecl; external BFD_LIB_NAME;
  1928. function bfd_getl_signed_16 (const val):bfd_signed_vma;cdecl; external BFD_LIB_NAME;
  1929. procedure bfd_putb64(vma: bfd_vma; var val);cdecl; external BFD_LIB_NAME;
  1930. procedure bfd_putl64(vma: bfd_vma; var val);cdecl; external BFD_LIB_NAME;
  1931. procedure bfd_putb32(vma: bfd_vma; var val);cdecl; external BFD_LIB_NAME;
  1932. procedure bfd_putl32(vma: bfd_vma; var val);cdecl; external BFD_LIB_NAME;
  1933. procedure bfd_putb16(vma: bfd_vma; var val);cdecl; external BFD_LIB_NAME;
  1934. procedure bfd_putl16(vma: bfd_vma; var val);cdecl; external BFD_LIB_NAME;
  1935. (* Byte swapping routines which take size and endiannes as arguments. *)
  1936. function bfd_get_bits (a: Pbfd_byte; b:integer; c: bfd_boolean): bfd_vma;cdecl; external BFD_LIB_NAME;
  1937. procedure bfd_put_bits (a: bfd_vma; b:Pbfd_byte; c:integer; d:bfd_boolean);cdecl; external BFD_LIB_NAME;
  1938. (* Externally visible ECOFF routines. *)
  1939. type
  1940. Pecoff_debug_info = pointer;
  1941. Pecoff_debug_swap = pointer;
  1942. function bfd_ecoff_get_gp_value(abfd: PBFD ):bfd_vma;cdecl; external BFD_LIB_NAME;
  1943. function bfd_ecoff_set_gp_value(abfd: PBFD; gp_value: bfd_vma):bfd_boolean ;cdecl; external BFD_LIB_NAME;
  1944. function bfd_ecoff_set_regmasks(abfd: PBFD; gprmask: LongWord; fprmask: LongWord;cprmask: PLongWord):bfd_boolean;cdecl; external BFD_LIB_NAME;
  1945. function bfd_ecoff_debug_init(output_bfd: PBFD; output_debug: Pecoff_debug_info; output_swap: Pecoff_debug_swap; li: Pbfd_link_info):pointer;cdecl; external BFD_LIB_NAME;
  1946. procedure bfd_ecoff_debug_free(handle: pointer; output_bfd: PBFD; output_debug: Pecoff_debug_info; output_swap: Pecoff_debug_swap;li: Pbfd_link_info);cdecl; external BFD_LIB_NAME;
  1947. function bfd_ecoff_debug_accumulate(
  1948. handle: pointer; output_bfd: PBFD; output_debug: Pecoff_debug_info;
  1949. output_swap: Pecoff_debug_swap;
  1950. input_bfd: PBFD; input_debug: Pecoff_debug_info;
  1951. input_swap: Pecoff_debug_swap;
  1952. li: Pbfd_link_info):bfd_boolean ;cdecl; external BFD_LIB_NAME;
  1953. (*todo: function bfd_ecoff_debug_accumulate_other(
  1954. pointer handle;
  1955. PBFD output_bfd;
  1956. Pecoff_debug_info output_debug;
  1957. Pecoff_debug_swap output_swap;
  1958. PBFD input_bfd;
  1959. li: Pbfd_link_info
  1960. ):bfd_boolean ;cdecl; external BFD_LIB_NAME;
  1961. *)
  1962. (*todo: function bfd_ecoff_debug_externals(
  1963. PBFD abfd;
  1964. Pecoff_debug_info debug;
  1965. Pecoff_debug_swap swap;
  1966. bfd_boolean relocateable;
  1967. bfd_boolean ( *get_extr) (struct symbol_cache_entry *;
  1968. struct ecoff_extr * );
  1969. void ( *set_index) (struct symbol_cache_entry *;
  1970. bfd_size_type)
  1971. ):bfd_boolean ;cdecl; external BFD_LIB_NAME;
  1972. *)
  1973. (*todo: function bfd_ecoff_debug_one_external(
  1974. PBFD abfd,
  1975. Pecoff_debug_info debug,
  1976. Pecoff_debug_swap swap,
  1977. const ShortInt *name,
  1978. struct ecoff_extr *esym
  1979. ):bfd_boolean ;cdecl; external BFD_LIB_NAME;
  1980. *)
  1981. (*todo: function bfd_ecoff_debug_size(
  1982. PBFD abfd,
  1983. Pecoff_debug_info debug,
  1984. Pecoff_debug_swap swap
  1985. ):bfd_size_type;cdecl; external BFD_LIB_NAME;
  1986. *)
  1987. (*todo: function bfd_ecoff_write_debug(
  1988. PBFD abfd,
  1989. Pecoff_debug_info debug,
  1990. Pecoff_debug_swap swap,
  1991. file_ptr where
  1992. ):bfd_boolean;cdecl; external BFD_LIB_NAME;
  1993. *)
  1994. (*todo: function bfd_ecoff_write_accumulated_debug(
  1995. pointer handle,
  1996. PBFD abfd,
  1997. Pecoff_debug_info debug,
  1998. Pecoff_debug_swap swa,
  1999. struct bfd_link_info *info, file_ptr where)
  2000. ):bfd_boolean;cdecl; external BFD_LIB_NAME;
  2001. *)
  2002. (*todo: function bfd_mips_ecoff_create_embedded_relocs(
  2003. PBFD ,
  2004. struct bfd_link_info *,
  2005. struct sec *,
  2006. struct sec *,
  2007. pchar*
  2008. ):bfd_boolean;cdecl; external BFD_LIB_NAME;
  2009. *)
  2010. (* Externally visible ELF routines. *)
  2011. //todo:function bfd_elf32_record_link_assignment(PBFD ; struct bfd_link_info *; const pchar; bfd_boolean):bfd_boolean;cdecl; external BFD_LIB_NAME;
  2012. //todo:function bfd_elf64_record_link_assignment(PBFD ; struct bfd_link_info *; const pchar; bfd_boolean):bfd_boolean;cdecl; external BFD_LIB_NAME;
  2013. //todo:function bfd_link_needed_list *bfd_elf_get_needed_list(PBFD ; struct bfd_link_info *):struct;cdecl; external BFD_LIB_NAME;
  2014. //todo:function bfd_elf_get_bfd_needed_list(PBFD ; struct bfd_link_needed_list **):bfd_boolean;cdecl; external BFD_LIB_NAME;
  2015. //todo:function bfd_elf32_size_dynamic_sections (PBFD ; const pchar; const pchar; bfd_boolean; const pchar; const pchar const *; struct bfd_link_info *; struct sec **; struct bfd_elf_version_tree *):bfd_boolean;cdecl; external BFD_LIB_NAME;
  2016. //todo:function bfd_elf64_size_dynamic_sections (PBFD ; const pchar; const pchar; bfd_boolean; const pchar; const pchar const *; struct bfd_link_info *; struct sec **; struct bfd_elf_version_tree *):bfd_boolean;cdecl; external BFD_LIB_NAME;
  2017. //todo:function bfd_elf_set_dt_needed_name(PBFD ; const pchar):void;cdecl; external BFD_LIB_NAME;
  2018. //todo:function bfd_elf_set_dt_needed_soname(PBFD ; const pchar):void;cdecl; external BFD_LIB_NAME;
  2019. //todo:function const ShortInt *bfd_elf_get_dt_soname (PBFD );cdecl; external BFD_LIB_NAME;
  2020. //todo:function struct bfd_link_needed_list *bfd_elf_get_runpath_list (PBFD ; struct bfd_link_info *);cdecl; external BFD_LIB_NAME;
  2021. (* Return an upper bound on the number of bytes required to store a
  2022. copy of ABFD's program header table entries. Return -1 if an error
  2023. occurs; bfd_get_error will return an appropriate code. *)
  2024. //todo:function bfd_get_elf_phdr_upper_bound(PBFD abfd):LongInt;cdecl; external BFD_LIB_NAME;
  2025. (* Copy ABFD's program header table entries to *PHDRS. The entries
  2026. will be stored as an array of Elf_Internal_Phdr structures, as
  2027. defined in include/elf/internal.h. To find out how large the
  2028. buffer needs to be, call bfd_get_elf_phdr_upper_bound.
  2029. Return the number of program header table entries read, or -1 if an
  2030. error occurs; bfd_get_error will return an appropriate code. *)
  2031. //todo:function bfd_get_elf_phdrs(PBFD abfd, void *phdrs):integer;cdecl; external BFD_LIB_NAME;
  2032. (* Return the arch_size field of an elf bfd, or -1 if not elf. *)
  2033. //todo:function bfd_get_arch_size(PBFD ):integer;cdecl; external BFD_LIB_NAME;
  2034. (* Return true if address "naturally" sign extends, or -1 if not elf. *)
  2035. //todo:function bfd_get_sign_extend_vma(PBFD ):integer;cdecl; external BFD_LIB_NAME;
  2036. //todo:function bfd_m68k_elf32_create_embedded_relocs(PBFD , struct bfd_link_info *, struct sec *, struct sec *, pchar*):bfd_boolean;cdecl; external BFD_LIB_NAME;
  2037. (* SunOS shared library support routines for the linker. *)
  2038. //todo:function *bfd_sunos_get_needed_list(PBFD , struct bfd_link_info *):bfd_link_needed_list;cdecl; external BFD_LIB_NAME;
  2039. //todo:function bfd_sunos_record_link_assignment(PBFD , struct bfd_link_info *, const pchar):bfd_boolean;cdecl; external BFD_LIB_NAME;
  2040. //todo:function bfd_sunos_size_dynamic_sections (PBFD , struct bfd_link_info *, struct sec **, struct sec **, struct sec **):bfd_boolean;cdecl; external BFD_LIB_NAME;
  2041. (* Linux shared library support routines for the linker. *)
  2042. //todo:function bfd_i386linux_size_dynamic_sections(PBFD , struct bfd_link_info *):bfd_boolean;cdecl; external BFD_LIB_NAME;
  2043. //todo:function bfd_m68klinux_size_dynamic_sections(PBFD , struct bfd_link_info *):bfd_boolean;cdecl; external BFD_LIB_NAME;
  2044. //todo:function bfd_sparclinux_size_dynamic_sections(PBFD , struct bfd_link_info *):bfd_boolean;cdecl; external BFD_LIB_NAME;
  2045. //todo:function bfd_init_window(bfd_window *):void;cdecl; external BFD_LIB_NAME;
  2046. //todo:function bfd_free_window(bfd_window *):void;cdecl; external BFD_LIB_NAME;
  2047. //todo:function bfd_get_file_window(PBFD , file_ptr, bfd_size_type, bfd_window *, bfd_boolean):bfd_boolean;cdecl; external BFD_LIB_NAME;
  2048. (* XCOFF support routines for the linker. *)
  2049. //todo:function bfd_boolean bfd_xcoff_link_record_set (PBFD , struct bfd_link_info *, struct bfd_link_hash_entry *, bfd_size_type));cdecl; external BFD_LIB_NAME;
  2050. //todo:function bfd_boolean bfd_xcoff_import_symbol (PBFD , struct bfd_link_info *, struct bfd_link_hash_entry *, bfd_vma, const pchar, const pchar, const pchar));cdecl; external BFD_LIB_NAME;
  2051. //todo:function bfd_boolean bfd_xcoff_export_symbol (PBFD , struct bfd_link_info *, struct bfd_link_hash_entry *, bfd_boolean));cdecl; external BFD_LIB_NAME;
  2052. //todo:function bfd_boolean bfd_xcoff_link_count_reloc (PBFD , struct bfd_link_info *, const pchar));cdecl; external BFD_LIB_NAME;
  2053. //todo:function bfd_boolean bfd_xcoff_record_link_assignment (PBFD , struct bfd_link_info *, const pchar));cdecl; external BFD_LIB_NAME;
  2054. //todo:function bfd_boolean bfd_xcoff_size_dynamic_sections (PBFD , struct bfd_link_info *, const pchar, const pchar, LongWord, LongWord, LongWord, bfd_boolean, integer, bfd_boolean, bfd_boolean, struct sec **));cdecl; external BFD_LIB_NAME;
  2055. (* Externally visible COFF routines. *)
  2056. //todo:function bfd_boolean bfd_coff_get_syment (PBFD , struct symbol_cache_entry *, struct internal_syment *));cdecl; external BFD_LIB_NAME;
  2057. //todo:function bfd_boolean bfd_coff_get_auxent (PBFD , struct symbol_cache_entry *, integer, union internal_auxent *));cdecl; external BFD_LIB_NAME;
  2058. //todo:function bfd_boolean bfd_coff_set_symbol_class (PBFD , struct symbol_cache_entry *, LongWord));cdecl; external BFD_LIB_NAME;
  2059. //todo:function bfd_boolean bfd_m68k_coff_create_embedded_relocs (PBFD , struct bfd_link_info *, struct sec *, struct sec *, pchar*));cdecl; external BFD_LIB_NAME;
  2060. (* ARM Interworking support. Called from linker. *)
  2061. //todo:function bfd_boolean bfd_arm_allocate_interworking_sections (struct bfd_link_info *));cdecl; external BFD_LIB_NAME;
  2062. //todo:function bfd_boolean bfd_arm_process_before_allocation (PBFD , struct bfd_link_info *, integer));cdecl; external BFD_LIB_NAME;
  2063. //todo:function bfd_boolean bfd_arm_get_bfd_for_interworking (PBFD , struct bfd_link_info *));cdecl; external BFD_LIB_NAME;
  2064. (* PE ARM Interworking support. Called from linker. *)
  2065. //todo:function bfd_boolean bfd_arm_pe_allocate_interworking_sections (struct bfd_link_info *));cdecl; external BFD_LIB_NAME;
  2066. //todo:function bfd_boolean bfd_arm_pe_process_before_allocation (PBFD , struct bfd_link_info *, integer));cdecl; external BFD_LIB_NAME;
  2067. //todo:function bfd_boolean bfd_arm_pe_get_bfd_for_interworking (PBFD , struct bfd_link_info *));cdecl; external BFD_LIB_NAME;
  2068. (* ELF ARM Interworking support. Called from linker. *)
  2069. //todo:function bfd_boolean bfd_elf32_arm_allocate_interworking_sections (struct bfd_link_info *));cdecl; external BFD_LIB_NAME;
  2070. //todo:function bfd_boolean bfd_elf32_arm_process_before_allocation (PBFD , struct bfd_link_info *, integer));cdecl; external BFD_LIB_NAME;
  2071. //todo:function bfd_boolean bfd_elf32_arm_get_bfd_for_interworking (PBFD , struct bfd_link_info *));cdecl; external BFD_LIB_NAME;
  2072. (* TI COFF load page support. *)
  2073. //todo:function void bfd_ticoff_set_section_load_page (struct sec *, integer));cdecl; external BFD_LIB_NAME;
  2074. //todo:function integer bfd_ticoff_get_section_load_page (struct sec *));cdecl; external BFD_LIB_NAME;
  2075. (* And more from the source. *)
  2076. procedure bfd_init;cdecl; external BFD_LIB_NAME;
  2077. function bfd_openr( filename: pchar ; target: pchar ):PBFD;cdecl; external BFD_LIB_NAME;
  2078. function bfd_fdopenr( filename: pchar ; target: pchar ; fd: integer):PBFD;cdecl; external BFD_LIB_NAME;
  2079. function bfd_openstreamr(a: pchar; b: pchar; c: pointer):PBFD;cdecl; external BFD_LIB_NAME;
  2080. function bfd_openw( filename: pchar ; target: pchar):PBFD;cdecl; external BFD_LIB_NAME;
  2081. function bfd_close(abfd: PBFD):bfd_boolean;cdecl; external BFD_LIB_NAME;
  2082. function bfd_close_all_done(abfd: PBFD ):bfd_boolean;cdecl; external BFD_LIB_NAME;
  2083. function bfd_create( filename: pchar ; templ: PBFD):PBFD;cdecl; external BFD_LIB_NAME;
  2084. function bfd_make_writable(abfd: PBFD ):bfd_boolean;cdecl; external BFD_LIB_NAME;
  2085. function bfd_make_readable(abfd: PBFD ):bfd_boolean;cdecl; external BFD_LIB_NAME;
  2086. (* General purpose part of a symbol X;
  2087. target specific parts are in libcoff.h, libaout.h, etc. *)
  2088. //todo:#define bfd_get_section(x) ((x)->section)
  2089. //todo:#define bfd_get_output_section(x) ((x)->section->output_section)
  2090. //todo:#define bfd_set_section(x,y) ((x)->section) = (y)
  2091. //todo:#define bfd_asymbol_base(x) ((x)->section->vma)
  2092. //todo:#define bfd_asymbol_value(x) (bfd_asymbol_base(x) + (x)->value)
  2093. //todo:#define bfd_asymbol_name(x) ((x)->name)
  2094. (*Perhaps future: #define bfd_asymbol_bfd(x) ((x)->section->owner)*)
  2095. //todo:#define bfd_asymbol_bfd(x) ((x)->the_bfd)
  2096. //todo:#define bfd_asymbol_flavour(x) (bfd_asymbol_bfd(x)->xvec->flavour)
  2097. //todo:#define align_power(addr, align) ((addr) + ((1<<(align))-1)) & (-1 << (align)))
  2098. //todo:#define bfd_get_section_name(bfd, ptr) ((ptr)->name + 0)
  2099. //todo:#define bfd_get_section_vma(bfd, ptr) ((ptr)->vma + 0)
  2100. //todo:#define bfd_get_section_alignment(bfd, ptr) ((ptr)->alignment_power + 0)
  2101. //todo:#define bfd_section_name(bfd, ptr) ((ptr)->name)
  2102. //todo:#define bfd_section_size(bfd, ptr) (bfd_get_section_size_before_reloc(ptr))
  2103. //todo:#define bfd_section_vma(bfd, ptr) ((ptr)->vma)
  2104. //todo:#define bfd_section_lma(bfd, ptr) ((ptr)->lma)
  2105. //todo:#define bfd_section_alignment(bfd, ptr) ((ptr)->alignment_power)
  2106. //todo:#define bfd_get_section_flags(bfd, ptr) ((ptr)->flags + 0)
  2107. //todo:#define bfd_get_section_userdata(bfd, ptr) ((ptr)->userdata)
  2108. //todo:#define bfd_is_com_section(ptr) (((ptr)->flags & SEC_IS_COMMON) != 0)
  2109. //todo:#define bfd_set_section_vma(bfd, ptr, val) (((ptr)->vma = (ptr)->lma= (val)), ((ptr)->user_set_vma = (bfd_boolean)true), true)
  2110. //todo:#define bfd_set_section_alignment(bfd, ptr, val) (((ptr)->alignment_power = (val)),true)
  2111. //todo:#define bfd_set_section_userdata(bfd, ptr, val) (((ptr)->userdata = (val)),true)
  2112. //todo:#define bfd_mach_sparc_v9_p(mach) ((mach) >= bfd_mach_sparc_v8plus && (mach) <= bfd_mach_sparc_v9b && (mach) != bfd_mach_sparc_sparclite_le)
  2113. //todo:#define bfd_get_elt_at_index(b,i) BFD_SEND(b, _bfd_get_elt_at_index, (b,i))
  2114. //todo:#define bfd_print_symbol(b,p,s,e) BFD_SEND(b, _bfd_print_symbol, (b,p,s,e))
  2115. //todo:#define bfd_get_symbol_info(b,p,e) BFD_SEND(b, _bfd_get_symbol_info, (b,p,e))
  2116. //todo:#define bfd_read_minisymbols(b, d, m, s) BFD_SEND (b, _read_minisymbols, (b, d, m, s))
  2117. //todo:#define bfd_minisymbol_to_symbol(b, d, m, f) BFD_SEND (b, _minisymbol_to_symbol, (b, d, m, f))
  2118. //todo:#define COFF_SWAP_TABLE (pointer) &bfd_coff_std_swap_table
  2119. //todo:#define bfd_get_cacheable(abfd) ((abfd)->cacheable)
  2120. //todo:#define bfd_get_format(abfd) ((abfd)->format)
  2121. //todo:#define bfd_get_target(abfd) ((abfd)->xvec->name)
  2122. //todo:#define bfd_get_flavour(abfd) ((abfd)->xvec->flavour)
  2123. //todo:#define bfd_family_coff(abfd) (bfd_get_flavour (abfd) == bfd_target_coff_flavour || bfd_get_flavour (abfd) == bfd_target_xcoff_flavour)
  2124. //todo:#define bfd_big_endian(abfd) ((abfd)->xvec->byteorder == BFD_ENDIAN_BIG)
  2125. //todo:#define bfd_little_endian(abfd) ((abfd)->xvec->byteorder == BFD_ENDIAN_LITTLE)
  2126. //todo:#define bfd_header_big_endian(abfd) ((abfd)->xvec->header_byteorder == BFD_ENDIAN_BIG)
  2127. //todo:#define bfd_header_little_endian(abfd) ((abfd)->xvec->header_byteorder == BFD_ENDIAN_LITTLE)
  2128. //todo:#define bfd_get_file_flags(abfd) ((abfd)->flags)
  2129. //todo:#define bfd_applicable_file_flags(abfd) ((abfd)->xvec->object_flags)
  2130. //todo:#define bfd_applicable_section_flags(abfd) ((abfd)->xvec->section_flags)
  2131. //todo:#define bfd_my_archive(abfd) ((abfd)->my_archive)
  2132. //todo:#define bfd_has_map(abfd) ((abfd)->has_armap)
  2133. //todo:#define bfd_valid_reloc_types(abfd) ((abfd)->xvec->valid_reloc_types)
  2134. //todo:#define bfd_usrdata(abfd) ((abfd)->usrdata)
  2135. //todo:#define bfd_get_start_address(abfd) ((abfd)->start_address)
  2136. //todo:#define bfd_get_symcount(abfd) ((abfd)->symcount)
  2137. //todo:#define bfd_get_outsymbols(abfd) ((abfd)->outsymbols)
  2138. //todo:#define bfd_count_sections(abfd) ((abfd)->section_count)
  2139. //todo:#define bfd_get_symbol_leading_char(abfd) ((abfd)->xvec->symbol_leading_char)
  2140. //todo:#define bfd_set_cacheable(abfd,bool) (((abfd)->cacheable = (bfd_boolean) (bool)), true)
  2141. //todo:#define bfd_put_8(abfd, val, ptr) ((void) (*((byte * ) (ptr)) = (Byte) (val)))
  2142. //todo:#define bfd_put_signed_8 bfd_put_8
  2143. //todo:#define bfd_get_8(abfd, ptr) ( *(Byte * ) (ptr))
  2144. //todo:#define bfd_get_signed_8(abfd, ptr) (( *(byte * ) (ptr) ^ $80) - $80)
  2145. //todo:#define bfd_put_16(abfd, val, ptr) BFD_SEND(abfd, bfd_putx16, ((val),(ptr)))
  2146. //todo:#define bfd_put_signed_16 bfd_put_16
  2147. //todo:#define bfd_get_16(abfd, ptr) BFD_SEND(abfd, bfd_getx16, (ptr))
  2148. //todo:#define bfd_get_signed_16(abfd, ptr) BFD_SEND (abfd, bfd_getx_signed_16, (ptr))
  2149. //todo:#define bfd_put_32(abfd, val, ptr) BFD_SEND(abfd, bfd_putx32, ((val),(ptr)))
  2150. //todo:#define bfd_put_signed_32 bfd_put_32
  2151. //todo:#define bfd_get_32(abfd, ptr) BFD_SEND(abfd, bfd_getx32, (ptr))
  2152. //todo:#define bfd_get_signed_32(abfd, ptr) BFD_SEND(abfd, bfd_getx_signed_32, (ptr))
  2153. //todo:#define bfd_put_64(abfd, val, ptr) BFD_SEND(abfd, bfd_putx64, ((val), (ptr)))
  2154. //todo:#define bfd_put_signed_64 bfd_put_64
  2155. //todo:#define bfd_get_64(abfd, ptr) BFD_SEND(abfd, bfd_getx64, (ptr))
  2156. //todo:#define bfd_get_signed_64(abfd, ptr) BFD_SEND(abfd, bfd_getx_signed_64, (ptr))
  2157. //todo:#define bfd_get(bits, abfd, ptr) ((bits) == 8 ? bfd_get_8 (abfd, ptr) : (bits) == 16 ? bfd_get_16 (abfd, ptr) : (bits) == 32 ? bfd_get_32 (abfd, ptr) : (bits) == 64 ? bfd_get_64 (abfd, ptr) : (abort (), (bfd_vma) - 1))
  2158. //todo:#define bfd_put(bits, abfd, val, ptr) ((bits) == 8 ? bfd_put_8 (abfd, val, ptr) : (bits) == 16 ? bfd_put_16 (abfd, val, ptr) : (bits) == 32 ? bfd_put_32 (abfd, val, ptr) : (bits) == 64 ? bfd_put_64 (abfd, val, ptr) : (abort (), (void) 0))
  2159. (* Byte swapping macros for file header data. *)
  2160. //todo:#define bfd_h_put_8(abfd, val, ptr) bfd_put_8 (abfd, val, ptr)
  2161. //todo:#define bfd_h_put_signed_8(abfd, val, ptr) bfd_put_8 (abfd, val, ptr)
  2162. //todo:#define bfd_h_get_8(abfd, ptr) bfd_get_8 (abfd, ptr)
  2163. //todo:#define bfd_h_get_signed_8(abfd, ptr) bfd_get_signed_8 (abfd, ptr)
  2164. //todo:#define bfd_h_put_16(abfd, val, ptr) BFD_SEND(abfd, bfd_h_putx16,(val,ptr))
  2165. //todo:#define bfd_h_put_signed_16 bfd_h_put_16
  2166. //todo:#define bfd_h_get_16(abfd, ptr) BFD_SEND(abfd, bfd_h_getx16,(ptr))
  2167. //todo:#define bfd_h_get_signed_16(abfd, ptr) BFD_SEND(abfd, bfd_h_getx_signed_16, (ptr))
  2168. //todo:#define bfd_h_put_32(abfd, val, ptr) BFD_SEND(abfd, bfd_h_putx32,(val,ptr))
  2169. //todo:#define bfd_h_put_signed_32 bfd_h_put_32
  2170. //todo:#define bfd_h_get_32(abfd, ptr) BFD_SEND(abfd, bfd_h_getx32,(ptr))
  2171. //todo:#define bfd_h_get_signed_32(abfd, ptr) BFD_SEND(abfd, bfd_h_getx_signed_32, (ptr))
  2172. //todo:#define bfd_h_put_64(abfd, val, ptr) BFD_SEND(abfd, bfd_h_putx64,(val, ptr))
  2173. //todo:#define bfd_h_put_signed_64 bfd_h_put_64
  2174. //todo:#define bfd_h_get_64(abfd, ptr) BFD_SEND(abfd, bfd_h_getx64,(ptr))
  2175. //todo:#define bfd_h_get_signed_64(abfd, ptr) BFD_SEND(abfd, bfd_h_getx_signed_64, (ptr))
  2176. (* These sections are global, and are managed by BFD. The application
  2177. and target back end are not permitted to change the values in
  2178. these sections. New code should use the section_ptr macros rather
  2179. than referring directly to the const sections. The const sections
  2180. may eventually vanish. *)
  2181. const
  2182. BFD_ABS_SECTION_NAME = '*ABS*';
  2183. BFD_UND_SECTION_NAME = '*UND*';
  2184. BFD_COM_SECTION_NAME = '*COM*';
  2185. BFD_IND_SECTION_NAME = '*IND*';
  2186. (* the absolute section *)
  2187. //todo:_BFD_IMPORT function const asection bfd_abs_section;
  2188. //todo:#define bfd_abs_section_ptr ((asection *) &bfd_abs_section)
  2189. //todo:#define bfd_is_abs_section(sec) ((sec) == bfd_abs_section_ptr)
  2190. (* Pointer to the undefined section *)
  2191. //todo:_BFD_IMPORT function const asection bfd_und_section;
  2192. //todo:#define bfd_und_section_ptr ((asection *) &bfd_und_section)
  2193. //todo:#define bfd_is_und_section(sec) ((sec) == bfd_und_section_ptr)
  2194. (* Pointer to the common section *)
  2195. //todo:_BFD_IMPORT function const asection bfd_com_section;
  2196. //todo:#define bfd_com_section_ptr ((asection *) &bfd_com_section)
  2197. (* Pointer to the indirect section *)
  2198. //todo:_BFD_IMPORT function const asection bfd_ind_section;
  2199. //todo:#define bfd_ind_section_ptr ((asection *) &bfd_ind_section)
  2200. //todo:#define bfd_is_ind_section(sec) ((sec) == bfd_ind_section_ptr)
  2201. //todo:function const struct symbol_cache_entry * const bfd_abs_symbol;
  2202. //todo:function const struct symbol_cache_entry * const bfd_com_symbol;
  2203. //todo:function const struct symbol_cache_entry * const bfd_und_symbol;
  2204. //todo:function const struct symbol_cache_entry * const bfd_ind_symbol;
  2205. //todo:#define bfd_get_section_size_before_reloc(section) ((section)->reloc_done ? (abort (), (bfd_size_type) 1) : (section)->_raw_size)
  2206. //todo:#define bfd_get_section_size_after_reloc(section) ((section)->reloc_done ? (section)->_cooked_size : (abort (), (bfd_size_type) 1))
  2207. //todo:asection * bfd_get_section_by_name (PBFD abfd, const ShortInt *name));
  2208. //todo:pchar bfd_get_unique_section_name (PBFD abfd, const ShortInt *templat, integer *count));
  2209. //todo:asection * bfd_make_section_old_way (PBFD abfd, const ShortInt *name));
  2210. //todo:asection * bfd_make_section_anyway (PBFD abfd, const ShortInt *name));
  2211. //todo:asection * bfd_make_section (PBFD , const ShortInt *name));
  2212. //todo:bfd_boolean bfd_set_section_flags (PBFD abfd, asection *sec, flagword flags));
  2213. type
  2214. bfd_map_over_sections_proc = procedure( abfd: PBFD; sect: Pasection; obj: pointer ); cdecl;
  2215. procedure bfd_map_over_sections( abfd: PBFD; func: bfd_map_over_sections_proc; obj: pointer ); cdecl; external BFD_LIB_NAME;
  2216. //todo:bfd_boolean bfd_set_section_size (PBFD abfd, asection *sec, bfd_size_type val));
  2217. //todo:bfd_boolean bfd_set_section_contents (PBFD abfd, asection *section, pointer data, file_ptr offset, bfd_size_type count));
  2218. function bfd_get_section_contents(abfd: PBFD; section: Pasection; location: pointer; offset: file_ptr; count: bfd_size_type): bfd_boolean; cdecl; external BFD_LIB_NAME;
  2219. //todo:bfd_boolean bfd_copy_private_section_data (PBFD ibfd, asection *isec, PBFD obfd, asection *osec));
  2220. //todo:#define bfd_copy_private_section_data(ibfd, isection, obfd, osection) BFD_SEND (obfd, _bfd_copy_private_section_data, (ibfd, isection, obfd, osection))
  2221. //todo:void _bfd_strip_section_from_output (struct bfd_link_info *info, asection *section));
  2222. //todo:const pchar bfd_printable_name (PBFD abfd));
  2223. //todo:const bfd_arch_info_type * bfd_scan_arch (const ShortInt *string));
  2224. //todo:const pchar* bfd_arch_list (void));
  2225. //todo:const bfd_arch_info_type * bfd_arch_get_compatible ( const PBFD abfd, const PBFD bbfd));
  2226. //todo:void bfd_set_arch_info (PBFD abfd, const bfd_arch_info_type *arg));
  2227. function bfd_get_arch( abfd: PBFD ): bfd_architecture; cdecl; external BFD_LIB_NAME;
  2228. function bfd_get_mach( abfd: PBFD ): LongWord; cdecl; external BFD_LIB_NAME;
  2229. //todo:LongWord bfd_arch_bits_per_byte (PBFD abfd));
  2230. //todo:LongWord bfd_arch_bits_per_address (PBFD abfd));
  2231. //todo:const bfd_arch_info_type * bfd_get_arch_info (PBFD abfd));
  2232. //todo:const bfd_arch_info_type * bfd_lookup_arch (enum bfd_architecture arch, LongWord machine));
  2233. function bfd_printable_arch_mach(arch: bfd_architecture; machine: LongWord): pchar; cdecl; external BFD_LIB_NAME;
  2234. //todo:LongWord bfd_octets_per_byte (PBFD abfd));
  2235. //todo:LongWord bfd_arch_mach_octets_per_byte (enum bfd_architecture arch, LongWord machine));
  2236. //todo:#define HOWTO(C, R,S,B, P, BI, O, SF, NAME, INPLACE, MASKSRC, MASKDST, PC) {(unsigned)C,R,S,B, P, BI, O,SF,NAME,INPLACE,MASKSRC,MASKDST,PC}
  2237. //todo:#define NEWHOWTO( FUNCTION, NAME,SIZE,REL,IN) HOWTO(0,0,SIZE,0,REL,0,complain_overflow_dont,FUNCTION, NAME,false,0,0,IN)
  2238. //todo:#define EMPTY_HOWTO(C) HOWTO((C),0,0,0,false,0,complain_overflow_dont,NULL,NULL,false,0,0,false)
  2239. //Todo:#define HOWTO_PREPARE(relocation, symbol){ if (symbol != (asymbol * )NULL) { if (bfd_is_com_section (symbol->section)) {relocation = 0;}else{ relocation = symbol->value;}}}
  2240. //todo:LongWord bfd_get_reloc_size (reloc_howto_type *));
  2241. {todo:
  2242. relent_chain = record
  2243. arelent relent;
  2244. struct relent_chain *next;
  2245. end;
  2246. arelent_chain = relent_chaing;
  2247. }
  2248. //todo:bfd_reloc_status_type bfd_check_overflow (enum complain_overflow how, LongWord bitsize, LongWord rightshift, LongWord addrsize, bfd_vma relocation));
  2249. //todo:bfd_reloc_status_type bfd_perform_relocation (PBFD abfd, arelent *reloc_entry, pointer data, asection *input_section, PBFD output_bfd, pchar*error_message));
  2250. //todo:bfd_reloc_status_type bfd_install_relocation (PBFD abfd, arelent *reloc_entry, pointer data, bfd_vma data_start, asection *input_section, pchar*error_message));
  2251. //todo:typedef enum bfd_reloc_code_real bfd_reloc_code_real_type;
  2252. //todo:reloc_howto_type * bfd_reloc_type_lookup (PBFD abfd, bfd_reloc_code_real_type code));
  2253. //todo:const pchar bfd_get_reloc_code_name (bfd_reloc_code_real_type code));
  2254. //todo:#define bfd_get_symtab_upper_bound(abfd) BFD_SEND (abfd, _bfd_get_symtab_upper_bound, (abfd))
  2255. //todo:bfd_boolean bfd_is_local_label (PBFD abfd, asymbol *sym));
  2256. //todo:bfd_boolean bfd_is_local_label_name (PBFD abfd, const ShortInt *name));
  2257. //todo:#define bfd_is_local_label_name(abfd, name) BFD_SEND (abfd, _bfd_is_local_label_name, (abfd, name))
  2258. //todo:#define bfd_canonicalize_symtab(abfd, location) BFD_SEND (abfd, _bfd_canonicalize_symtab, (abfd, location))
  2259. //todo:bfd_boolean bfd_set_symtab (PBFD abfd, asymbol **location, LongWord count));
  2260. //todo:void bfd_print_symbol_vandf (pointer file, asymbol *symbol));
  2261. //todo:#define bfd_make_empty_symbol(abfd) BFD_SEND (abfd, _bfd_make_empty_symbol, (abfd))
  2262. //todo:#define bfd_make_debug_symbol(abfd,ptr,size) BFD_SEND (abfd, _bfd_make_debug_symbol, (abfd, ptr, size))
  2263. //todo:integer bfd_decode_symclass (asymbol *symbol));
  2264. //todo:bfd_boolean bfd_is_undefined_symclass (integer symclass));
  2265. //todo:void bfd_symbol_info (asymbol *symbol, symbol_info *ret));
  2266. //todo:bfd_boolean bfd_copy_private_symbol_data (PBFD ibfd, asymbol *isym, PBFD obfd, asymbol *osym));
  2267. //todo:#define bfd_copy_private_symbol_data(ibfd, isymbol, obfd, osymbol) BFD_SEND (obfd, _bfd_copy_private_symbol_data, (ibfd, isymbol, obfd, osymbol))
  2268. function bfd_get_error: bfd_error; cdecl; external BFD_LIB_NAME;
  2269. //todo:void bfd_set_error (bfd_error error_tag));
  2270. function bfd_errmsg( error_tag: bfd_error ): pchar; cdecl; external BFD_LIB_NAME;
  2271. //todo:void bfd_perror ( ShortInt *message));
  2272. type
  2273. bfd_error_handler_type = procedure( a: pchar { VARARGS! } ); cdecl;
  2274. function bfd_set_error_handler( handler: bfd_error_handler_type ):bfd_error_handler_type; cdecl; external BFD_LIB_NAME;
  2275. //todo:void bfd_set_error_program_name (const pchar));
  2276. //todo:bfd_error_handler_type bfd_get_error_handler (void));
  2277. //todo:LongInt bfd_get_reloc_upper_bound (PBFD abfd, asection *sect));
  2278. //todo:LongInt bfd_canonicalize_reloc (PBFD abfd, asection *sec, arelent **loc, asymbol **syms));
  2279. //todo:void bfd_set_reloc (PBFD abfd, asection *sec, arelent **rel, LongWord count) );
  2280. //todo:bfd_boolean bfd_set_file_flags (PBFD abfd, flagword flags));
  2281. //todo:integer bfd_get_arch_size (PBFD abfd));
  2282. //todo:integer bfd_get_sign_extend_vma (PBFD abfd));
  2283. //todo:bfd_boolean bfd_set_start_address (PBFD abfd, bfd_vma vma));
  2284. //todo:LongInt bfd_get_mtime (PBFD abfd));
  2285. //todo:LongInt bfd_get_size (PBFD abfd));
  2286. //todo:integer bfd_get_gp_size (PBFD abfd));
  2287. //todo:void bfd_set_gp_size (PBFD abfd, integer i));
  2288. //todo:bfd_vma bfd_scan_vma ( ShortInt *string, pchar*end, integer base));
  2289. //todo:bfd_boolean bfd_copy_private_bfd_data (PBFD ibfd, PBFD obfd));
  2290. //todo: #define bfd_copy_private_bfd_data(ibfd, obfd) BFD_SEND (obfd, _bfd_copy_private_bfd_data, (ibfd, obfd))
  2291. //todo:bfd_boolean bfd_merge_private_bfd_data (PBFD ibfd, PBFD obfd));
  2292. //todo:#define bfd_merge_private_bfd_data(ibfd, obfd) BFD_SEND (obfd, _bfd_merge_private_bfd_data,(ibfd, obfd))
  2293. //todo:bfd_boolean bfd_set_private_flags (PBFD abfd, flagword flags));
  2294. //todo:#define bfd_set_private_flags(abfd, flags) BFD_SEND (abfd, _bfd_set_private_flags, (abfd, flags))
  2295. //todo:#define bfd_sizeof_headers(abfd, reloc) BFD_SEND (abfd, _bfd_sizeof_headers, (abfd, reloc))
  2296. //todo:#define bfd_find_nearest_line(abfd, sec, syms, off, file, func, line) BFD_SEND (abfd, _bfd_find_nearest_line, (abfd, sec, syms, off, file, func, line))
  2297. (* Do these three do anything useful at all, for any back end? *)
  2298. //todo:#define bfd_debug_info_start(abfd) BFD_SEND (abfd, _bfd_debug_info_start, (abfd))
  2299. //todo:#define bfd_debug_info_end(abfd) BFD_SEND (abfd, _bfd_debug_info_end, (abfd))
  2300. //todo:#define bfd_debug_info_accumulate(abfd, section) BFD_SEND (abfd, _bfd_debug_info_accumulate, (abfd, section))
  2301. //todo:#define bfd_stat_arch_elt(abfd, stat) BFD_SEND (abfd, _bfd_stat_arch_elt,(abfd, stat))
  2302. //todo:#define bfd_update_armap_timestamp(abfd) BFD_SEND (abfd, _bfd_update_armap_timestamp, (abfd))
  2303. //todo:#define bfd_set_arch_mach(abfd, arch, mach) BFD_SEND ( abfd, _bfd_set_arch_mach, (abfd, arch, mach))
  2304. //todo:#define bfd_relax_section(abfd, section, link_info, again) BFD_SEND (abfd, _bfd_relax_section, (abfd, section, link_info, again))
  2305. //todo:#define bfd_gc_sections(abfd, link_info) BFD_SEND (abfd, _bfd_gc_sections, (abfd, link_info))
  2306. //todo:#define bfd_link_hash_table_create(abfd) BFD_SEND (abfd, _bfd_link_hash_table_create, (abfd))
  2307. //todo:#define bfd_link_add_symbols(abfd, info) BFD_SEND (abfd, _bfd_link_add_symbols, (abfd, info))
  2308. //todo:#define bfd_final_link(abfd, info) BFD_SEND (abfd, _bfd_final_link, (abfd, info))
  2309. //todo:#define bfd_free_cached_info(abfd) BFD_SEND (abfd, _bfd_free_cached_info, (abfd))
  2310. //todo:#define bfd_get_dynamic_symtab_upper_bound(abfd) BFD_SEND (abfd, _bfd_get_dynamic_symtab_upper_bound, (abfd))
  2311. //todo:#define bfd_print_private_bfd_data(abfd, file) BFD_SEND (abfd, _bfd_print_private_bfd_data, (abfd, file))
  2312. //todo:#define bfd_canonicalize_dynamic_symtab(abfd, asymbols) BFD_SEND (abfd, _bfd_canonicalize_dynamic_symtab, (abfd, asymbols))
  2313. //todo:#define bfd_get_dynamic_reloc_upper_bound(abfd) BFD_SEND (abfd, _bfd_get_dynamic_reloc_upper_bound, (abfd))
  2314. //todo:#define bfd_canonicalize_dynamic_reloc(abfd, arels, asyms) BFD_SEND (abfd, _bfd_canonicalize_dynamic_reloc, (abfd, arels, asyms))
  2315. //todo:function Pbfd_byte bfd_get_relocated_section_contents (PBFD , struct bfd_link_info *, struct bfd_link_order *, Pbfd_byte , bfd_boolean, asymbol **));cdecl; external BFD_LIB_NAME;
  2316. //todo:symindex bfd_get_next_mapent (PBFD abfd, symindex previous, carsym **sym));cdecl; external BFD_LIB_NAME;
  2317. //todo:bfd_boolean bfd_set_archive_head (PBFD output, PBFD new_head));cdecl; external BFD_LIB_NAME;
  2318. //todo:PBFD bfd_openr_next_archived_file (PBFD archive, PBFD previous));cdecl; external BFD_LIB_NAME;
  2319. //todo:pchar bfd_core_file_failing_command (PBFD abfd));cdecl; external BFD_LIB_NAME;
  2320. //todo:integer bfd_core_file_failing_signal (PBFD abfd));cdecl; external BFD_LIB_NAME;
  2321. //todo:bfd_boolean core_file_matches_executable_p (PBFD core_bfd, PBFD exec_bfd));cdecl; external BFD_LIB_NAME;
  2322. //todo:#define BFD_SEND(bfd, message, arglist) (( *((bfd)->xvec->message)) arglist)
  2323. //todo:#define BFD_SEND_FMT(bfd, message, arglist)(((bfd)->xvec->message[(integer) ((bfd)->format)]) arglist)
  2324. //todo:bfd_boolean bfd_set_default_target (const ShortInt *name));cdecl; external BFD_LIB_NAME;
  2325. //todo:const bfd_target * bfd_find_target ( ShortInt *target_name, PBFD abfd));cdecl; external BFD_LIB_NAME;
  2326. //todo:const pchar* bfd_target_list (void));cdecl; external BFD_LIB_NAME;
  2327. //todo:const bfd_target * bfd_search_for_target (integer ( * search_func) (const bfd_target *, void * ), void * ));cdecl; external BFD_LIB_NAME;
  2328. function bfd_check_format(abfd: PBFD; format: bfd_format): bfd_boolean;cdecl; external BFD_LIB_NAME;
  2329. function bfd_check_format_matches(abfd: PBFD; format: bfd_format; matching: pppchar): bfd_boolean;cdecl; external BFD_LIB_NAME;
  2330. //todo:bfd_boolean bfd_set_format (PBFD abfd, bfd_format format));cdecl; external BFD_LIB_NAME;
  2331. //todo:pchar bfd_format_string (bfd_format format));cdecl; external BFD_LIB_NAME;
  2332. (* Values that may appear in the flags field of a BFD. These also
  2333. appear in the object_flags field of the bfd_target structure, where
  2334. they indicate the set of flags used by that backend (not all flags
  2335. are meaningful for all object file formats) (FIXME: at the moment,
  2336. the object_flags values have mostly just been copied from backend
  2337. to another, and are not necessarily correct). *)
  2338. (* No flags. *)
  2339. const
  2340. BFD_NO_FLAGS = $00;
  2341. (* BFD contains relocation entries. *)
  2342. HAS_RELOC = $01;
  2343. (* BFD is directly executable. *)
  2344. EXEC_P = $02;
  2345. (* BFD has line number information (basically used for F_LNNO in a
  2346. COFF header). *)
  2347. HAS_LINENO = $04;
  2348. (* BFD has debugging information. *)
  2349. HAS_DEBUG = $08;
  2350. (* BFD has symbols. *)
  2351. HAS_SYMS = $10;
  2352. (* BFD has local symbols (basically used for F_LSYMS in a COFF
  2353. header). *)
  2354. HAS_LOCALS = $20;
  2355. (* BFD is a dynamic object. *)
  2356. DYNAMIC = $40;
  2357. (* Text section is write protected (if D_PAGED is not set, this is
  2358. like an a.out NMAGIC file) (the linker sets this by default, but
  2359. clears it for -r or -N). *)
  2360. WP_TEXT = $80;
  2361. (* BFD is dynamically paged (this is like an a.out ZMAGIC file) (the
  2362. linker sets this by default, but clears it for -r or -n or -N). *)
  2363. D_PAGED = $100;
  2364. (* BFD is relaxable (this means that bfd_relax_section may be able to
  2365. do something) (sometimes bfd_relax_section can do something even if
  2366. this is not set). *)
  2367. BFD_IS_RELAXABLE = $200;
  2368. (* This may be set before writing out a BFD to request using a
  2369. traditional format. For example, this is used to request that when
  2370. writing out an a.out object the symbols not be hashed to eliminate
  2371. duplicates. *)
  2372. BFD_TRADITIONAL_FORMAT = $400;
  2373. (* This flag indicates that the BFD contents are actually cached in
  2374. memory. If this is set, iostream points to a bfd_in_memory struct. *)
  2375. BFD_IN_MEMORY = $800;
  2376. (* Get the name of a stabs type code. *)
  2377. function bfd_get_stab_name(a:integer):pchar;cdecl; external BFD_LIB_NAME;
  2378. (* Initialize a hash table. *)
  2379. //todo:function bfd_boolean bfd_hash_table_init (struct bfd_hash_table *, struct bfd_hash_entry *( * ) (struct bfd_hash_entry *, struct bfd_hash_table *, const pchar)));cdecl; external BFD_LIB_NAME;
  2380. (* Initialize a hash table specifying a size. *)
  2381. //todo:function bfd_boolean bfd_hash_table_init_n (struct bfd_hash_table *, struct bfd_hash_entry *( * ) (struct bfd_hash_entry *, struct bfd_hash_table *, const pchar), LongWord size));cdecl; external BFD_LIB_NAME;
  2382. (* Free up a hash table. *)
  2383. //todo:function void bfd_hash_table_free (struct bfd_hash_table *));cdecl; external BFD_LIB_NAME;
  2384. (* Look up a string in a hash table. If CREATE is true, a new entry
  2385. will be created for this string if one does not already exist. The
  2386. COPY argument must be true if this routine should copy the string
  2387. into newly allocated memory when adding an entry. *)
  2388. //todo:function struct bfd_hash_entry *bfd_hash_lookup (struct bfd_hash_table *, const pchar, bfd_boolean create, bfd_boolean copy));cdecl; external BFD_LIB_NAME;
  2389. (* Replace an entry in a hash table. *)
  2390. //todo:function void bfd_hash_replace (struct bfd_hash_table *, struct bfd_hash_entry *old, struct bfd_hash_entry *nw));cdecl; external BFD_LIB_NAME;
  2391. (* Base method for creating a hash table entry. *)
  2392. //todo:function struct bfd_hash_entry *bfd_hash_newfunc (struct bfd_hash_entry *, struct bfd_hash_table *, const pchar));cdecl; external BFD_LIB_NAME;
  2393. (* Grab some space for a hash table entry. *)
  2394. //todo:function pointer bfd_hash_allocate (struct bfd_hash_table *, LongWord));cdecl; external BFD_LIB_NAME;
  2395. (* Traverse a hash table in a random order, calling a function on each
  2396. element. If the function returns false, the traversal stops. The
  2397. INFO argument is passed to the function. *)
  2398. //todo:function void bfd_hash_traverse (struct bfd_hash_table *, bfd_boolean ( * ) (struct bfd_hash_entry *, pointer), pointer info));cdecl; external BFD_LIB_NAME;
  2399. (* Print a bfd_vma x on stream s. *)
  2400. //todo:#define fprintf_vma(s,x) fprintf (s, "%08lx", x)
  2401. //todo:#define sprintf_vma(s,x) sprintf (s, "%08lx", x)
  2402. //todo:#define printf_vma(x) fprintf_vma(stdout,x)
  2403. implementation
  2404. // Makros:
  2405. function bfd_get_filename(abfd: PBFD): pchar;
  2406. begin
  2407. result:=abfd.filename;
  2408. end;
  2409. initialization
  2410. bfd_init;
  2411. end.