| 1 | /* Main header file for the bfd library -- portable access to object files. | 
|---|
| 2 |  | 
|---|
| 3 | Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, | 
|---|
| 4 | 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc. | 
|---|
| 5 |  | 
|---|
| 6 | Contributed 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 2 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */ | 
|---|
| 23 |  | 
|---|
| 24 | #ifndef __BFD_H_SEEN__ | 
|---|
| 25 | #define __BFD_H_SEEN__ | 
|---|
| 26 |  | 
|---|
| 27 | #ifdef __cplusplus | 
|---|
| 28 | extern "C" { | 
|---|
| 29 | #endif | 
|---|
| 30 |  | 
|---|
| 31 | #include "ansidecl.h" | 
|---|
| 32 | #include "symcat.h" | 
|---|
| 33 | #if defined (__STDC__) || defined (ALMOST_STDC) || defined (HAVE_STRINGIZE) | 
|---|
| 34 | #ifndef SABER | 
|---|
| 35 | /* This hack is to avoid a problem with some strict ANSI C preprocessors. | 
|---|
| 36 | The problem is, "32_" is not a valid preprocessing token, and we don't | 
|---|
| 37 | want extra underscores (e.g., "nlm_32_").  The XCONCAT2 macro will | 
|---|
| 38 | cause the inner CONCAT2 macros to be evaluated first, producing | 
|---|
| 39 | still-valid pp-tokens.  Then the final concatenation can be done.  */ | 
|---|
| 40 | #undef CONCAT4 | 
|---|
| 41 | #define CONCAT4(a,b,c,d) XCONCAT2(CONCAT2(a,b),CONCAT2(c,d)) | 
|---|
| 42 | #endif | 
|---|
| 43 | #endif | 
|---|
| 44 |  | 
|---|
| 45 | /* The word size used by BFD on the host.  This may be 64 with a 32 | 
|---|
| 46 | bit target if the host is 64 bit, or if other 64 bit targets have | 
|---|
| 47 | been selected with --enable-targets, or if --enable-64-bit-bfd.  */ | 
|---|
| 48 | #define BFD_ARCH_SIZE @wordsize@ | 
|---|
| 49 |  | 
|---|
| 50 | /* The word size of the default bfd target.  */ | 
|---|
| 51 | #define BFD_DEFAULT_TARGET_SIZE @bfd_default_target_size@ | 
|---|
| 52 |  | 
|---|
| 53 | #define BFD_HOST_64BIT_LONG @BFD_HOST_64BIT_LONG@ | 
|---|
| 54 | #if @BFD_HOST_64_BIT_DEFINED@ | 
|---|
| 55 | #define BFD_HOST_64_BIT @BFD_HOST_64_BIT@ | 
|---|
| 56 | #define BFD_HOST_U_64_BIT @BFD_HOST_U_64_BIT@ | 
|---|
| 57 | #endif | 
|---|
| 58 |  | 
|---|
| 59 | #if BFD_ARCH_SIZE >= 64 | 
|---|
| 60 | #define BFD64 | 
|---|
| 61 | #endif | 
|---|
| 62 |  | 
|---|
| 63 | #ifndef INLINE | 
|---|
| 64 | #if __GNUC__ >= 2 | 
|---|
| 65 | #define INLINE __inline__ | 
|---|
| 66 | #else | 
|---|
| 67 | #define INLINE | 
|---|
| 68 | #endif | 
|---|
| 69 | #endif | 
|---|
| 70 |  | 
|---|
| 71 | /* Forward declaration.  */ | 
|---|
| 72 | typedef struct bfd bfd; | 
|---|
| 73 |  | 
|---|
| 74 | /* Boolean type used in bfd.  Too many systems define their own | 
|---|
| 75 | versions of "boolean" for us to safely typedef a "boolean" of | 
|---|
| 76 | our own.  Using an enum for "bfd_boolean" has its own set of | 
|---|
| 77 | problems, with strange looking casts required to avoid warnings | 
|---|
| 78 | on some older compilers.  Thus we just use an int. | 
|---|
| 79 |  | 
|---|
| 80 | General rule: Functions which are bfd_boolean return TRUE on | 
|---|
| 81 | success and FALSE on failure (unless they're a predicate).  */ | 
|---|
| 82 |  | 
|---|
| 83 | typedef int bfd_boolean; | 
|---|
| 84 | #undef FALSE | 
|---|
| 85 | #undef TRUE | 
|---|
| 86 | #define FALSE 0 | 
|---|
| 87 | #define TRUE 1 | 
|---|
| 88 |  | 
|---|
| 89 | #if 0 | 
|---|
| 90 | /* Poison.  */ | 
|---|
| 91 | #undef false | 
|---|
| 92 | #undef true | 
|---|
| 93 | #define false dont_use_false_in_bfd | 
|---|
| 94 | #define true dont_use_true_in_bfd | 
|---|
| 95 | #endif | 
|---|
| 96 |  | 
|---|
| 97 | /* Support for different sizes of target format ints and addresses. | 
|---|
| 98 | If the type `long' is at least 64 bits, BFD_HOST_64BIT_LONG will be | 
|---|
| 99 | set to 1 above.  Otherwise, if gcc is being used, this code will | 
|---|
| 100 | use gcc's "long long" type.  Otherwise, BFD_HOST_64_BIT must be | 
|---|
| 101 | defined above.  */ | 
|---|
| 102 |  | 
|---|
| 103 | #ifndef BFD_HOST_64_BIT | 
|---|
| 104 | # if BFD_HOST_64BIT_LONG | 
|---|
| 105 | #  define BFD_HOST_64_BIT long | 
|---|
| 106 | #  define BFD_HOST_U_64_BIT unsigned long | 
|---|
| 107 | # else | 
|---|
| 108 | #  ifdef __GNUC__ | 
|---|
| 109 | #   if __GNUC__ >= 2 | 
|---|
| 110 | #    define BFD_HOST_64_BIT long long | 
|---|
| 111 | #    define BFD_HOST_U_64_BIT unsigned long long | 
|---|
| 112 | #   endif /* __GNUC__ >= 2 */ | 
|---|
| 113 | #  endif /* ! defined (__GNUC__) */ | 
|---|
| 114 | # endif /* ! BFD_HOST_64BIT_LONG */ | 
|---|
| 115 | #endif /* ! defined (BFD_HOST_64_BIT) */ | 
|---|
| 116 |  | 
|---|
| 117 | #ifdef BFD64 | 
|---|
| 118 |  | 
|---|
| 119 | #ifndef BFD_HOST_64_BIT | 
|---|
| 120 | #error No 64 bit integer type available | 
|---|
| 121 | #endif /* ! defined (BFD_HOST_64_BIT) */ | 
|---|
| 122 |  | 
|---|
| 123 | typedef BFD_HOST_U_64_BIT bfd_vma; | 
|---|
| 124 | typedef BFD_HOST_64_BIT bfd_signed_vma; | 
|---|
| 125 | typedef BFD_HOST_U_64_BIT bfd_size_type; | 
|---|
| 126 | typedef BFD_HOST_U_64_BIT symvalue; | 
|---|
| 127 |  | 
|---|
| 128 | #ifndef fprintf_vma | 
|---|
| 129 | #if BFD_HOST_64BIT_LONG | 
|---|
| 130 | #define sprintf_vma(s,x) sprintf (s, "%016lx", x) | 
|---|
| 131 | #define fprintf_vma(f,x) fprintf (f, "%016lx", x) | 
|---|
| 132 | #else | 
|---|
| 133 | #define _bfd_int64_low(x) ((unsigned long) (((x) & 0xffffffff))) | 
|---|
| 134 | #define _bfd_int64_high(x) ((unsigned long) (((x) >> 32) & 0xffffffff)) | 
|---|
| 135 | #define fprintf_vma(s,x) \ | 
|---|
| 136 | fprintf ((s), "%08lx%08lx", _bfd_int64_high (x), _bfd_int64_low (x)) | 
|---|
| 137 | #define sprintf_vma(s,x) \ | 
|---|
| 138 | sprintf ((s), "%08lx%08lx", _bfd_int64_high (x), _bfd_int64_low (x)) | 
|---|
| 139 | #endif | 
|---|
| 140 | #endif | 
|---|
| 141 |  | 
|---|
| 142 | #else /* not BFD64  */ | 
|---|
| 143 |  | 
|---|
| 144 | /* Represent a target address.  Also used as a generic unsigned type | 
|---|
| 145 | which is guaranteed to be big enough to hold any arithmetic types | 
|---|
| 146 | we need to deal with.  */ | 
|---|
| 147 | typedef unsigned long bfd_vma; | 
|---|
| 148 |  | 
|---|
| 149 | /* A generic signed type which is guaranteed to be big enough to hold any | 
|---|
| 150 | arithmetic types we need to deal with.  Can be assumed to be compatible | 
|---|
| 151 | with bfd_vma in the same way that signed and unsigned ints are compatible | 
|---|
| 152 | (as parameters, in assignment, etc).  */ | 
|---|
| 153 | typedef long bfd_signed_vma; | 
|---|
| 154 |  | 
|---|
| 155 | typedef unsigned long symvalue; | 
|---|
| 156 | typedef unsigned long bfd_size_type; | 
|---|
| 157 |  | 
|---|
| 158 | /* Print a bfd_vma x on stream s.  */ | 
|---|
| 159 | #define fprintf_vma(s,x) fprintf (s, "%08lx", x) | 
|---|
| 160 | #define sprintf_vma(s,x) sprintf (s, "%08lx", x) | 
|---|
| 161 |  | 
|---|
| 162 | #endif /* not BFD64  */ | 
|---|
| 163 |  | 
|---|
| 164 | /* A pointer to a position in a file.  */ | 
|---|
| 165 | /* FIXME:  This should be using off_t from <sys/types.h>. | 
|---|
| 166 | For now, try to avoid breaking stuff by not including <sys/types.h> here. | 
|---|
| 167 | This will break on systems with 64-bit file offsets (e.g. 4.4BSD). | 
|---|
| 168 | Probably the best long-term answer is to avoid using file_ptr AND off_t | 
|---|
| 169 | in this header file, and to handle this in the BFD implementation | 
|---|
| 170 | rather than in its interface.  */ | 
|---|
| 171 | /* typedef off_t        file_ptr; */ | 
|---|
| 172 | typedef bfd_signed_vma file_ptr; | 
|---|
| 173 | typedef bfd_vma ufile_ptr; | 
|---|
| 174 |  | 
|---|
| 175 | extern void bfd_sprintf_vma | 
|---|
| 176 | PARAMS ((bfd *, char *, bfd_vma)); | 
|---|
| 177 | extern void bfd_fprintf_vma | 
|---|
| 178 | PARAMS ((bfd *, PTR, bfd_vma)); | 
|---|
| 179 |  | 
|---|
| 180 | #define printf_vma(x) fprintf_vma(stdout,x) | 
|---|
| 181 | #define bfd_printf_vma(abfd,x) bfd_fprintf_vma (abfd,stdout,x) | 
|---|
| 182 |  | 
|---|
| 183 | typedef unsigned int flagword;  /* 32 bits of flags */ | 
|---|
| 184 | typedef unsigned char bfd_byte; | 
|---|
| 185 |  | 
|---|
| 186 |  | 
|---|
| 187 | /* File formats.  */ | 
|---|
| 188 |  | 
|---|
| 189 | typedef enum bfd_format | 
|---|
| 190 | { | 
|---|
| 191 | bfd_unknown = 0,      /* File format is unknown.  */ | 
|---|
| 192 | bfd_object,           /* Linker/assember/compiler output.  */ | 
|---|
| 193 | bfd_archive,          /* Object archive file.  */ | 
|---|
| 194 | bfd_core,             /* Core dump.  */ | 
|---|
| 195 | bfd_type_end          /* Marks the end; don't use it!  */ | 
|---|
| 196 | } | 
|---|
| 197 | bfd_format; | 
|---|
| 198 |  | 
|---|
| 199 | /* Values that may appear in the flags field of a BFD.  These also | 
|---|
| 200 | appear in the object_flags field of the bfd_target structure, where | 
|---|
| 201 | they indicate the set of flags used by that backend (not all flags | 
|---|
| 202 | are meaningful for all object file formats) (FIXME: at the moment, | 
|---|
| 203 | the object_flags values have mostly just been copied from backend | 
|---|
| 204 | to another, and are not necessarily correct).  */ | 
|---|
| 205 |  | 
|---|
| 206 | /* No flags.  */ | 
|---|
| 207 | #define BFD_NO_FLAGS    0x00 | 
|---|
| 208 |  | 
|---|
| 209 | /* BFD contains relocation entries.  */ | 
|---|
| 210 | #define HAS_RELOC       0x01 | 
|---|
| 211 |  | 
|---|
| 212 | /* BFD is directly executable.  */ | 
|---|
| 213 | #define EXEC_P          0x02 | 
|---|
| 214 |  | 
|---|
| 215 | /* BFD has line number information (basically used for F_LNNO in a | 
|---|
| 216 | COFF header).  */ | 
|---|
| 217 | #define HAS_LINENO      0x04 | 
|---|
| 218 |  | 
|---|
| 219 | /* BFD has debugging information.  */ | 
|---|
| 220 | #define HAS_DEBUG       0x08 | 
|---|
| 221 |  | 
|---|
| 222 | /* BFD has symbols.  */ | 
|---|
| 223 | #define HAS_SYMS        0x10 | 
|---|
| 224 |  | 
|---|
| 225 | /* BFD has local symbols (basically used for F_LSYMS in a COFF | 
|---|
| 226 | header).  */ | 
|---|
| 227 | #define HAS_LOCALS      0x20 | 
|---|
| 228 |  | 
|---|
| 229 | /* BFD is a dynamic object.  */ | 
|---|
| 230 | #define DYNAMIC         0x40 | 
|---|
| 231 |  | 
|---|
| 232 | /* Text section is write protected (if D_PAGED is not set, this is | 
|---|
| 233 | like an a.out NMAGIC file) (the linker sets this by default, but | 
|---|
| 234 | clears it for -r or -N).  */ | 
|---|
| 235 | #define WP_TEXT         0x80 | 
|---|
| 236 |  | 
|---|
| 237 | /* BFD is dynamically paged (this is like an a.out ZMAGIC file) (the | 
|---|
| 238 | linker sets this by default, but clears it for -r or -n or -N).  */ | 
|---|
| 239 | #define D_PAGED         0x100 | 
|---|
| 240 |  | 
|---|
| 241 | /* BFD is relaxable (this means that bfd_relax_section may be able to | 
|---|
| 242 | do something) (sometimes bfd_relax_section can do something even if | 
|---|
| 243 | this is not set).  */ | 
|---|
| 244 | #define BFD_IS_RELAXABLE 0x200 | 
|---|
| 245 |  | 
|---|
| 246 | /* This may be set before writing out a BFD to request using a | 
|---|
| 247 | traditional format.  For example, this is used to request that when | 
|---|
| 248 | writing out an a.out object the symbols not be hashed to eliminate | 
|---|
| 249 | duplicates.  */ | 
|---|
| 250 | #define BFD_TRADITIONAL_FORMAT 0x400 | 
|---|
| 251 |  | 
|---|
| 252 | /* This flag indicates that the BFD contents are actually cached in | 
|---|
| 253 | memory.  If this is set, iostream points to a bfd_in_memory struct.  */ | 
|---|
| 254 | #define BFD_IN_MEMORY 0x800 | 
|---|
| 255 |  | 
|---|
| 256 | /* The sections in this BFD specify a memory page.  */ | 
|---|
| 257 | #define HAS_LOAD_PAGE 0x1000 | 
|---|
| 258 |  | 
|---|
| 259 |  | 
|---|
| 260 | /* Symbols and relocation.  */ | 
|---|
| 261 |  | 
|---|
| 262 | /* A count of carsyms (canonical archive symbols).  */ | 
|---|
| 263 | typedef unsigned long symindex; | 
|---|
| 264 |  | 
|---|
| 265 | /* How to perform a relocation.  */ | 
|---|
| 266 | typedef const struct reloc_howto_struct reloc_howto_type; | 
|---|
| 267 |  | 
|---|
| 268 | #define BFD_NO_MORE_SYMBOLS ((symindex) ~0) | 
|---|
| 269 |  | 
|---|
| 270 | /* General purpose part of a symbol X; | 
|---|
| 271 | target specific parts are in libcoff.h, libaout.h, etc.  */ | 
|---|
| 272 |  | 
|---|
| 273 | #define bfd_get_section(x) ((x)->section) | 
|---|
| 274 | #define bfd_get_output_section(x) ((x)->section->output_section) | 
|---|
| 275 | #define bfd_set_section(x,y) ((x)->section) = (y) | 
|---|
| 276 | #define bfd_asymbol_base(x) ((x)->section->vma) | 
|---|
| 277 | #define bfd_asymbol_value(x) (bfd_asymbol_base(x) + (x)->value) | 
|---|
| 278 | #define bfd_asymbol_name(x) ((x)->name) | 
|---|
| 279 | /*Perhaps future: #define bfd_asymbol_bfd(x) ((x)->section->owner)*/ | 
|---|
| 280 | #define bfd_asymbol_bfd(x) ((x)->the_bfd) | 
|---|
| 281 | #define bfd_asymbol_flavour(x) (bfd_asymbol_bfd(x)->xvec->flavour) | 
|---|
| 282 |  | 
|---|
| 283 | /* A canonical archive symbol.  */ | 
|---|
| 284 | /* This is a type pun with struct ranlib on purpose!  */ | 
|---|
| 285 | typedef struct carsym | 
|---|
| 286 | { | 
|---|
| 287 | char *name; | 
|---|
| 288 | file_ptr file_offset; /* Look here to find the file.  */ | 
|---|
| 289 | } | 
|---|
| 290 | carsym;                 /* To make these you call a carsymogen.  */ | 
|---|
| 291 |  | 
|---|
| 292 | /* Used in generating armaps (archive tables of contents). | 
|---|
| 293 | Perhaps just a forward definition would do?  */ | 
|---|
| 294 | struct orl                      /* Output ranlib.  */ | 
|---|
| 295 | { | 
|---|
| 296 | char **name;          /* Symbol name.  */ | 
|---|
| 297 | union | 
|---|
| 298 | { | 
|---|
| 299 | file_ptr pos; | 
|---|
| 300 | bfd *abfd; | 
|---|
| 301 | } u;                  /* bfd* or file position.  */ | 
|---|
| 302 | int namidx;           /* Index into string table.  */ | 
|---|
| 303 | }; | 
|---|
| 304 |  | 
|---|
| 305 |  | 
|---|
| 306 | /* Linenumber stuff.  */ | 
|---|
| 307 | typedef struct lineno_cache_entry | 
|---|
| 308 | { | 
|---|
| 309 | unsigned int line_number;     /* Linenumber from start of function.  */ | 
|---|
| 310 | union | 
|---|
| 311 | { | 
|---|
| 312 | struct symbol_cache_entry *sym;     /* Function name.  */ | 
|---|
| 313 | bfd_vma offset;                     /* Offset into section.  */ | 
|---|
| 314 | } u; | 
|---|
| 315 | } | 
|---|
| 316 | alent; | 
|---|
| 317 |  | 
|---|
| 318 |  | 
|---|
| 319 | /* Object and core file sections.  */ | 
|---|
| 320 |  | 
|---|
| 321 | #define align_power(addr, align)        \ | 
|---|
| 322 | (((addr) + ((bfd_vma) 1 << (align)) - 1) & ((bfd_vma) -1 << (align))) | 
|---|
| 323 |  | 
|---|
| 324 | typedef struct sec *sec_ptr; | 
|---|
| 325 |  | 
|---|
| 326 | #define bfd_get_section_name(bfd, ptr) ((ptr)->name + 0) | 
|---|
| 327 | #define bfd_get_section_vma(bfd, ptr) ((ptr)->vma + 0) | 
|---|
| 328 | #define bfd_get_section_lma(bfd, ptr) ((ptr)->lma + 0) | 
|---|
| 329 | #define bfd_get_section_alignment(bfd, ptr) ((ptr)->alignment_power + 0) | 
|---|
| 330 | #define bfd_section_name(bfd, ptr) ((ptr)->name) | 
|---|
| 331 | #define bfd_section_size(bfd, ptr) (bfd_get_section_size_before_reloc(ptr)) | 
|---|
| 332 | #define bfd_section_vma(bfd, ptr) ((ptr)->vma) | 
|---|
| 333 | #define bfd_section_lma(bfd, ptr) ((ptr)->lma) | 
|---|
| 334 | #define bfd_section_alignment(bfd, ptr) ((ptr)->alignment_power) | 
|---|
| 335 | #define bfd_get_section_flags(bfd, ptr) ((ptr)->flags + 0) | 
|---|
| 336 | #define bfd_get_section_userdata(bfd, ptr) ((ptr)->userdata) | 
|---|
| 337 |  | 
|---|
| 338 | #define bfd_is_com_section(ptr) (((ptr)->flags & SEC_IS_COMMON) != 0) | 
|---|
| 339 |  | 
|---|
| 340 | #define bfd_set_section_vma(bfd, ptr, val) (((ptr)->vma = (ptr)->lma = (val)), ((ptr)->user_set_vma = TRUE), TRUE) | 
|---|
| 341 | #define bfd_set_section_alignment(bfd, ptr, val) (((ptr)->alignment_power = (val)),TRUE) | 
|---|
| 342 | #define bfd_set_section_userdata(bfd, ptr, val) (((ptr)->userdata = (val)),TRUE) | 
|---|
| 343 |  | 
|---|
| 344 | typedef struct stat stat_type; | 
|---|
| 345 |  | 
|---|
| 346 |  | 
|---|
| 347 | typedef enum bfd_print_symbol | 
|---|
| 348 | { | 
|---|
| 349 | bfd_print_symbol_name, | 
|---|
| 350 | bfd_print_symbol_more, | 
|---|
| 351 | bfd_print_symbol_all | 
|---|
| 352 | } bfd_print_symbol_type; | 
|---|
| 353 |  | 
|---|
| 354 | /* Information about a symbol that nm needs.  */ | 
|---|
| 355 |  | 
|---|
| 356 | typedef struct _symbol_info | 
|---|
| 357 | { | 
|---|
| 358 | symvalue value; | 
|---|
| 359 | char type; | 
|---|
| 360 | const char *name;            /* Symbol name.  */ | 
|---|
| 361 | unsigned char stab_type;     /* Stab type.  */ | 
|---|
| 362 | char stab_other;             /* Stab other.  */ | 
|---|
| 363 | short stab_desc;             /* Stab desc.  */ | 
|---|
| 364 | const char *stab_name;       /* String for stab type.  */ | 
|---|
| 365 | } symbol_info; | 
|---|
| 366 |  | 
|---|
| 367 | /* Get the name of a stabs type code.  */ | 
|---|
| 368 |  | 
|---|
| 369 | extern const char *bfd_get_stab_name | 
|---|
| 370 | PARAMS ((int)); | 
|---|
| 371 |  | 
|---|
| 372 |  | 
|---|
| 373 | /* Hash table routines.  There is no way to free up a hash table.  */ | 
|---|
| 374 |  | 
|---|
| 375 | /* An element in the hash table.  Most uses will actually use a larger | 
|---|
| 376 | structure, and an instance of this will be the first field.  */ | 
|---|
| 377 |  | 
|---|
| 378 | struct bfd_hash_entry | 
|---|
| 379 | { | 
|---|
| 380 | /* Next entry for this hash code.  */ | 
|---|
| 381 | struct bfd_hash_entry *next; | 
|---|
| 382 | /* String being hashed.  */ | 
|---|
| 383 | const char *string; | 
|---|
| 384 | /* Hash code.  This is the full hash code, not the index into the | 
|---|
| 385 | table.  */ | 
|---|
| 386 | unsigned long hash; | 
|---|
| 387 | }; | 
|---|
| 388 |  | 
|---|
| 389 | /* A hash table.  */ | 
|---|
| 390 |  | 
|---|
| 391 | struct bfd_hash_table | 
|---|
| 392 | { | 
|---|
| 393 | /* The hash array.  */ | 
|---|
| 394 | struct bfd_hash_entry **table; | 
|---|
| 395 | /* The number of slots in the hash table.  */ | 
|---|
| 396 | unsigned int size; | 
|---|
| 397 | /* A function used to create new elements in the hash table.  The | 
|---|
| 398 | first entry is itself a pointer to an element.  When this | 
|---|
| 399 | function is first invoked, this pointer will be NULL.  However, | 
|---|
| 400 | having the pointer permits a hierarchy of method functions to be | 
|---|
| 401 | built each of which calls the function in the superclass.  Thus | 
|---|
| 402 | each function should be written to allocate a new block of memory | 
|---|
| 403 | only if the argument is NULL.  */ | 
|---|
| 404 | struct bfd_hash_entry *(*newfunc) | 
|---|
| 405 | PARAMS ((struct bfd_hash_entry *, struct bfd_hash_table *, const char *)); | 
|---|
| 406 | /* An objalloc for this hash table.  This is a struct objalloc *, | 
|---|
| 407 | but we use PTR to avoid requiring the inclusion of objalloc.h.  */ | 
|---|
| 408 | PTR memory; | 
|---|
| 409 | }; | 
|---|
| 410 |  | 
|---|
| 411 | /* Initialize a hash table.  */ | 
|---|
| 412 | extern bfd_boolean bfd_hash_table_init | 
|---|
| 413 | PARAMS ((struct bfd_hash_table *, | 
|---|
| 414 | struct bfd_hash_entry *(*) (struct bfd_hash_entry *, | 
|---|
| 415 | struct bfd_hash_table *, | 
|---|
| 416 | const char *))); | 
|---|
| 417 |  | 
|---|
| 418 | /* Initialize a hash table specifying a size.  */ | 
|---|
| 419 | extern bfd_boolean bfd_hash_table_init_n | 
|---|
| 420 | PARAMS ((struct bfd_hash_table *, | 
|---|
| 421 | struct bfd_hash_entry *(*) (struct bfd_hash_entry *, | 
|---|
| 422 | struct bfd_hash_table *, | 
|---|
| 423 | const char *), | 
|---|
| 424 | unsigned int size)); | 
|---|
| 425 |  | 
|---|
| 426 | /* Free up a hash table.  */ | 
|---|
| 427 | extern void bfd_hash_table_free | 
|---|
| 428 | PARAMS ((struct bfd_hash_table *)); | 
|---|
| 429 |  | 
|---|
| 430 | /* Look up a string in a hash table.  If CREATE is TRUE, a new entry | 
|---|
| 431 | will be created for this string if one does not already exist.  The | 
|---|
| 432 | COPY argument must be TRUE if this routine should copy the string | 
|---|
| 433 | into newly allocated memory when adding an entry.  */ | 
|---|
| 434 | extern struct bfd_hash_entry *bfd_hash_lookup | 
|---|
| 435 | PARAMS ((struct bfd_hash_table *, const char *, bfd_boolean create, | 
|---|
| 436 | bfd_boolean copy)); | 
|---|
| 437 |  | 
|---|
| 438 | /* Replace an entry in a hash table.  */ | 
|---|
| 439 | extern void bfd_hash_replace | 
|---|
| 440 | PARAMS ((struct bfd_hash_table *, struct bfd_hash_entry *old, | 
|---|
| 441 | struct bfd_hash_entry *nw)); | 
|---|
| 442 |  | 
|---|
| 443 | /* Base method for creating a hash table entry.  */ | 
|---|
| 444 | extern struct bfd_hash_entry *bfd_hash_newfunc | 
|---|
| 445 | PARAMS ((struct bfd_hash_entry *, struct bfd_hash_table *, | 
|---|
| 446 | const char *)); | 
|---|
| 447 |  | 
|---|
| 448 | /* Grab some space for a hash table entry.  */ | 
|---|
| 449 | extern PTR bfd_hash_allocate | 
|---|
| 450 | PARAMS ((struct bfd_hash_table *, unsigned int)); | 
|---|
| 451 |  | 
|---|
| 452 | /* Traverse a hash table in a random order, calling a function on each | 
|---|
| 453 | element.  If the function returns FALSE, the traversal stops.  The | 
|---|
| 454 | INFO argument is passed to the function.  */ | 
|---|
| 455 | extern void bfd_hash_traverse | 
|---|
| 456 | PARAMS ((struct bfd_hash_table *, | 
|---|
| 457 | bfd_boolean (*) (struct bfd_hash_entry *, PTR), | 
|---|
| 458 | PTR info)); | 
|---|
| 459 |  | 
|---|
| 460 | #define COFF_SWAP_TABLE (PTR) &bfd_coff_std_swap_table | 
|---|
| 461 |  | 
|---|
| 462 | /* User program access to BFD facilities.  */ | 
|---|
| 463 |  | 
|---|
| 464 | /* Direct I/O routines, for programs which know more about the object | 
|---|
| 465 | file than BFD does.  Use higher level routines if possible.  */ | 
|---|
| 466 |  | 
|---|
| 467 | extern bfd_size_type bfd_bread | 
|---|
| 468 | PARAMS ((PTR, bfd_size_type, bfd *)); | 
|---|
| 469 | extern bfd_size_type bfd_bwrite | 
|---|
| 470 | PARAMS ((const PTR, bfd_size_type, bfd *)); | 
|---|
| 471 | extern int bfd_seek | 
|---|
| 472 | PARAMS ((bfd *, file_ptr, int)); | 
|---|
| 473 | extern ufile_ptr bfd_tell | 
|---|
| 474 | PARAMS ((bfd *)); | 
|---|
| 475 | extern int bfd_flush | 
|---|
| 476 | PARAMS ((bfd *)); | 
|---|
| 477 | extern int bfd_stat | 
|---|
| 478 | PARAMS ((bfd *, struct stat *)); | 
|---|
| 479 |  | 
|---|
| 480 | /* Deprecated old routines.  */ | 
|---|
| 481 | #if __GNUC__ | 
|---|
| 482 | #define bfd_read(BUF, ELTSIZE, NITEMS, ABFD)                            \ | 
|---|
| 483 | (warn_deprecated ("bfd_read", __FILE__, __LINE__, __FUNCTION__),      \ | 
|---|
| 484 | bfd_bread ((BUF), (ELTSIZE) * (NITEMS), (ABFD))) | 
|---|
| 485 | #define bfd_write(BUF, ELTSIZE, NITEMS, ABFD)                           \ | 
|---|
| 486 | (warn_deprecated ("bfd_write", __FILE__, __LINE__, __FUNCTION__),     \ | 
|---|
| 487 | bfd_bwrite ((BUF), (ELTSIZE) * (NITEMS), (ABFD))) | 
|---|
| 488 | #else | 
|---|
| 489 | #define bfd_read(BUF, ELTSIZE, NITEMS, ABFD)                            \ | 
|---|
| 490 | (warn_deprecated ("bfd_read", (const char *) 0, 0, (const char *) 0), \ | 
|---|
| 491 | bfd_bread ((BUF), (ELTSIZE) * (NITEMS), (ABFD))) | 
|---|
| 492 | #define bfd_write(BUF, ELTSIZE, NITEMS, ABFD)                           \ | 
|---|
| 493 | (warn_deprecated ("bfd_write", (const char *) 0, 0, (const char *) 0),\ | 
|---|
| 494 | bfd_bwrite ((BUF), (ELTSIZE) * (NITEMS), (ABFD))) | 
|---|
| 495 | #endif | 
|---|
| 496 | extern void warn_deprecated | 
|---|
| 497 | PARAMS ((const char *, const char *, int, const char *)); | 
|---|
| 498 |  | 
|---|
| 499 | /* Cast from const char * to char * so that caller can assign to | 
|---|
| 500 | a char * without a warning.  */ | 
|---|
| 501 | #define bfd_get_filename(abfd) ((char *) (abfd)->filename) | 
|---|
| 502 | #define bfd_get_cacheable(abfd) ((abfd)->cacheable) | 
|---|
| 503 | #define bfd_get_format(abfd) ((abfd)->format) | 
|---|
| 504 | #define bfd_get_target(abfd) ((abfd)->xvec->name) | 
|---|
| 505 | #define bfd_get_flavour(abfd) ((abfd)->xvec->flavour) | 
|---|
| 506 | #define bfd_family_coff(abfd) \ | 
|---|
| 507 | (bfd_get_flavour (abfd) == bfd_target_coff_flavour || \ | 
|---|
| 508 | bfd_get_flavour (abfd) == bfd_target_xcoff_flavour) | 
|---|
| 509 | #define bfd_big_endian(abfd) ((abfd)->xvec->byteorder == BFD_ENDIAN_BIG) | 
|---|
| 510 | #define bfd_little_endian(abfd) ((abfd)->xvec->byteorder == BFD_ENDIAN_LITTLE) | 
|---|
| 511 | #define bfd_header_big_endian(abfd) \ | 
|---|
| 512 | ((abfd)->xvec->header_byteorder == BFD_ENDIAN_BIG) | 
|---|
| 513 | #define bfd_header_little_endian(abfd) \ | 
|---|
| 514 | ((abfd)->xvec->header_byteorder == BFD_ENDIAN_LITTLE) | 
|---|
| 515 | #define bfd_get_file_flags(abfd) ((abfd)->flags) | 
|---|
| 516 | #define bfd_applicable_file_flags(abfd) ((abfd)->xvec->object_flags) | 
|---|
| 517 | #define bfd_applicable_section_flags(abfd) ((abfd)->xvec->section_flags) | 
|---|
| 518 | #define bfd_my_archive(abfd) ((abfd)->my_archive) | 
|---|
| 519 | #define bfd_has_map(abfd) ((abfd)->has_armap) | 
|---|
| 520 |  | 
|---|
| 521 | #define bfd_valid_reloc_types(abfd) ((abfd)->xvec->valid_reloc_types) | 
|---|
| 522 | #define bfd_usrdata(abfd) ((abfd)->usrdata) | 
|---|
| 523 |  | 
|---|
| 524 | #define bfd_get_start_address(abfd) ((abfd)->start_address) | 
|---|
| 525 | #define bfd_get_symcount(abfd) ((abfd)->symcount) | 
|---|
| 526 | #define bfd_get_outsymbols(abfd) ((abfd)->outsymbols) | 
|---|
| 527 | #define bfd_count_sections(abfd) ((abfd)->section_count) | 
|---|
| 528 |  | 
|---|
| 529 | #define bfd_get_dynamic_symcount(abfd) ((abfd)->dynsymcount) | 
|---|
| 530 |  | 
|---|
| 531 | #define bfd_get_symbol_leading_char(abfd) ((abfd)->xvec->symbol_leading_char) | 
|---|
| 532 |  | 
|---|
| 533 | #define bfd_set_cacheable(abfd,bool) (((abfd)->cacheable = bool), TRUE) | 
|---|
| 534 |  | 
|---|
| 535 | extern bfd_boolean bfd_cache_close | 
|---|
| 536 | PARAMS ((bfd *abfd)); | 
|---|
| 537 | /* NB: This declaration should match the autogenerated one in libbfd.h.  */ | 
|---|
| 538 |  | 
|---|
| 539 | extern bfd_boolean bfd_record_phdr | 
|---|
| 540 | PARAMS ((bfd *, unsigned long, bfd_boolean, flagword, bfd_boolean, bfd_vma, | 
|---|
| 541 | bfd_boolean, bfd_boolean, unsigned int, struct sec **)); | 
|---|
| 542 |  | 
|---|
| 543 | /* Byte swapping routines.  */ | 
|---|
| 544 |  | 
|---|
| 545 | bfd_vma bfd_getb64 | 
|---|
| 546 | PARAMS ((const unsigned char *)); | 
|---|
| 547 | bfd_vma bfd_getl64 | 
|---|
| 548 | PARAMS ((const unsigned char *)); | 
|---|
| 549 | bfd_signed_vma bfd_getb_signed_64 | 
|---|
| 550 | PARAMS ((const unsigned char *)); | 
|---|
| 551 | bfd_signed_vma bfd_getl_signed_64 | 
|---|
| 552 | PARAMS ((const unsigned char *)); | 
|---|
| 553 | bfd_vma bfd_getb32 | 
|---|
| 554 | PARAMS ((const unsigned char *)); | 
|---|
| 555 | bfd_vma bfd_getl32 | 
|---|
| 556 | PARAMS ((const unsigned char *)); | 
|---|
| 557 | bfd_signed_vma bfd_getb_signed_32 | 
|---|
| 558 | PARAMS ((const unsigned char *)); | 
|---|
| 559 | bfd_signed_vma bfd_getl_signed_32 | 
|---|
| 560 | PARAMS ((const unsigned char *)); | 
|---|
| 561 | bfd_vma bfd_getb16 | 
|---|
| 562 | PARAMS ((const unsigned char *)); | 
|---|
| 563 | bfd_vma bfd_getl16 | 
|---|
| 564 | PARAMS ((const unsigned char *)); | 
|---|
| 565 | bfd_signed_vma bfd_getb_signed_16 | 
|---|
| 566 | PARAMS ((const unsigned char *)); | 
|---|
| 567 | bfd_signed_vma bfd_getl_signed_16 | 
|---|
| 568 | PARAMS ((const unsigned char *)); | 
|---|
| 569 | void bfd_putb64 | 
|---|
| 570 | PARAMS ((bfd_vma, unsigned char *)); | 
|---|
| 571 | void bfd_putl64 | 
|---|
| 572 | PARAMS ((bfd_vma, unsigned char *)); | 
|---|
| 573 | void bfd_putb32 | 
|---|
| 574 | PARAMS ((bfd_vma, unsigned char *)); | 
|---|
| 575 | void bfd_putl32 | 
|---|
| 576 | PARAMS ((bfd_vma, unsigned char *)); | 
|---|
| 577 | void bfd_putb16 | 
|---|
| 578 | PARAMS ((bfd_vma, unsigned char *)); | 
|---|
| 579 | void bfd_putl16 | 
|---|
| 580 | PARAMS ((bfd_vma, unsigned char *)); | 
|---|
| 581 |  | 
|---|
| 582 | /* Byte swapping routines which take size and endiannes as arguments.  */ | 
|---|
| 583 |  | 
|---|
| 584 | bfd_vma bfd_get_bits | 
|---|
| 585 | PARAMS ((bfd_byte *, int, bfd_boolean)); | 
|---|
| 586 | void bfd_put_bits | 
|---|
| 587 | PARAMS ((bfd_vma, bfd_byte *, int, bfd_boolean)); | 
|---|
| 588 |  | 
|---|
| 589 |  | 
|---|
| 590 | /* Externally visible ECOFF routines.  */ | 
|---|
| 591 |  | 
|---|
| 592 | #if defined(__STDC__) || defined(ALMOST_STDC) | 
|---|
| 593 | struct ecoff_debug_info; | 
|---|
| 594 | struct ecoff_debug_swap; | 
|---|
| 595 | struct ecoff_extr; | 
|---|
| 596 | struct symbol_cache_entry; | 
|---|
| 597 | struct bfd_link_info; | 
|---|
| 598 | struct bfd_link_hash_entry; | 
|---|
| 599 | struct bfd_elf_version_tree; | 
|---|
| 600 | #endif | 
|---|
| 601 | extern bfd_vma bfd_ecoff_get_gp_value | 
|---|
| 602 | PARAMS ((bfd * abfd)); | 
|---|
| 603 | extern bfd_boolean bfd_ecoff_set_gp_value | 
|---|
| 604 | PARAMS ((bfd *abfd, bfd_vma gp_value)); | 
|---|
| 605 | extern bfd_boolean bfd_ecoff_set_regmasks | 
|---|
| 606 | PARAMS ((bfd *abfd, unsigned long gprmask, unsigned long fprmask, | 
|---|
| 607 | unsigned long *cprmask)); | 
|---|
| 608 | extern PTR bfd_ecoff_debug_init | 
|---|
| 609 | PARAMS ((bfd *output_bfd, struct ecoff_debug_info *output_debug, | 
|---|
| 610 | const struct ecoff_debug_swap *output_swap, | 
|---|
| 611 | struct bfd_link_info *)); | 
|---|
| 612 | extern void bfd_ecoff_debug_free | 
|---|
| 613 | PARAMS ((PTR handle, bfd *output_bfd, struct ecoff_debug_info *output_debug, | 
|---|
| 614 | const struct ecoff_debug_swap *output_swap, | 
|---|
| 615 | struct bfd_link_info *)); | 
|---|
| 616 | extern bfd_boolean bfd_ecoff_debug_accumulate | 
|---|
| 617 | PARAMS ((PTR handle, bfd *output_bfd, struct ecoff_debug_info *output_debug, | 
|---|
| 618 | const struct ecoff_debug_swap *output_swap, | 
|---|
| 619 | bfd *input_bfd, struct ecoff_debug_info *input_debug, | 
|---|
| 620 | const struct ecoff_debug_swap *input_swap, | 
|---|
| 621 | struct bfd_link_info *)); | 
|---|
| 622 | extern bfd_boolean bfd_ecoff_debug_accumulate_other | 
|---|
| 623 | PARAMS ((PTR handle, bfd *output_bfd, struct ecoff_debug_info *output_debug, | 
|---|
| 624 | const struct ecoff_debug_swap *output_swap, bfd *input_bfd, | 
|---|
| 625 | struct bfd_link_info *)); | 
|---|
| 626 | extern bfd_boolean bfd_ecoff_debug_externals | 
|---|
| 627 | PARAMS ((bfd *abfd, struct ecoff_debug_info *debug, | 
|---|
| 628 | const struct ecoff_debug_swap *swap, | 
|---|
| 629 | bfd_boolean relocateable, | 
|---|
| 630 | bfd_boolean (*get_extr) (struct symbol_cache_entry *, | 
|---|
| 631 | struct ecoff_extr *), | 
|---|
| 632 | void (*set_index) (struct symbol_cache_entry *, | 
|---|
| 633 | bfd_size_type))); | 
|---|
| 634 | extern bfd_boolean bfd_ecoff_debug_one_external | 
|---|
| 635 | PARAMS ((bfd *abfd, struct ecoff_debug_info *debug, | 
|---|
| 636 | const struct ecoff_debug_swap *swap, | 
|---|
| 637 | const char *name, struct ecoff_extr *esym)); | 
|---|
| 638 | extern bfd_size_type bfd_ecoff_debug_size | 
|---|
| 639 | PARAMS ((bfd *abfd, struct ecoff_debug_info *debug, | 
|---|
| 640 | const struct ecoff_debug_swap *swap)); | 
|---|
| 641 | extern bfd_boolean bfd_ecoff_write_debug | 
|---|
| 642 | PARAMS ((bfd *abfd, struct ecoff_debug_info *debug, | 
|---|
| 643 | const struct ecoff_debug_swap *swap, file_ptr where)); | 
|---|
| 644 | extern bfd_boolean bfd_ecoff_write_accumulated_debug | 
|---|
| 645 | PARAMS ((PTR handle, bfd *abfd, struct ecoff_debug_info *debug, | 
|---|
| 646 | const struct ecoff_debug_swap *swap, | 
|---|
| 647 | struct bfd_link_info *info, file_ptr where)); | 
|---|
| 648 | extern bfd_boolean bfd_mips_ecoff_create_embedded_relocs | 
|---|
| 649 | PARAMS ((bfd *, struct bfd_link_info *, struct sec *, struct sec *, | 
|---|
| 650 | char **)); | 
|---|
| 651 |  | 
|---|
| 652 | /* Externally visible ELF routines.  */ | 
|---|
| 653 |  | 
|---|
| 654 | struct bfd_link_needed_list | 
|---|
| 655 | { | 
|---|
| 656 | struct bfd_link_needed_list *next; | 
|---|
| 657 | bfd *by; | 
|---|
| 658 | const char *name; | 
|---|
| 659 | }; | 
|---|
| 660 |  | 
|---|
| 661 | extern bfd_boolean bfd_elf32_record_link_assignment | 
|---|
| 662 | PARAMS ((bfd *, struct bfd_link_info *, const char *, bfd_boolean)); | 
|---|
| 663 | extern bfd_boolean bfd_elf64_record_link_assignment | 
|---|
| 664 | PARAMS ((bfd *, struct bfd_link_info *, const char *, bfd_boolean)); | 
|---|
| 665 | extern struct bfd_link_needed_list *bfd_elf_get_needed_list | 
|---|
| 666 | PARAMS ((bfd *, struct bfd_link_info *)); | 
|---|
| 667 | extern bfd_boolean bfd_elf_get_bfd_needed_list | 
|---|
| 668 | PARAMS ((bfd *, struct bfd_link_needed_list **)); | 
|---|
| 669 | extern bfd_boolean bfd_elf32_size_dynamic_sections | 
|---|
| 670 | PARAMS ((bfd *, const char *, const char *, const char *, | 
|---|
| 671 | const char * const *, struct bfd_link_info *, struct sec **, | 
|---|
| 672 | struct bfd_elf_version_tree *)); | 
|---|
| 673 | extern bfd_boolean bfd_elf64_size_dynamic_sections | 
|---|
| 674 | PARAMS ((bfd *, const char *, const char *, const char *, | 
|---|
| 675 | const char * const *, struct bfd_link_info *, struct sec **, | 
|---|
| 676 | struct bfd_elf_version_tree *)); | 
|---|
| 677 | extern void bfd_elf_set_dt_needed_name | 
|---|
| 678 | PARAMS ((bfd *, const char *)); | 
|---|
| 679 | extern void bfd_elf_set_dt_needed_soname | 
|---|
| 680 | PARAMS ((bfd *, const char *)); | 
|---|
| 681 | extern const char *bfd_elf_get_dt_soname | 
|---|
| 682 | PARAMS ((bfd *)); | 
|---|
| 683 | extern struct bfd_link_needed_list *bfd_elf_get_runpath_list | 
|---|
| 684 | PARAMS ((bfd *, struct bfd_link_info *)); | 
|---|
| 685 | extern bfd_boolean bfd_elf32_discard_info | 
|---|
| 686 | PARAMS ((bfd *, struct bfd_link_info *)); | 
|---|
| 687 | extern bfd_boolean bfd_elf64_discard_info | 
|---|
| 688 | PARAMS ((bfd *, struct bfd_link_info *)); | 
|---|
| 689 |  | 
|---|
| 690 | /* Return an upper bound on the number of bytes required to store a | 
|---|
| 691 | copy of ABFD's program header table entries.  Return -1 if an error | 
|---|
| 692 | occurs; bfd_get_error will return an appropriate code.  */ | 
|---|
| 693 | extern long bfd_get_elf_phdr_upper_bound | 
|---|
| 694 | PARAMS ((bfd *abfd)); | 
|---|
| 695 |  | 
|---|
| 696 | /* Copy ABFD's program header table entries to *PHDRS.  The entries | 
|---|
| 697 | will be stored as an array of Elf_Internal_Phdr structures, as | 
|---|
| 698 | defined in include/elf/internal.h.  To find out how large the | 
|---|
| 699 | buffer needs to be, call bfd_get_elf_phdr_upper_bound. | 
|---|
| 700 |  | 
|---|
| 701 | Return the number of program header table entries read, or -1 if an | 
|---|
| 702 | error occurs; bfd_get_error will return an appropriate code.  */ | 
|---|
| 703 | extern int bfd_get_elf_phdrs | 
|---|
| 704 | PARAMS ((bfd *abfd, void *phdrs)); | 
|---|
| 705 |  | 
|---|
| 706 | /* Return the arch_size field of an elf bfd, or -1 if not elf.  */ | 
|---|
| 707 | extern int bfd_get_arch_size | 
|---|
| 708 | PARAMS ((bfd *)); | 
|---|
| 709 |  | 
|---|
| 710 | /* Return TRUE if address "naturally" sign extends, or -1 if not elf.  */ | 
|---|
| 711 | extern int bfd_get_sign_extend_vma | 
|---|
| 712 | PARAMS ((bfd *)); | 
|---|
| 713 |  | 
|---|
| 714 | extern bfd_boolean bfd_m68k_elf32_create_embedded_relocs | 
|---|
| 715 | PARAMS ((bfd *, struct bfd_link_info *, struct sec *, struct sec *, | 
|---|
| 716 | char **)); | 
|---|
| 717 | extern bfd_boolean bfd_mips_elf32_create_embedded_relocs | 
|---|
| 718 | PARAMS ((bfd *, struct bfd_link_info *, struct sec *, struct sec *, | 
|---|
| 719 | char **)); | 
|---|
| 720 |  | 
|---|
| 721 | /* SunOS shared library support routines for the linker.  */ | 
|---|
| 722 |  | 
|---|
| 723 | extern struct bfd_link_needed_list *bfd_sunos_get_needed_list | 
|---|
| 724 | PARAMS ((bfd *, struct bfd_link_info *)); | 
|---|
| 725 | extern bfd_boolean bfd_sunos_record_link_assignment | 
|---|
| 726 | PARAMS ((bfd *, struct bfd_link_info *, const char *)); | 
|---|
| 727 | extern bfd_boolean bfd_sunos_size_dynamic_sections | 
|---|
| 728 | PARAMS ((bfd *, struct bfd_link_info *, struct sec **, struct sec **, | 
|---|
| 729 | struct sec **)); | 
|---|
| 730 |  | 
|---|
| 731 | /* Linux shared library support routines for the linker.  */ | 
|---|
| 732 |  | 
|---|
| 733 | extern bfd_boolean bfd_i386linux_size_dynamic_sections | 
|---|
| 734 | PARAMS ((bfd *, struct bfd_link_info *)); | 
|---|
| 735 | extern bfd_boolean bfd_m68klinux_size_dynamic_sections | 
|---|
| 736 | PARAMS ((bfd *, struct bfd_link_info *)); | 
|---|
| 737 | extern bfd_boolean bfd_sparclinux_size_dynamic_sections | 
|---|
| 738 | PARAMS ((bfd *, struct bfd_link_info *)); | 
|---|
| 739 |  | 
|---|
| 740 | /* mmap hacks */ | 
|---|
| 741 |  | 
|---|
| 742 | struct _bfd_window_internal; | 
|---|
| 743 | typedef struct _bfd_window_internal bfd_window_internal; | 
|---|
| 744 |  | 
|---|
| 745 | typedef struct _bfd_window | 
|---|
| 746 | { | 
|---|
| 747 | /* What the user asked for.  */ | 
|---|
| 748 | PTR data; | 
|---|
| 749 | bfd_size_type size; | 
|---|
| 750 | /* The actual window used by BFD.  Small user-requested read-only | 
|---|
| 751 | regions sharing a page may share a single window into the object | 
|---|
| 752 | file.  Read-write versions shouldn't until I've fixed things to | 
|---|
| 753 | keep track of which portions have been claimed by the | 
|---|
| 754 | application; don't want to give the same region back when the | 
|---|
| 755 | application wants two writable copies!  */ | 
|---|
| 756 | struct _bfd_window_internal *i; | 
|---|
| 757 | } | 
|---|
| 758 | bfd_window; | 
|---|
| 759 |  | 
|---|
| 760 | extern void bfd_init_window | 
|---|
| 761 | PARAMS ((bfd_window *)); | 
|---|
| 762 | extern void bfd_free_window | 
|---|
| 763 | PARAMS ((bfd_window *)); | 
|---|
| 764 | extern bfd_boolean bfd_get_file_window | 
|---|
| 765 | PARAMS ((bfd *, file_ptr, bfd_size_type, bfd_window *, bfd_boolean)); | 
|---|
| 766 |  | 
|---|
| 767 | /* XCOFF support routines for the linker.  */ | 
|---|
| 768 |  | 
|---|
| 769 | extern bfd_boolean bfd_xcoff_link_record_set | 
|---|
| 770 | PARAMS ((bfd *, struct bfd_link_info *, struct bfd_link_hash_entry *, | 
|---|
| 771 | bfd_size_type)); | 
|---|
| 772 | extern bfd_boolean bfd_xcoff_import_symbol | 
|---|
| 773 | PARAMS ((bfd *, struct bfd_link_info *, struct bfd_link_hash_entry *, | 
|---|
| 774 | bfd_vma, const char *, const char *, const char *, unsigned int)); | 
|---|
| 775 | extern bfd_boolean bfd_xcoff_export_symbol | 
|---|
| 776 | PARAMS ((bfd *, struct bfd_link_info *, struct bfd_link_hash_entry *)); | 
|---|
| 777 | extern bfd_boolean bfd_xcoff_link_count_reloc | 
|---|
| 778 | PARAMS ((bfd *, struct bfd_link_info *, const char *)); | 
|---|
| 779 | extern bfd_boolean bfd_xcoff_record_link_assignment | 
|---|
| 780 | PARAMS ((bfd *, struct bfd_link_info *, const char *)); | 
|---|
| 781 | extern bfd_boolean bfd_xcoff_size_dynamic_sections | 
|---|
| 782 | PARAMS ((bfd *, struct bfd_link_info *, const char *, const char *, | 
|---|
| 783 | unsigned long, unsigned long, unsigned long, bfd_boolean, | 
|---|
| 784 | int, bfd_boolean, bfd_boolean, struct sec **, bfd_boolean)); | 
|---|
| 785 | extern bfd_boolean bfd_xcoff_link_generate_rtinit | 
|---|
| 786 | PARAMS ((bfd *, const char *, const char *, bfd_boolean)); | 
|---|
| 787 |  | 
|---|
| 788 | /* XCOFF support routines for ar.  */ | 
|---|
| 789 | extern bfd_boolean bfd_xcoff_ar_archive_set_magic | 
|---|
| 790 | PARAMS ((bfd *, char *)); | 
|---|
| 791 |  | 
|---|
| 792 | /* Externally visible COFF routines.  */ | 
|---|
| 793 |  | 
|---|
| 794 | #if defined(__STDC__) || defined(ALMOST_STDC) | 
|---|
| 795 | struct internal_syment; | 
|---|
| 796 | union internal_auxent; | 
|---|
| 797 | #endif | 
|---|
| 798 |  | 
|---|
| 799 | extern bfd_boolean bfd_coff_get_syment | 
|---|
| 800 | PARAMS ((bfd *, struct symbol_cache_entry *, struct internal_syment *)); | 
|---|
| 801 |  | 
|---|
| 802 | extern bfd_boolean bfd_coff_get_auxent | 
|---|
| 803 | PARAMS ((bfd *, struct symbol_cache_entry *, int, union internal_auxent *)); | 
|---|
| 804 |  | 
|---|
| 805 | extern bfd_boolean bfd_coff_set_symbol_class | 
|---|
| 806 | PARAMS ((bfd *, struct symbol_cache_entry *, unsigned int)); | 
|---|
| 807 |  | 
|---|
| 808 | extern bfd_boolean bfd_m68k_coff_create_embedded_relocs | 
|---|
| 809 | PARAMS ((bfd *, struct bfd_link_info *, struct sec *, struct sec *, | 
|---|
| 810 | char **)); | 
|---|
| 811 |  | 
|---|
| 812 | /* ARM Interworking support.  Called from linker.  */ | 
|---|
| 813 | extern bfd_boolean bfd_arm_allocate_interworking_sections | 
|---|
| 814 | PARAMS ((struct bfd_link_info *)); | 
|---|
| 815 |  | 
|---|
| 816 | extern bfd_boolean bfd_arm_process_before_allocation | 
|---|
| 817 | PARAMS ((bfd *, struct bfd_link_info *, int)); | 
|---|
| 818 |  | 
|---|
| 819 | extern bfd_boolean bfd_arm_get_bfd_for_interworking | 
|---|
| 820 | PARAMS ((bfd *, struct bfd_link_info *)); | 
|---|
| 821 |  | 
|---|
| 822 | /* PE ARM Interworking support.  Called from linker.  */ | 
|---|
| 823 | extern bfd_boolean bfd_arm_pe_allocate_interworking_sections | 
|---|
| 824 | PARAMS ((struct bfd_link_info *)); | 
|---|
| 825 |  | 
|---|
| 826 | extern bfd_boolean bfd_arm_pe_process_before_allocation | 
|---|
| 827 | PARAMS ((bfd *, struct bfd_link_info *, int)); | 
|---|
| 828 |  | 
|---|
| 829 | extern bfd_boolean bfd_arm_pe_get_bfd_for_interworking | 
|---|
| 830 | PARAMS ((bfd *, struct bfd_link_info *)); | 
|---|
| 831 |  | 
|---|
| 832 | /* ELF ARM Interworking support.  Called from linker.  */ | 
|---|
| 833 | extern bfd_boolean bfd_elf32_arm_allocate_interworking_sections | 
|---|
| 834 | PARAMS ((struct bfd_link_info *)); | 
|---|
| 835 |  | 
|---|
| 836 | extern bfd_boolean bfd_elf32_arm_process_before_allocation | 
|---|
| 837 | PARAMS ((bfd *, struct bfd_link_info *, int)); | 
|---|
| 838 |  | 
|---|
| 839 | extern bfd_boolean bfd_elf32_arm_get_bfd_for_interworking | 
|---|
| 840 | PARAMS ((bfd *, struct bfd_link_info *)); | 
|---|
| 841 |  | 
|---|
| 842 | extern bfd_boolean bfd_elf32_arm_add_glue_sections_to_bfd | 
|---|
| 843 | PARAMS ((bfd *, struct bfd_link_info *)); | 
|---|
| 844 |  | 
|---|
| 845 | /* ARM Note section processing.  */ | 
|---|
| 846 | extern bfd_boolean bfd_arm_merge_machines | 
|---|
| 847 | PARAMS ((bfd *, bfd *)); | 
|---|
| 848 |  | 
|---|
| 849 | extern bfd_boolean bfd_arm_update_notes | 
|---|
| 850 | PARAMS ((bfd *, const char *)); | 
|---|
| 851 |  | 
|---|
| 852 | extern unsigned int bfd_arm_get_mach_from_notes | 
|---|
| 853 | PARAMS ((bfd *, const char *)); | 
|---|
| 854 |  | 
|---|
| 855 | /* TI COFF load page support.  */ | 
|---|
| 856 | extern void bfd_ticoff_set_section_load_page | 
|---|
| 857 | PARAMS ((struct sec *, int)); | 
|---|
| 858 |  | 
|---|
| 859 | extern int bfd_ticoff_get_section_load_page | 
|---|
| 860 | PARAMS ((struct sec *)); | 
|---|
| 861 |  | 
|---|