Home | History | Annotate | Line # | Download | only in bfd
libbfd-in.h revision 1.5.2.1
      1 /* libbfd.h -- Declarations used by bfd library *implementation*.
      2    (This include file is not for users of the library.)
      3 
      4    Copyright (C) 1990-2018 Free Software Foundation, Inc.
      5 
      6    Written by Cygnus Support.
      7 
      8    This file is part of BFD, the Binary File Descriptor library.
      9 
     10    This program is free software; you can redistribute it and/or modify
     11    it under the terms of the GNU General Public License as published by
     12    the Free Software Foundation; either version 3 of the License, or
     13    (at your option) any later version.
     14 
     15    This program is distributed in the hope that it will be useful,
     16    but WITHOUT ANY WARRANTY; without even the implied warranty of
     17    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
     18    GNU General Public License for more details.
     19 
     20    You should have received a copy of the GNU General Public License
     21    along with this program; if not, write to the Free Software
     22    Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston,
     23    MA 02110-1301, USA.  */
     24 
     25 #ifndef _LIBBFD_H
     26 #define _LIBBFD_H 1
     27 
     28 #ifndef ATTRIBUTE_HIDDEN
     29 #if HAVE_HIDDEN
     30 #define ATTRIBUTE_HIDDEN __attribute__ ((__visibility__ ("hidden")))
     31 #else
     32 #define ATTRIBUTE_HIDDEN
     33 #endif
     34 #endif
     35 
     36 #include "hashtab.h"
     37 
     38 #ifdef __cplusplus
     39 extern "C" {
     40 #endif
     41 
     42 /* If you want to read and write large blocks, you might want to do it
     43    in quanta of this amount */
     44 #define DEFAULT_BUFFERSIZE 8192
     45 
     46 /* Set a tdata field.  Can't use the other macros for this, since they
     47    do casts, and casting to the left of assignment isn't portable.  */
     48 #define set_tdata(bfd, v) ((bfd)->tdata.any = (v))
     49 
     50 /* If BFD_IN_MEMORY is set for a BFD, then the iostream fields points
     51    to an instance of this structure.  */
     52 
     53 struct bfd_in_memory
     54 {
     55   /* Size of buffer.  */
     56   bfd_size_type size;
     57   /* Buffer holding contents of BFD.  */
     58   bfd_byte *buffer;
     59 };
     60 
     61 struct section_hash_entry
     62 {
     63   struct bfd_hash_entry root;
     64   asection section;
     65 };
     66 
     67 /* Unique section id.  */
     68 extern unsigned int _bfd_section_id ATTRIBUTE_HIDDEN;
     69 
     70 /* tdata for an archive.  For an input archive, cache
     71    needs to be free()'d.  For an output archive, symdefs do.  */
     72 
     73 struct artdata
     74 {
     75   file_ptr first_file_filepos;
     76   /* Speed up searching the armap */
     77   htab_t cache;
     78   bfd *archive_head;		/* Only interesting in output routines.  */
     79   carsym *symdefs;		/* The symdef entries.  */
     80   symindex symdef_count;	/* How many there are.  */
     81   char *extended_names;		/* Clever intel extension.  */
     82   bfd_size_type extended_names_size; /* Size of extended names.  */
     83   /* When more compilers are standard C, this can be a time_t.  */
     84   long  armap_timestamp;	/* Timestamp value written into armap.
     85 				   This is used for BSD archives to check
     86 				   that the timestamp is recent enough
     87 				   for the BSD linker to not complain,
     88 				   just before we finish writing an
     89 				   archive.  */
     90   file_ptr armap_datepos;	/* Position within archive to seek to
     91 				   rewrite the date field.  */
     92   void *tdata;			/* Backend specific information.  */
     93 };
     94 
     95 #define bfd_ardata(bfd) ((bfd)->tdata.aout_ar_data)
     96 
     97 /* Goes in bfd's arelt_data slot */
     98 struct areltdata
     99 {
    100   char * arch_header;		/* It's actually a string.  */
    101   bfd_size_type parsed_size;	/* Octets of filesize not including ar_hdr.  */
    102   bfd_size_type extra_size;	/* BSD4.4: extra bytes after the header.  */
    103   char *filename;		/* Null-terminated.  */
    104   file_ptr origin;		/* For element of a thin archive.  */
    105   void *parent_cache;		/* Where and how to find this member.  */
    106   file_ptr key;
    107 };
    108 
    109 #define arelt_size(bfd) (((struct areltdata *)((bfd)->arelt_data))->parsed_size)
    110 
    111 extern void *bfd_malloc
    112   (bfd_size_type) ATTRIBUTE_HIDDEN;
    113 extern void *bfd_realloc
    114   (void *, bfd_size_type) ATTRIBUTE_HIDDEN;
    115 extern void *bfd_realloc_or_free
    116   (void *, bfd_size_type) ATTRIBUTE_HIDDEN;
    117 extern void *bfd_zmalloc
    118   (bfd_size_type) ATTRIBUTE_HIDDEN;
    119 extern void *bfd_malloc2
    120   (bfd_size_type, bfd_size_type) ATTRIBUTE_HIDDEN;
    121 extern void *bfd_realloc2
    122   (void *, bfd_size_type, bfd_size_type) ATTRIBUTE_HIDDEN;
    123 extern void *bfd_zmalloc2
    124   (bfd_size_type, bfd_size_type) ATTRIBUTE_HIDDEN;
    125 
    126 /* These routines allocate and free things on the BFD's objalloc.  */
    127 
    128 extern void *bfd_alloc2
    129   (bfd *, bfd_size_type, bfd_size_type) ATTRIBUTE_HIDDEN;
    130 extern void *bfd_zalloc2
    131   (bfd *, bfd_size_type, bfd_size_type) ATTRIBUTE_HIDDEN;
    132 extern void bfd_release
    133   (bfd *, void *) ATTRIBUTE_HIDDEN;
    134 
    135 extern bfd * _bfd_create_empty_archive_element_shell
    136   (bfd *) ATTRIBUTE_HIDDEN;
    137 extern bfd * _bfd_look_for_bfd_in_cache
    138   (bfd *, file_ptr) ATTRIBUTE_HIDDEN;
    139 extern bfd_boolean _bfd_add_bfd_to_archive_cache
    140   (bfd *, file_ptr, bfd *) ATTRIBUTE_HIDDEN;
    141 extern bfd_boolean _bfd_generic_mkarchive
    142   (bfd *) ATTRIBUTE_HIDDEN;
    143 extern char *_bfd_append_relative_path
    144   (bfd *, char *) ATTRIBUTE_HIDDEN;
    145 extern const bfd_target *bfd_generic_archive_p
    146   (bfd *) ATTRIBUTE_HIDDEN;
    147 extern bfd_boolean bfd_slurp_armap
    148   (bfd *) ATTRIBUTE_HIDDEN;
    149 #define bfd_slurp_bsd_armap bfd_slurp_armap
    150 #define bfd_slurp_coff_armap bfd_slurp_armap
    151 extern bfd_boolean _bfd_archive_64_bit_slurp_armap
    152   (bfd *) ATTRIBUTE_HIDDEN;
    153 extern bfd_boolean _bfd_archive_64_bit_write_armap
    154   (bfd *, unsigned int, struct orl *, unsigned int, int) ATTRIBUTE_HIDDEN;
    155 #define _bfd_archive_64_bit_slurp_extended_name_table \
    156   _bfd_slurp_extended_name_table
    157 #define _bfd_archive_64_bit_construct_extended_name_table \
    158   _bfd_archive_coff_construct_extended_name_table
    159 #define _bfd_archive_64_bit_truncate_arname \
    160   bfd_dont_truncate_arname
    161 #define _bfd_archive_64_bit_read_ar_hdr \
    162   _bfd_generic_read_ar_hdr
    163 #define _bfd_archive_64_bit_write_ar_hdr \
    164   _bfd_generic_write_ar_hdr
    165 #define _bfd_archive_64_bit_openr_next_archived_file \
    166   bfd_generic_openr_next_archived_file
    167 #define _bfd_archive_64_bit_get_elt_at_index \
    168   _bfd_generic_get_elt_at_index
    169 #define _bfd_archive_64_bit_generic_stat_arch_elt \
    170   bfd_generic_stat_arch_elt
    171 #define _bfd_archive_64_bit_update_armap_timestamp _bfd_bool_bfd_true
    172 
    173 extern bfd_boolean _bfd_slurp_extended_name_table
    174   (bfd *) ATTRIBUTE_HIDDEN;
    175 extern bfd_boolean _bfd_construct_extended_name_table
    176   (bfd *, bfd_boolean, char **, bfd_size_type *) ATTRIBUTE_HIDDEN;
    177 extern bfd_boolean _bfd_write_archive_contents
    178   (bfd *) ATTRIBUTE_HIDDEN;
    179 extern bfd_boolean _bfd_compute_and_write_armap
    180   (bfd *, unsigned int) ATTRIBUTE_HIDDEN;
    181 extern bfd *_bfd_get_elt_at_filepos
    182   (bfd *, file_ptr) ATTRIBUTE_HIDDEN;
    183 extern bfd *_bfd_generic_get_elt_at_index
    184   (bfd *, symindex) ATTRIBUTE_HIDDEN;
    185 extern bfd * _bfd_new_bfd
    186   (void) ATTRIBUTE_HIDDEN;
    187 extern bfd_boolean _bfd_free_cached_info
    188   (bfd *) ATTRIBUTE_HIDDEN;
    189 
    190 extern bfd_boolean _bfd_bool_bfd_false
    191   (bfd *) ATTRIBUTE_HIDDEN;
    192 extern bfd_boolean _bfd_bool_bfd_asymbol_false
    193   (bfd *, asymbol *) ATTRIBUTE_HIDDEN;
    194 extern bfd_boolean _bfd_bool_bfd_false_error
    195   (bfd *) ATTRIBUTE_HIDDEN;
    196 extern bfd_boolean _bfd_bool_bfd_link_false_error
    197   (bfd *, struct bfd_link_info *) ATTRIBUTE_HIDDEN;
    198 extern bfd_boolean _bfd_bool_bfd_true
    199   (bfd *) ATTRIBUTE_HIDDEN;
    200 extern bfd_boolean _bfd_bool_bfd_link_true
    201   (bfd *, struct bfd_link_info *) ATTRIBUTE_HIDDEN;
    202 extern bfd_boolean _bfd_bool_bfd_bfd_true
    203   (bfd *, bfd *) ATTRIBUTE_HIDDEN;
    204 extern bfd_boolean _bfd_bool_bfd_uint_true
    205   (bfd *, unsigned int) ATTRIBUTE_HIDDEN;
    206 extern bfd_boolean _bfd_bool_bfd_asection_bfd_asection_true
    207   (bfd *, asection *, bfd *, asection *) ATTRIBUTE_HIDDEN;
    208 extern bfd_boolean _bfd_bool_bfd_asymbol_bfd_asymbol_true
    209   (bfd *, asymbol *, bfd *, asymbol *) ATTRIBUTE_HIDDEN;
    210 extern bfd_boolean _bfd_bool_bfd_ptr_true
    211   (bfd *, void *) ATTRIBUTE_HIDDEN;
    212 extern void *_bfd_ptr_bfd_null_error
    213   (bfd *) ATTRIBUTE_HIDDEN;
    214 extern int _bfd_int_bfd_0
    215   (bfd *) ATTRIBUTE_HIDDEN;
    216 extern unsigned int _bfd_uint_bfd_0
    217   (bfd *) ATTRIBUTE_HIDDEN;
    218 extern long _bfd_long_bfd_0
    219   (bfd *) ATTRIBUTE_HIDDEN;
    220 extern long _bfd_long_bfd_n1_error
    221   (bfd *) ATTRIBUTE_HIDDEN;
    222 extern void _bfd_void_bfd
    223   (bfd *) ATTRIBUTE_HIDDEN;
    224 extern void _bfd_void_bfd_link
    225   (bfd *, struct bfd_link_info *) ATTRIBUTE_HIDDEN;
    226 extern void _bfd_void_bfd_asection
    227   (bfd *, asection *) ATTRIBUTE_HIDDEN;
    228 
    229 extern bfd *_bfd_new_bfd_contained_in
    230   (bfd *) ATTRIBUTE_HIDDEN;
    231 extern const bfd_target *_bfd_dummy_target
    232   (bfd *) ATTRIBUTE_HIDDEN;
    233 
    234 extern void bfd_dont_truncate_arname
    235   (bfd *, const char *, char *) ATTRIBUTE_HIDDEN;
    236 extern void bfd_bsd_truncate_arname
    237   (bfd *, const char *, char *) ATTRIBUTE_HIDDEN;
    238 extern void bfd_gnu_truncate_arname
    239   (bfd *, const char *, char *) ATTRIBUTE_HIDDEN;
    240 
    241 extern bfd_boolean _bfd_bsd_write_armap
    242   (bfd *, unsigned int, struct orl *, unsigned int, int) ATTRIBUTE_HIDDEN;
    243 
    244 extern bfd_boolean _bfd_coff_write_armap
    245   (bfd *, unsigned int, struct orl *, unsigned int, int) ATTRIBUTE_HIDDEN;
    246 
    247 extern void *_bfd_generic_read_ar_hdr
    248   (bfd *) ATTRIBUTE_HIDDEN;
    249 extern void _bfd_ar_spacepad
    250   (char *, size_t, const char *, long) ATTRIBUTE_HIDDEN;
    251 extern bfd_boolean _bfd_ar_sizepad
    252   (char *, size_t, bfd_size_type) ATTRIBUTE_HIDDEN;
    253 
    254 extern void *_bfd_generic_read_ar_hdr_mag
    255   (bfd *, const char *) ATTRIBUTE_HIDDEN;
    256 
    257 extern bfd_boolean _bfd_generic_write_ar_hdr
    258   (bfd *, bfd *) ATTRIBUTE_HIDDEN;
    259 
    260 extern bfd_boolean _bfd_bsd44_write_ar_hdr
    261   (bfd *, bfd *) ATTRIBUTE_HIDDEN;
    262 
    263 extern bfd * bfd_generic_openr_next_archived_file
    264   (bfd *, bfd *) ATTRIBUTE_HIDDEN;
    265 
    266 extern int bfd_generic_stat_arch_elt
    267   (bfd *, struct stat *) ATTRIBUTE_HIDDEN;
    268 
    269 #define _bfd_read_ar_hdr(abfd) \
    270 	BFD_SEND (abfd, _bfd_read_ar_hdr_fn, (abfd))
    271 #define _bfd_write_ar_hdr(archive, abfd)	 \
    272 	BFD_SEND (abfd, _bfd_write_ar_hdr_fn, (archive, abfd))
    273 
    274 /* Generic routines to use for BFD_JUMP_TABLE_GENERIC.  Use
    276    BFD_JUMP_TABLE_GENERIC (_bfd_generic).  */
    277 
    278 #define _bfd_generic_close_and_cleanup _bfd_archive_close_and_cleanup
    279 extern bfd_boolean _bfd_archive_close_and_cleanup
    280   (bfd *) ATTRIBUTE_HIDDEN;
    281 #define _bfd_generic_bfd_free_cached_info _bfd_bool_bfd_true
    282 extern bfd_boolean _bfd_generic_new_section_hook
    283   (bfd *, asection *) ATTRIBUTE_HIDDEN;
    284 extern bfd_boolean _bfd_generic_get_section_contents
    285   (bfd *, asection *, void *, file_ptr, bfd_size_type) ATTRIBUTE_HIDDEN;
    286 extern bfd_boolean _bfd_generic_get_section_contents_in_window
    287   (bfd *, asection *, bfd_window *, file_ptr, bfd_size_type) ATTRIBUTE_HIDDEN;
    288 
    289 /* Generic routines to use for BFD_JUMP_TABLE_COPY.  Use
    290    BFD_JUMP_TABLE_COPY (_bfd_generic).  */
    291 
    292 #define _bfd_generic_bfd_copy_private_bfd_data _bfd_bool_bfd_bfd_true
    293 #define _bfd_generic_bfd_merge_private_bfd_data \
    294   _bfd_bool_bfd_link_true
    295 #define _bfd_generic_bfd_set_private_flags _bfd_bool_bfd_uint_true
    296 #define _bfd_generic_bfd_copy_private_section_data \
    297   _bfd_bool_bfd_asection_bfd_asection_true
    298 #define _bfd_generic_bfd_copy_private_symbol_data \
    299   _bfd_bool_bfd_asymbol_bfd_asymbol_true
    300 #define _bfd_generic_bfd_copy_private_header_data _bfd_bool_bfd_bfd_true
    301 #define _bfd_generic_bfd_print_private_bfd_data _bfd_bool_bfd_ptr_true
    302 
    303 extern bfd_boolean _bfd_generic_init_private_section_data
    304   (bfd *, asection *, bfd *, asection *, struct bfd_link_info *)
    305   ATTRIBUTE_HIDDEN;
    306 
    307 /* Routines to use for BFD_JUMP_TABLE_CORE when there is no core file
    308    support.  Use BFD_JUMP_TABLE_CORE (_bfd_nocore).  */
    309 
    310 extern char *_bfd_nocore_core_file_failing_command
    311   (bfd *) ATTRIBUTE_HIDDEN;
    312 extern int _bfd_nocore_core_file_failing_signal
    313   (bfd *) ATTRIBUTE_HIDDEN;
    314 extern bfd_boolean _bfd_nocore_core_file_matches_executable_p
    315   (bfd *, bfd *) ATTRIBUTE_HIDDEN;
    316 extern int _bfd_nocore_core_file_pid
    317   (bfd *) ATTRIBUTE_HIDDEN;
    318 
    319 /* Routines to use for BFD_JUMP_TABLE_ARCHIVE when there is no archive
    320    file support.  Use BFD_JUMP_TABLE_ARCHIVE (_bfd_noarchive).  */
    321 
    322 #define _bfd_noarchive_slurp_armap _bfd_bool_bfd_false_error
    323 #define _bfd_noarchive_slurp_extended_name_table _bfd_bool_bfd_false_error
    324 extern bfd_boolean _bfd_noarchive_construct_extended_name_table
    325   (bfd *, char **, bfd_size_type *, const char **) ATTRIBUTE_HIDDEN;
    326 extern void _bfd_noarchive_truncate_arname
    327   (bfd *, const char *, char *) ATTRIBUTE_HIDDEN;
    328 extern bfd_boolean _bfd_noarchive_write_armap
    329   (bfd *, unsigned int, struct orl *, unsigned int, int) ATTRIBUTE_HIDDEN;
    330 #define _bfd_noarchive_read_ar_hdr _bfd_ptr_bfd_null_error
    331 extern bfd_boolean _bfd_noarchive_write_ar_hdr
    332   (bfd *, bfd *) ATTRIBUTE_HIDDEN;
    333 extern bfd *
    334 _bfd_noarchive_openr_next_archived_file
    335   (bfd *, bfd *) ATTRIBUTE_HIDDEN;
    336 extern bfd * _bfd_noarchive_get_elt_at_index
    337   (bfd *, symindex) ATTRIBUTE_HIDDEN;
    338 #define _bfd_noarchive_generic_stat_arch_elt bfd_generic_stat_arch_elt
    339 #define _bfd_noarchive_update_armap_timestamp _bfd_bool_bfd_false_error
    340 
    341 /* Routines to use for BFD_JUMP_TABLE_ARCHIVE to get BSD style
    342    archives.  Use BFD_JUMP_TABLE_ARCHIVE (_bfd_archive_bsd).  */
    343 
    344 #define _bfd_archive_bsd_slurp_armap bfd_slurp_bsd_armap
    345 #define _bfd_archive_bsd_slurp_extended_name_table \
    346   _bfd_slurp_extended_name_table
    347 extern bfd_boolean _bfd_archive_bsd_construct_extended_name_table
    348   (bfd *, char **, bfd_size_type *, const char **) ATTRIBUTE_HIDDEN;
    349 #define _bfd_archive_bsd_truncate_arname bfd_bsd_truncate_arname
    350 #define _bfd_archive_bsd_write_armap _bfd_bsd_write_armap
    351 #define _bfd_archive_bsd_read_ar_hdr _bfd_generic_read_ar_hdr
    352 #define _bfd_archive_bsd_write_ar_hdr _bfd_generic_write_ar_hdr
    353 #define _bfd_archive_bsd_openr_next_archived_file \
    354   bfd_generic_openr_next_archived_file
    355 #define _bfd_archive_bsd_get_elt_at_index _bfd_generic_get_elt_at_index
    356 #define _bfd_archive_bsd_generic_stat_arch_elt \
    357   bfd_generic_stat_arch_elt
    358 extern bfd_boolean _bfd_archive_bsd_update_armap_timestamp
    359   (bfd *) ATTRIBUTE_HIDDEN;
    360 
    361 /* Routines to use for BFD_JUMP_TABLE_ARCHIVE to get COFF style
    362    archives.  Use BFD_JUMP_TABLE_ARCHIVE (_bfd_archive_coff).  */
    363 
    364 #define _bfd_archive_coff_slurp_armap bfd_slurp_coff_armap
    365 #define _bfd_archive_coff_slurp_extended_name_table \
    366   _bfd_slurp_extended_name_table
    367 extern bfd_boolean _bfd_archive_coff_construct_extended_name_table
    368   (bfd *, char **, bfd_size_type *, const char **) ATTRIBUTE_HIDDEN;
    369 #define _bfd_archive_coff_truncate_arname bfd_dont_truncate_arname
    370 #define _bfd_archive_coff_write_armap _bfd_coff_write_armap
    371 #define _bfd_archive_coff_read_ar_hdr _bfd_generic_read_ar_hdr
    372 #define _bfd_archive_coff_write_ar_hdr _bfd_generic_write_ar_hdr
    373 #define _bfd_archive_coff_openr_next_archived_file \
    374   bfd_generic_openr_next_archived_file
    375 #define _bfd_archive_coff_get_elt_at_index _bfd_generic_get_elt_at_index
    376 #define _bfd_archive_coff_generic_stat_arch_elt \
    377   bfd_generic_stat_arch_elt
    378 #define _bfd_archive_coff_update_armap_timestamp _bfd_bool_bfd_true
    379 
    380 /* Routines to use for BFD_JUMP_TABLE_ARCHIVE to get BSD4.4 style
    381    archives.  Use BFD_JUMP_TABLE_ARCHIVE (_bfd_archive_bsd44).  */
    382 
    383 #define _bfd_archive_bsd44_slurp_armap bfd_slurp_bsd_armap
    384 #define _bfd_archive_bsd44_slurp_extended_name_table \
    385   _bfd_slurp_extended_name_table
    386 extern bfd_boolean _bfd_archive_bsd44_construct_extended_name_table
    387   (bfd *, char **, bfd_size_type *, const char **) ATTRIBUTE_HIDDEN;
    388 #define _bfd_archive_bsd44_truncate_arname bfd_bsd_truncate_arname
    389 #define _bfd_archive_bsd44_write_armap _bfd_bsd_write_armap
    390 #define _bfd_archive_bsd44_read_ar_hdr _bfd_generic_read_ar_hdr
    391 #define _bfd_archive_bsd44_write_ar_hdr _bfd_bsd44_write_ar_hdr
    392 #define _bfd_archive_bsd44_openr_next_archived_file \
    393   bfd_generic_openr_next_archived_file
    394 #define _bfd_archive_bsd44_get_elt_at_index _bfd_generic_get_elt_at_index
    395 #define _bfd_archive_bsd44_generic_stat_arch_elt \
    396   bfd_generic_stat_arch_elt
    397 #define _bfd_archive_bsd44_update_armap_timestamp \
    398   _bfd_archive_bsd_update_armap_timestamp
    399 
    400 /* Routines to use for BFD_JUMP_TABLE_ARCHIVE to get VMS style
    401    archives.  Use BFD_JUMP_TABLE_ARCHIVE (_bfd_vms_lib).  Some of them
    402    are irrelevant.  */
    403 
    404 extern bfd_boolean _bfd_vms_lib_write_archive_contents
    405   (bfd *) ATTRIBUTE_HIDDEN;
    406 #define _bfd_vms_lib_slurp_armap _bfd_noarchive_slurp_armap
    407 #define _bfd_vms_lib_slurp_extended_name_table \
    408   _bfd_noarchive_slurp_extended_name_table
    409 #define _bfd_vms_lib_construct_extended_name_table \
    410   _bfd_noarchive_construct_extended_name_table
    411 #define _bfd_vms_lib_truncate_arname _bfd_noarchive_truncate_arname
    412 #define _bfd_vms_lib_write_armap _bfd_noarchive_write_armap
    413 #define _bfd_vms_lib_read_ar_hdr _bfd_noarchive_read_ar_hdr
    414 #define _bfd_vms_lib_write_ar_hdr _bfd_noarchive_write_ar_hdr
    415 extern bfd *_bfd_vms_lib_openr_next_archived_file
    416   (bfd *, bfd *) ATTRIBUTE_HIDDEN;
    417 extern bfd *_bfd_vms_lib_get_elt_at_index
    418   (bfd *, symindex) ATTRIBUTE_HIDDEN;
    419 extern int _bfd_vms_lib_generic_stat_arch_elt
    420   (bfd *, struct stat *) ATTRIBUTE_HIDDEN;
    421 #define _bfd_vms_lib_update_armap_timestamp _bfd_bool_bfd_true
    422 
    423 /* Extra routines for VMS style archives.  */
    424 
    425 extern symindex _bfd_vms_lib_find_symbol
    426   (bfd *, const char *) ATTRIBUTE_HIDDEN;
    427 extern bfd *_bfd_vms_lib_get_imagelib_file
    428   (bfd *) ATTRIBUTE_HIDDEN;
    429 extern const bfd_target *_bfd_vms_lib_alpha_archive_p
    430   (bfd *) ATTRIBUTE_HIDDEN;
    431 extern const bfd_target *_bfd_vms_lib_ia64_archive_p
    432   (bfd *) ATTRIBUTE_HIDDEN;
    433 extern bfd_boolean _bfd_vms_lib_alpha_mkarchive
    434   (bfd *) ATTRIBUTE_HIDDEN;
    435 extern bfd_boolean _bfd_vms_lib_ia64_mkarchive
    436   (bfd *) ATTRIBUTE_HIDDEN;
    437 
    438 /* Routines to use for BFD_JUMP_TABLE_SYMBOLS where there is no symbol
    439    support.  Use BFD_JUMP_TABLE_SYMBOLS (_bfd_nosymbols).  */
    440 
    441 #define _bfd_nosymbols_get_symtab_upper_bound _bfd_long_bfd_n1_error
    442 extern long _bfd_nosymbols_canonicalize_symtab
    443   (bfd *, asymbol **) ATTRIBUTE_HIDDEN;
    444 #define _bfd_nosymbols_make_empty_symbol _bfd_generic_make_empty_symbol
    445 extern void _bfd_nosymbols_print_symbol
    446   (bfd *, void *, asymbol *, bfd_print_symbol_type) ATTRIBUTE_HIDDEN;
    447 extern void _bfd_nosymbols_get_symbol_info
    448   (bfd *, asymbol *, symbol_info *) ATTRIBUTE_HIDDEN;
    449 extern const char * _bfd_nosymbols_get_symbol_version_string
    450   (bfd *, asymbol *, bfd_boolean *) ATTRIBUTE_HIDDEN;
    451 extern bfd_boolean _bfd_nosymbols_bfd_is_local_label_name
    452   (bfd *, const char *) ATTRIBUTE_HIDDEN;
    453 #define _bfd_nosymbols_bfd_is_target_special_symbol _bfd_bool_bfd_asymbol_false
    454 extern alent *_bfd_nosymbols_get_lineno
    455   (bfd *, asymbol *) ATTRIBUTE_HIDDEN;
    456 extern bfd_boolean _bfd_nosymbols_find_nearest_line
    457   (bfd *, asymbol **, asection *, bfd_vma,
    458    const char **, const char **, unsigned int *, unsigned int *)
    459   ATTRIBUTE_HIDDEN;
    460 extern bfd_boolean _bfd_nosymbols_find_line
    461   (bfd *, asymbol **, asymbol *, const char **, unsigned int *)
    462   ATTRIBUTE_HIDDEN;
    463 extern bfd_boolean _bfd_nosymbols_find_inliner_info
    464   (bfd *, const char **, const char **, unsigned int *) ATTRIBUTE_HIDDEN;
    465 extern asymbol *_bfd_nosymbols_bfd_make_debug_symbol
    466   (bfd *, void *, unsigned long) ATTRIBUTE_HIDDEN;
    467 extern long _bfd_nosymbols_read_minisymbols
    468   (bfd *, bfd_boolean, void **, unsigned int *) ATTRIBUTE_HIDDEN;
    469 extern asymbol *_bfd_nosymbols_minisymbol_to_symbol
    470   (bfd *, bfd_boolean, const void *, asymbol *) ATTRIBUTE_HIDDEN;
    471 
    472 /* Routines to use for BFD_JUMP_TABLE_RELOCS when there is no reloc
    473    support.  Use BFD_JUMP_TABLE_RELOCS (_bfd_norelocs).  */
    474 
    475 extern long _bfd_norelocs_get_reloc_upper_bound
    476   (bfd *, asection *) ATTRIBUTE_HIDDEN;
    477 extern long _bfd_norelocs_canonicalize_reloc
    478   (bfd *, asection *, arelent **, asymbol **) ATTRIBUTE_HIDDEN;
    479 extern void _bfd_norelocs_set_reloc
    480   (bfd *, asection *, arelent **, unsigned int) ATTRIBUTE_HIDDEN;
    481 extern reloc_howto_type *_bfd_norelocs_bfd_reloc_type_lookup
    482   (bfd *, bfd_reloc_code_real_type) ATTRIBUTE_HIDDEN;
    483 extern reloc_howto_type *_bfd_norelocs_bfd_reloc_name_lookup
    484   (bfd *, const char *) ATTRIBUTE_HIDDEN;
    485 
    486 /* Routines to use for BFD_JUMP_TABLE_WRITE for targets which may not
    487    be written.  Use BFD_JUMP_TABLE_WRITE (_bfd_nowrite).  */
    488 
    489 extern bfd_boolean _bfd_nowrite_set_arch_mach
    490   (bfd *, enum bfd_architecture, unsigned long) ATTRIBUTE_HIDDEN;
    491 extern bfd_boolean _bfd_nowrite_set_section_contents
    492   (bfd *, asection *, const void *, file_ptr, bfd_size_type) ATTRIBUTE_HIDDEN;
    493 
    494 /* Generic routines to use for BFD_JUMP_TABLE_WRITE.  Use
    495    BFD_JUMP_TABLE_WRITE (_bfd_generic).  */
    496 
    497 #define _bfd_generic_set_arch_mach bfd_default_set_arch_mach
    498 extern bfd_boolean _bfd_generic_set_section_contents
    499   (bfd *, asection *, const void *, file_ptr, bfd_size_type) ATTRIBUTE_HIDDEN;
    500 
    501 /* Routines to use for BFD_JUMP_TABLE_LINK for targets which do not
    502    support linking.  Use BFD_JUMP_TABLE_LINK (_bfd_nolink).  */
    503 
    504 extern int _bfd_nolink_sizeof_headers
    505   (bfd *, struct bfd_link_info *) ATTRIBUTE_HIDDEN;
    506 extern bfd_byte *_bfd_nolink_bfd_get_relocated_section_contents
    507   (bfd *, struct bfd_link_info *, struct bfd_link_order *,
    508    bfd_byte *, bfd_boolean, asymbol **) ATTRIBUTE_HIDDEN;
    509 extern bfd_boolean _bfd_nolink_bfd_relax_section
    510   (bfd *, asection *, struct bfd_link_info *, bfd_boolean *) ATTRIBUTE_HIDDEN;
    511 #define _bfd_nolink_bfd_gc_sections _bfd_bool_bfd_link_false_error
    512 extern bfd_boolean _bfd_nolink_bfd_lookup_section_flags
    513   (struct bfd_link_info *, struct flag_info *, asection *) ATTRIBUTE_HIDDEN;
    514 #define _bfd_nolink_bfd_merge_sections _bfd_bool_bfd_link_false_error
    515 extern bfd_boolean _bfd_nolink_bfd_is_group_section
    516   (bfd *, const asection *) ATTRIBUTE_HIDDEN;
    517 extern bfd_boolean _bfd_nolink_bfd_discard_group
    518   (bfd *, asection *) ATTRIBUTE_HIDDEN;
    519 extern struct bfd_link_hash_table *_bfd_nolink_bfd_link_hash_table_create
    520   (bfd *) ATTRIBUTE_HIDDEN;
    521 #define _bfd_nolink_bfd_link_add_symbols _bfd_bool_bfd_link_false_error
    522 extern void _bfd_nolink_bfd_link_just_syms
    523   (asection *, struct bfd_link_info *) ATTRIBUTE_HIDDEN;
    524 extern void _bfd_nolink_bfd_copy_link_hash_symbol_type
    525   (bfd *, struct bfd_link_hash_entry *, struct bfd_link_hash_entry *)
    526   ATTRIBUTE_HIDDEN;
    527 #define _bfd_nolink_bfd_final_link _bfd_bool_bfd_link_false_error
    528 extern bfd_boolean _bfd_nolink_bfd_link_split_section
    529   (bfd *, struct bfd_section *) ATTRIBUTE_HIDDEN;
    530 extern bfd_boolean _bfd_nolink_section_already_linked
    531   (bfd *, asection *, struct bfd_link_info *) ATTRIBUTE_HIDDEN;
    532 extern bfd_boolean _bfd_nolink_bfd_define_common_symbol
    533   (bfd *, struct bfd_link_info *, struct bfd_link_hash_entry *)
    534   ATTRIBUTE_HIDDEN;
    535 #define _bfd_nolink_bfd_link_hide_symbol \
    536   _bfd_generic_link_hide_symbol
    537 extern struct bfd_link_hash_entry *_bfd_nolink_bfd_define_start_stop
    538   (struct bfd_link_info *, const char *, asection *) ATTRIBUTE_HIDDEN;
    539 #define _bfd_nolink_bfd_link_check_relocs \
    540   _bfd_generic_link_check_relocs
    541 
    542 /* Routines to use for BFD_JUMP_TABLE_DYNAMIC for targets which do not
    543    have dynamic symbols or relocs.  Use BFD_JUMP_TABLE_DYNAMIC
    544    (_bfd_nodynamic).  */
    545 
    546 #define _bfd_nodynamic_get_dynamic_symtab_upper_bound _bfd_long_bfd_n1_error
    547 #define _bfd_nodynamic_canonicalize_dynamic_symtab \
    548   _bfd_nosymbols_canonicalize_symtab
    549 extern long _bfd_nodynamic_get_synthetic_symtab
    550   (bfd *, long, asymbol **, long, asymbol **, asymbol **) ATTRIBUTE_HIDDEN;
    551 #define _bfd_nodynamic_get_dynamic_reloc_upper_bound _bfd_long_bfd_n1_error
    552 extern long _bfd_nodynamic_canonicalize_dynamic_reloc
    553   (bfd *, arelent **, asymbol **) ATTRIBUTE_HIDDEN;
    554 
    555 /* Generic routine to determine of the given symbol is a local
    557    label.  */
    558 extern bfd_boolean bfd_generic_is_local_label_name
    559   (bfd *, const char *) ATTRIBUTE_HIDDEN;
    560 
    561 /* Generic minisymbol routines.  */
    562 extern long _bfd_generic_read_minisymbols
    563   (bfd *, bfd_boolean, void **, unsigned int *) ATTRIBUTE_HIDDEN;
    564 extern asymbol *_bfd_generic_minisymbol_to_symbol
    565   (bfd *, bfd_boolean, const void *, asymbol *) ATTRIBUTE_HIDDEN;
    566 
    567 /* Find the nearest line using .stab/.stabstr sections.  */
    568 extern bfd_boolean _bfd_stab_section_find_nearest_line
    569   (bfd *, asymbol **, asection *, bfd_vma, bfd_boolean *,
    570    const char **, const char **, unsigned int *, void **) ATTRIBUTE_HIDDEN;
    571 
    572 /* Find the nearest line using DWARF 1 debugging information.  */
    573 extern bfd_boolean _bfd_dwarf1_find_nearest_line
    574   (bfd *, asymbol **, asection *, bfd_vma,
    575    const char **, const char **, unsigned int *) ATTRIBUTE_HIDDEN;
    576 
    577 struct dwarf_debug_section
    578 {
    579   const char * uncompressed_name;
    580   const char * compressed_name;
    581 };
    582 
    583 /* Map of uncompressed DWARF debug section name to compressed one.  It
    584    is terminated by NULL uncompressed_name.  */
    585 
    586 extern const struct dwarf_debug_section dwarf_debug_sections[] ATTRIBUTE_HIDDEN;
    587 
    588 /* Find the nearest line using DWARF 2 debugging information.  */
    589 extern bfd_boolean _bfd_dwarf2_find_nearest_line
    590   (bfd *, asymbol **, asymbol *, asection *, bfd_vma,
    591    const char **, const char **, unsigned int *, unsigned int *,
    592    const struct dwarf_debug_section *, unsigned int, void **) ATTRIBUTE_HIDDEN;
    593 
    594 /* Find the bias between DWARF addresses and real addresses.  */
    595 extern bfd_signed_vma _bfd_dwarf2_find_symbol_bias
    596   (asymbol **, void **) ATTRIBUTE_HIDDEN;
    597 
    598 /* Find inliner info after calling bfd_find_nearest_line. */
    599 extern bfd_boolean _bfd_dwarf2_find_inliner_info
    600   (bfd *, const char **, const char **, unsigned int *, void **)
    601   ATTRIBUTE_HIDDEN;
    602 
    603 /* Read DWARF 2 debugging information. */
    604 extern bfd_boolean _bfd_dwarf2_slurp_debug_info
    605   (bfd *, bfd *, const struct dwarf_debug_section *, asymbol **, void **,
    606    bfd_boolean) ATTRIBUTE_HIDDEN;
    607 
    608 /* Clean up the data used to handle DWARF 2 debugging information. */
    609 extern void _bfd_dwarf2_cleanup_debug_info
    610   (bfd *, void **) ATTRIBUTE_HIDDEN;
    611 
    612 /* Create a new section entry.  */
    613 extern struct bfd_hash_entry *bfd_section_hash_newfunc
    614   (struct bfd_hash_entry *, struct bfd_hash_table *, const char *)
    615   ATTRIBUTE_HIDDEN;
    616 
    617 /* A routine to create entries for a bfd_link_hash_table.  */
    618 extern struct bfd_hash_entry *_bfd_link_hash_newfunc
    619   (struct bfd_hash_entry *entry, struct bfd_hash_table *table,
    620    const char *string) ATTRIBUTE_HIDDEN;
    621 
    622 /* Initialize a bfd_link_hash_table.  */
    623 extern bfd_boolean _bfd_link_hash_table_init
    624   (struct bfd_link_hash_table *, bfd *,
    625    struct bfd_hash_entry *(*) (struct bfd_hash_entry *,
    626 			       struct bfd_hash_table *,
    627 			       const char *),
    628    unsigned int) ATTRIBUTE_HIDDEN;
    629 
    630 /* Generic link hash table creation routine.  */
    631 extern struct bfd_link_hash_table *_bfd_generic_link_hash_table_create
    632   (bfd *) ATTRIBUTE_HIDDEN;
    633 
    634 /* Generic link hash table destruction routine.  */
    635 extern void _bfd_generic_link_hash_table_free
    636   (bfd *) ATTRIBUTE_HIDDEN;
    637 
    638 /* Generic add symbol routine.  */
    639 extern bfd_boolean _bfd_generic_link_add_symbols
    640   (bfd *, struct bfd_link_info *) ATTRIBUTE_HIDDEN;
    641 
    642 /* Generic archive add symbol routine.  */
    643 extern bfd_boolean _bfd_generic_link_add_archive_symbols
    644   (bfd *, struct bfd_link_info *,
    645    bfd_boolean (*) (bfd *, struct bfd_link_info *,
    646 		    struct bfd_link_hash_entry *, const char *,
    647 		    bfd_boolean *)) ATTRIBUTE_HIDDEN;
    648 
    649 /* Forward declaration to avoid prototype errors.  */
    650 typedef struct bfd_link_hash_entry _bfd_link_hash_entry;
    651 
    652 /* Generic routine to add a single symbol.  */
    653 extern bfd_boolean _bfd_generic_link_add_one_symbol
    654   (struct bfd_link_info *, bfd *, const char *name, flagword,
    655    asection *, bfd_vma, const char *, bfd_boolean copy,
    656    bfd_boolean constructor, struct bfd_link_hash_entry **) ATTRIBUTE_HIDDEN;
    657 
    658 /* Generic routine to mark section as supplying symbols only.  */
    659 extern void _bfd_generic_link_just_syms
    660   (asection *, struct bfd_link_info *) ATTRIBUTE_HIDDEN;
    661 
    662 /* Generic routine that does nothing.  */
    663 extern void _bfd_generic_copy_link_hash_symbol_type
    664   (bfd *, struct bfd_link_hash_entry *, struct bfd_link_hash_entry *)
    665   ATTRIBUTE_HIDDEN;
    666 
    667 /* Generic link routine.  */
    668 extern bfd_boolean _bfd_generic_final_link
    669   (bfd *, struct bfd_link_info *) ATTRIBUTE_HIDDEN;
    670 
    671 extern bfd_boolean _bfd_generic_link_split_section
    672   (bfd *, struct bfd_section *) ATTRIBUTE_HIDDEN;
    673 
    674 extern bfd_boolean _bfd_generic_section_already_linked
    675   (bfd *, asection *, struct bfd_link_info *) ATTRIBUTE_HIDDEN;
    676 
    677 /* Generic reloc_link_order processing routine.  */
    678 extern bfd_boolean _bfd_generic_reloc_link_order
    679   (bfd *, struct bfd_link_info *, asection *, struct bfd_link_order *)
    680   ATTRIBUTE_HIDDEN;
    681 
    682 /* Default link order processing routine.  */
    683 extern bfd_boolean _bfd_default_link_order
    684   (bfd *, struct bfd_link_info *, asection *, struct bfd_link_order *)
    685   ATTRIBUTE_HIDDEN;
    686 
    687 /* Count the number of reloc entries in a link order list.  */
    688 extern unsigned int _bfd_count_link_order_relocs
    689   (struct bfd_link_order *) ATTRIBUTE_HIDDEN;
    690 
    691 /* Final link relocation routine.  */
    692 extern bfd_reloc_status_type _bfd_final_link_relocate
    693   (reloc_howto_type *, bfd *, asection *, bfd_byte *,
    694    bfd_vma, bfd_vma, bfd_vma) ATTRIBUTE_HIDDEN;
    695 
    696 /* Relocate a particular location by a howto and a value.  */
    697 extern bfd_reloc_status_type _bfd_relocate_contents
    698   (reloc_howto_type *, bfd *, bfd_vma, bfd_byte *) ATTRIBUTE_HIDDEN;
    699 
    700 /* Clear a given location using a given howto.  */
    701 extern void _bfd_clear_contents
    702   (reloc_howto_type *, bfd *, asection *, bfd_byte *) ATTRIBUTE_HIDDEN;
    703 
    704 /* Link stabs in sections in the first pass.  */
    705 
    706 extern bfd_boolean _bfd_link_section_stabs
    707   (bfd *, struct stab_info *, asection *, asection *, void **,
    708    bfd_size_type *) ATTRIBUTE_HIDDEN;
    709 
    710 /* Eliminate stabs for discarded functions and symbols.  */
    711 extern bfd_boolean _bfd_discard_section_stabs
    712   (bfd *, asection *, void *, bfd_boolean (*) (bfd_vma, void *), void *)
    713   ATTRIBUTE_HIDDEN;
    714 
    715 /* Write out the .stab section when linking stabs in sections.  */
    716 
    717 extern bfd_boolean _bfd_write_section_stabs
    718   (bfd *, struct stab_info *, asection *, void **, bfd_byte *)
    719   ATTRIBUTE_HIDDEN;
    720 
    721 /* Write out the .stabstr string table when linking stabs in sections.  */
    722 
    723 extern bfd_boolean _bfd_write_stab_strings
    724   (bfd *, struct stab_info *) ATTRIBUTE_HIDDEN;
    725 
    726 /* Find an offset within a .stab section when linking stabs in
    727    sections.  */
    728 
    729 extern bfd_vma _bfd_stab_section_offset
    730   (asection *, void *, bfd_vma) ATTRIBUTE_HIDDEN;
    731 
    732 /* Register a SEC_MERGE section as a candidate for merging.  */
    733 
    734 extern bfd_boolean _bfd_add_merge_section
    735   (bfd *, void **, asection *, void **) ATTRIBUTE_HIDDEN;
    736 
    737 /* Attempt to merge SEC_MERGE sections.  */
    738 
    739 extern bfd_boolean _bfd_merge_sections
    740   (bfd *, struct bfd_link_info *, void *, void (*) (bfd *, asection *))
    741   ATTRIBUTE_HIDDEN;
    742 
    743 /* Write out a merged section.  */
    744 
    745 extern bfd_boolean _bfd_write_merged_section
    746   (bfd *, asection *, void *) ATTRIBUTE_HIDDEN;
    747 
    748 /* Find an offset within a modified SEC_MERGE section.  */
    749 
    750 extern bfd_vma _bfd_merged_section_offset
    751   (bfd *, asection **, void *, bfd_vma) ATTRIBUTE_HIDDEN;
    752 
    753 /* Tidy up when done.  */
    754 
    755 extern void _bfd_merge_sections_free (void *) ATTRIBUTE_HIDDEN;
    756 
    757 /* Create a string table.  */
    758 extern struct bfd_strtab_hash *_bfd_stringtab_init
    759   (void) ATTRIBUTE_HIDDEN;
    760 
    761 /* Create an XCOFF .debug section style string table.  */
    762 extern struct bfd_strtab_hash *_bfd_xcoff_stringtab_init
    763   (void) ATTRIBUTE_HIDDEN;
    764 
    765 /* Free a string table.  */
    766 extern void _bfd_stringtab_free
    767   (struct bfd_strtab_hash *) ATTRIBUTE_HIDDEN;
    768 
    769 /* Get the size of a string table.  */
    770 extern bfd_size_type _bfd_stringtab_size
    771   (struct bfd_strtab_hash *) ATTRIBUTE_HIDDEN;
    772 
    773 /* Add a string to a string table.  */
    774 extern bfd_size_type _bfd_stringtab_add
    775   (struct bfd_strtab_hash *, const char *, bfd_boolean hash, bfd_boolean copy)
    776   ATTRIBUTE_HIDDEN;
    777 
    778 /* Write out a string table.  */
    779 extern bfd_boolean _bfd_stringtab_emit
    780   (bfd *, struct bfd_strtab_hash *) ATTRIBUTE_HIDDEN;
    781 
    782 /* Macros to tell if bfds are read or write enabled.
    784 
    785    Note that bfds open for read may be scribbled into if the fd passed
    786    to bfd_fdopenr is actually open both for read and write
    787    simultaneously.  However an output bfd will never be open for
    788    read.  Therefore sometimes you want to check bfd_read_p or
    789    !bfd_read_p, and only sometimes bfd_write_p.
    790 */
    791 
    792 #define	bfd_read_p(abfd) \
    793   ((abfd)->direction == read_direction || (abfd)->direction == both_direction)
    794 #define	bfd_write_p(abfd) \
    795   ((abfd)->direction == write_direction || (abfd)->direction == both_direction)
    796 
    797 extern void bfd_assert
    798   (const char*,int) ATTRIBUTE_HIDDEN;
    799 
    800 #define BFD_ASSERT(x) \
    801   do { if (!(x)) bfd_assert(__FILE__,__LINE__); } while (0)
    802 
    803 #define BFD_FAIL() \
    804   do { bfd_assert(__FILE__,__LINE__); } while (0)
    805 
    806 extern void _bfd_abort
    807   (const char *, int, const char *) ATTRIBUTE_NORETURN ATTRIBUTE_HIDDEN;
    808 
    809 /* if gcc >= 2.6, we can give a function name, too */
    810 #if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 6)
    811 #define __PRETTY_FUNCTION__  ((char *) NULL)
    812 #endif
    813 
    814 #undef abort
    815 #define abort() _bfd_abort (__FILE__, __LINE__, __PRETTY_FUNCTION__)
    816 
    817 /* Manipulate a system FILE but using BFD's "file_ptr", rather than
    818    the system "off_t" or "off64_t", as the offset.  */
    819 extern file_ptr _bfd_real_ftell
    820   (FILE *) ATTRIBUTE_HIDDEN;
    821 extern int _bfd_real_fseek
    822   (FILE *, file_ptr, int) ATTRIBUTE_HIDDEN;
    823 extern FILE *_bfd_real_fopen
    824   (const char *, const char *) ATTRIBUTE_HIDDEN;
    825 
    826 /* List of supported target vectors, and the default vector (if
    827    bfd_default_vector[0] is NULL, there is no default).  */
    828 extern const bfd_target * const *bfd_target_vector ATTRIBUTE_HIDDEN;
    829 extern const bfd_target *bfd_default_vector[] ATTRIBUTE_HIDDEN;
    830 
    831 /* List of associated target vectors.  */
    832 extern const bfd_target * const *bfd_associated_vector ATTRIBUTE_HIDDEN;
    833 
    834 /* Functions shared by the ECOFF and MIPS ELF backends, which have no
    835    other common header files.  */
    836 
    837 #if defined(__STDC__) || defined(ALMOST_STDC)
    838 struct ecoff_find_line;
    839 #endif
    840 
    841 extern bfd_boolean _bfd_ecoff_locate_line
    842   (bfd *, asection *, bfd_vma, struct ecoff_debug_info * const,
    843    const struct ecoff_debug_swap * const, struct ecoff_find_line *,
    844    const char **, const char **, unsigned int *) ATTRIBUTE_HIDDEN;
    845 extern bfd_boolean _bfd_ecoff_get_accumulated_pdr
    846   (void *, bfd_byte *) ATTRIBUTE_HIDDEN;
    847 extern bfd_boolean _bfd_ecoff_get_accumulated_sym
    848   (void *, bfd_byte *) ATTRIBUTE_HIDDEN;
    849 extern bfd_boolean _bfd_ecoff_get_accumulated_ss
    850   (void *, bfd_byte *) ATTRIBUTE_HIDDEN;
    851 
    852 extern bfd_vma _bfd_get_gp_value
    853   (bfd *) ATTRIBUTE_HIDDEN;
    854 extern void _bfd_set_gp_value
    855   (bfd *, bfd_vma) ATTRIBUTE_HIDDEN;
    856 
    857 /* Function shared by the COFF and ELF SH backends, which have no
    858    other common header files.  */
    859 
    860 #ifndef _bfd_sh_align_load_span
    861 extern bfd_boolean _bfd_sh_align_load_span
    862   (bfd *, asection *, bfd_byte *,
    863    bfd_boolean (*) (bfd *, asection *, void *, bfd_byte *, bfd_vma),
    864    void *, bfd_vma **, bfd_vma *, bfd_vma, bfd_vma, bfd_boolean *) ATTRIBUTE_HIDDEN;
    865 #endif
    866 
    867 /* This is the shape of the elements inside the already_linked hash
    868    table. It maps a name onto a list of already_linked elements with
    869    the same name.  */
    870 
    871 struct bfd_section_already_linked_hash_entry
    872 {
    873   struct bfd_hash_entry root;
    874   struct bfd_section_already_linked *entry;
    875 };
    876 
    877 struct bfd_section_already_linked
    878 {
    879   struct bfd_section_already_linked *next;
    880   asection *sec;
    881 };
    882 
    883 extern struct bfd_section_already_linked_hash_entry *
    884   bfd_section_already_linked_table_lookup (const char *) ATTRIBUTE_HIDDEN;
    885 extern bfd_boolean bfd_section_already_linked_table_insert
    886   (struct bfd_section_already_linked_hash_entry *, asection *)
    887   ATTRIBUTE_HIDDEN;
    888 extern void bfd_section_already_linked_table_traverse
    889   (bfd_boolean (*) (struct bfd_section_already_linked_hash_entry *,
    890 		    void *), void *) ATTRIBUTE_HIDDEN;
    891 
    892 extern bfd_vma _bfd_read_unsigned_leb128
    893   (bfd *, bfd_byte *, unsigned int *) ATTRIBUTE_HIDDEN;
    894 extern bfd_signed_vma _bfd_read_signed_leb128
    895   (bfd *, bfd_byte *, unsigned int *) ATTRIBUTE_HIDDEN;
    896 extern bfd_vma _bfd_safe_read_leb128
    897   (bfd *, bfd_byte *, unsigned int *, bfd_boolean, const bfd_byte * const)
    898   ATTRIBUTE_HIDDEN;
    899