Home | History | Annotate | Line # | Download | only in bfd
libbfd-in.h revision 1.1.1.8
      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-2020 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 static inline char *
    127 bfd_strdup (const char *str)
    128 {
    129   size_t len = strlen (str) + 1;
    130   char *buf = bfd_malloc (len);
    131   if (buf != NULL)
    132     memcpy (buf, str, len);
    133   return buf;
    134 }
    135 /* These routines allocate and free things on the BFD's objalloc.  */
    136 
    137 extern void *bfd_alloc2
    138   (bfd *, bfd_size_type, bfd_size_type) ATTRIBUTE_HIDDEN;
    139 extern void *bfd_zalloc2
    140   (bfd *, bfd_size_type, bfd_size_type) ATTRIBUTE_HIDDEN;
    141 extern void bfd_release
    142   (bfd *, void *) ATTRIBUTE_HIDDEN;
    143 
    144 extern bfd * _bfd_create_empty_archive_element_shell
    145   (bfd *) ATTRIBUTE_HIDDEN;
    146 extern bfd * _bfd_look_for_bfd_in_cache
    147   (bfd *, file_ptr) ATTRIBUTE_HIDDEN;
    148 extern bfd_boolean _bfd_add_bfd_to_archive_cache
    149   (bfd *, file_ptr, bfd *) ATTRIBUTE_HIDDEN;
    150 extern bfd_boolean _bfd_generic_mkarchive
    151   (bfd *) ATTRIBUTE_HIDDEN;
    152 extern char *_bfd_append_relative_path
    153   (bfd *, char *) ATTRIBUTE_HIDDEN;
    154 extern const bfd_target *bfd_generic_archive_p
    155   (bfd *) ATTRIBUTE_HIDDEN;
    156 extern bfd_boolean bfd_slurp_armap
    157   (bfd *) ATTRIBUTE_HIDDEN;
    158 #define bfd_slurp_bsd_armap bfd_slurp_armap
    159 #define bfd_slurp_coff_armap bfd_slurp_armap
    160 extern bfd_boolean _bfd_archive_64_bit_slurp_armap
    161   (bfd *) ATTRIBUTE_HIDDEN;
    162 extern bfd_boolean _bfd_archive_64_bit_write_armap
    163   (bfd *, unsigned int, struct orl *, unsigned int, int) ATTRIBUTE_HIDDEN;
    164 #define _bfd_archive_64_bit_slurp_extended_name_table \
    165   _bfd_slurp_extended_name_table
    166 #define _bfd_archive_64_bit_construct_extended_name_table \
    167   _bfd_archive_coff_construct_extended_name_table
    168 #define _bfd_archive_64_bit_truncate_arname \
    169   bfd_dont_truncate_arname
    170 #define _bfd_archive_64_bit_read_ar_hdr \
    171   _bfd_generic_read_ar_hdr
    172 #define _bfd_archive_64_bit_write_ar_hdr \
    173   _bfd_generic_write_ar_hdr
    174 #define _bfd_archive_64_bit_openr_next_archived_file \
    175   bfd_generic_openr_next_archived_file
    176 #define _bfd_archive_64_bit_get_elt_at_index \
    177   _bfd_generic_get_elt_at_index
    178 #define _bfd_archive_64_bit_generic_stat_arch_elt \
    179   bfd_generic_stat_arch_elt
    180 #define _bfd_archive_64_bit_update_armap_timestamp _bfd_bool_bfd_true
    181 
    182 extern bfd_boolean _bfd_slurp_extended_name_table
    183   (bfd *) ATTRIBUTE_HIDDEN;
    184 extern bfd_boolean _bfd_construct_extended_name_table
    185   (bfd *, bfd_boolean, char **, bfd_size_type *) ATTRIBUTE_HIDDEN;
    186 extern bfd_boolean _bfd_write_archive_contents
    187   (bfd *) ATTRIBUTE_HIDDEN;
    188 extern bfd_boolean _bfd_compute_and_write_armap
    189   (bfd *, unsigned int) ATTRIBUTE_HIDDEN;
    190 extern bfd *_bfd_get_elt_at_filepos
    191   (bfd *, file_ptr) ATTRIBUTE_HIDDEN;
    192 extern bfd *_bfd_generic_get_elt_at_index
    193   (bfd *, symindex) ATTRIBUTE_HIDDEN;
    194 extern bfd * _bfd_new_bfd
    195   (void) ATTRIBUTE_HIDDEN;
    196 extern bfd_boolean _bfd_free_cached_info
    197   (bfd *) ATTRIBUTE_HIDDEN;
    198 
    199 extern bfd_boolean _bfd_bool_bfd_false
    200   (bfd *) ATTRIBUTE_HIDDEN;
    201 extern bfd_boolean _bfd_bool_bfd_asymbol_false
    202   (bfd *, asymbol *) ATTRIBUTE_HIDDEN;
    203 extern bfd_boolean _bfd_bool_bfd_false_error
    204   (bfd *) ATTRIBUTE_HIDDEN;
    205 extern bfd_boolean _bfd_bool_bfd_link_false_error
    206   (bfd *, struct bfd_link_info *) ATTRIBUTE_HIDDEN;
    207 extern bfd_boolean _bfd_bool_bfd_true
    208   (bfd *) ATTRIBUTE_HIDDEN;
    209 extern bfd_boolean _bfd_bool_bfd_link_true
    210   (bfd *, struct bfd_link_info *) ATTRIBUTE_HIDDEN;
    211 extern bfd_boolean _bfd_bool_bfd_bfd_true
    212   (bfd *, bfd *) ATTRIBUTE_HIDDEN;
    213 extern bfd_boolean _bfd_bool_bfd_uint_true
    214   (bfd *, unsigned int) ATTRIBUTE_HIDDEN;
    215 extern bfd_boolean _bfd_bool_bfd_asection_bfd_asection_true
    216   (bfd *, asection *, bfd *, asection *) ATTRIBUTE_HIDDEN;
    217 extern bfd_boolean _bfd_bool_bfd_asymbol_bfd_asymbol_true
    218   (bfd *, asymbol *, bfd *, asymbol *) ATTRIBUTE_HIDDEN;
    219 extern bfd_boolean _bfd_bool_bfd_ptr_true
    220   (bfd *, void *) ATTRIBUTE_HIDDEN;
    221 extern void *_bfd_ptr_bfd_null_error
    222   (bfd *) ATTRIBUTE_HIDDEN;
    223 extern int _bfd_int_bfd_0
    224   (bfd *) ATTRIBUTE_HIDDEN;
    225 extern unsigned int _bfd_uint_bfd_0
    226   (bfd *) ATTRIBUTE_HIDDEN;
    227 extern long _bfd_long_bfd_0
    228   (bfd *) ATTRIBUTE_HIDDEN;
    229 extern long _bfd_long_bfd_n1_error
    230   (bfd *) ATTRIBUTE_HIDDEN;
    231 extern void _bfd_void_bfd
    232   (bfd *) ATTRIBUTE_HIDDEN;
    233 extern void _bfd_void_bfd_link
    234   (bfd *, struct bfd_link_info *) ATTRIBUTE_HIDDEN;
    235 extern void _bfd_void_bfd_asection
    236   (bfd *, asection *) ATTRIBUTE_HIDDEN;
    237 
    238 extern bfd *_bfd_new_bfd_contained_in
    239   (bfd *) ATTRIBUTE_HIDDEN;
    240 extern const bfd_target *_bfd_dummy_target
    241   (bfd *) ATTRIBUTE_HIDDEN;
    242 
    243 extern void bfd_dont_truncate_arname
    244   (bfd *, const char *, char *) ATTRIBUTE_HIDDEN;
    245 extern void bfd_bsd_truncate_arname
    246   (bfd *, const char *, char *) ATTRIBUTE_HIDDEN;
    247 extern void bfd_gnu_truncate_arname
    248   (bfd *, const char *, char *) ATTRIBUTE_HIDDEN;
    249 
    250 extern bfd_boolean _bfd_bsd_write_armap
    251   (bfd *, unsigned int, struct orl *, unsigned int, int) ATTRIBUTE_HIDDEN;
    252 
    253 extern bfd_boolean _bfd_coff_write_armap
    254   (bfd *, unsigned int, struct orl *, unsigned int, int) ATTRIBUTE_HIDDEN;
    255 
    256 extern void *_bfd_generic_read_ar_hdr
    257   (bfd *) ATTRIBUTE_HIDDEN;
    258 extern void _bfd_ar_spacepad
    259   (char *, size_t, const char *, long) ATTRIBUTE_HIDDEN;
    260 extern bfd_boolean _bfd_ar_sizepad
    261   (char *, size_t, bfd_size_type) ATTRIBUTE_HIDDEN;
    262 
    263 extern void *_bfd_generic_read_ar_hdr_mag
    264   (bfd *, const char *) ATTRIBUTE_HIDDEN;
    265 
    266 extern bfd_boolean _bfd_generic_write_ar_hdr
    267   (bfd *, bfd *) ATTRIBUTE_HIDDEN;
    268 
    269 extern bfd_boolean _bfd_bsd44_write_ar_hdr
    270   (bfd *, bfd *) ATTRIBUTE_HIDDEN;
    271 
    272 extern bfd * bfd_generic_openr_next_archived_file
    273   (bfd *, bfd *) ATTRIBUTE_HIDDEN;
    274 
    275 extern int bfd_generic_stat_arch_elt
    276   (bfd *, struct stat *) ATTRIBUTE_HIDDEN;
    277 
    278 #define _bfd_read_ar_hdr(abfd) \
    279 	BFD_SEND (abfd, _bfd_read_ar_hdr_fn, (abfd))
    280 #define _bfd_write_ar_hdr(archive, abfd)	 \
    281 	BFD_SEND (abfd, _bfd_write_ar_hdr_fn, (archive, abfd))
    282 
    283 /* Generic routines to use for BFD_JUMP_TABLE_GENERIC.  Use
    285    BFD_JUMP_TABLE_GENERIC (_bfd_generic).  */
    286 
    287 #define _bfd_generic_close_and_cleanup _bfd_archive_close_and_cleanup
    288 extern bfd_boolean _bfd_archive_close_and_cleanup
    289   (bfd *) ATTRIBUTE_HIDDEN;
    290 extern void _bfd_unlink_from_archive_parent (bfd *) ATTRIBUTE_HIDDEN;
    291 #define _bfd_generic_bfd_free_cached_info _bfd_bool_bfd_true
    292 extern bfd_boolean _bfd_generic_new_section_hook
    293   (bfd *, asection *) ATTRIBUTE_HIDDEN;
    294 extern bfd_boolean _bfd_generic_get_section_contents
    295   (bfd *, asection *, void *, file_ptr, bfd_size_type) ATTRIBUTE_HIDDEN;
    296 extern bfd_boolean _bfd_generic_get_section_contents_in_window
    297   (bfd *, asection *, bfd_window *, file_ptr, bfd_size_type) ATTRIBUTE_HIDDEN;
    298 
    299 /* Generic routines to use for BFD_JUMP_TABLE_COPY.  Use
    300    BFD_JUMP_TABLE_COPY (_bfd_generic).  */
    301 
    302 #define _bfd_generic_bfd_copy_private_bfd_data _bfd_bool_bfd_bfd_true
    303 #define _bfd_generic_bfd_merge_private_bfd_data \
    304   _bfd_bool_bfd_link_true
    305 #define _bfd_generic_bfd_set_private_flags _bfd_bool_bfd_uint_true
    306 #define _bfd_generic_bfd_copy_private_section_data \
    307   _bfd_bool_bfd_asection_bfd_asection_true
    308 #define _bfd_generic_bfd_copy_private_symbol_data \
    309   _bfd_bool_bfd_asymbol_bfd_asymbol_true
    310 #define _bfd_generic_bfd_copy_private_header_data _bfd_bool_bfd_bfd_true
    311 #define _bfd_generic_bfd_print_private_bfd_data _bfd_bool_bfd_ptr_true
    312 
    313 extern bfd_boolean _bfd_generic_init_private_section_data
    314   (bfd *, asection *, bfd *, asection *, struct bfd_link_info *)
    315   ATTRIBUTE_HIDDEN;
    316 
    317 /* Routines to use for BFD_JUMP_TABLE_CORE when there is no core file
    318    support.  Use BFD_JUMP_TABLE_CORE (_bfd_nocore).  */
    319 
    320 extern char *_bfd_nocore_core_file_failing_command
    321   (bfd *) ATTRIBUTE_HIDDEN;
    322 extern int _bfd_nocore_core_file_failing_signal
    323   (bfd *) ATTRIBUTE_HIDDEN;
    324 extern bfd_boolean _bfd_nocore_core_file_matches_executable_p
    325   (bfd *, bfd *) ATTRIBUTE_HIDDEN;
    326 extern int _bfd_nocore_core_file_pid
    327   (bfd *) ATTRIBUTE_HIDDEN;
    328 
    329 /* Routines to use for BFD_JUMP_TABLE_ARCHIVE when there is no archive
    330    file support.  Use BFD_JUMP_TABLE_ARCHIVE (_bfd_noarchive).  */
    331 
    332 #define _bfd_noarchive_slurp_armap _bfd_bool_bfd_false_error
    333 #define _bfd_noarchive_slurp_extended_name_table _bfd_bool_bfd_false_error
    334 extern bfd_boolean _bfd_noarchive_construct_extended_name_table
    335   (bfd *, char **, bfd_size_type *, const char **) ATTRIBUTE_HIDDEN;
    336 extern void _bfd_noarchive_truncate_arname
    337   (bfd *, const char *, char *) ATTRIBUTE_HIDDEN;
    338 extern bfd_boolean _bfd_noarchive_write_armap
    339   (bfd *, unsigned int, struct orl *, unsigned int, int) ATTRIBUTE_HIDDEN;
    340 #define _bfd_noarchive_read_ar_hdr _bfd_ptr_bfd_null_error
    341 extern bfd_boolean _bfd_noarchive_write_ar_hdr
    342   (bfd *, bfd *) ATTRIBUTE_HIDDEN;
    343 extern bfd *
    344 _bfd_noarchive_openr_next_archived_file
    345   (bfd *, bfd *) ATTRIBUTE_HIDDEN;
    346 extern bfd * _bfd_noarchive_get_elt_at_index
    347   (bfd *, symindex) ATTRIBUTE_HIDDEN;
    348 #define _bfd_noarchive_generic_stat_arch_elt bfd_generic_stat_arch_elt
    349 #define _bfd_noarchive_update_armap_timestamp _bfd_bool_bfd_false_error
    350 
    351 /* Routines to use for BFD_JUMP_TABLE_ARCHIVE to get BSD style
    352    archives.  Use BFD_JUMP_TABLE_ARCHIVE (_bfd_archive_bsd).  */
    353 
    354 #define _bfd_archive_bsd_slurp_armap bfd_slurp_bsd_armap
    355 #define _bfd_archive_bsd_slurp_extended_name_table \
    356   _bfd_slurp_extended_name_table
    357 extern bfd_boolean _bfd_archive_bsd_construct_extended_name_table
    358   (bfd *, char **, bfd_size_type *, const char **) ATTRIBUTE_HIDDEN;
    359 #define _bfd_archive_bsd_truncate_arname bfd_bsd_truncate_arname
    360 #define _bfd_archive_bsd_write_armap _bfd_bsd_write_armap
    361 #define _bfd_archive_bsd_read_ar_hdr _bfd_generic_read_ar_hdr
    362 #define _bfd_archive_bsd_write_ar_hdr _bfd_generic_write_ar_hdr
    363 #define _bfd_archive_bsd_openr_next_archived_file \
    364   bfd_generic_openr_next_archived_file
    365 #define _bfd_archive_bsd_get_elt_at_index _bfd_generic_get_elt_at_index
    366 #define _bfd_archive_bsd_generic_stat_arch_elt \
    367   bfd_generic_stat_arch_elt
    368 extern bfd_boolean _bfd_archive_bsd_update_armap_timestamp
    369   (bfd *) ATTRIBUTE_HIDDEN;
    370 
    371 /* Routines to use for BFD_JUMP_TABLE_ARCHIVE to get COFF style
    372    archives.  Use BFD_JUMP_TABLE_ARCHIVE (_bfd_archive_coff).  */
    373 
    374 #define _bfd_archive_coff_slurp_armap bfd_slurp_coff_armap
    375 #define _bfd_archive_coff_slurp_extended_name_table \
    376   _bfd_slurp_extended_name_table
    377 extern bfd_boolean _bfd_archive_coff_construct_extended_name_table
    378   (bfd *, char **, bfd_size_type *, const char **) ATTRIBUTE_HIDDEN;
    379 #define _bfd_archive_coff_truncate_arname bfd_dont_truncate_arname
    380 #define _bfd_archive_coff_write_armap _bfd_coff_write_armap
    381 #define _bfd_archive_coff_read_ar_hdr _bfd_generic_read_ar_hdr
    382 #define _bfd_archive_coff_write_ar_hdr _bfd_generic_write_ar_hdr
    383 #define _bfd_archive_coff_openr_next_archived_file \
    384   bfd_generic_openr_next_archived_file
    385 #define _bfd_archive_coff_get_elt_at_index _bfd_generic_get_elt_at_index
    386 #define _bfd_archive_coff_generic_stat_arch_elt \
    387   bfd_generic_stat_arch_elt
    388 #define _bfd_archive_coff_update_armap_timestamp _bfd_bool_bfd_true
    389 
    390 /* Routines to use for BFD_JUMP_TABLE_ARCHIVE to get BSD4.4 style
    391    archives.  Use BFD_JUMP_TABLE_ARCHIVE (_bfd_archive_bsd44).  */
    392 
    393 #define _bfd_archive_bsd44_slurp_armap bfd_slurp_bsd_armap
    394 #define _bfd_archive_bsd44_slurp_extended_name_table \
    395   _bfd_slurp_extended_name_table
    396 extern bfd_boolean _bfd_archive_bsd44_construct_extended_name_table
    397   (bfd *, char **, bfd_size_type *, const char **) ATTRIBUTE_HIDDEN;
    398 #define _bfd_archive_bsd44_truncate_arname bfd_bsd_truncate_arname
    399 #define _bfd_archive_bsd44_write_armap _bfd_bsd_write_armap
    400 #define _bfd_archive_bsd44_read_ar_hdr _bfd_generic_read_ar_hdr
    401 #define _bfd_archive_bsd44_write_ar_hdr _bfd_bsd44_write_ar_hdr
    402 #define _bfd_archive_bsd44_openr_next_archived_file \
    403   bfd_generic_openr_next_archived_file
    404 #define _bfd_archive_bsd44_get_elt_at_index _bfd_generic_get_elt_at_index
    405 #define _bfd_archive_bsd44_generic_stat_arch_elt \
    406   bfd_generic_stat_arch_elt
    407 #define _bfd_archive_bsd44_update_armap_timestamp \
    408   _bfd_archive_bsd_update_armap_timestamp
    409 
    410 /* Routines to use for BFD_JUMP_TABLE_ARCHIVE to get VMS style
    411    archives.  Use BFD_JUMP_TABLE_ARCHIVE (_bfd_vms_lib).  Some of them
    412    are irrelevant.  */
    413 
    414 extern bfd_boolean _bfd_vms_lib_write_archive_contents
    415   (bfd *) ATTRIBUTE_HIDDEN;
    416 #define _bfd_vms_lib_slurp_armap _bfd_noarchive_slurp_armap
    417 #define _bfd_vms_lib_slurp_extended_name_table \
    418   _bfd_noarchive_slurp_extended_name_table
    419 #define _bfd_vms_lib_construct_extended_name_table \
    420   _bfd_noarchive_construct_extended_name_table
    421 #define _bfd_vms_lib_truncate_arname _bfd_noarchive_truncate_arname
    422 #define _bfd_vms_lib_write_armap _bfd_noarchive_write_armap
    423 #define _bfd_vms_lib_read_ar_hdr _bfd_noarchive_read_ar_hdr
    424 #define _bfd_vms_lib_write_ar_hdr _bfd_noarchive_write_ar_hdr
    425 extern bfd *_bfd_vms_lib_openr_next_archived_file
    426   (bfd *, bfd *) ATTRIBUTE_HIDDEN;
    427 extern bfd *_bfd_vms_lib_get_elt_at_index
    428   (bfd *, symindex) ATTRIBUTE_HIDDEN;
    429 extern int _bfd_vms_lib_generic_stat_arch_elt
    430   (bfd *, struct stat *) ATTRIBUTE_HIDDEN;
    431 #define _bfd_vms_lib_update_armap_timestamp _bfd_bool_bfd_true
    432 
    433 /* Extra routines for VMS style archives.  */
    434 
    435 extern symindex _bfd_vms_lib_find_symbol
    436   (bfd *, const char *) ATTRIBUTE_HIDDEN;
    437 extern bfd *_bfd_vms_lib_get_imagelib_file
    438   (bfd *) ATTRIBUTE_HIDDEN;
    439 extern const bfd_target *_bfd_vms_lib_alpha_archive_p
    440   (bfd *) ATTRIBUTE_HIDDEN;
    441 extern const bfd_target *_bfd_vms_lib_ia64_archive_p
    442   (bfd *) ATTRIBUTE_HIDDEN;
    443 extern bfd_boolean _bfd_vms_lib_alpha_mkarchive
    444   (bfd *) ATTRIBUTE_HIDDEN;
    445 extern bfd_boolean _bfd_vms_lib_ia64_mkarchive
    446   (bfd *) ATTRIBUTE_HIDDEN;
    447 
    448 /* Routines to use for BFD_JUMP_TABLE_SYMBOLS where there is no symbol
    449    support.  Use BFD_JUMP_TABLE_SYMBOLS (_bfd_nosymbols).  */
    450 
    451 #define _bfd_nosymbols_get_symtab_upper_bound _bfd_long_bfd_n1_error
    452 extern long _bfd_nosymbols_canonicalize_symtab
    453   (bfd *, asymbol **) ATTRIBUTE_HIDDEN;
    454 #define _bfd_nosymbols_make_empty_symbol _bfd_generic_make_empty_symbol
    455 extern void _bfd_nosymbols_print_symbol
    456   (bfd *, void *, asymbol *, bfd_print_symbol_type) ATTRIBUTE_HIDDEN;
    457 extern void _bfd_nosymbols_get_symbol_info
    458   (bfd *, asymbol *, symbol_info *) ATTRIBUTE_HIDDEN;
    459 extern const char * _bfd_nosymbols_get_symbol_version_string
    460   (bfd *, asymbol *, bfd_boolean *) ATTRIBUTE_HIDDEN;
    461 extern bfd_boolean _bfd_nosymbols_bfd_is_local_label_name
    462   (bfd *, const char *) ATTRIBUTE_HIDDEN;
    463 #define _bfd_nosymbols_bfd_is_target_special_symbol _bfd_bool_bfd_asymbol_false
    464 extern alent *_bfd_nosymbols_get_lineno
    465   (bfd *, asymbol *) ATTRIBUTE_HIDDEN;
    466 extern bfd_boolean _bfd_nosymbols_find_nearest_line
    467   (bfd *, asymbol **, asection *, bfd_vma,
    468    const char **, const char **, unsigned int *, unsigned int *)
    469   ATTRIBUTE_HIDDEN;
    470 extern bfd_boolean _bfd_nosymbols_find_line
    471   (bfd *, asymbol **, asymbol *, const char **, unsigned int *)
    472   ATTRIBUTE_HIDDEN;
    473 extern bfd_boolean _bfd_nosymbols_find_inliner_info
    474   (bfd *, const char **, const char **, unsigned int *) ATTRIBUTE_HIDDEN;
    475 extern asymbol *_bfd_nosymbols_bfd_make_debug_symbol
    476   (bfd *, void *, unsigned long) ATTRIBUTE_HIDDEN;
    477 extern long _bfd_nosymbols_read_minisymbols
    478   (bfd *, bfd_boolean, void **, unsigned int *) ATTRIBUTE_HIDDEN;
    479 extern asymbol *_bfd_nosymbols_minisymbol_to_symbol
    480   (bfd *, bfd_boolean, const void *, asymbol *) ATTRIBUTE_HIDDEN;
    481 
    482 /* Routines to use for BFD_JUMP_TABLE_RELOCS when there is no reloc
    483    support.  Use BFD_JUMP_TABLE_RELOCS (_bfd_norelocs).  */
    484 
    485 extern long _bfd_norelocs_get_reloc_upper_bound
    486   (bfd *, asection *) ATTRIBUTE_HIDDEN;
    487 extern long _bfd_norelocs_canonicalize_reloc
    488   (bfd *, asection *, arelent **, asymbol **) ATTRIBUTE_HIDDEN;
    489 extern void _bfd_norelocs_set_reloc
    490   (bfd *, asection *, arelent **, unsigned int) ATTRIBUTE_HIDDEN;
    491 extern reloc_howto_type *_bfd_norelocs_bfd_reloc_type_lookup
    492   (bfd *, bfd_reloc_code_real_type) ATTRIBUTE_HIDDEN;
    493 extern reloc_howto_type *_bfd_norelocs_bfd_reloc_name_lookup
    494   (bfd *, const char *) ATTRIBUTE_HIDDEN;
    495 
    496 /* Routines to use for BFD_JUMP_TABLE_WRITE for targets which may not
    497    be written.  Use BFD_JUMP_TABLE_WRITE (_bfd_nowrite).  */
    498 
    499 extern bfd_boolean _bfd_nowrite_set_arch_mach
    500   (bfd *, enum bfd_architecture, unsigned long) ATTRIBUTE_HIDDEN;
    501 extern bfd_boolean _bfd_nowrite_set_section_contents
    502   (bfd *, asection *, const void *, file_ptr, bfd_size_type) ATTRIBUTE_HIDDEN;
    503 
    504 /* Generic routines to use for BFD_JUMP_TABLE_WRITE.  Use
    505    BFD_JUMP_TABLE_WRITE (_bfd_generic).  */
    506 
    507 #define _bfd_generic_set_arch_mach bfd_default_set_arch_mach
    508 extern bfd_boolean _bfd_generic_set_section_contents
    509   (bfd *, asection *, const void *, file_ptr, bfd_size_type) ATTRIBUTE_HIDDEN;
    510 
    511 /* Routines to use for BFD_JUMP_TABLE_LINK for targets which do not
    512    support linking.  Use BFD_JUMP_TABLE_LINK (_bfd_nolink).  */
    513 
    514 extern int _bfd_nolink_sizeof_headers
    515   (bfd *, struct bfd_link_info *) ATTRIBUTE_HIDDEN;
    516 extern bfd_byte *_bfd_nolink_bfd_get_relocated_section_contents
    517   (bfd *, struct bfd_link_info *, struct bfd_link_order *,
    518    bfd_byte *, bfd_boolean, asymbol **) ATTRIBUTE_HIDDEN;
    519 extern bfd_boolean _bfd_nolink_bfd_relax_section
    520   (bfd *, asection *, struct bfd_link_info *, bfd_boolean *) ATTRIBUTE_HIDDEN;
    521 #define _bfd_nolink_bfd_gc_sections _bfd_bool_bfd_link_false_error
    522 extern bfd_boolean _bfd_nolink_bfd_lookup_section_flags
    523   (struct bfd_link_info *, struct flag_info *, asection *) ATTRIBUTE_HIDDEN;
    524 #define _bfd_nolink_bfd_merge_sections _bfd_bool_bfd_link_false_error
    525 extern bfd_boolean _bfd_nolink_bfd_is_group_section
    526   (bfd *, const asection *) ATTRIBUTE_HIDDEN;
    527 extern const char *_bfd_nolink_bfd_group_name
    528   (bfd *, const asection *) ATTRIBUTE_HIDDEN;
    529 extern bfd_boolean _bfd_nolink_bfd_discard_group
    530   (bfd *, asection *) ATTRIBUTE_HIDDEN;
    531 extern struct bfd_link_hash_table *_bfd_nolink_bfd_link_hash_table_create
    532   (bfd *) ATTRIBUTE_HIDDEN;
    533 #define _bfd_nolink_bfd_link_add_symbols _bfd_bool_bfd_link_false_error
    534 extern void _bfd_nolink_bfd_link_just_syms
    535   (asection *, struct bfd_link_info *) ATTRIBUTE_HIDDEN;
    536 extern void _bfd_nolink_bfd_copy_link_hash_symbol_type
    537   (bfd *, struct bfd_link_hash_entry *, struct bfd_link_hash_entry *)
    538   ATTRIBUTE_HIDDEN;
    539 #define _bfd_nolink_bfd_final_link _bfd_bool_bfd_link_false_error
    540 extern bfd_boolean _bfd_nolink_bfd_link_split_section
    541   (bfd *, struct bfd_section *) ATTRIBUTE_HIDDEN;
    542 extern bfd_boolean _bfd_nolink_section_already_linked
    543   (bfd *, asection *, struct bfd_link_info *) ATTRIBUTE_HIDDEN;
    544 extern bfd_boolean _bfd_nolink_bfd_define_common_symbol
    545   (bfd *, struct bfd_link_info *, struct bfd_link_hash_entry *)
    546   ATTRIBUTE_HIDDEN;
    547 #define _bfd_nolink_bfd_link_hide_symbol \
    548   _bfd_generic_link_hide_symbol
    549 extern struct bfd_link_hash_entry *_bfd_nolink_bfd_define_start_stop
    550   (struct bfd_link_info *, const char *, asection *) ATTRIBUTE_HIDDEN;
    551 #define _bfd_nolink_bfd_link_check_relocs \
    552   _bfd_generic_link_check_relocs
    553 
    554 /* Routines to use for BFD_JUMP_TABLE_DYNAMIC for targets which do not
    555    have dynamic symbols or relocs.  Use BFD_JUMP_TABLE_DYNAMIC
    556    (_bfd_nodynamic).  */
    557 
    558 #define _bfd_nodynamic_get_dynamic_symtab_upper_bound _bfd_long_bfd_n1_error
    559 #define _bfd_nodynamic_canonicalize_dynamic_symtab \
    560   _bfd_nosymbols_canonicalize_symtab
    561 extern long _bfd_nodynamic_get_synthetic_symtab
    562   (bfd *, long, asymbol **, long, asymbol **, asymbol **) ATTRIBUTE_HIDDEN;
    563 #define _bfd_nodynamic_get_dynamic_reloc_upper_bound _bfd_long_bfd_n1_error
    564 extern long _bfd_nodynamic_canonicalize_dynamic_reloc
    565   (bfd *, arelent **, asymbol **) ATTRIBUTE_HIDDEN;
    566 
    567 /* Generic routine to determine of the given symbol is a local
    569    label.  */
    570 extern bfd_boolean bfd_generic_is_local_label_name
    571   (bfd *, const char *) ATTRIBUTE_HIDDEN;
    572 
    573 /* Generic minisymbol routines.  */
    574 extern long _bfd_generic_read_minisymbols
    575   (bfd *, bfd_boolean, void **, unsigned int *) ATTRIBUTE_HIDDEN;
    576 extern asymbol *_bfd_generic_minisymbol_to_symbol
    577   (bfd *, bfd_boolean, const void *, asymbol *) ATTRIBUTE_HIDDEN;
    578 
    579 /* Find the nearest line using .stab/.stabstr sections.  */
    580 extern bfd_boolean _bfd_stab_section_find_nearest_line
    581   (bfd *, asymbol **, asection *, bfd_vma, bfd_boolean *,
    582    const char **, const char **, unsigned int *, void **) ATTRIBUTE_HIDDEN;
    583 
    584 /* Find the nearest line using DWARF 1 debugging information.  */
    585 extern bfd_boolean _bfd_dwarf1_find_nearest_line
    586   (bfd *, asymbol **, asection *, bfd_vma,
    587    const char **, const char **, unsigned int *) ATTRIBUTE_HIDDEN;
    588 
    589 struct dwarf_debug_section
    590 {
    591   const char * uncompressed_name;
    592   const char * compressed_name;
    593 };
    594 
    595 /* Map of uncompressed DWARF debug section name to compressed one.  It
    596    is terminated by NULL uncompressed_name.  */
    597 
    598 extern const struct dwarf_debug_section dwarf_debug_sections[] ATTRIBUTE_HIDDEN;
    599 
    600 /* Find the nearest line using DWARF 2 debugging information.  */
    601 extern int _bfd_dwarf2_find_nearest_line
    602   (bfd *, asymbol **, asymbol *, asection *, bfd_vma,
    603    const char **, const char **, unsigned int *, unsigned int *,
    604    const struct dwarf_debug_section *, void **) ATTRIBUTE_HIDDEN;
    605 
    606 /* Find the bias between DWARF addresses and real addresses.  */
    607 extern bfd_signed_vma _bfd_dwarf2_find_symbol_bias
    608   (asymbol **, void **) ATTRIBUTE_HIDDEN;
    609 
    610 /* Find inliner info after calling bfd_find_nearest_line. */
    611 extern bfd_boolean _bfd_dwarf2_find_inliner_info
    612   (bfd *, const char **, const char **, unsigned int *, void **)
    613   ATTRIBUTE_HIDDEN;
    614 
    615 /* Read DWARF 2 debugging information. */
    616 extern bfd_boolean _bfd_dwarf2_slurp_debug_info
    617   (bfd *, bfd *, const struct dwarf_debug_section *, asymbol **, void **,
    618    bfd_boolean) ATTRIBUTE_HIDDEN;
    619 
    620 /* Clean up the data used to handle DWARF 2 debugging information. */
    621 extern void _bfd_dwarf2_cleanup_debug_info
    622   (bfd *, void **) ATTRIBUTE_HIDDEN;
    623 
    624 /* Create a new section entry.  */
    625 extern struct bfd_hash_entry *bfd_section_hash_newfunc
    626   (struct bfd_hash_entry *, struct bfd_hash_table *, const char *)
    627   ATTRIBUTE_HIDDEN;
    628 
    629 /* A routine to create entries for a bfd_link_hash_table.  */
    630 extern struct bfd_hash_entry *_bfd_link_hash_newfunc
    631   (struct bfd_hash_entry *entry, struct bfd_hash_table *table,
    632    const char *string) ATTRIBUTE_HIDDEN;
    633 
    634 /* Initialize a bfd_link_hash_table.  */
    635 extern bfd_boolean _bfd_link_hash_table_init
    636   (struct bfd_link_hash_table *, bfd *,
    637    struct bfd_hash_entry *(*) (struct bfd_hash_entry *,
    638 			       struct bfd_hash_table *,
    639 			       const char *),
    640    unsigned int) ATTRIBUTE_HIDDEN;
    641 
    642 /* Generic link hash table creation routine.  */
    643 extern struct bfd_link_hash_table *_bfd_generic_link_hash_table_create
    644   (bfd *) ATTRIBUTE_HIDDEN;
    645 
    646 /* Generic link hash table destruction routine.  */
    647 extern void _bfd_generic_link_hash_table_free
    648   (bfd *) ATTRIBUTE_HIDDEN;
    649 
    650 /* Generic add symbol routine.  */
    651 extern bfd_boolean _bfd_generic_link_add_symbols
    652   (bfd *, struct bfd_link_info *) ATTRIBUTE_HIDDEN;
    653 
    654 /* Generic archive add symbol routine.  */
    655 extern bfd_boolean _bfd_generic_link_add_archive_symbols
    656   (bfd *, struct bfd_link_info *,
    657    bfd_boolean (*) (bfd *, struct bfd_link_info *,
    658 		    struct bfd_link_hash_entry *, const char *,
    659 		    bfd_boolean *)) ATTRIBUTE_HIDDEN;
    660 
    661 /* Forward declaration to avoid prototype errors.  */
    662 typedef struct bfd_link_hash_entry _bfd_link_hash_entry;
    663 
    664 /* Generic routine to add a single symbol.  */
    665 extern bfd_boolean _bfd_generic_link_add_one_symbol
    666   (struct bfd_link_info *, bfd *, const char *name, flagword,
    667    asection *, bfd_vma, const char *, bfd_boolean copy,
    668    bfd_boolean constructor, struct bfd_link_hash_entry **) ATTRIBUTE_HIDDEN;
    669 
    670 /* Generic routine to mark section as supplying symbols only.  */
    671 extern void _bfd_generic_link_just_syms
    672   (asection *, struct bfd_link_info *) ATTRIBUTE_HIDDEN;
    673 
    674 /* Generic routine that does nothing.  */
    675 extern void _bfd_generic_copy_link_hash_symbol_type
    676   (bfd *, struct bfd_link_hash_entry *, struct bfd_link_hash_entry *)
    677   ATTRIBUTE_HIDDEN;
    678 
    679 /* Generic link routine.  */
    680 extern bfd_boolean _bfd_generic_final_link
    681   (bfd *, struct bfd_link_info *) ATTRIBUTE_HIDDEN;
    682 
    683 extern bfd_boolean _bfd_generic_link_split_section
    684   (bfd *, struct bfd_section *) ATTRIBUTE_HIDDEN;
    685 
    686 extern bfd_boolean _bfd_generic_section_already_linked
    687   (bfd *, asection *, struct bfd_link_info *) ATTRIBUTE_HIDDEN;
    688 
    689 /* Generic reloc_link_order processing routine.  */
    690 extern bfd_boolean _bfd_generic_reloc_link_order
    691   (bfd *, struct bfd_link_info *, asection *, struct bfd_link_order *)
    692   ATTRIBUTE_HIDDEN;
    693 
    694 /* Default link order processing routine.  */
    695 extern bfd_boolean _bfd_default_link_order
    696   (bfd *, struct bfd_link_info *, asection *, struct bfd_link_order *)
    697   ATTRIBUTE_HIDDEN;
    698 
    699 /* Count the number of reloc entries in a link order list.  */
    700 extern unsigned int _bfd_count_link_order_relocs
    701   (struct bfd_link_order *) ATTRIBUTE_HIDDEN;
    702 
    703 /* Final link relocation routine.  */
    704 extern bfd_reloc_status_type _bfd_final_link_relocate
    705   (reloc_howto_type *, bfd *, asection *, bfd_byte *,
    706    bfd_vma, bfd_vma, bfd_vma) ATTRIBUTE_HIDDEN;
    707 
    708 /* Relocate a particular location by a howto and a value.  */
    709 extern bfd_reloc_status_type _bfd_relocate_contents
    710   (reloc_howto_type *, bfd *, bfd_vma, bfd_byte *) ATTRIBUTE_HIDDEN;
    711 
    712 /* Clear a given location using a given howto.  */
    713 extern bfd_reloc_status_type _bfd_clear_contents
    714   (reloc_howto_type *, bfd *, asection *, bfd_byte *, bfd_vma) ATTRIBUTE_HIDDEN;
    715 
    716 /* Link stabs in sections in the first pass.  */
    717 
    718 extern bfd_boolean _bfd_link_section_stabs
    719   (bfd *, struct stab_info *, asection *, asection *, void **,
    720    bfd_size_type *) ATTRIBUTE_HIDDEN;
    721 
    722 /* Eliminate stabs for discarded functions and symbols.  */
    723 extern bfd_boolean _bfd_discard_section_stabs
    724   (bfd *, asection *, void *, bfd_boolean (*) (bfd_vma, void *), void *)
    725   ATTRIBUTE_HIDDEN;
    726 
    727 /* Write out the .stab section when linking stabs in sections.  */
    728 
    729 extern bfd_boolean _bfd_write_section_stabs
    730   (bfd *, struct stab_info *, asection *, void **, bfd_byte *)
    731   ATTRIBUTE_HIDDEN;
    732 
    733 /* Write out the .stabstr string table when linking stabs in sections.  */
    734 
    735 extern bfd_boolean _bfd_write_stab_strings
    736   (bfd *, struct stab_info *) ATTRIBUTE_HIDDEN;
    737 
    738 /* Find an offset within a .stab section when linking stabs in
    739    sections.  */
    740 
    741 extern bfd_vma _bfd_stab_section_offset
    742   (asection *, void *, bfd_vma) ATTRIBUTE_HIDDEN;
    743 
    744 /* Register a SEC_MERGE section as a candidate for merging.  */
    745 
    746 extern bfd_boolean _bfd_add_merge_section
    747   (bfd *, void **, asection *, void **) ATTRIBUTE_HIDDEN;
    748 
    749 /* Attempt to merge SEC_MERGE sections.  */
    750 
    751 extern bfd_boolean _bfd_merge_sections
    752   (bfd *, struct bfd_link_info *, void *, void (*) (bfd *, asection *))
    753   ATTRIBUTE_HIDDEN;
    754 
    755 /* Write out a merged section.  */
    756 
    757 extern bfd_boolean _bfd_write_merged_section
    758   (bfd *, asection *, void *) ATTRIBUTE_HIDDEN;
    759 
    760 /* Find an offset within a modified SEC_MERGE section.  */
    761 
    762 extern bfd_vma _bfd_merged_section_offset
    763   (bfd *, asection **, void *, bfd_vma) ATTRIBUTE_HIDDEN;
    764 
    765 /* Tidy up when done.  */
    766 
    767 extern void _bfd_merge_sections_free (void *) ATTRIBUTE_HIDDEN;
    768 
    769 /* Create a string table.  */
    770 extern struct bfd_strtab_hash *_bfd_stringtab_init
    771   (void) ATTRIBUTE_HIDDEN;
    772 
    773 /* Create an XCOFF .debug section style string table.  */
    774 extern struct bfd_strtab_hash *_bfd_xcoff_stringtab_init
    775   (void) ATTRIBUTE_HIDDEN;
    776 
    777 /* Free a string table.  */
    778 extern void _bfd_stringtab_free
    779   (struct bfd_strtab_hash *) ATTRIBUTE_HIDDEN;
    780 
    781 /* Get the size of a string table.  */
    782 extern bfd_size_type _bfd_stringtab_size
    783   (struct bfd_strtab_hash *) ATTRIBUTE_HIDDEN;
    784 
    785 /* Add a string to a string table.  */
    786 extern bfd_size_type _bfd_stringtab_add
    787   (struct bfd_strtab_hash *, const char *, bfd_boolean hash, bfd_boolean copy)
    788   ATTRIBUTE_HIDDEN;
    789 
    790 /* Write out a string table.  */
    791 extern bfd_boolean _bfd_stringtab_emit
    792   (bfd *, struct bfd_strtab_hash *) ATTRIBUTE_HIDDEN;
    793 
    794 /* Macros to tell if bfds are read or write enabled.
    796 
    797    Note that bfds open for read may be scribbled into if the fd passed
    798    to bfd_fdopenr is actually open both for read and write
    799    simultaneously.  However an output bfd will never be open for
    800    read.  Therefore sometimes you want to check bfd_read_p or
    801    !bfd_read_p, and only sometimes bfd_write_p.
    802 */
    803 
    804 #define	bfd_read_p(abfd) \
    805   ((abfd)->direction == read_direction || (abfd)->direction == both_direction)
    806 #define	bfd_write_p(abfd) \
    807   ((abfd)->direction == write_direction || (abfd)->direction == both_direction)
    808 
    809 extern void bfd_assert
    810   (const char*,int) ATTRIBUTE_HIDDEN;
    811 
    812 #define BFD_ASSERT(x) \
    813   do { if (!(x)) bfd_assert(__FILE__,__LINE__); } while (0)
    814 
    815 #define BFD_FAIL() \
    816   do { bfd_assert(__FILE__,__LINE__); } while (0)
    817 
    818 extern void _bfd_abort
    819   (const char *, int, const char *) ATTRIBUTE_NORETURN ATTRIBUTE_HIDDEN;
    820 
    821 /* if gcc >= 2.6, we can give a function name, too */
    822 #if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 6)
    823 #define __PRETTY_FUNCTION__  ((char *) NULL)
    824 #endif
    825 
    826 #undef abort
    827 #define abort() _bfd_abort (__FILE__, __LINE__, __PRETTY_FUNCTION__)
    828 
    829 /* Manipulate a system FILE but using BFD's "file_ptr", rather than
    830    the system "off_t" or "off64_t", as the offset.  */
    831 extern file_ptr _bfd_real_ftell
    832   (FILE *) ATTRIBUTE_HIDDEN;
    833 extern int _bfd_real_fseek
    834   (FILE *, file_ptr, int) ATTRIBUTE_HIDDEN;
    835 extern FILE *_bfd_real_fopen
    836   (const char *, const char *) ATTRIBUTE_HIDDEN;
    837 
    838 /* List of supported target vectors, and the default vector (if
    839    bfd_default_vector[0] is NULL, there is no default).  */
    840 extern const bfd_target * const *bfd_target_vector ATTRIBUTE_HIDDEN;
    841 extern const bfd_target *bfd_default_vector[] ATTRIBUTE_HIDDEN;
    842 
    843 /* List of associated target vectors.  */
    844 extern const bfd_target * const *bfd_associated_vector ATTRIBUTE_HIDDEN;
    845 
    846 /* Functions shared by the ECOFF and MIPS ELF backends, which have no
    847    other common header files.  */
    848 
    849 #if defined(__STDC__) || defined(ALMOST_STDC)
    850 struct ecoff_find_line;
    851 #endif
    852 
    853 extern bfd_boolean _bfd_ecoff_locate_line
    854   (bfd *, asection *, bfd_vma, struct ecoff_debug_info * const,
    855    const struct ecoff_debug_swap * const, struct ecoff_find_line *,
    856    const char **, const char **, unsigned int *) ATTRIBUTE_HIDDEN;
    857 extern bfd_boolean _bfd_ecoff_get_accumulated_pdr
    858   (void *, bfd_byte *) ATTRIBUTE_HIDDEN;
    859 extern bfd_boolean _bfd_ecoff_get_accumulated_sym
    860   (void *, bfd_byte *) ATTRIBUTE_HIDDEN;
    861 extern bfd_boolean _bfd_ecoff_get_accumulated_ss
    862   (void *, bfd_byte *) ATTRIBUTE_HIDDEN;
    863 
    864 extern bfd_vma _bfd_get_gp_value
    865   (bfd *) ATTRIBUTE_HIDDEN;
    866 extern void _bfd_set_gp_value
    867   (bfd *, bfd_vma) ATTRIBUTE_HIDDEN;
    868 
    869 /* Function shared by the COFF and ELF SH backends, which have no
    870    other common header files.  */
    871 
    872 #ifndef _bfd_sh_align_load_span
    873 extern bfd_boolean _bfd_sh_align_load_span
    874   (bfd *, asection *, bfd_byte *,
    875    bfd_boolean (*) (bfd *, asection *, void *, bfd_byte *, bfd_vma),
    876    void *, bfd_vma **, bfd_vma *, bfd_vma, bfd_vma, bfd_boolean *) ATTRIBUTE_HIDDEN;
    877 #endif
    878 
    879 /* This is the shape of the elements inside the already_linked hash
    880    table. It maps a name onto a list of already_linked elements with
    881    the same name.  */
    882 
    883 struct bfd_section_already_linked_hash_entry
    884 {
    885   struct bfd_hash_entry root;
    886   struct bfd_section_already_linked *entry;
    887 };
    888 
    889 struct bfd_section_already_linked
    890 {
    891   struct bfd_section_already_linked *next;
    892   asection *sec;
    893 };
    894 
    895 extern struct bfd_section_already_linked_hash_entry *
    896   bfd_section_already_linked_table_lookup (const char *) ATTRIBUTE_HIDDEN;
    897 extern bfd_boolean bfd_section_already_linked_table_insert
    898   (struct bfd_section_already_linked_hash_entry *, asection *)
    899   ATTRIBUTE_HIDDEN;
    900 extern void bfd_section_already_linked_table_traverse
    901   (bfd_boolean (*) (struct bfd_section_already_linked_hash_entry *,
    902 		    void *), void *) ATTRIBUTE_HIDDEN;
    903 
    904 extern bfd_vma _bfd_read_unsigned_leb128
    905   (bfd *, bfd_byte *, unsigned int *) ATTRIBUTE_HIDDEN;
    906 extern bfd_signed_vma _bfd_read_signed_leb128
    907   (bfd *, bfd_byte *, unsigned int *) ATTRIBUTE_HIDDEN;
    908 extern bfd_vma _bfd_safe_read_leb128
    909   (bfd *, bfd_byte *, unsigned int *, bfd_boolean, const bfd_byte * const)
    910   ATTRIBUTE_HIDDEN;
    911