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