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