bfd.pas 118 KB

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