xref: /openbsd-src/gnu/usr.bin/binutils-2.17/bfd/libbfd-in.h (revision b841744944f6c4f20c64e53feab02094e01cb9ec)
13d8817e4Smiod /* libbfd.h -- Declarations used by bfd library *implementation*.
23d8817e4Smiod    (This include file is not for users of the library.)
33d8817e4Smiod 
43d8817e4Smiod    Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998,
53d8817e4Smiod    1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006
63d8817e4Smiod    Free Software Foundation, Inc.
73d8817e4Smiod 
83d8817e4Smiod    Written by Cygnus Support.
93d8817e4Smiod 
103d8817e4Smiod This file is part of BFD, the Binary File Descriptor library.
113d8817e4Smiod 
123d8817e4Smiod This program is free software; you can redistribute it and/or modify
133d8817e4Smiod it under the terms of the GNU General Public License as published by
143d8817e4Smiod the Free Software Foundation; either version 2 of the License, or
153d8817e4Smiod (at your option) any later version.
163d8817e4Smiod 
173d8817e4Smiod This program is distributed in the hope that it will be useful,
183d8817e4Smiod but WITHOUT ANY WARRANTY; without even the implied warranty of
193d8817e4Smiod MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
203d8817e4Smiod GNU General Public License for more details.
213d8817e4Smiod 
223d8817e4Smiod You should have received a copy of the GNU General Public License
233d8817e4Smiod along with this program; if not, write to the Free Software
243d8817e4Smiod Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.  */
253d8817e4Smiod 
263d8817e4Smiod #include "hashtab.h"
273d8817e4Smiod 
283d8817e4Smiod /* Align an address upward to a boundary, expressed as a number of bytes.
293d8817e4Smiod    E.g. align to an 8-byte boundary with argument of 8.  Take care never
303d8817e4Smiod    to wrap around if the address is within boundary-1 of the end of the
313d8817e4Smiod    address space.  */
323d8817e4Smiod #define BFD_ALIGN(this, boundary)					  \
333d8817e4Smiod   ((((bfd_vma) (this) + (boundary) - 1) >= (bfd_vma) (this))		  \
343d8817e4Smiod    ? (((bfd_vma) (this) + ((boundary) - 1)) & ~ (bfd_vma) ((boundary)-1)) \
353d8817e4Smiod    : ~ (bfd_vma) 0)
363d8817e4Smiod 
373d8817e4Smiod /* If you want to read and write large blocks, you might want to do it
383d8817e4Smiod    in quanta of this amount */
393d8817e4Smiod #define DEFAULT_BUFFERSIZE 8192
403d8817e4Smiod 
413d8817e4Smiod /* Set a tdata field.  Can't use the other macros for this, since they
423d8817e4Smiod    do casts, and casting to the left of assignment isn't portable.  */
433d8817e4Smiod #define set_tdata(bfd, v) ((bfd)->tdata.any = (v))
443d8817e4Smiod 
453d8817e4Smiod /* If BFD_IN_MEMORY is set for a BFD, then the iostream fields points
463d8817e4Smiod    to an instance of this structure.  */
473d8817e4Smiod 
483d8817e4Smiod struct bfd_in_memory
493d8817e4Smiod {
503d8817e4Smiod   /* Size of buffer.  */
513d8817e4Smiod   bfd_size_type size;
523d8817e4Smiod   /* Buffer holding contents of BFD.  */
533d8817e4Smiod   bfd_byte *buffer;
543d8817e4Smiod };
553d8817e4Smiod 
563d8817e4Smiod struct section_hash_entry
573d8817e4Smiod {
583d8817e4Smiod   struct bfd_hash_entry root;
593d8817e4Smiod   asection section;
603d8817e4Smiod };
613d8817e4Smiod 
623d8817e4Smiod /* tdata for an archive.  For an input archive, cache
633d8817e4Smiod    needs to be free()'d.  For an output archive, symdefs do.  */
643d8817e4Smiod 
653d8817e4Smiod struct artdata {
663d8817e4Smiod   file_ptr first_file_filepos;
673d8817e4Smiod   /* Speed up searching the armap */
683d8817e4Smiod   htab_t cache;
693d8817e4Smiod   bfd *archive_head;		/* Only interesting in output routines */
703d8817e4Smiod   carsym *symdefs;		/* the symdef entries */
713d8817e4Smiod   symindex symdef_count;	/* how many there are */
723d8817e4Smiod   char *extended_names;		/* clever intel extension */
733d8817e4Smiod   bfd_size_type extended_names_size; /* Size of extended names */
74d04417c8Smiod   time_t  armap_timestamp;	/* Timestamp value written into armap.
753d8817e4Smiod 				   This is used for BSD archives to check
763d8817e4Smiod 				   that the timestamp is recent enough
773d8817e4Smiod 				   for the BSD linker to not complain,
783d8817e4Smiod 				   just before we finish writing an
793d8817e4Smiod 				   archive.  */
803d8817e4Smiod   file_ptr armap_datepos;	/* Position within archive to seek to
813d8817e4Smiod 				   rewrite the date field.  */
823d8817e4Smiod   void *tdata;			/* Backend specific information.  */
833d8817e4Smiod };
843d8817e4Smiod 
853d8817e4Smiod #define bfd_ardata(bfd) ((bfd)->tdata.aout_ar_data)
863d8817e4Smiod 
873d8817e4Smiod /* Goes in bfd's arelt_data slot */
883d8817e4Smiod struct areltdata {
893d8817e4Smiod   char * arch_header;		/* it's actually a string */
903d8817e4Smiod   unsigned int parsed_size;	/* octets of filesize not including ar_hdr */
913d8817e4Smiod   char *filename;		/* null-terminated */
923d8817e4Smiod };
933d8817e4Smiod 
943d8817e4Smiod #define arelt_size(bfd) (((struct areltdata *)((bfd)->arelt_data))->parsed_size)
953d8817e4Smiod 
963d8817e4Smiod extern void *bfd_malloc
973d8817e4Smiod   (bfd_size_type);
983d8817e4Smiod extern void *bfd_realloc
993d8817e4Smiod   (void *, bfd_size_type);
1003d8817e4Smiod extern void *bfd_zmalloc
1013d8817e4Smiod   (bfd_size_type);
1023d8817e4Smiod extern void *bfd_malloc2
1033d8817e4Smiod   (bfd_size_type, bfd_size_type);
1043d8817e4Smiod extern void *bfd_realloc2
1053d8817e4Smiod   (void *, bfd_size_type, bfd_size_type);
1063d8817e4Smiod extern void *bfd_zmalloc2
1073d8817e4Smiod   (bfd_size_type, bfd_size_type);
1083d8817e4Smiod 
1093d8817e4Smiod extern void _bfd_default_error_handler (const char *s, ...);
1103d8817e4Smiod extern bfd_error_handler_type _bfd_error_handler;
1113d8817e4Smiod 
1123d8817e4Smiod /* These routines allocate and free things on the BFD's objalloc.  */
1133d8817e4Smiod 
1143d8817e4Smiod extern void *bfd_alloc
1153d8817e4Smiod   (bfd *, bfd_size_type);
1163d8817e4Smiod extern void *bfd_zalloc
1173d8817e4Smiod   (bfd *, bfd_size_type);
1183d8817e4Smiod extern void *bfd_alloc2
1193d8817e4Smiod   (bfd *, bfd_size_type, bfd_size_type);
1203d8817e4Smiod extern void *bfd_zalloc2
1213d8817e4Smiod   (bfd *, bfd_size_type, bfd_size_type);
1223d8817e4Smiod extern void bfd_release
1233d8817e4Smiod   (bfd *, void *);
1243d8817e4Smiod 
1253d8817e4Smiod bfd * _bfd_create_empty_archive_element_shell
1263d8817e4Smiod   (bfd *obfd);
1273d8817e4Smiod bfd * _bfd_look_for_bfd_in_cache
1283d8817e4Smiod   (bfd *, file_ptr);
1293d8817e4Smiod bfd_boolean _bfd_add_bfd_to_archive_cache
1303d8817e4Smiod   (bfd *, file_ptr, bfd *);
1313d8817e4Smiod bfd_boolean _bfd_generic_mkarchive
1323d8817e4Smiod   (bfd *abfd);
1333d8817e4Smiod const bfd_target *bfd_generic_archive_p
1343d8817e4Smiod   (bfd *abfd);
1353d8817e4Smiod bfd_boolean bfd_slurp_armap
1363d8817e4Smiod   (bfd *abfd);
1373d8817e4Smiod bfd_boolean bfd_slurp_bsd_armap_f2
1383d8817e4Smiod   (bfd *abfd);
1393d8817e4Smiod #define bfd_slurp_bsd_armap bfd_slurp_armap
1403d8817e4Smiod #define bfd_slurp_coff_armap bfd_slurp_armap
1413d8817e4Smiod bfd_boolean _bfd_slurp_extended_name_table
1423d8817e4Smiod   (bfd *abfd);
1433d8817e4Smiod extern bfd_boolean _bfd_construct_extended_name_table
1443d8817e4Smiod   (bfd *, bfd_boolean, char **, bfd_size_type *);
1453d8817e4Smiod bfd_boolean _bfd_write_archive_contents
1463d8817e4Smiod   (bfd *abfd);
1473d8817e4Smiod bfd_boolean _bfd_compute_and_write_armap
1483d8817e4Smiod   (bfd *, unsigned int elength);
1493d8817e4Smiod bfd *_bfd_get_elt_at_filepos
1503d8817e4Smiod   (bfd *archive, file_ptr filepos);
1513d8817e4Smiod extern bfd *_bfd_generic_get_elt_at_index
1523d8817e4Smiod   (bfd *, symindex);
1533d8817e4Smiod bfd * _bfd_new_bfd
1543d8817e4Smiod   (void);
1553d8817e4Smiod void _bfd_delete_bfd
1563d8817e4Smiod   (bfd *);
1573d8817e4Smiod 
1583d8817e4Smiod bfd_boolean bfd_false
1593d8817e4Smiod   (bfd *ignore);
1603d8817e4Smiod bfd_boolean bfd_true
1613d8817e4Smiod   (bfd *ignore);
1623d8817e4Smiod void *bfd_nullvoidptr
1633d8817e4Smiod   (bfd *ignore);
1643d8817e4Smiod int bfd_0
1653d8817e4Smiod   (bfd *ignore);
1663d8817e4Smiod unsigned int bfd_0u
1673d8817e4Smiod   (bfd *ignore);
1683d8817e4Smiod long bfd_0l
1693d8817e4Smiod   (bfd *ignore);
1703d8817e4Smiod long _bfd_n1
1713d8817e4Smiod   (bfd *ignore);
1723d8817e4Smiod void bfd_void
1733d8817e4Smiod   (bfd *ignore);
1743d8817e4Smiod 
1753d8817e4Smiod bfd *_bfd_new_bfd_contained_in
1763d8817e4Smiod   (bfd *);
1773d8817e4Smiod const bfd_target *_bfd_dummy_target
1783d8817e4Smiod   (bfd *abfd);
1793d8817e4Smiod 
1803d8817e4Smiod void bfd_dont_truncate_arname
1813d8817e4Smiod   (bfd *abfd, const char *filename, char *hdr);
1823d8817e4Smiod void bfd_bsd_truncate_arname
1833d8817e4Smiod   (bfd *abfd, const char *filename, char *hdr);
1843d8817e4Smiod void bfd_gnu_truncate_arname
1853d8817e4Smiod   (bfd *abfd, const char *filename, char *hdr);
1863d8817e4Smiod 
1873d8817e4Smiod bfd_boolean bsd_write_armap
1883d8817e4Smiod   (bfd *arch, unsigned int elength, struct orl *map, unsigned int orl_count,
1893d8817e4Smiod    int stridx);
1903d8817e4Smiod 
1913d8817e4Smiod bfd_boolean coff_write_armap
1923d8817e4Smiod   (bfd *arch, unsigned int elength, struct orl *map, unsigned int orl_count,
1933d8817e4Smiod    int stridx);
1943d8817e4Smiod 
1953d8817e4Smiod extern void *_bfd_generic_read_ar_hdr
1963d8817e4Smiod   (bfd *);
1973d8817e4Smiod extern void _bfd_ar_spacepad
1983d8817e4Smiod   (char *, size_t, const char *, long);
19904a47612Sguenther extern void _bfd_ar_spacepadll
20004a47612Sguenther   (char *, size_t, const char *, long long);
2013d8817e4Smiod 
2023d8817e4Smiod extern void *_bfd_generic_read_ar_hdr_mag
2033d8817e4Smiod   (bfd *, const char *);
2043d8817e4Smiod 
2053d8817e4Smiod bfd * bfd_generic_openr_next_archived_file
2063d8817e4Smiod   (bfd *archive, bfd *last_file);
2073d8817e4Smiod 
2083d8817e4Smiod int bfd_generic_stat_arch_elt
2093d8817e4Smiod   (bfd *, struct stat *);
2103d8817e4Smiod 
2113d8817e4Smiod #define _bfd_read_ar_hdr(abfd) \
2123d8817e4Smiod   BFD_SEND (abfd, _bfd_read_ar_hdr_fn, (abfd))
2133d8817e4Smiod 
2143d8817e4Smiod /* Generic routines to use for BFD_JUMP_TABLE_GENERIC.  Use
2153d8817e4Smiod    BFD_JUMP_TABLE_GENERIC (_bfd_generic).  */
2163d8817e4Smiod 
2173d8817e4Smiod #define _bfd_generic_close_and_cleanup bfd_true
2183d8817e4Smiod #define _bfd_generic_bfd_free_cached_info bfd_true
2193d8817e4Smiod #define _bfd_generic_new_section_hook \
2203d8817e4Smiod   ((bfd_boolean (*) (bfd *, asection *)) bfd_true)
2213d8817e4Smiod extern bfd_boolean _bfd_generic_get_section_contents
2223d8817e4Smiod   (bfd *, asection *, void *, file_ptr, bfd_size_type);
2233d8817e4Smiod extern bfd_boolean _bfd_generic_get_section_contents_in_window
2243d8817e4Smiod   (bfd *, asection *, bfd_window *, file_ptr, bfd_size_type);
2253d8817e4Smiod 
2263d8817e4Smiod /* Generic routines to use for BFD_JUMP_TABLE_COPY.  Use
2273d8817e4Smiod    BFD_JUMP_TABLE_COPY (_bfd_generic).  */
2283d8817e4Smiod 
2293d8817e4Smiod #define _bfd_generic_bfd_copy_private_bfd_data \
2303d8817e4Smiod   ((bfd_boolean (*) (bfd *, bfd *)) bfd_true)
2313d8817e4Smiod #define _bfd_generic_bfd_merge_private_bfd_data \
2323d8817e4Smiod   ((bfd_boolean (*) (bfd *, bfd *)) bfd_true)
2333d8817e4Smiod #define _bfd_generic_bfd_set_private_flags \
2343d8817e4Smiod   ((bfd_boolean (*) (bfd *, flagword)) bfd_true)
2353d8817e4Smiod #define _bfd_generic_bfd_copy_private_section_data \
2363d8817e4Smiod   ((bfd_boolean (*) (bfd *, asection *, bfd *, asection *)) bfd_true)
2373d8817e4Smiod #define _bfd_generic_bfd_copy_private_symbol_data \
2383d8817e4Smiod   ((bfd_boolean (*) (bfd *, asymbol *, bfd *, asymbol *)) bfd_true)
2393d8817e4Smiod #define _bfd_generic_bfd_copy_private_header_data \
2403d8817e4Smiod   ((bfd_boolean (*) (bfd *, bfd *)) bfd_true)
2413d8817e4Smiod #define _bfd_generic_bfd_print_private_bfd_data \
2423d8817e4Smiod   ((bfd_boolean (*) (bfd *, void *)) bfd_true)
2433d8817e4Smiod 
2443d8817e4Smiod extern bfd_boolean _bfd_generic_init_private_section_data
2453d8817e4Smiod   (bfd *, asection *, bfd *, asection *, struct bfd_link_info *);
2463d8817e4Smiod 
2473d8817e4Smiod /* Routines to use for BFD_JUMP_TABLE_CORE when there is no core file
2483d8817e4Smiod    support.  Use BFD_JUMP_TABLE_CORE (_bfd_nocore).  */
2493d8817e4Smiod 
2503d8817e4Smiod extern char *_bfd_nocore_core_file_failing_command
2513d8817e4Smiod   (bfd *);
2523d8817e4Smiod extern int _bfd_nocore_core_file_failing_signal
2533d8817e4Smiod   (bfd *);
2543d8817e4Smiod extern bfd_boolean _bfd_nocore_core_file_matches_executable_p
2553d8817e4Smiod   (bfd *, bfd *);
2563d8817e4Smiod 
2573d8817e4Smiod /* Routines to use for BFD_JUMP_TABLE_ARCHIVE when there is no archive
2583d8817e4Smiod    file support.  Use BFD_JUMP_TABLE_ARCHIVE (_bfd_noarchive).  */
2593d8817e4Smiod 
2603d8817e4Smiod #define _bfd_noarchive_slurp_armap bfd_false
2613d8817e4Smiod #define _bfd_noarchive_slurp_extended_name_table bfd_false
2623d8817e4Smiod #define _bfd_noarchive_construct_extended_name_table \
2633d8817e4Smiod   ((bfd_boolean (*) (bfd *, char **, bfd_size_type *, const char **)) \
2643d8817e4Smiod    bfd_false)
2653d8817e4Smiod #define _bfd_noarchive_truncate_arname \
2663d8817e4Smiod   ((void (*) (bfd *, const char *, char *)) bfd_void)
2673d8817e4Smiod #define _bfd_noarchive_write_armap \
2683d8817e4Smiod   ((bfd_boolean (*) (bfd *, unsigned int, struct orl *, unsigned int, int)) \
2693d8817e4Smiod    bfd_false)
2703d8817e4Smiod #define _bfd_noarchive_read_ar_hdr bfd_nullvoidptr
2713d8817e4Smiod #define _bfd_noarchive_openr_next_archived_file \
2723d8817e4Smiod   ((bfd *(*) (bfd *, bfd *)) bfd_nullvoidptr)
2733d8817e4Smiod #define _bfd_noarchive_get_elt_at_index \
2743d8817e4Smiod   ((bfd *(*) (bfd *, symindex)) bfd_nullvoidptr)
2753d8817e4Smiod #define _bfd_noarchive_generic_stat_arch_elt bfd_generic_stat_arch_elt
2763d8817e4Smiod #define _bfd_noarchive_update_armap_timestamp bfd_false
2773d8817e4Smiod 
2783d8817e4Smiod /* Routines to use for BFD_JUMP_TABLE_ARCHIVE to get BSD style
2793d8817e4Smiod    archives.  Use BFD_JUMP_TABLE_ARCHIVE (_bfd_archive_bsd).  */
2803d8817e4Smiod 
2813d8817e4Smiod #define _bfd_archive_bsd_slurp_armap bfd_slurp_bsd_armap
2823d8817e4Smiod #define _bfd_archive_bsd_slurp_extended_name_table \
2833d8817e4Smiod   _bfd_slurp_extended_name_table
2843d8817e4Smiod extern bfd_boolean _bfd_archive_bsd_construct_extended_name_table
2853d8817e4Smiod   (bfd *, char **, bfd_size_type *, const char **);
2863d8817e4Smiod #define _bfd_archive_bsd_truncate_arname bfd_bsd_truncate_arname
2873d8817e4Smiod #define _bfd_archive_bsd_write_armap bsd_write_armap
2883d8817e4Smiod #define _bfd_archive_bsd_read_ar_hdr _bfd_generic_read_ar_hdr
2893d8817e4Smiod #define _bfd_archive_bsd_openr_next_archived_file \
2903d8817e4Smiod   bfd_generic_openr_next_archived_file
2913d8817e4Smiod #define _bfd_archive_bsd_get_elt_at_index _bfd_generic_get_elt_at_index
2923d8817e4Smiod #define _bfd_archive_bsd_generic_stat_arch_elt \
2933d8817e4Smiod   bfd_generic_stat_arch_elt
2943d8817e4Smiod extern bfd_boolean _bfd_archive_bsd_update_armap_timestamp
2953d8817e4Smiod   (bfd *);
2963d8817e4Smiod 
2973d8817e4Smiod /* Routines to use for BFD_JUMP_TABLE_ARCHIVE to get COFF style
2983d8817e4Smiod    archives.  Use BFD_JUMP_TABLE_ARCHIVE (_bfd_archive_coff).  */
2993d8817e4Smiod 
3003d8817e4Smiod #define _bfd_archive_coff_slurp_armap bfd_slurp_coff_armap
3013d8817e4Smiod #define _bfd_archive_coff_slurp_extended_name_table \
3023d8817e4Smiod   _bfd_slurp_extended_name_table
3033d8817e4Smiod extern bfd_boolean _bfd_archive_coff_construct_extended_name_table
3043d8817e4Smiod   (bfd *, char **, bfd_size_type *, const char **);
3053d8817e4Smiod #define _bfd_archive_coff_truncate_arname bfd_dont_truncate_arname
3063d8817e4Smiod #define _bfd_archive_coff_write_armap coff_write_armap
3073d8817e4Smiod #define _bfd_archive_coff_read_ar_hdr _bfd_generic_read_ar_hdr
3083d8817e4Smiod #define _bfd_archive_coff_openr_next_archived_file \
3093d8817e4Smiod   bfd_generic_openr_next_archived_file
3103d8817e4Smiod #define _bfd_archive_coff_get_elt_at_index _bfd_generic_get_elt_at_index
3113d8817e4Smiod #define _bfd_archive_coff_generic_stat_arch_elt \
3123d8817e4Smiod   bfd_generic_stat_arch_elt
3133d8817e4Smiod #define _bfd_archive_coff_update_armap_timestamp bfd_true
3143d8817e4Smiod 
3153d8817e4Smiod /* Routines to use for BFD_JUMP_TABLE_SYMBOLS where there is no symbol
3163d8817e4Smiod    support.  Use BFD_JUMP_TABLE_SYMBOLS (_bfd_nosymbols).  */
3173d8817e4Smiod 
3183d8817e4Smiod #define _bfd_nosymbols_get_symtab_upper_bound _bfd_n1
3193d8817e4Smiod #define _bfd_nosymbols_canonicalize_symtab \
3203d8817e4Smiod   ((long (*) (bfd *, asymbol **)) _bfd_n1)
3213d8817e4Smiod #define _bfd_nosymbols_make_empty_symbol _bfd_generic_make_empty_symbol
3223d8817e4Smiod #define _bfd_nosymbols_print_symbol \
3233d8817e4Smiod   ((void (*) (bfd *, void *, asymbol *, bfd_print_symbol_type)) bfd_void)
3243d8817e4Smiod #define _bfd_nosymbols_get_symbol_info \
3253d8817e4Smiod   ((void (*) (bfd *, asymbol *, symbol_info *)) bfd_void)
3263d8817e4Smiod #define _bfd_nosymbols_bfd_is_local_label_name \
3273d8817e4Smiod   ((bfd_boolean (*) (bfd *, const char *)) bfd_false)
3283d8817e4Smiod #define _bfd_nosymbols_bfd_is_target_special_symbol \
3293d8817e4Smiod   ((bfd_boolean (*) (bfd *, asymbol *)) bfd_false)
3303d8817e4Smiod #define _bfd_nosymbols_get_lineno \
3313d8817e4Smiod   ((alent *(*) (bfd *, asymbol *)) bfd_nullvoidptr)
3323d8817e4Smiod #define _bfd_nosymbols_find_nearest_line \
3333d8817e4Smiod   ((bfd_boolean (*) (bfd *, asection *, asymbol **, bfd_vma, const char **, \
3343d8817e4Smiod 		     const char **, unsigned int *)) \
3353d8817e4Smiod    bfd_false)
3363d8817e4Smiod #define _bfd_nosymbols_find_inliner_info \
3373d8817e4Smiod   ((bfd_boolean (*) (bfd *, const char **, const char **, unsigned int *)) \
3383d8817e4Smiod    bfd_false)
3393d8817e4Smiod #define _bfd_nosymbols_bfd_make_debug_symbol \
3403d8817e4Smiod   ((asymbol *(*) (bfd *, void *, unsigned long)) bfd_nullvoidptr)
3413d8817e4Smiod #define _bfd_nosymbols_read_minisymbols \
3423d8817e4Smiod   ((long (*) (bfd *, bfd_boolean, void **, unsigned int *)) _bfd_n1)
3433d8817e4Smiod #define _bfd_nosymbols_minisymbol_to_symbol \
3443d8817e4Smiod   ((asymbol *(*) (bfd *, bfd_boolean, const void *, asymbol *)) \
3453d8817e4Smiod    bfd_nullvoidptr)
3463d8817e4Smiod 
3473d8817e4Smiod /* Routines to use for BFD_JUMP_TABLE_RELOCS when there is no reloc
3483d8817e4Smiod    support.  Use BFD_JUMP_TABLE_RELOCS (_bfd_norelocs).  */
3493d8817e4Smiod 
3503d8817e4Smiod #define _bfd_norelocs_get_reloc_upper_bound \
3513d8817e4Smiod   ((long (*) (bfd *, asection *)) _bfd_n1)
3523d8817e4Smiod #define _bfd_norelocs_canonicalize_reloc \
3533d8817e4Smiod   ((long (*) (bfd *, asection *, arelent **, asymbol **)) _bfd_n1)
3543d8817e4Smiod #define _bfd_norelocs_bfd_reloc_type_lookup \
3553d8817e4Smiod   ((reloc_howto_type *(*) (bfd *, bfd_reloc_code_real_type)) bfd_nullvoidptr)
3563d8817e4Smiod 
3573d8817e4Smiod /* Routines to use for BFD_JUMP_TABLE_WRITE for targets which may not
3583d8817e4Smiod    be written.  Use BFD_JUMP_TABLE_WRITE (_bfd_nowrite).  */
3593d8817e4Smiod 
3603d8817e4Smiod #define _bfd_nowrite_set_arch_mach \
3613d8817e4Smiod   ((bfd_boolean (*) (bfd *, enum bfd_architecture, unsigned long)) \
3623d8817e4Smiod    bfd_false)
3633d8817e4Smiod #define _bfd_nowrite_set_section_contents \
3643d8817e4Smiod   ((bfd_boolean (*) (bfd *, asection *, const void *, file_ptr, bfd_size_type)) \
3653d8817e4Smiod    bfd_false)
3663d8817e4Smiod 
3673d8817e4Smiod /* Generic routines to use for BFD_JUMP_TABLE_WRITE.  Use
3683d8817e4Smiod    BFD_JUMP_TABLE_WRITE (_bfd_generic).  */
3693d8817e4Smiod 
3703d8817e4Smiod #define _bfd_generic_set_arch_mach bfd_default_set_arch_mach
3713d8817e4Smiod extern bfd_boolean _bfd_generic_set_section_contents
3723d8817e4Smiod   (bfd *, asection *, const void *, file_ptr, bfd_size_type);
3733d8817e4Smiod 
3743d8817e4Smiod /* Routines to use for BFD_JUMP_TABLE_LINK for targets which do not
3753d8817e4Smiod    support linking.  Use BFD_JUMP_TABLE_LINK (_bfd_nolink).  */
3763d8817e4Smiod 
3773d8817e4Smiod #define _bfd_nolink_sizeof_headers ((int (*) (bfd *, bfd_boolean)) bfd_0)
3783d8817e4Smiod #define _bfd_nolink_bfd_get_relocated_section_contents \
3793d8817e4Smiod   ((bfd_byte *(*) (bfd *, struct bfd_link_info *, struct bfd_link_order *, \
3803d8817e4Smiod 		   bfd_byte *, bfd_boolean, asymbol **)) \
3813d8817e4Smiod    bfd_nullvoidptr)
3823d8817e4Smiod #define _bfd_nolink_bfd_relax_section \
3833d8817e4Smiod   ((bfd_boolean (*) \
3843d8817e4Smiod     (bfd *, asection *, struct bfd_link_info *, bfd_boolean *)) \
3853d8817e4Smiod    bfd_false)
3863d8817e4Smiod #define _bfd_nolink_bfd_gc_sections \
3873d8817e4Smiod   ((bfd_boolean (*) (bfd *, struct bfd_link_info *)) \
3883d8817e4Smiod    bfd_false)
3893d8817e4Smiod #define _bfd_nolink_bfd_merge_sections \
3903d8817e4Smiod   ((bfd_boolean (*) (bfd *, struct bfd_link_info *)) \
3913d8817e4Smiod    bfd_false)
3923d8817e4Smiod #define _bfd_nolink_bfd_is_group_section \
3933d8817e4Smiod   ((bfd_boolean (*) (bfd *, const struct bfd_section *)) \
3943d8817e4Smiod    bfd_false)
3953d8817e4Smiod #define _bfd_nolink_bfd_discard_group \
3963d8817e4Smiod   ((bfd_boolean (*) (bfd *, struct bfd_section *)) \
3973d8817e4Smiod    bfd_false)
3983d8817e4Smiod #define _bfd_nolink_bfd_link_hash_table_create \
3993d8817e4Smiod   ((struct bfd_link_hash_table *(*) (bfd *)) bfd_nullvoidptr)
4003d8817e4Smiod #define _bfd_nolink_bfd_link_hash_table_free \
4013d8817e4Smiod   ((void (*) (struct bfd_link_hash_table *)) bfd_void)
4023d8817e4Smiod #define _bfd_nolink_bfd_link_add_symbols \
4033d8817e4Smiod   ((bfd_boolean (*) (bfd *, struct bfd_link_info *)) bfd_false)
4043d8817e4Smiod #define _bfd_nolink_bfd_link_just_syms \
4053d8817e4Smiod   ((void (*) (asection *, struct bfd_link_info *)) bfd_void)
4063d8817e4Smiod #define _bfd_nolink_bfd_final_link \
4073d8817e4Smiod   ((bfd_boolean (*) (bfd *, struct bfd_link_info *)) bfd_false)
4083d8817e4Smiod #define _bfd_nolink_bfd_link_split_section \
4093d8817e4Smiod   ((bfd_boolean (*) (bfd *, struct bfd_section *)) bfd_false)
4103d8817e4Smiod #define _bfd_nolink_section_already_linked \
411*b8417449Sstefan   ((void (*) (bfd *, struct bfd_section *, struct bfd_link_info *)) bfd_void)
4123d8817e4Smiod 
4133d8817e4Smiod /* Routines to use for BFD_JUMP_TABLE_DYNAMIC for targets which do not
4143d8817e4Smiod    have dynamic symbols or relocs.  Use BFD_JUMP_TABLE_DYNAMIC
4153d8817e4Smiod    (_bfd_nodynamic).  */
4163d8817e4Smiod 
4173d8817e4Smiod #define _bfd_nodynamic_get_dynamic_symtab_upper_bound _bfd_n1
4183d8817e4Smiod #define _bfd_nodynamic_canonicalize_dynamic_symtab \
4193d8817e4Smiod   ((long (*) (bfd *, asymbol **)) _bfd_n1)
4203d8817e4Smiod #define _bfd_nodynamic_get_synthetic_symtab \
4213d8817e4Smiod   ((long (*) (bfd *, long, asymbol **, long, asymbol **, asymbol **)) _bfd_n1)
4223d8817e4Smiod #define _bfd_nodynamic_get_dynamic_reloc_upper_bound _bfd_n1
4233d8817e4Smiod #define _bfd_nodynamic_canonicalize_dynamic_reloc \
4243d8817e4Smiod   ((long (*) (bfd *, arelent **, asymbol **)) _bfd_n1)
4253d8817e4Smiod 
4263d8817e4Smiod /* Generic routine to determine of the given symbol is a local
4273d8817e4Smiod    label.  */
4283d8817e4Smiod extern bfd_boolean bfd_generic_is_local_label_name
4293d8817e4Smiod   (bfd *, const char *);
4303d8817e4Smiod 
4313d8817e4Smiod /* Generic minisymbol routines.  */
4323d8817e4Smiod extern long _bfd_generic_read_minisymbols
4333d8817e4Smiod   (bfd *, bfd_boolean, void **, unsigned int *);
4343d8817e4Smiod extern asymbol *_bfd_generic_minisymbol_to_symbol
4353d8817e4Smiod   (bfd *, bfd_boolean, const void *, asymbol *);
4363d8817e4Smiod 
4373d8817e4Smiod /* Find the nearest line using .stab/.stabstr sections.  */
4383d8817e4Smiod extern bfd_boolean _bfd_stab_section_find_nearest_line
4393d8817e4Smiod   (bfd *, asymbol **, asection *, bfd_vma, bfd_boolean *,
4403d8817e4Smiod    const char **, const char **, unsigned int *, void **);
4413d8817e4Smiod 
4423d8817e4Smiod /* Find the nearest line using DWARF 1 debugging information.  */
4433d8817e4Smiod extern bfd_boolean _bfd_dwarf1_find_nearest_line
4443d8817e4Smiod   (bfd *, asection *, asymbol **, bfd_vma, const char **,
4453d8817e4Smiod    const char **, unsigned int *);
4463d8817e4Smiod 
4473d8817e4Smiod /* Find the nearest line using DWARF 2 debugging information.  */
4483d8817e4Smiod extern bfd_boolean _bfd_dwarf2_find_nearest_line
4493d8817e4Smiod   (bfd *, asection *, asymbol **, bfd_vma, const char **, const char **,
4503d8817e4Smiod    unsigned int *, unsigned int, void **);
4513d8817e4Smiod 
4523d8817e4Smiod /* Find the line using DWARF 2 debugging information.  */
4533d8817e4Smiod extern bfd_boolean _bfd_dwarf2_find_line
4543d8817e4Smiod   (bfd *, asymbol **, asymbol *, const char **,
4553d8817e4Smiod    unsigned int *, unsigned int, void **);
4563d8817e4Smiod 
4573d8817e4Smiod bfd_boolean _bfd_generic_find_line
4583d8817e4Smiod   (bfd *, asymbol **, asymbol *, const char **, unsigned int *);
4593d8817e4Smiod 
4603d8817e4Smiod /* Find inliner info after calling bfd_find_nearest_line. */
4613d8817e4Smiod extern bfd_boolean _bfd_dwarf2_find_inliner_info
4623d8817e4Smiod   (bfd *, const char **, const char **, unsigned int *, void **);
4633d8817e4Smiod 
4643d8817e4Smiod /* Create a new section entry.  */
4653d8817e4Smiod extern struct bfd_hash_entry *bfd_section_hash_newfunc
4663d8817e4Smiod   (struct bfd_hash_entry *, struct bfd_hash_table *, const char *);
4673d8817e4Smiod 
4683d8817e4Smiod /* A routine to create entries for a bfd_link_hash_table.  */
4693d8817e4Smiod extern struct bfd_hash_entry *_bfd_link_hash_newfunc
4703d8817e4Smiod   (struct bfd_hash_entry *entry, struct bfd_hash_table *table,
4713d8817e4Smiod    const char *string);
4723d8817e4Smiod 
4733d8817e4Smiod /* Initialize a bfd_link_hash_table.  */
4743d8817e4Smiod extern bfd_boolean _bfd_link_hash_table_init
4753d8817e4Smiod   (struct bfd_link_hash_table *, bfd *,
4763d8817e4Smiod    struct bfd_hash_entry *(*) (struct bfd_hash_entry *,
4773d8817e4Smiod 			       struct bfd_hash_table *,
4783d8817e4Smiod 			       const char *),
4793d8817e4Smiod    unsigned int);
4803d8817e4Smiod 
4813d8817e4Smiod /* Generic link hash table creation routine.  */
4823d8817e4Smiod extern struct bfd_link_hash_table *_bfd_generic_link_hash_table_create
4833d8817e4Smiod   (bfd *);
4843d8817e4Smiod 
4853d8817e4Smiod /* Generic link hash table destruction routine.  */
4863d8817e4Smiod extern void _bfd_generic_link_hash_table_free
4873d8817e4Smiod   (struct bfd_link_hash_table *);
4883d8817e4Smiod 
4893d8817e4Smiod /* Generic add symbol routine.  */
4903d8817e4Smiod extern bfd_boolean _bfd_generic_link_add_symbols
4913d8817e4Smiod   (bfd *, struct bfd_link_info *);
4923d8817e4Smiod 
4933d8817e4Smiod /* Generic add symbol routine.  This version is used by targets for
4943d8817e4Smiod    which the linker must collect constructors and destructors by name,
4953d8817e4Smiod    as the collect2 program does.  */
4963d8817e4Smiod extern bfd_boolean _bfd_generic_link_add_symbols_collect
4973d8817e4Smiod   (bfd *, struct bfd_link_info *);
4983d8817e4Smiod 
4993d8817e4Smiod /* Generic archive add symbol routine.  */
5003d8817e4Smiod extern bfd_boolean _bfd_generic_link_add_archive_symbols
5013d8817e4Smiod   (bfd *, struct bfd_link_info *,
5023d8817e4Smiod    bfd_boolean (*) (bfd *, struct bfd_link_info *, bfd_boolean *));
5033d8817e4Smiod 
5043d8817e4Smiod /* Forward declaration to avoid prototype errors.  */
5053d8817e4Smiod typedef struct bfd_link_hash_entry _bfd_link_hash_entry;
5063d8817e4Smiod 
5073d8817e4Smiod /* Generic routine to add a single symbol.  */
5083d8817e4Smiod extern bfd_boolean _bfd_generic_link_add_one_symbol
5093d8817e4Smiod   (struct bfd_link_info *, bfd *, const char *name, flagword,
5103d8817e4Smiod    asection *, bfd_vma, const char *, bfd_boolean copy,
5113d8817e4Smiod    bfd_boolean constructor, struct bfd_link_hash_entry **);
5123d8817e4Smiod 
5133d8817e4Smiod /* Generic routine to mark section as supplying symbols only.  */
5143d8817e4Smiod extern void _bfd_generic_link_just_syms
5153d8817e4Smiod   (asection *, struct bfd_link_info *);
5163d8817e4Smiod 
5173d8817e4Smiod /* Generic link routine.  */
5183d8817e4Smiod extern bfd_boolean _bfd_generic_final_link
5193d8817e4Smiod   (bfd *, struct bfd_link_info *);
5203d8817e4Smiod 
5213d8817e4Smiod extern bfd_boolean _bfd_generic_link_split_section
5223d8817e4Smiod   (bfd *, struct bfd_section *);
5233d8817e4Smiod 
5243d8817e4Smiod extern void _bfd_generic_section_already_linked
525*b8417449Sstefan   (bfd *, struct bfd_section *, struct bfd_link_info *);
5263d8817e4Smiod 
5273d8817e4Smiod /* Generic reloc_link_order processing routine.  */
5283d8817e4Smiod extern bfd_boolean _bfd_generic_reloc_link_order
5293d8817e4Smiod   (bfd *, struct bfd_link_info *, asection *, struct bfd_link_order *);
5303d8817e4Smiod 
5313d8817e4Smiod /* Default link order processing routine.  */
5323d8817e4Smiod extern bfd_boolean _bfd_default_link_order
5333d8817e4Smiod   (bfd *, struct bfd_link_info *, asection *, struct bfd_link_order *);
5343d8817e4Smiod 
5353d8817e4Smiod /* Count the number of reloc entries in a link order list.  */
5363d8817e4Smiod extern unsigned int _bfd_count_link_order_relocs
5373d8817e4Smiod   (struct bfd_link_order *);
5383d8817e4Smiod 
5393d8817e4Smiod /* Final link relocation routine.  */
5403d8817e4Smiod extern bfd_reloc_status_type _bfd_final_link_relocate
5413d8817e4Smiod   (reloc_howto_type *, bfd *, asection *, bfd_byte *,
5423d8817e4Smiod    bfd_vma, bfd_vma, bfd_vma);
5433d8817e4Smiod 
5443d8817e4Smiod /* Relocate a particular location by a howto and a value.  */
5453d8817e4Smiod extern bfd_reloc_status_type _bfd_relocate_contents
5463d8817e4Smiod   (reloc_howto_type *, bfd *, bfd_vma, bfd_byte *);
5473d8817e4Smiod 
5483d8817e4Smiod /* Link stabs in sections in the first pass.  */
5493d8817e4Smiod 
5503d8817e4Smiod extern bfd_boolean _bfd_link_section_stabs
5513d8817e4Smiod   (bfd *, struct stab_info *, asection *, asection *, void **,
5523d8817e4Smiod    bfd_size_type *);
5533d8817e4Smiod 
5543d8817e4Smiod /* Eliminate stabs for discarded functions and symbols.  */
5553d8817e4Smiod extern bfd_boolean _bfd_discard_section_stabs
5563d8817e4Smiod   (bfd *, asection *, void *, bfd_boolean (*) (bfd_vma, void *), void *);
5573d8817e4Smiod 
5583d8817e4Smiod /* Write out the .stab section when linking stabs in sections.  */
5593d8817e4Smiod 
5603d8817e4Smiod extern bfd_boolean _bfd_write_section_stabs
5613d8817e4Smiod   (bfd *, struct stab_info *, asection *, void **, bfd_byte *);
5623d8817e4Smiod 
5633d8817e4Smiod /* Write out the .stabstr string table when linking stabs in sections.  */
5643d8817e4Smiod 
5653d8817e4Smiod extern bfd_boolean _bfd_write_stab_strings
5663d8817e4Smiod   (bfd *, struct stab_info *);
5673d8817e4Smiod 
5683d8817e4Smiod /* Find an offset within a .stab section when linking stabs in
5693d8817e4Smiod    sections.  */
5703d8817e4Smiod 
5713d8817e4Smiod extern bfd_vma _bfd_stab_section_offset
5723d8817e4Smiod   (asection *, void *, bfd_vma);
5733d8817e4Smiod 
5743d8817e4Smiod /* Register a SEC_MERGE section as a candidate for merging.  */
5753d8817e4Smiod 
5763d8817e4Smiod extern bfd_boolean _bfd_add_merge_section
5773d8817e4Smiod   (bfd *, void **, asection *, void **);
5783d8817e4Smiod 
5793d8817e4Smiod /* Attempt to merge SEC_MERGE sections.  */
5803d8817e4Smiod 
5813d8817e4Smiod extern bfd_boolean _bfd_merge_sections
5823d8817e4Smiod   (bfd *, struct bfd_link_info *, void *, void (*) (bfd *, asection *));
5833d8817e4Smiod 
5843d8817e4Smiod /* Write out a merged section.  */
5853d8817e4Smiod 
5863d8817e4Smiod extern bfd_boolean _bfd_write_merged_section
5873d8817e4Smiod   (bfd *, asection *, void *);
5883d8817e4Smiod 
5893d8817e4Smiod /* Find an offset within a modified SEC_MERGE section.  */
5903d8817e4Smiod 
5913d8817e4Smiod extern bfd_vma _bfd_merged_section_offset
5923d8817e4Smiod   (bfd *, asection **, void *, bfd_vma);
5933d8817e4Smiod 
5943d8817e4Smiod /* Create a string table.  */
5953d8817e4Smiod extern struct bfd_strtab_hash *_bfd_stringtab_init
5963d8817e4Smiod   (void);
5973d8817e4Smiod 
5983d8817e4Smiod /* Create an XCOFF .debug section style string table.  */
5993d8817e4Smiod extern struct bfd_strtab_hash *_bfd_xcoff_stringtab_init
6003d8817e4Smiod   (void);
6013d8817e4Smiod 
6023d8817e4Smiod /* Free a string table.  */
6033d8817e4Smiod extern void _bfd_stringtab_free
6043d8817e4Smiod   (struct bfd_strtab_hash *);
6053d8817e4Smiod 
6063d8817e4Smiod /* Get the size of a string table.  */
6073d8817e4Smiod extern bfd_size_type _bfd_stringtab_size
6083d8817e4Smiod   (struct bfd_strtab_hash *);
6093d8817e4Smiod 
6103d8817e4Smiod /* Add a string to a string table.  */
6113d8817e4Smiod extern bfd_size_type _bfd_stringtab_add
6123d8817e4Smiod   (struct bfd_strtab_hash *, const char *, bfd_boolean hash, bfd_boolean copy);
6133d8817e4Smiod 
6143d8817e4Smiod /* Write out a string table.  */
6153d8817e4Smiod extern bfd_boolean _bfd_stringtab_emit
6163d8817e4Smiod   (bfd *, struct bfd_strtab_hash *);
6173d8817e4Smiod 
6183d8817e4Smiod /* Check that endianness of input and output file match.  */
6193d8817e4Smiod extern bfd_boolean _bfd_generic_verify_endian_match
6203d8817e4Smiod   (bfd *, bfd *);
6213d8817e4Smiod 
6223d8817e4Smiod /* Macros to tell if bfds are read or write enabled.
6233d8817e4Smiod 
6243d8817e4Smiod    Note that bfds open for read may be scribbled into if the fd passed
6253d8817e4Smiod    to bfd_fdopenr is actually open both for read and write
6263d8817e4Smiod    simultaneously.  However an output bfd will never be open for
6273d8817e4Smiod    read.  Therefore sometimes you want to check bfd_read_p or
6283d8817e4Smiod    !bfd_read_p, and only sometimes bfd_write_p.
6293d8817e4Smiod */
6303d8817e4Smiod 
6313d8817e4Smiod #define	bfd_read_p(abfd) \
6323d8817e4Smiod   ((abfd)->direction == read_direction || (abfd)->direction == both_direction)
6333d8817e4Smiod #define	bfd_write_p(abfd) \
6343d8817e4Smiod   ((abfd)->direction == write_direction || (abfd)->direction == both_direction)
6353d8817e4Smiod 
6363d8817e4Smiod void bfd_assert
6373d8817e4Smiod   (const char*,int);
6383d8817e4Smiod 
6393d8817e4Smiod #define BFD_ASSERT(x) \
6403d8817e4Smiod   do { if (!(x)) bfd_assert(__FILE__,__LINE__); } while (0)
6413d8817e4Smiod 
6423d8817e4Smiod #define BFD_FAIL() \
6433d8817e4Smiod   do { bfd_assert(__FILE__,__LINE__); } while (0)
6443d8817e4Smiod 
6453d8817e4Smiod extern void _bfd_abort
6463d8817e4Smiod   (const char *, int, const char *) ATTRIBUTE_NORETURN;
6473d8817e4Smiod 
6483d8817e4Smiod /* if gcc >= 2.6, we can give a function name, too */
6493d8817e4Smiod #if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 6)
6503d8817e4Smiod #define __PRETTY_FUNCTION__  ((char *) NULL)
6513d8817e4Smiod #endif
6523d8817e4Smiod 
6533d8817e4Smiod #undef abort
6543d8817e4Smiod #define abort() _bfd_abort (__FILE__, __LINE__, __PRETTY_FUNCTION__)
6553d8817e4Smiod 
6563d8817e4Smiod /* Manipulate a system FILE but using BFD's "file_ptr", rather than
6573d8817e4Smiod    the system "off_t" or "off64_t", as the offset.  */
6583d8817e4Smiod extern file_ptr real_ftell (FILE *file);
6593d8817e4Smiod extern int real_fseek (FILE *file, file_ptr offset, int whence);
6603d8817e4Smiod extern FILE *real_fopen (const char *filename, const char *modes);
6613d8817e4Smiod 
6623d8817e4Smiod /* List of supported target vectors, and the default vector (if
6633d8817e4Smiod    bfd_default_vector[0] is NULL, there is no default).  */
6643d8817e4Smiod extern const bfd_target * const *bfd_target_vector;
6653d8817e4Smiod extern const bfd_target *bfd_default_vector[];
6663d8817e4Smiod 
6673d8817e4Smiod /* List of associated target vectors.  */
6683d8817e4Smiod extern const bfd_target * const *bfd_associated_vector;
6693d8817e4Smiod 
6703d8817e4Smiod /* Functions shared by the ECOFF and MIPS ELF backends, which have no
6713d8817e4Smiod    other common header files.  */
6723d8817e4Smiod 
6733d8817e4Smiod #if defined(__STDC__) || defined(ALMOST_STDC)
6743d8817e4Smiod struct ecoff_find_line;
6753d8817e4Smiod #endif
6763d8817e4Smiod 
6773d8817e4Smiod extern bfd_boolean _bfd_ecoff_locate_line
6783d8817e4Smiod   (bfd *, asection *, bfd_vma, struct ecoff_debug_info * const,
6793d8817e4Smiod    const struct ecoff_debug_swap * const, struct ecoff_find_line *,
6803d8817e4Smiod    const char **, const char **, unsigned int *);
6813d8817e4Smiod extern bfd_boolean _bfd_ecoff_get_accumulated_pdr
6823d8817e4Smiod   (void *, bfd_byte *);
6833d8817e4Smiod extern bfd_boolean _bfd_ecoff_get_accumulated_sym
6843d8817e4Smiod   (void *, bfd_byte *);
6853d8817e4Smiod extern bfd_boolean _bfd_ecoff_get_accumulated_ss
6863d8817e4Smiod   (void *, bfd_byte *);
6873d8817e4Smiod 
6883d8817e4Smiod extern bfd_vma _bfd_get_gp_value
6893d8817e4Smiod   (bfd *);
6903d8817e4Smiod extern void _bfd_set_gp_value
6913d8817e4Smiod   (bfd *, bfd_vma);
6923d8817e4Smiod 
6933d8817e4Smiod /* Function shared by the COFF and ELF SH backends, which have no
6943d8817e4Smiod    other common header files.  */
6953d8817e4Smiod 
6963d8817e4Smiod #ifndef _bfd_sh_align_load_span
6973d8817e4Smiod extern bfd_boolean _bfd_sh_align_load_span
6983d8817e4Smiod   (bfd *, asection *, bfd_byte *,
6993d8817e4Smiod    bfd_boolean (*) (bfd *, asection *, void *, bfd_byte *, bfd_vma),
7003d8817e4Smiod    void *, bfd_vma **, bfd_vma *, bfd_vma, bfd_vma, bfd_boolean *);
7013d8817e4Smiod #endif
7023d8817e4Smiod 
7033d8817e4Smiod /* This is the shape of the elements inside the already_linked hash
7043d8817e4Smiod    table. It maps a name onto a list of already_linked elements with
7053d8817e4Smiod    the same name.  */
7063d8817e4Smiod 
7073d8817e4Smiod struct bfd_section_already_linked_hash_entry
7083d8817e4Smiod {
7093d8817e4Smiod   struct bfd_hash_entry root;
7103d8817e4Smiod   struct bfd_section_already_linked *entry;
7113d8817e4Smiod };
7123d8817e4Smiod 
7133d8817e4Smiod struct bfd_section_already_linked
7143d8817e4Smiod {
7153d8817e4Smiod   struct bfd_section_already_linked *next;
7163d8817e4Smiod   asection *sec;
7173d8817e4Smiod };
7183d8817e4Smiod 
7193d8817e4Smiod extern struct bfd_section_already_linked_hash_entry *
7203d8817e4Smiod   bfd_section_already_linked_table_lookup (const char *);
7213d8817e4Smiod extern void bfd_section_already_linked_table_insert
7223d8817e4Smiod   (struct bfd_section_already_linked_hash_entry *, asection *);
7233d8817e4Smiod extern void bfd_section_already_linked_table_traverse
7243d8817e4Smiod   (bfd_boolean (*) (struct bfd_section_already_linked_hash_entry *,
7253d8817e4Smiod 		    void *), void *);
7263d8817e4Smiod 
7273d8817e4Smiod extern bfd_vma read_unsigned_leb128 (bfd *, bfd_byte *, unsigned int *);
7283d8817e4Smiod extern bfd_signed_vma read_signed_leb128 (bfd *, bfd_byte *, unsigned int *);
7293d8817e4Smiod 
730