Home | History | Annotate | Line # | Download | only in bfd
libcoff-in.h revision 1.1.1.11
      1 /* BFD COFF object file private structure.
      2    Copyright (C) 1990-2025 Free Software Foundation, Inc.
      3    Written by Cygnus Support.
      4 
      5    This file is part of BFD, the Binary File Descriptor library.
      6 
      7    This program is free software; you can redistribute it and/or modify
      8    it under the terms of the GNU General Public License as published by
      9    the Free Software Foundation; either version 3 of the License, or
     10    (at your option) any later version.
     11 
     12    This program is distributed in the hope that it will be useful,
     13    but WITHOUT ANY WARRANTY; without even the implied warranty of
     14    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
     15    GNU General Public License for more details.
     16 
     17    You should have received a copy of the GNU General Public License
     18    along with this program; if not, write to the Free Software
     19    Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston,
     20    MA 02110-1301, USA.  */
     21 
     22 #ifndef _LIBCOFF_H
     23 #define _LIBCOFF_H 1
     24 
     25 #include "bfdlink.h"
     26 #include "coff-bfd.h"
     27 #include "hashtab.h"
     28 
     29 #ifdef __cplusplus
     30 extern "C" {
     31 #endif
     32 
     33 /* Object file tdata; access macros.  */
     34 
     35 #define coff_data(bfd)		      ((bfd)->tdata.coff_obj_data)
     36 #define obj_pe(bfd)		      (coff_data (bfd)->pe)
     37 #define obj_go32(bfd)		      (coff_data (bfd)->go32)
     38 #define obj_symbols(bfd)	      (coff_data (bfd)->symbols)
     39 #define obj_sym_filepos(bfd)	      (coff_data (bfd)->sym_filepos)
     40 #define obj_relocbase(bfd)	      (coff_data (bfd)->relocbase)
     41 #define obj_raw_syments(bfd)	      (coff_data (bfd)->raw_syments)
     42 #define obj_raw_syment_count(bfd)     (coff_data (bfd)->raw_syment_count)
     43 #define obj_coff_keep_raw_syms(bfd)   (coff_data (bfd)->keep_raw_syms)
     44 #define obj_convert(bfd)	      (coff_data (bfd)->conversion_table)
     45 #define obj_conv_table_size(bfd)      (coff_data (bfd)->conv_table_size)
     46 #define obj_coff_external_syms(bfd)   (coff_data (bfd)->external_syms)
     47 #define obj_coff_keep_syms(bfd)	      (coff_data (bfd)->keep_syms)
     48 #define obj_coff_strings(bfd)	      (coff_data (bfd)->strings)
     49 #define obj_coff_strings_len(bfd)     (coff_data (bfd)->strings_len)
     50 #define obj_coff_keep_strings(bfd)    (coff_data (bfd)->keep_strings)
     51 #define obj_coff_sym_hashes(bfd)      (coff_data (bfd)->sym_hashes)
     52 #define obj_coff_strings_written(bfd) (coff_data (bfd)->strings_written)
     53 #define obj_coff_local_toc_table(bfd) (coff_data (bfd)->local_toc_sym_map)
     54 
     55 /* `Tdata' information kept for COFF files.  */
     56 
     57 typedef struct coff_tdata
     58 {
     59   struct coff_symbol_struct *symbols;	/* Symtab for input bfd.  */
     60   unsigned int *conversion_table;
     61   int conv_table_size;
     62   file_ptr sym_filepos;
     63 
     64   struct coff_ptr_struct *raw_syments;
     65   unsigned long raw_syment_count;
     66 
     67   /* These are only valid once writing has begun.  */
     68   unsigned long int relocbase;
     69 
     70   /* These members communicate important constants about the symbol table
     71      to GDB's symbol-reading code.  These `constants' unfortunately vary
     72      from coff implementation to implementation...  */
     73   unsigned local_n_btmask;
     74   unsigned local_n_btshft;
     75   unsigned local_n_tmask;
     76   unsigned local_n_tshift;
     77   unsigned local_symesz;
     78   unsigned local_auxesz;
     79   unsigned local_linesz;
     80 
     81   /* The unswapped external symbols.  May be NULL.  Read by
     82      _bfd_coff_get_external_symbols.  */
     83   void * external_syms;
     84 
     85   /* The string table.  May be NULL.  Read by
     86      _bfd_coff_read_string_table.  */
     87   char *strings;
     88   /* The length of the strings table.  For error checking.  */
     89   bfd_size_type strings_len;
     90 
     91   /* Set if long section names are supported.  A writable copy of the COFF
     92      backend flag _bfd_coff_long_section_names.  */
     93   bool long_section_names;
     94 
     95   /* If this is TRUE, raw_syments may not be released.  */
     96   bool keep_raw_syms;
     97   /* If this is TRUE, the external_syms may not be freed.  */
     98   bool keep_syms;
     99   /* If this is TRUE, the strings may not be freed.  */
    100   bool keep_strings;
    101   /* If this is TRUE, the strings have been written out already.  */
    102   bool strings_written;
    103 
    104   /* Is this a GO32 coff file?  */
    105   bool go32;
    106 
    107   /* Is this a PE format coff file?  */
    108   bool pe;
    109 
    110   /* Copy of some of the f_flags bits in the COFF filehdr structure,
    111      used by ARM code.  */
    112   flagword flags;
    113 
    114   /* Used by the COFF backend linker.  */
    115   struct coff_link_hash_entry **sym_hashes;
    116 
    117   /* Used by the pe linker for PowerPC.  */
    118   int *local_toc_sym_map;
    119 
    120   struct bfd_link_info *link_info;
    121 
    122   /* Used by coff_find_nearest_line.  */
    123   void * line_info;
    124 
    125   /* A place to stash dwarf2 info for this bfd.  */
    126   void * dwarf2_find_line_info;
    127 
    128   /* The timestamp from the COFF file header.  */
    129   long timestamp;
    130 
    131   /* A stub (extra data prepended before the COFF image) and its size.
    132      Used by coff-go32-exe, it contains executable data that loads the
    133      COFF object into memory.  */
    134   char * stub;
    135   bfd_size_type stub_size;
    136 
    137   /* Hash table containing sections by target index.  */
    138   htab_t section_by_target_index;
    139 
    140   /* Hash table containing sections by index.  */
    141   htab_t section_by_index;
    142 
    143 } coff_data_type;
    144 
    145 /* Tdata for pe image files.  */
    146 typedef struct pe_tdata
    147 {
    148   coff_data_type coff;
    149   struct internal_extra_pe_aouthdr pe_opthdr;
    150   int dll;
    151   int has_reloc_section;
    152   int dont_strip_reloc;
    153   char dos_message[64];
    154   /* The timestamp to insert into the output file.
    155      If the timestamp is -1 then the current time is used.  */
    156   int timestamp;
    157   bool (*in_reloc_p) (bfd *, reloc_howto_type *);
    158   flagword real_flags;
    159 
    160   /* Build-id info.  */
    161   struct
    162   {
    163     bool (*after_write_object_contents) (bfd *);
    164     const char *style;
    165     asection *sec;
    166   } build_id;
    167 
    168   htab_t comdat_hash;
    169 } pe_data_type;
    170 
    171 #define pe_data(bfd)		((bfd)->tdata.pe_obj_data)
    172 
    173 struct comdat_hash_entry
    174 {
    175   int target_index;
    176   struct internal_syment isym;
    177   char *symname;
    178   flagword sec_flags;
    179   char *comdat_name;
    180   long comdat_symbol;
    181 };
    182 
    183 /* Tdata for XCOFF files.  */
    184 
    185 struct xcoff_tdata
    186 {
    187   /* Basic COFF information.  */
    188   coff_data_type coff;
    189 
    190   /* TRUE if this is an XCOFF64 file. */
    191   bool xcoff64;
    192 
    193   /* TRUE if a large a.out header should be generated.  */
    194   bool full_aouthdr;
    195 
    196   /* TOC value.  */
    197   bfd_vma toc;
    198 
    199   /* Index of section holding TOC.  */
    200   int sntoc;
    201 
    202   /* Index of section holding entry point.  */
    203   int snentry;
    204 
    205   /* .text alignment from optional header.  */
    206   int text_align_power;
    207 
    208   /* .data alignment from optional header.  */
    209   int data_align_power;
    210 
    211   /* modtype from optional header.  */
    212   short modtype;
    213 
    214   /* cputype from optional header.  */
    215   short cputype;
    216 
    217   /* maxdata from optional header.  */
    218   bfd_vma maxdata;
    219 
    220   /* maxstack from optional header.  */
    221   bfd_vma maxstack;
    222 
    223   /* Used by the XCOFF backend linker.  */
    224   asection **csects;
    225   long *debug_indices;
    226   unsigned int *lineno_counts;
    227   unsigned int import_file_id;
    228 };
    229 
    230 #define xcoff_data(abfd) ((abfd)->tdata.xcoff_obj_data)
    231 
    232 /* We take the address of the first element of an asymbol to ensure that the
    233    macro is only ever applied to an asymbol.  */
    234 #define coffsymbol(asymbol) ((coff_symbol_type *)(&((asymbol)->the_bfd)))
    235 
    236 /* Tdata for sections in XCOFF files.  This is used by the linker.  */
    237 
    238 struct xcoff_section_tdata
    239 {
    240   /* Used for XCOFF csects created by the linker; points to the real
    241      XCOFF section which contains this csect.  */
    242   asection *enclosing;
    243   /* The lineno_count field for the enclosing section, because we are
    244      going to clobber it there.  */
    245   unsigned int lineno_count;
    246   /* The first and last symbol indices for symbols used by this csect.  */
    247   unsigned long first_symndx;
    248   unsigned long last_symndx;
    249 };
    250 
    251 /* An accessor macro the xcoff_section_tdata structure.  */
    252 #define xcoff_section_data(abfd, sec) \
    253   ((struct xcoff_section_tdata *) coff_section_data ((abfd), (sec))->tdata)
    254 
    255 /* Tdata for sections in PE files.  */
    256 
    257 struct pei_section_tdata
    258 {
    259   /* The virtual size of the section.  */
    260   bfd_size_type virt_size;
    261   /* The PE section flags.  */
    262   long pe_flags;
    263 };
    264 
    265 /* An accessor macro for the pei_section_tdata structure.  */
    266 #define pei_section_data(abfd, sec) \
    267   ((struct pei_section_tdata *) coff_section_data ((abfd), (sec))->tdata)
    268 
    269 /* COFF linker hash table entries.  */
    270 
    271 struct coff_link_hash_entry
    272 {
    273   struct bfd_link_hash_entry root;
    274 
    275   /* Symbol index in output file.  This is initialized to -1.  It is
    276      set to -2 if the symbol is used by a reloc.  It is set to -3 if
    277      this symbol is defined in a discarded section.  */
    278   long indx;
    279 
    280   /* Symbol type.  */
    281   unsigned short type;
    282 
    283   /* Symbol class.  */
    284   unsigned char symbol_class;
    285 
    286   /* Number of auxiliary entries.  */
    287   char numaux;
    288 
    289   /* BFD to take auxiliary entries from.  */
    290   bfd *auxbfd;
    291 
    292   /* Pointer to array of auxiliary entries, if any.  */
    293   union internal_auxent *aux;
    294 
    295   /* Flag word; legal values follow.  */
    296   unsigned short coff_link_hash_flags;
    297   /* Symbol is a PE section symbol.  */
    298 #define COFF_LINK_HASH_PE_SECTION_SYMBOL (01)
    299 };
    300 
    301 /* COFF linker hash table.  */
    302 
    303 struct coff_link_hash_table
    304 {
    305   struct bfd_link_hash_table root;
    306   /* A pointer to information used to link stabs in sections.  */
    307   struct stab_info stab_info;
    308   /* Hash table that maps undecorated names to their respective
    309    * decorated coff_link_hash_entry as found in fixup_stdcalls  */
    310   struct bfd_hash_table decoration_hash;
    311 };
    312 
    313 struct coff_reloc_cookie
    314 {
    315   struct internal_reloc *	  rels;
    316   struct internal_reloc *	  rel;
    317   struct internal_reloc *	  relend;
    318   struct coff_symbol_struct *	  symbols;	/* Symtab for input bfd.  */
    319   bfd *				  abfd;
    320   struct coff_link_hash_entry **  sym_hashes;
    321 };
    322 
    323 /* Look up an entry in a COFF linker hash table.  */
    324 
    325 #define coff_link_hash_lookup(table, string, create, copy, follow)	\
    326   ((struct coff_link_hash_entry *)					\
    327    bfd_link_hash_lookup (&(table)->root, (string), (create),		\
    328 			 (copy), (follow)))
    329 
    330 /* Traverse a COFF linker hash table.  */
    331 
    332 #define coff_link_hash_traverse(table, func, info)			\
    333   (bfd_link_hash_traverse						\
    334    (&(table)->root,							\
    335     (bool (*) (struct bfd_link_hash_entry *, void *)) (func),		\
    336     (info)))
    337 
    338 /* Get the COFF linker hash table from a link_info structure.  */
    339 
    340 #define coff_hash_table(p) ((struct coff_link_hash_table *) ((p)->hash))
    341 
    342 struct decoration_hash_entry
    343 {
    344   struct bfd_hash_entry root;
    345   struct bfd_link_hash_entry *decorated_link;
    346 };
    347 
    348 /* Functions in coffgen.c.  */
    349 extern void coff_object_cleanup
    350   (bfd *);
    351 extern bfd_cleanup coff_real_object_p
    352   (bfd *, unsigned, struct internal_filehdr *, struct internal_aouthdr *);
    353 extern bfd_cleanup coff_object_p
    354   (bfd *);
    355 extern struct bfd_section *coff_section_from_bfd_index
    356   (bfd *, int);
    357 extern long coff_get_symtab_upper_bound
    358   (bfd *);
    359 extern long coff_canonicalize_symtab
    360   (bfd *, asymbol **);
    361 extern int coff_count_linenumbers
    362   (bfd *);
    363 extern bool coff_renumber_symbols
    364   (bfd *, int *);
    365 extern void coff_mangle_symbols
    366   (bfd *);
    367 extern bool coff_write_symbols
    368   (bfd *);
    369 extern bool coff_write_alien_symbol
    370   (bfd *, asymbol *, struct internal_syment *, bfd_vma *,
    371    struct bfd_strtab_hash *, bool, asection **, bfd_size_type *);
    372 extern bool coff_write_linenumbers
    373   (bfd *);
    374 extern alent *coff_get_lineno
    375   (bfd *, asymbol *);
    376 extern asymbol *coff_section_symbol
    377   (bfd *, char *);
    378 extern bool _bfd_coff_get_external_symbols
    379   (bfd *);
    380 extern const char *_bfd_coff_read_string_table
    381   (bfd *);
    382 extern bool _bfd_coff_free_symbols
    383   (bfd *);
    384 extern struct coff_ptr_struct *coff_get_normalized_symtab
    385   (bfd *);
    386 extern long coff_get_reloc_upper_bound
    387   (bfd *, sec_ptr);
    388 extern asymbol *coff_make_empty_symbol
    389   (bfd *);
    390 extern void coff_print_symbol
    391   (bfd *, void * filep, asymbol *, bfd_print_symbol_type);
    392 extern void coff_get_symbol_info
    393   (bfd *, asymbol *, symbol_info *ret);
    394 #define coff_get_symbol_version_string \
    395   _bfd_nosymbols_get_symbol_version_string
    396 extern bool _bfd_coff_is_local_label_name
    397   (bfd *, const char *);
    398 extern asymbol *coff_bfd_make_debug_symbol
    399   (bfd *);
    400 extern bool coff_find_nearest_line
    401   (bfd *, asymbol **, asection *, bfd_vma,
    402    const char **, const char **, unsigned int *, unsigned int *);
    403 #define coff_find_nearest_line_with_alt \
    404   _bfd_nosymbols_find_nearest_line_with_alt
    405 #define coff_find_line _bfd_nosymbols_find_line
    406 struct dwarf_debug_section;
    407 extern bool coff_find_nearest_line_with_names
    408   (bfd *, asymbol **, asection *, bfd_vma, const char **, const char **,
    409    unsigned int *, const struct dwarf_debug_section *);
    410 extern bool coff_find_inliner_info
    411   (bfd *, const char **, const char **, unsigned int *);
    412 extern int coff_sizeof_headers
    413   (bfd *, struct bfd_link_info *);
    414 extern bool bfd_coff_reloc16_relax_section
    415   (bfd *, asection *, struct bfd_link_info *, bool *);
    416 extern bfd_byte *bfd_coff_reloc16_get_relocated_section_contents
    417   (bfd *, struct bfd_link_info *, struct bfd_link_order *,
    418    bfd_byte *, bool, asymbol **);
    419 extern bfd_vma bfd_coff_reloc16_get_value
    420   (arelent *, struct bfd_link_info *, asection *);
    421 extern void bfd_perform_slip
    422   (bfd *, unsigned int, asection *, bfd_vma);
    423 extern bool _bfd_coff_free_cached_info
    424   (bfd *);
    425 
    426 /* Functions and types in cofflink.c.  */
    427 
    428 #define STRING_SIZE_SIZE 4
    429 
    430 /* We use a hash table to merge identical enum, struct, and union
    431    definitions in the linker.  */
    432 
    433 /* Information we keep for a single element (an enum value, a
    434    structure or union field) in the debug merge hash table.  */
    435 
    436 struct coff_debug_merge_element
    437 {
    438   /* Next element.  */
    439   struct coff_debug_merge_element *next;
    440 
    441   /* Name.  */
    442   const char *name;
    443 
    444   /* Type.  */
    445   unsigned int type;
    446 
    447   /* Symbol index for complex type.  */
    448   long tagndx;
    449 };
    450 
    451 /* A linked list of debug merge entries for a given name.  */
    452 
    453 struct coff_debug_merge_type
    454 {
    455   /* Next type with the same name.  */
    456   struct coff_debug_merge_type *next;
    457 
    458   /* Class of type.  */
    459   int type_class;
    460 
    461   /* Symbol index where this type is defined.  */
    462   long indx;
    463 
    464   /* List of elements.  */
    465   struct coff_debug_merge_element *elements;
    466 };
    467 
    468 /* Information we store in the debug merge hash table.  */
    469 
    470 struct coff_debug_merge_hash_entry
    471 {
    472   struct bfd_hash_entry root;
    473 
    474   /* A list of types with this name.  */
    475   struct coff_debug_merge_type *types;
    476 };
    477 
    478 /* The debug merge hash table.  */
    479 
    480 struct coff_debug_merge_hash_table
    481 {
    482   struct bfd_hash_table root;
    483 };
    484 
    485 /* Initialize a COFF debug merge hash table.  */
    486 
    487 #define coff_debug_merge_hash_table_init(table) \
    488   (bfd_hash_table_init (&(table)->root, _bfd_coff_debug_merge_hash_newfunc, \
    489 			sizeof (struct coff_debug_merge_hash_entry)))
    490 
    491 /* Free a COFF debug merge hash table.  */
    492 
    493 #define coff_debug_merge_hash_table_free(table) \
    494   (bfd_hash_table_free (&(table)->root))
    495 
    496 /* Look up an entry in a COFF debug merge hash table.  */
    497 
    498 #define coff_debug_merge_hash_lookup(table, string, create, copy) \
    499   ((struct coff_debug_merge_hash_entry *) \
    500    bfd_hash_lookup (&(table)->root, (string), (create), (copy)))
    501 
    502 /* Information we keep for each section in the output file when doing
    503    a relocatable link.  */
    504 
    505 struct coff_link_section_info
    506 {
    507   /* The relocs to be output.  */
    508   struct internal_reloc *relocs;
    509   /* For each reloc against a global symbol whose index was not known
    510      when the reloc was handled, the global hash table entry.  */
    511   struct coff_link_hash_entry **rel_hashes;
    512 };
    513 
    514 /* Information that we pass around while doing the final link step.  */
    515 
    516 struct coff_final_link_info
    517 {
    518   /* General link information.  */
    519   struct bfd_link_info *info;
    520   /* Output BFD.  */
    521   bfd *output_bfd;
    522   /* Used to indicate failure in traversal routine.  */
    523   bool failed;
    524   /* If doing "task linking" set only during the time when we want the
    525      global symbol writer to convert the storage class of defined global
    526      symbols from global to static. */
    527   bool global_to_static;
    528   /* Hash table for long symbol names.  */
    529   struct bfd_strtab_hash *strtab;
    530   /* When doing a relocatable link, an array of information kept for
    531      each output section, indexed by the target_index field.  */
    532   struct coff_link_section_info *section_info;
    533   /* Symbol index of last C_FILE symbol (-1 if none).  */
    534   long last_file_index;
    535   /* Contents of last C_FILE symbol.  */
    536   struct internal_syment last_file;
    537   /* Symbol index of first aux entry of last .bf symbol with an empty
    538      endndx field (-1 if none).  */
    539   long last_bf_index;
    540   /* Contents of last_bf_index aux entry.  */
    541   union internal_auxent last_bf;
    542   /* Hash table used to merge debug information.  */
    543   struct coff_debug_merge_hash_table debug_merge;
    544   /* Buffer large enough to hold swapped symbols of any input file.  */
    545   struct internal_syment *internal_syms;
    546   /* Buffer large enough to hold sections of symbols of any input file.  */
    547   asection **sec_ptrs;
    548   /* Buffer large enough to hold output indices of symbols of any
    549      input file.  */
    550   long *sym_indices;
    551   /* Buffer large enough to hold output symbols for any input file.  */
    552   bfd_byte *outsyms;
    553   /* Buffer large enough to hold external line numbers for any input
    554      section.  */
    555   bfd_byte *linenos;
    556   /* Buffer large enough to hold any input section.  */
    557   bfd_byte *contents;
    558   /* Buffer large enough to hold external relocs of any input section.  */
    559   bfd_byte *external_relocs;
    560   /* Buffer large enough to hold swapped relocs of any input section.  */
    561   struct internal_reloc *internal_relocs;
    562 };
    563 
    564 /* Most COFF variants have no way to record the alignment of a
    565    section.  This struct is used to set a specific alignment based on
    566    the name of the section.  */
    567 
    568 struct coff_section_alignment_entry
    569 {
    570   /* The section name.  */
    571   const char *name;
    572 
    573   /* This is either (unsigned int) -1, indicating that the section
    574      name must match exactly, or it is the number of letters which
    575      must match at the start of the name.  */
    576   unsigned int comparison_length;
    577 
    578   /* These macros may be used to fill in the first two fields in a
    579      structure initialization.  */
    580 #define COFF_SECTION_NAME_EXACT_MATCH(name) (name), ((unsigned int) -1)
    581 #define COFF_SECTION_NAME_PARTIAL_MATCH(name) (name), (sizeof (name) - 1)
    582 
    583   /* Only use this entry if the default section alignment for this
    584      target is at least that much (as a power of two).  If this field
    585      is COFF_ALIGNMENT_FIELD_EMPTY, it should be ignored.  */
    586   unsigned int default_alignment_min;
    587 
    588   /* Only use this entry if the default section alignment for this
    589      target is no greater than this (as a power of two).  If this
    590      field is COFF_ALIGNMENT_FIELD_EMPTY, it should be ignored.  */
    591   unsigned int default_alignment_max;
    592 
    593 #define COFF_ALIGNMENT_FIELD_EMPTY ((unsigned int) -1)
    594 
    595   /* The desired alignment for this section (as a power of two).  */
    596   unsigned int alignment_power;
    597 };
    598 
    599 extern struct bfd_hash_entry *_decoration_hash_newfunc
    600   (struct bfd_hash_entry *, struct bfd_hash_table *, const char *);
    601 extern struct bfd_hash_entry *_bfd_coff_link_hash_newfunc
    602   (struct bfd_hash_entry *, struct bfd_hash_table *, const char *);
    603 extern bool _bfd_coff_link_hash_table_init
    604   (struct coff_link_hash_table *, bfd *,
    605    struct bfd_hash_entry *(*) (struct bfd_hash_entry *,
    606 			       struct bfd_hash_table *,
    607 			       const char *),
    608    unsigned int);
    609 extern struct bfd_link_hash_table *_bfd_coff_link_hash_table_create
    610   (bfd *);
    611 extern const char *_bfd_coff_internal_syment_name
    612   (bfd *, const struct internal_syment *, char *);
    613 extern bool _bfd_coff_section_already_linked
    614   (bfd *, asection *, struct bfd_link_info *);
    615 extern bool _bfd_coff_link_add_symbols
    616   (bfd *, struct bfd_link_info *);
    617 extern bool _bfd_coff_final_link
    618   (bfd *, struct bfd_link_info *);
    619 extern struct internal_reloc *_bfd_coff_read_internal_relocs
    620   (bfd *, asection *, bool, bfd_byte *, bool,
    621    struct internal_reloc *);
    622 extern bool _bfd_coff_generic_relocate_section
    623   (bfd *, struct bfd_link_info *, bfd *, asection *, bfd_byte *,
    624    struct internal_reloc *, struct internal_syment *, asection **);
    625 extern struct bfd_hash_entry *_bfd_coff_debug_merge_hash_newfunc
    626   (struct bfd_hash_entry *, struct bfd_hash_table *, const char *);
    627 extern bool _bfd_coff_write_global_sym
    628   (struct bfd_hash_entry *, void *);
    629 extern bool _bfd_coff_write_task_globals
    630   (struct coff_link_hash_entry *, void *);
    631 extern bool _bfd_coff_link_input_bfd
    632   (struct coff_final_link_info *, bfd *);
    633 extern bool _bfd_coff_reloc_link_order
    634   (bfd *, struct coff_final_link_info *, asection *,
    635    struct bfd_link_order *);
    636 extern bool bfd_coff_gc_sections
    637   (bfd *, struct bfd_link_info *);
    638 extern const char *bfd_coff_group_name
    639   (bfd *, const asection *);
    640 
    641 /* Functions in xcofflink.c.  */
    642 
    643 extern long _bfd_xcoff_get_dynamic_symtab_upper_bound
    644   (bfd *);
    645 extern long _bfd_xcoff_canonicalize_dynamic_symtab
    646   (bfd *, asymbol **);
    647 extern long _bfd_xcoff_get_dynamic_reloc_upper_bound
    648   (bfd *);
    649 extern long _bfd_xcoff_canonicalize_dynamic_reloc
    650   (bfd *, arelent **, asymbol **);
    651 extern struct bfd_link_hash_table *_bfd_xcoff_bfd_link_hash_table_create
    652   (bfd *);
    653 extern bool _bfd_xcoff_bfd_link_add_symbols
    654   (bfd *, struct bfd_link_info *);
    655 extern bool _bfd_xcoff_bfd_final_link
    656   (bfd *, struct bfd_link_info *);
    657 extern bool _bfd_xcoff_define_common_symbol
    658   (bfd *, struct bfd_link_info *, struct bfd_link_hash_entry *);
    659 extern bool _bfd_ppc_xcoff_relocate_section
    660   (bfd *, struct bfd_link_info *, bfd *, asection *, bfd_byte *,
    661    struct internal_reloc *, struct internal_syment *, asection **);
    662