nkeynes@362: /* DO NOT EDIT! -*- buffer-read-only: t -*- This file is automatically nkeynes@362: generated from "bfd-in.h", "init.c", "opncls.c", "libbfd.c", nkeynes@362: "bfdio.c", "bfdwin.c", "section.c", "archures.c", "reloc.c", nkeynes@362: "syms.c", "bfd.c", "archive.c", "corefile.c", "targets.c", "format.c", nkeynes@362: "linker.c" and "simple.c". nkeynes@362: Run "make headers" in your build bfd/ to regenerate. */ nkeynes@362: nkeynes@362: /* Main header file for the bfd library -- portable access to object files. nkeynes@362: nkeynes@362: Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, nkeynes@362: 1999, 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. nkeynes@362: nkeynes@362: Contributed by Cygnus Support. nkeynes@362: nkeynes@362: This file is part of BFD, the Binary File Descriptor library. nkeynes@362: nkeynes@362: This program is free software; you can redistribute it and/or modify nkeynes@362: it under the terms of the GNU General Public License as published by nkeynes@362: the Free Software Foundation; either version 2 of the License, or nkeynes@362: (at your option) any later version. nkeynes@362: nkeynes@362: This program is distributed in the hope that it will be useful, nkeynes@362: but WITHOUT ANY WARRANTY; without even the implied warranty of nkeynes@362: MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the nkeynes@362: GNU General Public License for more details. nkeynes@362: nkeynes@362: You should have received a copy of the GNU General Public License nkeynes@362: along with this program; if not, write to the Free Software nkeynes@362: Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ nkeynes@362: nkeynes@362: #ifndef __BFD_H_SEEN__ nkeynes@362: #define __BFD_H_SEEN__ nkeynes@362: nkeynes@362: #ifdef __cplusplus nkeynes@362: extern "C" { nkeynes@362: #endif nkeynes@362: nkeynes@755: #include "x86dasm/ansidecl.h" nkeynes@755: #include "x86dasm/symcat.h" nkeynes@362: #if defined (__STDC__) || defined (ALMOST_STDC) || defined (HAVE_STRINGIZE) nkeynes@362: #ifndef SABER nkeynes@362: /* This hack is to avoid a problem with some strict ANSI C preprocessors. nkeynes@362: The problem is, "32_" is not a valid preprocessing token, and we don't nkeynes@362: want extra underscores (e.g., "nlm_32_"). The XCONCAT2 macro will nkeynes@362: cause the inner CONCAT2 macros to be evaluated first, producing nkeynes@362: still-valid pp-tokens. Then the final concatenation can be done. */ nkeynes@362: #undef CONCAT4 nkeynes@362: #define CONCAT4(a,b,c,d) XCONCAT2(CONCAT2(a,b),CONCAT2(c,d)) nkeynes@362: #endif nkeynes@362: #endif nkeynes@362: nkeynes@362: /* The word size used by BFD on the host. This may be 64 with a 32 nkeynes@362: bit target if the host is 64 bit, or if other 64 bit targets have nkeynes@362: been selected with --enable-targets, or if --enable-64-bit-bfd. */ nkeynes@362: #define BFD_ARCH_SIZE 64 nkeynes@362: nkeynes@362: /* The word size of the default bfd target. */ nkeynes@362: #define BFD_DEFAULT_TARGET_SIZE 32 nkeynes@362: nkeynes@362: #define BFD_HOST_64BIT_LONG 0 nkeynes@362: #define BFD_HOST_LONG_LONG 1 nkeynes@362: #if 1 nkeynes@362: #define BFD_HOST_64_BIT long long nkeynes@362: #define BFD_HOST_U_64_BIT unsigned long long nkeynes@362: typedef BFD_HOST_64_BIT bfd_int64_t; nkeynes@362: typedef BFD_HOST_U_64_BIT bfd_uint64_t; nkeynes@362: #endif nkeynes@362: nkeynes@362: #if BFD_ARCH_SIZE >= 64 nkeynes@362: #define BFD64 nkeynes@362: #endif nkeynes@362: nkeynes@362: #ifndef INLINE nkeynes@362: #if __GNUC__ >= 2 nkeynes@362: #define INLINE __inline__ nkeynes@362: #else nkeynes@362: #define INLINE nkeynes@362: #endif nkeynes@362: #endif nkeynes@362: nkeynes@362: /* Forward declaration. */ nkeynes@362: typedef struct bfd bfd; nkeynes@362: nkeynes@362: /* Boolean type used in bfd. Too many systems define their own nkeynes@362: versions of "boolean" for us to safely typedef a "boolean" of nkeynes@362: our own. Using an enum for "bfd_boolean" has its own set of nkeynes@362: problems, with strange looking casts required to avoid warnings nkeynes@362: on some older compilers. Thus we just use an int. nkeynes@362: nkeynes@362: General rule: Functions which are bfd_boolean return TRUE on nkeynes@362: success and FALSE on failure (unless they're a predicate). */ nkeynes@362: nkeynes@362: typedef int bfd_boolean; nkeynes@362: #undef FALSE nkeynes@362: #undef TRUE nkeynes@362: #define FALSE 0 nkeynes@362: #define TRUE 1 nkeynes@362: nkeynes@362: #ifdef BFD64 nkeynes@362: nkeynes@362: #ifndef BFD_HOST_64_BIT nkeynes@362: #error No 64 bit integer type available nkeynes@362: #endif /* ! defined (BFD_HOST_64_BIT) */ nkeynes@362: nkeynes@362: typedef BFD_HOST_U_64_BIT bfd_vma; nkeynes@362: typedef BFD_HOST_64_BIT bfd_signed_vma; nkeynes@362: typedef BFD_HOST_U_64_BIT bfd_size_type; nkeynes@362: typedef BFD_HOST_U_64_BIT symvalue; nkeynes@362: nkeynes@362: #ifndef fprintf_vma nkeynes@362: #if BFD_HOST_64BIT_LONG nkeynes@362: #define sprintf_vma(s,x) sprintf (s, "%016lx", x) nkeynes@362: #define fprintf_vma(f,x) fprintf (f, "%016lx", x) nkeynes@362: #else nkeynes@362: #define _bfd_int64_low(x) ((unsigned long) (((x) & 0xffffffff))) nkeynes@362: #define _bfd_int64_high(x) ((unsigned long) (((x) >> 32) & 0xffffffff)) nkeynes@362: #define fprintf_vma(s,x) \ nkeynes@362: fprintf ((s), "%08lx%08lx", _bfd_int64_high (x), _bfd_int64_low (x)) nkeynes@362: #define sprintf_vma(s,x) \ nkeynes@362: sprintf ((s), "%08lx%08lx", _bfd_int64_high (x), _bfd_int64_low (x)) nkeynes@362: #endif nkeynes@362: #endif nkeynes@362: nkeynes@362: #else /* not BFD64 */ nkeynes@362: nkeynes@362: /* Represent a target address. Also used as a generic unsigned type nkeynes@362: which is guaranteed to be big enough to hold any arithmetic types nkeynes@362: we need to deal with. */ nkeynes@362: typedef unsigned long bfd_vma; nkeynes@362: nkeynes@362: /* A generic signed type which is guaranteed to be big enough to hold any nkeynes@362: arithmetic types we need to deal with. Can be assumed to be compatible nkeynes@362: with bfd_vma in the same way that signed and unsigned ints are compatible nkeynes@362: (as parameters, in assignment, etc). */ nkeynes@362: typedef long bfd_signed_vma; nkeynes@362: nkeynes@362: typedef unsigned long symvalue; nkeynes@362: typedef unsigned long bfd_size_type; nkeynes@362: nkeynes@362: /* Print a bfd_vma x on stream s. */ nkeynes@362: #define fprintf_vma(s,x) fprintf (s, "%08lx", x) nkeynes@362: #define sprintf_vma(s,x) sprintf (s, "%08lx", x) nkeynes@362: nkeynes@362: #endif /* not BFD64 */ nkeynes@362: nkeynes@362: #ifndef BFD_HOST_64_BIT nkeynes@362: /* Fall back on a 32 bit type. The idea is to make these types always nkeynes@362: available for function return types, but in the case that nkeynes@362: BFD_HOST_64_BIT is undefined such a function should abort or nkeynes@362: otherwise signal an error. */ nkeynes@362: typedef bfd_signed_vma bfd_int64_t; nkeynes@362: typedef bfd_vma bfd_uint64_t; nkeynes@362: #endif nkeynes@362: nkeynes@362: /* An offset into a file. BFD always uses the largest possible offset nkeynes@362: based on the build time availability of fseek, fseeko, or fseeko64. */ nkeynes@362: typedef BFD_HOST_64_BIT file_ptr; nkeynes@362: typedef unsigned BFD_HOST_64_BIT ufile_ptr; nkeynes@362: nkeynes@362: extern void bfd_sprintf_vma (bfd *, char *, bfd_vma); nkeynes@362: extern void bfd_fprintf_vma (bfd *, void *, bfd_vma); nkeynes@362: nkeynes@362: #define printf_vma(x) fprintf_vma(stdout,x) nkeynes@362: #define bfd_printf_vma(abfd,x) bfd_fprintf_vma (abfd,stdout,x) nkeynes@362: nkeynes@362: typedef unsigned int flagword; /* 32 bits of flags */ nkeynes@362: typedef unsigned char bfd_byte; nkeynes@362: nkeynes@362: /* File formats. */ nkeynes@362: nkeynes@362: typedef enum bfd_format nkeynes@362: { nkeynes@362: bfd_unknown = 0, /* File format is unknown. */ nkeynes@362: bfd_object, /* Linker/assembler/compiler output. */ nkeynes@362: bfd_archive, /* Object archive file. */ nkeynes@362: bfd_core, /* Core dump. */ nkeynes@362: bfd_type_end /* Marks the end; don't use it! */ nkeynes@362: } nkeynes@362: bfd_format; nkeynes@362: nkeynes@362: /* Values that may appear in the flags field of a BFD. These also nkeynes@362: appear in the object_flags field of the bfd_target structure, where nkeynes@362: they indicate the set of flags used by that backend (not all flags nkeynes@362: are meaningful for all object file formats) (FIXME: at the moment, nkeynes@362: the object_flags values have mostly just been copied from backend nkeynes@362: to another, and are not necessarily correct). */ nkeynes@362: nkeynes@362: /* No flags. */ nkeynes@362: #define BFD_NO_FLAGS 0x00 nkeynes@362: nkeynes@362: /* BFD contains relocation entries. */ nkeynes@362: #define HAS_RELOC 0x01 nkeynes@362: nkeynes@362: /* BFD is directly executable. */ nkeynes@362: #define EXEC_P 0x02 nkeynes@362: nkeynes@362: /* BFD has line number information (basically used for F_LNNO in a nkeynes@362: COFF header). */ nkeynes@362: #define HAS_LINENO 0x04 nkeynes@362: nkeynes@362: /* BFD has debugging information. */ nkeynes@362: #define HAS_DEBUG 0x08 nkeynes@362: nkeynes@362: /* BFD has symbols. */ nkeynes@362: #define HAS_SYMS 0x10 nkeynes@362: nkeynes@362: /* BFD has local symbols (basically used for F_LSYMS in a COFF nkeynes@362: header). */ nkeynes@362: #define HAS_LOCALS 0x20 nkeynes@362: nkeynes@362: /* BFD is a dynamic object. */ nkeynes@362: #define DYNAMIC 0x40 nkeynes@362: nkeynes@362: /* Text section is write protected (if D_PAGED is not set, this is nkeynes@362: like an a.out NMAGIC file) (the linker sets this by default, but nkeynes@362: clears it for -r or -N). */ nkeynes@362: #define WP_TEXT 0x80 nkeynes@362: nkeynes@362: /* BFD is dynamically paged (this is like an a.out ZMAGIC file) (the nkeynes@362: linker sets this by default, but clears it for -r or -n or -N). */ nkeynes@362: #define D_PAGED 0x100 nkeynes@362: nkeynes@362: /* BFD is relaxable (this means that bfd_relax_section may be able to nkeynes@362: do something) (sometimes bfd_relax_section can do something even if nkeynes@362: this is not set). */ nkeynes@362: #define BFD_IS_RELAXABLE 0x200 nkeynes@362: nkeynes@362: /* This may be set before writing out a BFD to request using a nkeynes@362: traditional format. For example, this is used to request that when nkeynes@362: writing out an a.out object the symbols not be hashed to eliminate nkeynes@362: duplicates. */ nkeynes@362: #define BFD_TRADITIONAL_FORMAT 0x400 nkeynes@362: nkeynes@362: /* This flag indicates that the BFD contents are actually cached in nkeynes@362: memory. If this is set, iostream points to a bfd_in_memory struct. */ nkeynes@362: #define BFD_IN_MEMORY 0x800 nkeynes@362: nkeynes@362: /* The sections in this BFD specify a memory page. */ nkeynes@362: #define HAS_LOAD_PAGE 0x1000 nkeynes@362: nkeynes@362: /* This BFD has been created by the linker and doesn't correspond nkeynes@362: to any input file. */ nkeynes@362: #define BFD_LINKER_CREATED 0x2000 nkeynes@362: nkeynes@362: /* Symbols and relocation. */ nkeynes@362: nkeynes@362: /* A count of carsyms (canonical archive symbols). */ nkeynes@362: typedef unsigned long symindex; nkeynes@362: nkeynes@362: /* How to perform a relocation. */ nkeynes@362: typedef const struct reloc_howto_struct reloc_howto_type; nkeynes@362: nkeynes@362: #define BFD_NO_MORE_SYMBOLS ((symindex) ~0) nkeynes@362: nkeynes@362: /* General purpose part of a symbol X; nkeynes@362: target specific parts are in libcoff.h, libaout.h, etc. */ nkeynes@362: nkeynes@362: #define bfd_get_section(x) ((x)->section) nkeynes@362: #define bfd_get_output_section(x) ((x)->section->output_section) nkeynes@362: #define bfd_set_section(x,y) ((x)->section) = (y) nkeynes@362: #define bfd_asymbol_base(x) ((x)->section->vma) nkeynes@362: #define bfd_asymbol_value(x) (bfd_asymbol_base(x) + (x)->value) nkeynes@362: #define bfd_asymbol_name(x) ((x)->name) nkeynes@362: /*Perhaps future: #define bfd_asymbol_bfd(x) ((x)->section->owner)*/ nkeynes@362: #define bfd_asymbol_bfd(x) ((x)->the_bfd) nkeynes@362: #define bfd_asymbol_flavour(x) (bfd_asymbol_bfd(x)->xvec->flavour) nkeynes@362: nkeynes@362: /* A canonical archive symbol. */ nkeynes@362: /* This is a type pun with struct ranlib on purpose! */ nkeynes@362: typedef struct carsym nkeynes@362: { nkeynes@362: char *name; nkeynes@362: file_ptr file_offset; /* Look here to find the file. */ nkeynes@362: } nkeynes@362: carsym; /* To make these you call a carsymogen. */ nkeynes@362: nkeynes@362: /* Used in generating armaps (archive tables of contents). nkeynes@362: Perhaps just a forward definition would do? */ nkeynes@362: struct orl /* Output ranlib. */ nkeynes@362: { nkeynes@362: char **name; /* Symbol name. */ nkeynes@362: union nkeynes@362: { nkeynes@362: file_ptr pos; nkeynes@362: bfd *abfd; nkeynes@362: } u; /* bfd* or file position. */ nkeynes@362: int namidx; /* Index into string table. */ nkeynes@362: }; nkeynes@362: nkeynes@362: /* Linenumber stuff. */ nkeynes@362: typedef struct lineno_cache_entry nkeynes@362: { nkeynes@362: unsigned int line_number; /* Linenumber from start of function. */ nkeynes@362: union nkeynes@362: { nkeynes@362: struct bfd_symbol *sym; /* Function name. */ nkeynes@362: bfd_vma offset; /* Offset into section. */ nkeynes@362: } u; nkeynes@362: } nkeynes@362: alent; nkeynes@362: nkeynes@362: /* Object and core file sections. */ nkeynes@362: nkeynes@362: #define align_power(addr, align) \ nkeynes@362: (((addr) + ((bfd_vma) 1 << (align)) - 1) & ((bfd_vma) -1 << (align))) nkeynes@362: nkeynes@362: typedef struct bfd_section *sec_ptr; nkeynes@362: nkeynes@362: #define bfd_get_section_name(bfd, ptr) ((ptr)->name + 0) nkeynes@362: #define bfd_get_section_vma(bfd, ptr) ((ptr)->vma + 0) nkeynes@362: #define bfd_get_section_lma(bfd, ptr) ((ptr)->lma + 0) nkeynes@362: #define bfd_get_section_alignment(bfd, ptr) ((ptr)->alignment_power + 0) nkeynes@362: #define bfd_section_name(bfd, ptr) ((ptr)->name) nkeynes@362: #define bfd_section_size(bfd, ptr) ((ptr)->size) nkeynes@362: #define bfd_get_section_size(ptr) ((ptr)->size) nkeynes@362: #define bfd_section_vma(bfd, ptr) ((ptr)->vma) nkeynes@362: #define bfd_section_lma(bfd, ptr) ((ptr)->lma) nkeynes@362: #define bfd_section_alignment(bfd, ptr) ((ptr)->alignment_power) nkeynes@362: #define bfd_get_section_flags(bfd, ptr) ((ptr)->flags + 0) nkeynes@362: #define bfd_get_section_userdata(bfd, ptr) ((ptr)->userdata) nkeynes@362: nkeynes@362: #define bfd_is_com_section(ptr) (((ptr)->flags & SEC_IS_COMMON) != 0) nkeynes@362: nkeynes@362: #define bfd_set_section_vma(bfd, ptr, val) (((ptr)->vma = (ptr)->lma = (val)), ((ptr)->user_set_vma = TRUE), TRUE) nkeynes@362: #define bfd_set_section_alignment(bfd, ptr, val) (((ptr)->alignment_power = (val)),TRUE) nkeynes@362: #define bfd_set_section_userdata(bfd, ptr, val) (((ptr)->userdata = (val)),TRUE) nkeynes@362: /* Find the address one past the end of SEC. */ nkeynes@362: #define bfd_get_section_limit(bfd, sec) \ nkeynes@362: (((sec)->rawsize ? (sec)->rawsize : (sec)->size) \ nkeynes@362: / bfd_octets_per_byte (bfd)) nkeynes@362: nkeynes@362: typedef struct stat stat_type; nkeynes@362: nkeynes@362: typedef enum bfd_print_symbol nkeynes@362: { nkeynes@362: bfd_print_symbol_name, nkeynes@362: bfd_print_symbol_more, nkeynes@362: bfd_print_symbol_all nkeynes@362: } bfd_print_symbol_type; nkeynes@362: nkeynes@362: /* Information about a symbol that nm needs. */ nkeynes@362: nkeynes@362: typedef struct _symbol_info nkeynes@362: { nkeynes@362: symvalue value; nkeynes@362: char type; nkeynes@362: const char *name; /* Symbol name. */ nkeynes@362: unsigned char stab_type; /* Stab type. */ nkeynes@362: char stab_other; /* Stab other. */ nkeynes@362: short stab_desc; /* Stab desc. */ nkeynes@362: const char *stab_name; /* String for stab type. */ nkeynes@362: } symbol_info; nkeynes@362: nkeynes@362: /* Get the name of a stabs type code. */ nkeynes@362: nkeynes@362: extern const char *bfd_get_stab_name (int); nkeynes@362: nkeynes@362: /* Hash table routines. There is no way to free up a hash table. */ nkeynes@362: nkeynes@362: /* An element in the hash table. Most uses will actually use a larger nkeynes@362: structure, and an instance of this will be the first field. */ nkeynes@362: nkeynes@362: struct bfd_hash_entry nkeynes@362: { nkeynes@362: /* Next entry for this hash code. */ nkeynes@362: struct bfd_hash_entry *next; nkeynes@362: /* String being hashed. */ nkeynes@362: const char *string; nkeynes@362: /* Hash code. This is the full hash code, not the index into the nkeynes@362: table. */ nkeynes@362: unsigned long hash; nkeynes@362: }; nkeynes@362: nkeynes@362: /* A hash table. */ nkeynes@362: nkeynes@362: struct bfd_hash_table nkeynes@362: { nkeynes@362: /* The hash array. */ nkeynes@362: struct bfd_hash_entry **table; nkeynes@362: /* The number of slots in the hash table. */ nkeynes@362: unsigned int size; nkeynes@362: /* A function used to create new elements in the hash table. The nkeynes@362: first entry is itself a pointer to an element. When this nkeynes@362: function is first invoked, this pointer will be NULL. However, nkeynes@362: having the pointer permits a hierarchy of method functions to be nkeynes@362: built each of which calls the function in the superclass. Thus nkeynes@362: each function should be written to allocate a new block of memory nkeynes@362: only if the argument is NULL. */ nkeynes@362: struct bfd_hash_entry *(*newfunc) nkeynes@362: (struct bfd_hash_entry *, struct bfd_hash_table *, const char *); nkeynes@362: /* An objalloc for this hash table. This is a struct objalloc *, nkeynes@362: but we use void * to avoid requiring the inclusion of objalloc.h. */ nkeynes@362: void *memory; nkeynes@362: }; nkeynes@362: nkeynes@362: /* Initialize a hash table. */ nkeynes@362: extern bfd_boolean bfd_hash_table_init nkeynes@362: (struct bfd_hash_table *, nkeynes@362: struct bfd_hash_entry *(*) (struct bfd_hash_entry *, nkeynes@362: struct bfd_hash_table *, nkeynes@362: const char *)); nkeynes@362: nkeynes@362: /* Initialize a hash table specifying a size. */ nkeynes@362: extern bfd_boolean bfd_hash_table_init_n nkeynes@362: (struct bfd_hash_table *, nkeynes@362: struct bfd_hash_entry *(*) (struct bfd_hash_entry *, nkeynes@362: struct bfd_hash_table *, nkeynes@362: const char *), nkeynes@362: unsigned int size); nkeynes@362: nkeynes@362: /* Free up a hash table. */ nkeynes@362: extern void bfd_hash_table_free nkeynes@362: (struct bfd_hash_table *); nkeynes@362: nkeynes@362: /* Look up a string in a hash table. If CREATE is TRUE, a new entry nkeynes@362: will be created for this string if one does not already exist. The nkeynes@362: COPY argument must be TRUE if this routine should copy the string nkeynes@362: into newly allocated memory when adding an entry. */ nkeynes@362: extern struct bfd_hash_entry *bfd_hash_lookup nkeynes@362: (struct bfd_hash_table *, const char *, bfd_boolean create, nkeynes@362: bfd_boolean copy); nkeynes@362: nkeynes@362: /* Replace an entry in a hash table. */ nkeynes@362: extern void bfd_hash_replace nkeynes@362: (struct bfd_hash_table *, struct bfd_hash_entry *old, nkeynes@362: struct bfd_hash_entry *nw); nkeynes@362: nkeynes@362: /* Base method for creating a hash table entry. */ nkeynes@362: extern struct bfd_hash_entry *bfd_hash_newfunc nkeynes@362: (struct bfd_hash_entry *, struct bfd_hash_table *, const char *); nkeynes@362: nkeynes@362: /* Grab some space for a hash table entry. */ nkeynes@362: extern void *bfd_hash_allocate nkeynes@362: (struct bfd_hash_table *, unsigned int); nkeynes@362: nkeynes@362: /* Traverse a hash table in a random order, calling a function on each nkeynes@362: element. If the function returns FALSE, the traversal stops. The nkeynes@362: INFO argument is passed to the function. */ nkeynes@362: extern void bfd_hash_traverse nkeynes@362: (struct bfd_hash_table *, nkeynes@362: bfd_boolean (*) (struct bfd_hash_entry *, void *), nkeynes@362: void *info); nkeynes@362: nkeynes@362: /* Allows the default size of a hash table to be configured. New hash nkeynes@362: tables allocated using bfd_hash_table_init will be created with nkeynes@362: this size. */ nkeynes@362: extern void bfd_hash_set_default_size (bfd_size_type); nkeynes@362: nkeynes@362: /* This structure is used to keep track of stabs in sections nkeynes@362: information while linking. */ nkeynes@362: nkeynes@362: struct stab_info nkeynes@362: { nkeynes@362: /* A hash table used to hold stabs strings. */ nkeynes@362: struct bfd_strtab_hash *strings; nkeynes@362: /* The header file hash table. */ nkeynes@362: struct bfd_hash_table includes; nkeynes@362: /* The first .stabstr section. */ nkeynes@362: struct bfd_section *stabstr; nkeynes@362: }; nkeynes@362: nkeynes@362: #define COFF_SWAP_TABLE (void *) &bfd_coff_std_swap_table nkeynes@362: nkeynes@362: /* User program access to BFD facilities. */ nkeynes@362: nkeynes@362: /* Direct I/O routines, for programs which know more about the object nkeynes@362: file than BFD does. Use higher level routines if possible. */ nkeynes@362: nkeynes@362: extern bfd_size_type bfd_bread (void *, bfd_size_type, bfd *); nkeynes@362: extern bfd_size_type bfd_bwrite (const void *, bfd_size_type, bfd *); nkeynes@362: extern int bfd_seek (bfd *, file_ptr, int); nkeynes@362: extern file_ptr bfd_tell (bfd *); nkeynes@362: extern int bfd_flush (bfd *); nkeynes@362: extern int bfd_stat (bfd *, struct stat *); nkeynes@362: nkeynes@362: /* Deprecated old routines. */ nkeynes@362: #if __GNUC__ nkeynes@362: #define bfd_read(BUF, ELTSIZE, NITEMS, ABFD) \ nkeynes@362: (warn_deprecated ("bfd_read", __FILE__, __LINE__, __FUNCTION__), \ nkeynes@362: bfd_bread ((BUF), (ELTSIZE) * (NITEMS), (ABFD))) nkeynes@362: #define bfd_write(BUF, ELTSIZE, NITEMS, ABFD) \ nkeynes@362: (warn_deprecated ("bfd_write", __FILE__, __LINE__, __FUNCTION__), \ nkeynes@362: bfd_bwrite ((BUF), (ELTSIZE) * (NITEMS), (ABFD))) nkeynes@362: #else nkeynes@362: #define bfd_read(BUF, ELTSIZE, NITEMS, ABFD) \ nkeynes@362: (warn_deprecated ("bfd_read", (const char *) 0, 0, (const char *) 0), \ nkeynes@362: bfd_bread ((BUF), (ELTSIZE) * (NITEMS), (ABFD))) nkeynes@362: #define bfd_write(BUF, ELTSIZE, NITEMS, ABFD) \ nkeynes@362: (warn_deprecated ("bfd_write", (const char *) 0, 0, (const char *) 0),\ nkeynes@362: bfd_bwrite ((BUF), (ELTSIZE) * (NITEMS), (ABFD))) nkeynes@362: #endif nkeynes@362: extern void warn_deprecated (const char *, const char *, int, const char *); nkeynes@362: nkeynes@362: /* Cast from const char * to char * so that caller can assign to nkeynes@362: a char * without a warning. */ nkeynes@362: #define bfd_get_filename(abfd) ((char *) (abfd)->filename) nkeynes@362: #define bfd_get_cacheable(abfd) ((abfd)->cacheable) nkeynes@362: #define bfd_get_format(abfd) ((abfd)->format) nkeynes@362: #define bfd_get_target(abfd) ((abfd)->xvec->name) nkeynes@362: #define bfd_get_flavour(abfd) ((abfd)->xvec->flavour) nkeynes@362: #define bfd_family_coff(abfd) \ nkeynes@362: (bfd_get_flavour (abfd) == bfd_target_coff_flavour || \ nkeynes@362: bfd_get_flavour (abfd) == bfd_target_xcoff_flavour) nkeynes@362: #define bfd_big_endian(abfd) ((abfd)->xvec->byteorder == BFD_ENDIAN_BIG) nkeynes@362: #define bfd_little_endian(abfd) ((abfd)->xvec->byteorder == BFD_ENDIAN_LITTLE) nkeynes@362: #define bfd_header_big_endian(abfd) \ nkeynes@362: ((abfd)->xvec->header_byteorder == BFD_ENDIAN_BIG) nkeynes@362: #define bfd_header_little_endian(abfd) \ nkeynes@362: ((abfd)->xvec->header_byteorder == BFD_ENDIAN_LITTLE) nkeynes@362: #define bfd_get_file_flags(abfd) ((abfd)->flags) nkeynes@362: #define bfd_applicable_file_flags(abfd) ((abfd)->xvec->object_flags) nkeynes@362: #define bfd_applicable_section_flags(abfd) ((abfd)->xvec->section_flags) nkeynes@362: #define bfd_my_archive(abfd) ((abfd)->my_archive) nkeynes@362: #define bfd_has_map(abfd) ((abfd)->has_armap) nkeynes@362: nkeynes@362: #define bfd_valid_reloc_types(abfd) ((abfd)->xvec->valid_reloc_types) nkeynes@362: #define bfd_usrdata(abfd) ((abfd)->usrdata) nkeynes@362: nkeynes@362: #define bfd_get_start_address(abfd) ((abfd)->start_address) nkeynes@362: #define bfd_get_symcount(abfd) ((abfd)->symcount) nkeynes@362: #define bfd_get_outsymbols(abfd) ((abfd)->outsymbols) nkeynes@362: #define bfd_count_sections(abfd) ((abfd)->section_count) nkeynes@362: nkeynes@362: #define bfd_get_dynamic_symcount(abfd) ((abfd)->dynsymcount) nkeynes@362: nkeynes@362: #define bfd_get_symbol_leading_char(abfd) ((abfd)->xvec->symbol_leading_char) nkeynes@362: nkeynes@362: #define bfd_set_cacheable(abfd,bool) (((abfd)->cacheable = bool), TRUE) nkeynes@362: nkeynes@362: extern bfd_boolean bfd_cache_close nkeynes@362: (bfd *abfd); nkeynes@362: /* NB: This declaration should match the autogenerated one in libbfd.h. */ nkeynes@362: nkeynes@362: extern bfd_boolean bfd_cache_close_all (void); nkeynes@362: nkeynes@362: extern bfd_boolean bfd_record_phdr nkeynes@362: (bfd *, unsigned long, bfd_boolean, flagword, bfd_boolean, bfd_vma, nkeynes@362: bfd_boolean, bfd_boolean, unsigned int, struct bfd_section **); nkeynes@362: nkeynes@362: /* Byte swapping routines. */ nkeynes@362: nkeynes@362: bfd_uint64_t bfd_getb64 (const void *); nkeynes@362: bfd_uint64_t bfd_getl64 (const void *); nkeynes@362: bfd_int64_t bfd_getb_signed_64 (const void *); nkeynes@362: bfd_int64_t bfd_getl_signed_64 (const void *); nkeynes@362: bfd_vma bfd_getb32 (const void *); nkeynes@362: bfd_vma bfd_getl32 (const void *); nkeynes@362: bfd_signed_vma bfd_getb_signed_32 (const void *); nkeynes@362: bfd_signed_vma bfd_getl_signed_32 (const void *); nkeynes@362: bfd_vma bfd_getb16 (const void *); nkeynes@362: bfd_vma bfd_getl16 (const void *); nkeynes@362: bfd_signed_vma bfd_getb_signed_16 (const void *); nkeynes@362: bfd_signed_vma bfd_getl_signed_16 (const void *); nkeynes@362: void bfd_putb64 (bfd_uint64_t, void *); nkeynes@362: void bfd_putl64 (bfd_uint64_t, void *); nkeynes@362: void bfd_putb32 (bfd_vma, void *); nkeynes@362: void bfd_putl32 (bfd_vma, void *); nkeynes@362: void bfd_putb16 (bfd_vma, void *); nkeynes@362: void bfd_putl16 (bfd_vma, void *); nkeynes@362: nkeynes@362: /* Byte swapping routines which take size and endiannes as arguments. */ nkeynes@362: nkeynes@362: bfd_uint64_t bfd_get_bits (const void *, int, bfd_boolean); nkeynes@362: void bfd_put_bits (bfd_uint64_t, void *, int, bfd_boolean); nkeynes@362: nkeynes@362: extern bfd_boolean bfd_section_already_linked_table_init (void); nkeynes@362: extern void bfd_section_already_linked_table_free (void); nkeynes@362: nkeynes@362: /* Externally visible ECOFF routines. */ nkeynes@362: nkeynes@362: #if defined(__STDC__) || defined(ALMOST_STDC) nkeynes@362: struct ecoff_debug_info; nkeynes@362: struct ecoff_debug_swap; nkeynes@362: struct ecoff_extr; nkeynes@362: struct bfd_symbol; nkeynes@362: struct bfd_link_info; nkeynes@362: struct bfd_link_hash_entry; nkeynes@362: struct bfd_elf_version_tree; nkeynes@362: #endif nkeynes@362: extern bfd_vma bfd_ecoff_get_gp_value nkeynes@362: (bfd * abfd); nkeynes@362: extern bfd_boolean bfd_ecoff_set_gp_value nkeynes@362: (bfd *abfd, bfd_vma gp_value); nkeynes@362: extern bfd_boolean bfd_ecoff_set_regmasks nkeynes@362: (bfd *abfd, unsigned long gprmask, unsigned long fprmask, nkeynes@362: unsigned long *cprmask); nkeynes@362: extern void *bfd_ecoff_debug_init nkeynes@362: (bfd *output_bfd, struct ecoff_debug_info *output_debug, nkeynes@362: const struct ecoff_debug_swap *output_swap, struct bfd_link_info *); nkeynes@362: extern void bfd_ecoff_debug_free nkeynes@362: (void *handle, bfd *output_bfd, struct ecoff_debug_info *output_debug, nkeynes@362: const struct ecoff_debug_swap *output_swap, struct bfd_link_info *); nkeynes@362: extern bfd_boolean bfd_ecoff_debug_accumulate nkeynes@362: (void *handle, bfd *output_bfd, struct ecoff_debug_info *output_debug, nkeynes@362: const struct ecoff_debug_swap *output_swap, bfd *input_bfd, nkeynes@362: struct ecoff_debug_info *input_debug, nkeynes@362: const struct ecoff_debug_swap *input_swap, struct bfd_link_info *); nkeynes@362: extern bfd_boolean bfd_ecoff_debug_accumulate_other nkeynes@362: (void *handle, bfd *output_bfd, struct ecoff_debug_info *output_debug, nkeynes@362: const struct ecoff_debug_swap *output_swap, bfd *input_bfd, nkeynes@362: struct bfd_link_info *); nkeynes@362: extern bfd_boolean bfd_ecoff_debug_externals nkeynes@362: (bfd *abfd, struct ecoff_debug_info *debug, nkeynes@362: const struct ecoff_debug_swap *swap, bfd_boolean relocatable, nkeynes@362: bfd_boolean (*get_extr) (struct bfd_symbol *, struct ecoff_extr *), nkeynes@362: void (*set_index) (struct bfd_symbol *, bfd_size_type)); nkeynes@362: extern bfd_boolean bfd_ecoff_debug_one_external nkeynes@362: (bfd *abfd, struct ecoff_debug_info *debug, nkeynes@362: const struct ecoff_debug_swap *swap, const char *name, nkeynes@362: struct ecoff_extr *esym); nkeynes@362: extern bfd_size_type bfd_ecoff_debug_size nkeynes@362: (bfd *abfd, struct ecoff_debug_info *debug, nkeynes@362: const struct ecoff_debug_swap *swap); nkeynes@362: extern bfd_boolean bfd_ecoff_write_debug nkeynes@362: (bfd *abfd, struct ecoff_debug_info *debug, nkeynes@362: const struct ecoff_debug_swap *swap, file_ptr where); nkeynes@362: extern bfd_boolean bfd_ecoff_write_accumulated_debug nkeynes@362: (void *handle, bfd *abfd, struct ecoff_debug_info *debug, nkeynes@362: const struct ecoff_debug_swap *swap, nkeynes@362: struct bfd_link_info *info, file_ptr where); nkeynes@362: nkeynes@362: /* Externally visible ELF routines. */ nkeynes@362: nkeynes@362: struct bfd_link_needed_list nkeynes@362: { nkeynes@362: struct bfd_link_needed_list *next; nkeynes@362: bfd *by; nkeynes@362: const char *name; nkeynes@362: }; nkeynes@362: nkeynes@362: enum dynamic_lib_link_class { nkeynes@362: DYN_NORMAL = 0, nkeynes@362: DYN_AS_NEEDED = 1, nkeynes@362: DYN_DT_NEEDED = 2, nkeynes@362: DYN_NO_ADD_NEEDED = 4, nkeynes@362: DYN_NO_NEEDED = 8 nkeynes@362: }; nkeynes@362: nkeynes@362: extern bfd_boolean bfd_elf_record_link_assignment nkeynes@362: (bfd *, struct bfd_link_info *, const char *, bfd_boolean); nkeynes@362: extern struct bfd_link_needed_list *bfd_elf_get_needed_list nkeynes@362: (bfd *, struct bfd_link_info *); nkeynes@362: extern bfd_boolean bfd_elf_get_bfd_needed_list nkeynes@362: (bfd *, struct bfd_link_needed_list **); nkeynes@362: extern bfd_boolean bfd_elf_size_dynamic_sections nkeynes@362: (bfd *, const char *, const char *, const char *, const char * const *, nkeynes@362: struct bfd_link_info *, struct bfd_section **, struct bfd_elf_version_tree *); nkeynes@362: extern void bfd_elf_set_dt_needed_name nkeynes@362: (bfd *, const char *); nkeynes@362: extern const char *bfd_elf_get_dt_soname nkeynes@362: (bfd *); nkeynes@362: extern void bfd_elf_set_dyn_lib_class nkeynes@362: (bfd *, int); nkeynes@362: extern int bfd_elf_get_dyn_lib_class nkeynes@362: (bfd *); nkeynes@362: extern struct bfd_link_needed_list *bfd_elf_get_runpath_list nkeynes@362: (bfd *, struct bfd_link_info *); nkeynes@362: extern bfd_boolean bfd_elf_discard_info nkeynes@362: (bfd *, struct bfd_link_info *); nkeynes@362: nkeynes@362: /* Return an upper bound on the number of bytes required to store a nkeynes@362: copy of ABFD's program header table entries. Return -1 if an error nkeynes@362: occurs; bfd_get_error will return an appropriate code. */ nkeynes@362: extern long bfd_get_elf_phdr_upper_bound nkeynes@362: (bfd *abfd); nkeynes@362: nkeynes@362: /* Copy ABFD's program header table entries to *PHDRS. The entries nkeynes@362: will be stored as an array of Elf_Internal_Phdr structures, as nkeynes@362: defined in include/elf/internal.h. To find out how large the nkeynes@362: buffer needs to be, call bfd_get_elf_phdr_upper_bound. nkeynes@362: nkeynes@362: Return the number of program header table entries read, or -1 if an nkeynes@362: error occurs; bfd_get_error will return an appropriate code. */ nkeynes@362: extern int bfd_get_elf_phdrs nkeynes@362: (bfd *abfd, void *phdrs); nkeynes@362: nkeynes@362: /* Create a new BFD as if by bfd_openr. Rather than opening a file, nkeynes@362: reconstruct an ELF file by reading the segments out of remote memory nkeynes@362: based on the ELF file header at EHDR_VMA and the ELF program headers it nkeynes@362: points to. If not null, *LOADBASEP is filled in with the difference nkeynes@362: between the VMAs from which the segments were read, and the VMAs the nkeynes@362: file headers (and hence BFD's idea of each section's VMA) put them at. nkeynes@362: nkeynes@362: The function TARGET_READ_MEMORY is called to copy LEN bytes from the nkeynes@362: remote memory at target address VMA into the local buffer at MYADDR; it nkeynes@362: should return zero on success or an `errno' code on failure. TEMPL must nkeynes@362: be a BFD for an ELF target with the word size and byte order found in nkeynes@362: the remote memory. */ nkeynes@362: extern bfd *bfd_elf_bfd_from_remote_memory nkeynes@362: (bfd *templ, bfd_vma ehdr_vma, bfd_vma *loadbasep, nkeynes@362: int (*target_read_memory) (bfd_vma vma, bfd_byte *myaddr, int len)); nkeynes@362: nkeynes@362: /* Return the arch_size field of an elf bfd, or -1 if not elf. */ nkeynes@362: extern int bfd_get_arch_size nkeynes@362: (bfd *); nkeynes@362: nkeynes@362: /* Return TRUE if address "naturally" sign extends, or -1 if not elf. */ nkeynes@362: extern int bfd_get_sign_extend_vma nkeynes@362: (bfd *); nkeynes@362: nkeynes@362: extern struct bfd_section *_bfd_elf_tls_setup nkeynes@362: (bfd *, struct bfd_link_info *); nkeynes@362: nkeynes@362: extern bfd_boolean bfd_m68k_elf32_create_embedded_relocs nkeynes@362: (bfd *, struct bfd_link_info *, struct bfd_section *, struct bfd_section *, char **); nkeynes@362: nkeynes@362: /* SunOS shared library support routines for the linker. */ nkeynes@362: nkeynes@362: extern struct bfd_link_needed_list *bfd_sunos_get_needed_list nkeynes@362: (bfd *, struct bfd_link_info *); nkeynes@362: extern bfd_boolean bfd_sunos_record_link_assignment nkeynes@362: (bfd *, struct bfd_link_info *, const char *); nkeynes@362: extern bfd_boolean bfd_sunos_size_dynamic_sections nkeynes@362: (bfd *, struct bfd_link_info *, struct bfd_section **, struct bfd_section **, struct bfd_section **); nkeynes@362: nkeynes@362: /* Linux shared library support routines for the linker. */ nkeynes@362: nkeynes@362: extern bfd_boolean bfd_i386linux_size_dynamic_sections nkeynes@362: (bfd *, struct bfd_link_info *); nkeynes@362: extern bfd_boolean bfd_m68klinux_size_dynamic_sections nkeynes@362: (bfd *, struct bfd_link_info *); nkeynes@362: extern bfd_boolean bfd_sparclinux_size_dynamic_sections nkeynes@362: (bfd *, struct bfd_link_info *); nkeynes@362: nkeynes@362: /* mmap hacks */ nkeynes@362: nkeynes@362: struct _bfd_window_internal; nkeynes@362: typedef struct _bfd_window_internal bfd_window_internal; nkeynes@362: nkeynes@362: typedef struct _bfd_window nkeynes@362: { nkeynes@362: /* What the user asked for. */ nkeynes@362: void *data; nkeynes@362: bfd_size_type size; nkeynes@362: /* The actual window used by BFD. Small user-requested read-only nkeynes@362: regions sharing a page may share a single window into the object nkeynes@362: file. Read-write versions shouldn't until I've fixed things to nkeynes@362: keep track of which portions have been claimed by the nkeynes@362: application; don't want to give the same region back when the nkeynes@362: application wants two writable copies! */ nkeynes@362: struct _bfd_window_internal *i; nkeynes@362: } nkeynes@362: bfd_window; nkeynes@362: nkeynes@362: extern void bfd_init_window nkeynes@362: (bfd_window *); nkeynes@362: extern void bfd_free_window nkeynes@362: (bfd_window *); nkeynes@362: extern bfd_boolean bfd_get_file_window nkeynes@362: (bfd *, file_ptr, bfd_size_type, bfd_window *, bfd_boolean); nkeynes@362: nkeynes@362: /* XCOFF support routines for the linker. */ nkeynes@362: nkeynes@362: extern bfd_boolean bfd_xcoff_link_record_set nkeynes@362: (bfd *, struct bfd_link_info *, struct bfd_link_hash_entry *, bfd_size_type); nkeynes@362: extern bfd_boolean bfd_xcoff_import_symbol nkeynes@362: (bfd *, struct bfd_link_info *, struct bfd_link_hash_entry *, bfd_vma, nkeynes@362: const char *, const char *, const char *, unsigned int); nkeynes@362: extern bfd_boolean bfd_xcoff_export_symbol nkeynes@362: (bfd *, struct bfd_link_info *, struct bfd_link_hash_entry *); nkeynes@362: extern bfd_boolean bfd_xcoff_link_count_reloc nkeynes@362: (bfd *, struct bfd_link_info *, const char *); nkeynes@362: extern bfd_boolean bfd_xcoff_record_link_assignment nkeynes@362: (bfd *, struct bfd_link_info *, const char *); nkeynes@362: extern bfd_boolean bfd_xcoff_size_dynamic_sections nkeynes@362: (bfd *, struct bfd_link_info *, const char *, const char *, nkeynes@362: unsigned long, unsigned long, unsigned long, bfd_boolean, nkeynes@362: int, bfd_boolean, bfd_boolean, struct bfd_section **, bfd_boolean); nkeynes@362: extern bfd_boolean bfd_xcoff_link_generate_rtinit nkeynes@362: (bfd *, const char *, const char *, bfd_boolean); nkeynes@362: nkeynes@362: /* XCOFF support routines for ar. */ nkeynes@362: extern bfd_boolean bfd_xcoff_ar_archive_set_magic nkeynes@362: (bfd *, char *); nkeynes@362: nkeynes@362: /* Externally visible COFF routines. */ nkeynes@362: nkeynes@362: #if defined(__STDC__) || defined(ALMOST_STDC) nkeynes@362: struct internal_syment; nkeynes@362: union internal_auxent; nkeynes@362: #endif nkeynes@362: nkeynes@362: extern bfd_boolean bfd_coff_get_syment nkeynes@362: (bfd *, struct bfd_symbol *, struct internal_syment *); nkeynes@362: nkeynes@362: extern bfd_boolean bfd_coff_get_auxent nkeynes@362: (bfd *, struct bfd_symbol *, int, union internal_auxent *); nkeynes@362: nkeynes@362: extern bfd_boolean bfd_coff_set_symbol_class nkeynes@362: (bfd *, struct bfd_symbol *, unsigned int); nkeynes@362: nkeynes@362: extern bfd_boolean bfd_m68k_coff_create_embedded_relocs nkeynes@362: (bfd *, struct bfd_link_info *, struct bfd_section *, struct bfd_section *, char **); nkeynes@362: nkeynes@362: /* ARM Interworking support. Called from linker. */ nkeynes@362: extern bfd_boolean bfd_arm_allocate_interworking_sections nkeynes@362: (struct bfd_link_info *); nkeynes@362: nkeynes@362: extern bfd_boolean bfd_arm_process_before_allocation nkeynes@362: (bfd *, struct bfd_link_info *, int); nkeynes@362: nkeynes@362: extern bfd_boolean bfd_arm_get_bfd_for_interworking nkeynes@362: (bfd *, struct bfd_link_info *); nkeynes@362: nkeynes@362: /* PE ARM Interworking support. Called from linker. */ nkeynes@362: extern bfd_boolean bfd_arm_pe_allocate_interworking_sections nkeynes@362: (struct bfd_link_info *); nkeynes@362: nkeynes@362: extern bfd_boolean bfd_arm_pe_process_before_allocation nkeynes@362: (bfd *, struct bfd_link_info *, int); nkeynes@362: nkeynes@362: extern bfd_boolean bfd_arm_pe_get_bfd_for_interworking nkeynes@362: (bfd *, struct bfd_link_info *); nkeynes@362: nkeynes@362: /* ELF ARM Interworking support. Called from linker. */ nkeynes@362: extern bfd_boolean bfd_elf32_arm_allocate_interworking_sections nkeynes@362: (struct bfd_link_info *); nkeynes@362: nkeynes@362: extern bfd_boolean bfd_elf32_arm_process_before_allocation nkeynes@362: (bfd *, struct bfd_link_info *, int); nkeynes@362: nkeynes@362: void bfd_elf32_arm_set_target_relocs nkeynes@362: (struct bfd_link_info *, int, char *, int); nkeynes@362: nkeynes@362: extern bfd_boolean bfd_elf32_arm_get_bfd_for_interworking nkeynes@362: (bfd *, struct bfd_link_info *); nkeynes@362: nkeynes@362: extern bfd_boolean bfd_elf32_arm_add_glue_sections_to_bfd nkeynes@362: (bfd *, struct bfd_link_info *); nkeynes@362: nkeynes@362: /* ARM Note section processing. */ nkeynes@362: extern bfd_boolean bfd_arm_merge_machines nkeynes@362: (bfd *, bfd *); nkeynes@362: nkeynes@362: extern bfd_boolean bfd_arm_update_notes nkeynes@362: (bfd *, const char *); nkeynes@362: nkeynes@362: extern unsigned int bfd_arm_get_mach_from_notes nkeynes@362: (bfd *, const char *); nkeynes@362: nkeynes@362: /* TI COFF load page support. */ nkeynes@362: extern void bfd_ticoff_set_section_load_page nkeynes@362: (struct bfd_section *, int); nkeynes@362: nkeynes@362: extern int bfd_ticoff_get_section_load_page nkeynes@362: (struct bfd_section *); nkeynes@362: nkeynes@362: /* H8/300 functions. */ nkeynes@362: extern bfd_vma bfd_h8300_pad_address nkeynes@362: (bfd *, bfd_vma); nkeynes@362: nkeynes@362: /* IA64 Itanium code generation. Called from linker. */ nkeynes@362: extern void bfd_elf32_ia64_after_parse nkeynes@362: (int); nkeynes@362: nkeynes@362: extern void bfd_elf64_ia64_after_parse nkeynes@362: (int); nkeynes@362: nkeynes@362: /* This structure is used for a comdat section, as in PE. A comdat nkeynes@362: section is associated with a particular symbol. When the linker nkeynes@362: sees a comdat section, it keeps only one of the sections with a nkeynes@362: given name and associated with a given symbol. */ nkeynes@362: nkeynes@362: struct coff_comdat_info nkeynes@362: { nkeynes@362: /* The name of the symbol associated with a comdat section. */ nkeynes@362: const char *name; nkeynes@362: nkeynes@362: /* The local symbol table index of the symbol associated with a nkeynes@362: comdat section. This is only meaningful to the object file format nkeynes@362: specific code; it is not an index into the list returned by nkeynes@362: bfd_canonicalize_symtab. */ nkeynes@362: long symbol; nkeynes@362: }; nkeynes@362: nkeynes@362: extern struct coff_comdat_info *bfd_coff_get_comdat_section nkeynes@362: (bfd *, struct bfd_section *); nkeynes@362: nkeynes@362: /* Extracted from init.c. */ nkeynes@362: void bfd_init (void); nkeynes@362: nkeynes@362: /* Extracted from opncls.c. */ nkeynes@362: bfd *bfd_openr (const char *filename, const char *target); nkeynes@362: nkeynes@362: bfd *bfd_fdopenr (const char *filename, const char *target, int fd); nkeynes@362: nkeynes@362: bfd *bfd_openstreamr (const char *, const char *, void *); nkeynes@362: nkeynes@362: bfd *bfd_openr_iovec (const char *filename, const char *target, nkeynes@362: void *(*open) (struct bfd *nbfd, nkeynes@362: void *open_closure), nkeynes@362: void *open_closure, nkeynes@362: file_ptr (*pread) (struct bfd *nbfd, nkeynes@362: void *stream, nkeynes@362: void *buf, nkeynes@362: file_ptr nbytes, nkeynes@362: file_ptr offset), nkeynes@362: int (*close) (struct bfd *nbfd, nkeynes@362: void *stream)); nkeynes@362: nkeynes@362: bfd *bfd_openw (const char *filename, const char *target); nkeynes@362: nkeynes@362: bfd_boolean bfd_close (bfd *abfd); nkeynes@362: nkeynes@362: bfd_boolean bfd_close_all_done (bfd *); nkeynes@362: nkeynes@362: bfd *bfd_create (const char *filename, bfd *templ); nkeynes@362: nkeynes@362: bfd_boolean bfd_make_writable (bfd *abfd); nkeynes@362: nkeynes@362: bfd_boolean bfd_make_readable (bfd *abfd); nkeynes@362: nkeynes@362: unsigned long bfd_calc_gnu_debuglink_crc32 nkeynes@362: (unsigned long crc, const unsigned char *buf, bfd_size_type len); nkeynes@362: nkeynes@362: char *bfd_follow_gnu_debuglink (bfd *abfd, const char *dir); nkeynes@362: nkeynes@362: struct bfd_section *bfd_create_gnu_debuglink_section nkeynes@362: (bfd *abfd, const char *filename); nkeynes@362: nkeynes@362: bfd_boolean bfd_fill_in_gnu_debuglink_section nkeynes@362: (bfd *abfd, struct bfd_section *sect, const char *filename); nkeynes@362: nkeynes@362: /* Extracted from libbfd.c. */ nkeynes@362: nkeynes@362: /* Byte swapping macros for user section data. */ nkeynes@362: nkeynes@362: #define bfd_put_8(abfd, val, ptr) \ nkeynes@362: ((void) (*((unsigned char *) (ptr)) = (val) & 0xff)) nkeynes@362: #define bfd_put_signed_8 \ nkeynes@362: bfd_put_8 nkeynes@362: #define bfd_get_8(abfd, ptr) \ nkeynes@362: (*(unsigned char *) (ptr) & 0xff) nkeynes@362: #define bfd_get_signed_8(abfd, ptr) \ nkeynes@362: (((*(unsigned char *) (ptr) & 0xff) ^ 0x80) - 0x80) nkeynes@362: nkeynes@362: #define bfd_put_16(abfd, val, ptr) \ nkeynes@362: BFD_SEND (abfd, bfd_putx16, ((val),(ptr))) nkeynes@362: #define bfd_put_signed_16 \ nkeynes@362: bfd_put_16 nkeynes@362: #define bfd_get_16(abfd, ptr) \ nkeynes@362: BFD_SEND (abfd, bfd_getx16, (ptr)) nkeynes@362: #define bfd_get_signed_16(abfd, ptr) \ nkeynes@362: BFD_SEND (abfd, bfd_getx_signed_16, (ptr)) nkeynes@362: nkeynes@362: #define bfd_put_32(abfd, val, ptr) \ nkeynes@362: BFD_SEND (abfd, bfd_putx32, ((val),(ptr))) nkeynes@362: #define bfd_put_signed_32 \ nkeynes@362: bfd_put_32 nkeynes@362: #define bfd_get_32(abfd, ptr) \ nkeynes@362: BFD_SEND (abfd, bfd_getx32, (ptr)) nkeynes@362: #define bfd_get_signed_32(abfd, ptr) \ nkeynes@362: BFD_SEND (abfd, bfd_getx_signed_32, (ptr)) nkeynes@362: nkeynes@362: #define bfd_put_64(abfd, val, ptr) \ nkeynes@362: BFD_SEND (abfd, bfd_putx64, ((val), (ptr))) nkeynes@362: #define bfd_put_signed_64 \ nkeynes@362: bfd_put_64 nkeynes@362: #define bfd_get_64(abfd, ptr) \ nkeynes@362: BFD_SEND (abfd, bfd_getx64, (ptr)) nkeynes@362: #define bfd_get_signed_64(abfd, ptr) \ nkeynes@362: BFD_SEND (abfd, bfd_getx_signed_64, (ptr)) nkeynes@362: nkeynes@362: #define bfd_get(bits, abfd, ptr) \ nkeynes@362: ((bits) == 8 ? (bfd_vma) bfd_get_8 (abfd, ptr) \ nkeynes@362: : (bits) == 16 ? bfd_get_16 (abfd, ptr) \ nkeynes@362: : (bits) == 32 ? bfd_get_32 (abfd, ptr) \ nkeynes@362: : (bits) == 64 ? bfd_get_64 (abfd, ptr) \ nkeynes@362: : (abort (), (bfd_vma) - 1)) nkeynes@362: nkeynes@362: #define bfd_put(bits, abfd, val, ptr) \ nkeynes@362: ((bits) == 8 ? bfd_put_8 (abfd, val, ptr) \ nkeynes@362: : (bits) == 16 ? bfd_put_16 (abfd, val, ptr) \ nkeynes@362: : (bits) == 32 ? bfd_put_32 (abfd, val, ptr) \ nkeynes@362: : (bits) == 64 ? bfd_put_64 (abfd, val, ptr) \ nkeynes@362: : (abort (), (void) 0)) nkeynes@362: nkeynes@362: nkeynes@362: /* Byte swapping macros for file header data. */ nkeynes@362: nkeynes@362: #define bfd_h_put_8(abfd, val, ptr) \ nkeynes@362: bfd_put_8 (abfd, val, ptr) nkeynes@362: #define bfd_h_put_signed_8(abfd, val, ptr) \ nkeynes@362: bfd_put_8 (abfd, val, ptr) nkeynes@362: #define bfd_h_get_8(abfd, ptr) \ nkeynes@362: bfd_get_8 (abfd, ptr) nkeynes@362: #define bfd_h_get_signed_8(abfd, ptr) \ nkeynes@362: bfd_get_signed_8 (abfd, ptr) nkeynes@362: nkeynes@362: #define bfd_h_put_16(abfd, val, ptr) \ nkeynes@362: BFD_SEND (abfd, bfd_h_putx16, (val, ptr)) nkeynes@362: #define bfd_h_put_signed_16 \ nkeynes@362: bfd_h_put_16 nkeynes@362: #define bfd_h_get_16(abfd, ptr) \ nkeynes@362: BFD_SEND (abfd, bfd_h_getx16, (ptr)) nkeynes@362: #define bfd_h_get_signed_16(abfd, ptr) \ nkeynes@362: BFD_SEND (abfd, bfd_h_getx_signed_16, (ptr)) nkeynes@362: nkeynes@362: #define bfd_h_put_32(abfd, val, ptr) \ nkeynes@362: BFD_SEND (abfd, bfd_h_putx32, (val, ptr)) nkeynes@362: #define bfd_h_put_signed_32 \ nkeynes@362: bfd_h_put_32 nkeynes@362: #define bfd_h_get_32(abfd, ptr) \ nkeynes@362: BFD_SEND (abfd, bfd_h_getx32, (ptr)) nkeynes@362: #define bfd_h_get_signed_32(abfd, ptr) \ nkeynes@362: BFD_SEND (abfd, bfd_h_getx_signed_32, (ptr)) nkeynes@362: nkeynes@362: #define bfd_h_put_64(abfd, val, ptr) \ nkeynes@362: BFD_SEND (abfd, bfd_h_putx64, (val, ptr)) nkeynes@362: #define bfd_h_put_signed_64 \ nkeynes@362: bfd_h_put_64 nkeynes@362: #define bfd_h_get_64(abfd, ptr) \ nkeynes@362: BFD_SEND (abfd, bfd_h_getx64, (ptr)) nkeynes@362: #define bfd_h_get_signed_64(abfd, ptr) \ nkeynes@362: BFD_SEND (abfd, bfd_h_getx_signed_64, (ptr)) nkeynes@362: nkeynes@362: /* Aliases for the above, which should eventually go away. */ nkeynes@362: nkeynes@362: #define H_PUT_64 bfd_h_put_64 nkeynes@362: #define H_PUT_32 bfd_h_put_32 nkeynes@362: #define H_PUT_16 bfd_h_put_16 nkeynes@362: #define H_PUT_8 bfd_h_put_8 nkeynes@362: #define H_PUT_S64 bfd_h_put_signed_64 nkeynes@362: #define H_PUT_S32 bfd_h_put_signed_32 nkeynes@362: #define H_PUT_S16 bfd_h_put_signed_16 nkeynes@362: #define H_PUT_S8 bfd_h_put_signed_8 nkeynes@362: #define H_GET_64 bfd_h_get_64 nkeynes@362: #define H_GET_32 bfd_h_get_32 nkeynes@362: #define H_GET_16 bfd_h_get_16 nkeynes@362: #define H_GET_8 bfd_h_get_8 nkeynes@362: #define H_GET_S64 bfd_h_get_signed_64 nkeynes@362: #define H_GET_S32 bfd_h_get_signed_32 nkeynes@362: #define H_GET_S16 bfd_h_get_signed_16 nkeynes@362: #define H_GET_S8 bfd_h_get_signed_8 nkeynes@362: nkeynes@362: nkeynes@362: /* Extracted from bfdio.c. */ nkeynes@362: long bfd_get_mtime (bfd *abfd); nkeynes@362: nkeynes@362: long bfd_get_size (bfd *abfd); nkeynes@362: nkeynes@362: /* Extracted from bfdwin.c. */ nkeynes@362: /* Extracted from section.c. */ nkeynes@362: typedef struct bfd_section nkeynes@362: { nkeynes@362: /* The name of the section; the name isn't a copy, the pointer is nkeynes@362: the same as that passed to bfd_make_section. */ nkeynes@362: const char *name; nkeynes@362: nkeynes@362: /* A unique sequence number. */ nkeynes@362: int id; nkeynes@362: nkeynes@362: /* Which section in the bfd; 0..n-1 as sections are created in a bfd. */ nkeynes@362: int index; nkeynes@362: nkeynes@362: /* The next section in the list belonging to the BFD, or NULL. */ nkeynes@362: struct bfd_section *next; nkeynes@362: nkeynes@362: /* The field flags contains attributes of the section. Some nkeynes@362: flags are read in from the object file, and some are nkeynes@362: synthesized from other information. */ nkeynes@362: flagword flags; nkeynes@362: nkeynes@362: #define SEC_NO_FLAGS 0x000 nkeynes@362: nkeynes@362: /* Tells the OS to allocate space for this section when loading. nkeynes@362: This is clear for a section containing debug information only. */ nkeynes@362: #define SEC_ALLOC 0x001 nkeynes@362: nkeynes@362: /* Tells the OS to load the section from the file when loading. nkeynes@362: This is clear for a .bss section. */ nkeynes@362: #define SEC_LOAD 0x002 nkeynes@362: nkeynes@362: /* The section contains data still to be relocated, so there is nkeynes@362: some relocation information too. */ nkeynes@362: #define SEC_RELOC 0x004 nkeynes@362: nkeynes@362: /* A signal to the OS that the section contains read only data. */ nkeynes@362: #define SEC_READONLY 0x008 nkeynes@362: nkeynes@362: /* The section contains code only. */ nkeynes@362: #define SEC_CODE 0x010 nkeynes@362: nkeynes@362: /* The section contains data only. */ nkeynes@362: #define SEC_DATA 0x020 nkeynes@362: nkeynes@362: /* The section will reside in ROM. */ nkeynes@362: #define SEC_ROM 0x040 nkeynes@362: nkeynes@362: /* The section contains constructor information. This section nkeynes@362: type is used by the linker to create lists of constructors and nkeynes@362: destructors used by <>. When a back end sees a symbol nkeynes@362: which should be used in a constructor list, it creates a new nkeynes@362: section for the type of name (e.g., <<__CTOR_LIST__>>), attaches nkeynes@362: the symbol to it, and builds a relocation. To build the lists nkeynes@362: of constructors, all the linker has to do is catenate all the nkeynes@362: sections called <<__CTOR_LIST__>> and relocate the data nkeynes@362: contained within - exactly the operations it would peform on nkeynes@362: standard data. */ nkeynes@362: #define SEC_CONSTRUCTOR 0x080 nkeynes@362: nkeynes@362: /* The section has contents - a data section could be nkeynes@362: <> | <>; a debug section could be nkeynes@362: <> */ nkeynes@362: #define SEC_HAS_CONTENTS 0x100 nkeynes@362: nkeynes@362: /* An instruction to the linker to not output the section nkeynes@362: even if it has information which would normally be written. */ nkeynes@362: #define SEC_NEVER_LOAD 0x200 nkeynes@362: nkeynes@362: /* The section contains thread local data. */ nkeynes@362: #define SEC_THREAD_LOCAL 0x400 nkeynes@362: nkeynes@362: /* The section has GOT references. This flag is only for the nkeynes@362: linker, and is currently only used by the elf32-hppa back end. nkeynes@362: It will be set if global offset table references were detected nkeynes@362: in this section, which indicate to the linker that the section nkeynes@362: contains PIC code, and must be handled specially when doing a nkeynes@362: static link. */ nkeynes@362: #define SEC_HAS_GOT_REF 0x800 nkeynes@362: nkeynes@362: /* The section contains common symbols (symbols may be defined nkeynes@362: multiple times, the value of a symbol is the amount of nkeynes@362: space it requires, and the largest symbol value is the one nkeynes@362: used). Most targets have exactly one of these (which we nkeynes@362: translate to bfd_com_section_ptr), but ECOFF has two. */ nkeynes@362: #define SEC_IS_COMMON 0x1000 nkeynes@362: nkeynes@362: /* The section contains only debugging information. For nkeynes@362: example, this is set for ELF .debug and .stab sections. nkeynes@362: strip tests this flag to see if a section can be nkeynes@362: discarded. */ nkeynes@362: #define SEC_DEBUGGING 0x2000 nkeynes@362: nkeynes@362: /* The contents of this section are held in memory pointed to nkeynes@362: by the contents field. This is checked by bfd_get_section_contents, nkeynes@362: and the data is retrieved from memory if appropriate. */ nkeynes@362: #define SEC_IN_MEMORY 0x4000 nkeynes@362: nkeynes@362: /* The contents of this section are to be excluded by the nkeynes@362: linker for executable and shared objects unless those nkeynes@362: objects are to be further relocated. */ nkeynes@362: #define SEC_EXCLUDE 0x8000 nkeynes@362: nkeynes@362: /* The contents of this section are to be sorted based on the sum of nkeynes@362: the symbol and addend values specified by the associated relocation nkeynes@362: entries. Entries without associated relocation entries will be nkeynes@362: appended to the end of the section in an unspecified order. */ nkeynes@362: #define SEC_SORT_ENTRIES 0x10000 nkeynes@362: nkeynes@362: /* When linking, duplicate sections of the same name should be nkeynes@362: discarded, rather than being combined into a single section as nkeynes@362: is usually done. This is similar to how common symbols are nkeynes@362: handled. See SEC_LINK_DUPLICATES below. */ nkeynes@362: #define SEC_LINK_ONCE 0x20000 nkeynes@362: nkeynes@362: /* If SEC_LINK_ONCE is set, this bitfield describes how the linker nkeynes@362: should handle duplicate sections. */ nkeynes@362: #define SEC_LINK_DUPLICATES 0x40000 nkeynes@362: nkeynes@362: /* This value for SEC_LINK_DUPLICATES means that duplicate nkeynes@362: sections with the same name should simply be discarded. */ nkeynes@362: #define SEC_LINK_DUPLICATES_DISCARD 0x0 nkeynes@362: nkeynes@362: /* This value for SEC_LINK_DUPLICATES means that the linker nkeynes@362: should warn if there are any duplicate sections, although nkeynes@362: it should still only link one copy. */ nkeynes@362: #define SEC_LINK_DUPLICATES_ONE_ONLY 0x80000 nkeynes@362: nkeynes@362: /* This value for SEC_LINK_DUPLICATES means that the linker nkeynes@362: should warn if any duplicate sections are a different size. */ nkeynes@362: #define SEC_LINK_DUPLICATES_SAME_SIZE 0x100000 nkeynes@362: nkeynes@362: /* This value for SEC_LINK_DUPLICATES means that the linker nkeynes@362: should warn if any duplicate sections contain different nkeynes@362: contents. */ nkeynes@362: #define SEC_LINK_DUPLICATES_SAME_CONTENTS \ nkeynes@362: (SEC_LINK_DUPLICATES_ONE_ONLY | SEC_LINK_DUPLICATES_SAME_SIZE) nkeynes@362: nkeynes@362: /* This section was created by the linker as part of dynamic nkeynes@362: relocation or other arcane processing. It is skipped when nkeynes@362: going through the first-pass output, trusting that someone nkeynes@362: else up the line will take care of it later. */ nkeynes@362: #define SEC_LINKER_CREATED 0x200000 nkeynes@362: nkeynes@362: /* This section should not be subject to garbage collection. */ nkeynes@362: #define SEC_KEEP 0x400000 nkeynes@362: nkeynes@362: /* This section contains "short" data, and should be placed nkeynes@362: "near" the GP. */ nkeynes@362: #define SEC_SMALL_DATA 0x800000 nkeynes@362: nkeynes@362: /* Attempt to merge identical entities in the section. nkeynes@362: Entity size is given in the entsize field. */ nkeynes@362: #define SEC_MERGE 0x1000000 nkeynes@362: nkeynes@362: /* If given with SEC_MERGE, entities to merge are zero terminated nkeynes@362: strings where entsize specifies character size instead of fixed nkeynes@362: size entries. */ nkeynes@362: #define SEC_STRINGS 0x2000000 nkeynes@362: nkeynes@362: /* This section contains data about section groups. */ nkeynes@362: #define SEC_GROUP 0x4000000 nkeynes@362: nkeynes@362: /* The section is a COFF shared library section. This flag is nkeynes@362: only for the linker. If this type of section appears in nkeynes@362: the input file, the linker must copy it to the output file nkeynes@362: without changing the vma or size. FIXME: Although this nkeynes@362: was originally intended to be general, it really is COFF nkeynes@362: specific (and the flag was renamed to indicate this). It nkeynes@362: might be cleaner to have some more general mechanism to nkeynes@362: allow the back end to control what the linker does with nkeynes@362: sections. */ nkeynes@362: #define SEC_COFF_SHARED_LIBRARY 0x10000000 nkeynes@362: nkeynes@362: /* This section contains data which may be shared with other nkeynes@362: executables or shared objects. This is for COFF only. */ nkeynes@362: #define SEC_COFF_SHARED 0x20000000 nkeynes@362: nkeynes@362: /* When a section with this flag is being linked, then if the size of nkeynes@362: the input section is less than a page, it should not cross a page nkeynes@362: boundary. If the size of the input section is one page or more, nkeynes@362: it should be aligned on a page boundary. This is for TI nkeynes@362: TMS320C54X only. */ nkeynes@362: #define SEC_TIC54X_BLOCK 0x40000000 nkeynes@362: nkeynes@362: /* Conditionally link this section; do not link if there are no nkeynes@362: references found to any symbol in the section. This is for TI nkeynes@362: TMS320C54X only. */ nkeynes@362: #define SEC_TIC54X_CLINK 0x80000000 nkeynes@362: nkeynes@362: /* End of section flags. */ nkeynes@362: nkeynes@362: /* Some internal packed boolean fields. */ nkeynes@362: nkeynes@362: /* See the vma field. */ nkeynes@362: unsigned int user_set_vma : 1; nkeynes@362: nkeynes@362: /* A mark flag used by some of the linker backends. */ nkeynes@362: unsigned int linker_mark : 1; nkeynes@362: nkeynes@362: /* Another mark flag used by some of the linker backends. Set for nkeynes@362: output sections that have an input section. */ nkeynes@362: unsigned int linker_has_input : 1; nkeynes@362: nkeynes@362: /* A mark flag used by some linker backends for garbage collection. */ nkeynes@362: unsigned int gc_mark : 1; nkeynes@362: nkeynes@362: /* The following flags are used by the ELF linker. */ nkeynes@362: nkeynes@362: /* Mark sections which have been allocated to segments. */ nkeynes@362: unsigned int segment_mark : 1; nkeynes@362: nkeynes@362: /* Type of sec_info information. */ nkeynes@362: unsigned int sec_info_type:3; nkeynes@362: #define ELF_INFO_TYPE_NONE 0 nkeynes@362: #define ELF_INFO_TYPE_STABS 1 nkeynes@362: #define ELF_INFO_TYPE_MERGE 2 nkeynes@362: #define ELF_INFO_TYPE_EH_FRAME 3 nkeynes@362: #define ELF_INFO_TYPE_JUST_SYMS 4 nkeynes@362: nkeynes@362: /* Nonzero if this section uses RELA relocations, rather than REL. */ nkeynes@362: unsigned int use_rela_p:1; nkeynes@362: nkeynes@362: /* Bits used by various backends. The generic code doesn't touch nkeynes@362: these fields. */ nkeynes@362: nkeynes@362: /* Nonzero if this section has TLS related relocations. */ nkeynes@362: unsigned int has_tls_reloc:1; nkeynes@362: nkeynes@362: /* Nonzero if this section has a gp reloc. */ nkeynes@362: unsigned int has_gp_reloc:1; nkeynes@362: nkeynes@362: /* Nonzero if this section needs the relax finalize pass. */ nkeynes@362: unsigned int need_finalize_relax:1; nkeynes@362: nkeynes@362: /* Whether relocations have been processed. */ nkeynes@362: unsigned int reloc_done : 1; nkeynes@362: nkeynes@362: /* End of internal packed boolean fields. */ nkeynes@362: nkeynes@362: /* The virtual memory address of the section - where it will be nkeynes@362: at run time. The symbols are relocated against this. The nkeynes@362: user_set_vma flag is maintained by bfd; if it's not set, the nkeynes@362: backend can assign addresses (for example, in <>, where nkeynes@362: the default address for <<.data>> is dependent on the specific nkeynes@362: target and various flags). */ nkeynes@362: bfd_vma vma; nkeynes@362: nkeynes@362: /* The load address of the section - where it would be in a nkeynes@362: rom image; really only used for writing section header nkeynes@362: information. */ nkeynes@362: bfd_vma lma; nkeynes@362: nkeynes@362: /* The size of the section in octets, as it will be output. nkeynes@362: Contains a value even if the section has no contents (e.g., the nkeynes@362: size of <<.bss>>). */ nkeynes@362: bfd_size_type size; nkeynes@362: nkeynes@362: /* For input sections, the original size on disk of the section, in nkeynes@362: octets. This field is used by the linker relaxation code. It is nkeynes@362: currently only set for sections where the linker relaxation scheme nkeynes@362: doesn't cache altered section and reloc contents (stabs, eh_frame, nkeynes@362: SEC_MERGE, some coff relaxing targets), and thus the original size nkeynes@362: needs to be kept to read the section multiple times. nkeynes@362: For output sections, rawsize holds the section size calculated on nkeynes@362: a previous linker relaxation pass. */ nkeynes@362: bfd_size_type rawsize; nkeynes@362: nkeynes@362: /* If this section is going to be output, then this value is the nkeynes@362: offset in *bytes* into the output section of the first byte in the nkeynes@362: input section (byte ==> smallest addressable unit on the nkeynes@362: target). In most cases, if this was going to start at the nkeynes@362: 100th octet (8-bit quantity) in the output section, this value nkeynes@362: would be 100. However, if the target byte size is 16 bits nkeynes@362: (bfd_octets_per_byte is "2"), this value would be 50. */ nkeynes@362: bfd_vma output_offset; nkeynes@362: nkeynes@362: /* The output section through which to map on output. */ nkeynes@362: struct bfd_section *output_section; nkeynes@362: nkeynes@362: /* The alignment requirement of the section, as an exponent of 2 - nkeynes@362: e.g., 3 aligns to 2^3 (or 8). */ nkeynes@362: unsigned int alignment_power; nkeynes@362: nkeynes@362: /* If an input section, a pointer to a vector of relocation nkeynes@362: records for the data in this section. */ nkeynes@362: struct reloc_cache_entry *relocation; nkeynes@362: nkeynes@362: /* If an output section, a pointer to a vector of pointers to nkeynes@362: relocation records for the data in this section. */ nkeynes@362: struct reloc_cache_entry **orelocation; nkeynes@362: nkeynes@362: /* The number of relocation records in one of the above. */ nkeynes@362: unsigned reloc_count; nkeynes@362: nkeynes@362: /* Information below is back end specific - and not always used nkeynes@362: or updated. */ nkeynes@362: nkeynes@362: /* File position of section data. */ nkeynes@362: file_ptr filepos; nkeynes@362: nkeynes@362: /* File position of relocation info. */ nkeynes@362: file_ptr rel_filepos; nkeynes@362: nkeynes@362: /* File position of line data. */ nkeynes@362: file_ptr line_filepos; nkeynes@362: nkeynes@362: /* Pointer to data for applications. */ nkeynes@362: void *userdata; nkeynes@362: nkeynes@362: /* If the SEC_IN_MEMORY flag is set, this points to the actual nkeynes@362: contents. */ nkeynes@362: unsigned char *contents; nkeynes@362: nkeynes@362: /* Attached line number information. */ nkeynes@362: alent *lineno; nkeynes@362: nkeynes@362: /* Number of line number records. */ nkeynes@362: unsigned int lineno_count; nkeynes@362: nkeynes@362: /* Entity size for merging purposes. */ nkeynes@362: unsigned int entsize; nkeynes@362: nkeynes@362: /* Points to the kept section if this section is a link-once section, nkeynes@362: and is discarded. */ nkeynes@362: struct bfd_section *kept_section; nkeynes@362: nkeynes@362: /* When a section is being output, this value changes as more nkeynes@362: linenumbers are written out. */ nkeynes@362: file_ptr moving_line_filepos; nkeynes@362: nkeynes@362: /* What the section number is in the target world. */ nkeynes@362: int target_index; nkeynes@362: nkeynes@362: void *used_by_bfd; nkeynes@362: nkeynes@362: /* If this is a constructor section then here is a list of the nkeynes@362: relocations created to relocate items within it. */ nkeynes@362: struct relent_chain *constructor_chain; nkeynes@362: nkeynes@362: /* The BFD which owns the section. */ nkeynes@362: bfd *owner; nkeynes@362: nkeynes@362: /* A symbol which points at this section only. */ nkeynes@362: struct bfd_symbol *symbol; nkeynes@362: struct bfd_symbol **symbol_ptr_ptr; nkeynes@362: nkeynes@362: struct bfd_link_order *link_order_head; nkeynes@362: struct bfd_link_order *link_order_tail; nkeynes@362: } asection; nkeynes@362: nkeynes@362: /* These sections are global, and are managed by BFD. The application nkeynes@362: and target back end are not permitted to change the values in nkeynes@362: these sections. New code should use the section_ptr macros rather nkeynes@362: than referring directly to the const sections. The const sections nkeynes@362: may eventually vanish. */ nkeynes@362: #define BFD_ABS_SECTION_NAME "*ABS*" nkeynes@362: #define BFD_UND_SECTION_NAME "*UND*" nkeynes@362: #define BFD_COM_SECTION_NAME "*COM*" nkeynes@362: #define BFD_IND_SECTION_NAME "*IND*" nkeynes@362: nkeynes@362: /* The absolute section. */ nkeynes@362: extern asection bfd_abs_section; nkeynes@362: #define bfd_abs_section_ptr ((asection *) &bfd_abs_section) nkeynes@362: #define bfd_is_abs_section(sec) ((sec) == bfd_abs_section_ptr) nkeynes@362: /* Pointer to the undefined section. */ nkeynes@362: extern asection bfd_und_section; nkeynes@362: #define bfd_und_section_ptr ((asection *) &bfd_und_section) nkeynes@362: #define bfd_is_und_section(sec) ((sec) == bfd_und_section_ptr) nkeynes@362: /* Pointer to the common section. */ nkeynes@362: extern asection bfd_com_section; nkeynes@362: #define bfd_com_section_ptr ((asection *) &bfd_com_section) nkeynes@362: /* Pointer to the indirect section. */ nkeynes@362: extern asection bfd_ind_section; nkeynes@362: #define bfd_ind_section_ptr ((asection *) &bfd_ind_section) nkeynes@362: #define bfd_is_ind_section(sec) ((sec) == bfd_ind_section_ptr) nkeynes@362: nkeynes@362: #define bfd_is_const_section(SEC) \ nkeynes@362: ( ((SEC) == bfd_abs_section_ptr) \ nkeynes@362: || ((SEC) == bfd_und_section_ptr) \ nkeynes@362: || ((SEC) == bfd_com_section_ptr) \ nkeynes@362: || ((SEC) == bfd_ind_section_ptr)) nkeynes@362: nkeynes@362: extern const struct bfd_symbol * const bfd_abs_symbol; nkeynes@362: extern const struct bfd_symbol * const bfd_com_symbol; nkeynes@362: extern const struct bfd_symbol * const bfd_und_symbol; nkeynes@362: extern const struct bfd_symbol * const bfd_ind_symbol; nkeynes@362: nkeynes@362: /* Macros to handle insertion and deletion of a bfd's sections. These nkeynes@362: only handle the list pointers, ie. do not adjust section_count, nkeynes@362: target_index etc. */ nkeynes@362: #define bfd_section_list_remove(ABFD, PS) \ nkeynes@362: do \ nkeynes@362: { \ nkeynes@362: asection **_ps = PS; \ nkeynes@362: asection *_s = *_ps; \ nkeynes@362: *_ps = _s->next; \ nkeynes@362: if (_s->next == NULL) \ nkeynes@362: (ABFD)->section_tail = _ps; \ nkeynes@362: } \ nkeynes@362: while (0) nkeynes@362: #define bfd_section_list_insert(ABFD, PS, S) \ nkeynes@362: do \ nkeynes@362: { \ nkeynes@362: asection **_ps = PS; \ nkeynes@362: asection *_s = S; \ nkeynes@362: _s->next = *_ps; \ nkeynes@362: *_ps = _s; \ nkeynes@362: if (_s->next == NULL) \ nkeynes@362: (ABFD)->section_tail = &_s->next; \ nkeynes@362: } \ nkeynes@362: while (0) nkeynes@362: nkeynes@362: void bfd_section_list_clear (bfd *); nkeynes@362: nkeynes@362: asection *bfd_get_section_by_name (bfd *abfd, const char *name); nkeynes@362: nkeynes@362: asection *bfd_get_section_by_name_if nkeynes@362: (bfd *abfd, nkeynes@362: const char *name, nkeynes@362: bfd_boolean (*func) (bfd *abfd, asection *sect, void *obj), nkeynes@362: void *obj); nkeynes@362: nkeynes@362: char *bfd_get_unique_section_name nkeynes@362: (bfd *abfd, const char *templat, int *count); nkeynes@362: nkeynes@362: asection *bfd_make_section_old_way (bfd *abfd, const char *name); nkeynes@362: nkeynes@362: asection *bfd_make_section_anyway (bfd *abfd, const char *name); nkeynes@362: nkeynes@362: asection *bfd_make_section (bfd *, const char *name); nkeynes@362: nkeynes@362: bfd_boolean bfd_set_section_flags nkeynes@362: (bfd *abfd, asection *sec, flagword flags); nkeynes@362: nkeynes@362: void bfd_map_over_sections nkeynes@362: (bfd *abfd, nkeynes@362: void (*func) (bfd *abfd, asection *sect, void *obj), nkeynes@362: void *obj); nkeynes@362: nkeynes@362: asection *bfd_sections_find_if nkeynes@362: (bfd *abfd, nkeynes@362: bfd_boolean (*operation) (bfd *abfd, asection *sect, void *obj), nkeynes@362: void *obj); nkeynes@362: nkeynes@362: bfd_boolean bfd_set_section_size nkeynes@362: (bfd *abfd, asection *sec, bfd_size_type val); nkeynes@362: nkeynes@362: bfd_boolean bfd_set_section_contents nkeynes@362: (bfd *abfd, asection *section, const void *data, nkeynes@362: file_ptr offset, bfd_size_type count); nkeynes@362: nkeynes@362: bfd_boolean bfd_get_section_contents nkeynes@362: (bfd *abfd, asection *section, void *location, file_ptr offset, nkeynes@362: bfd_size_type count); nkeynes@362: nkeynes@362: bfd_boolean bfd_malloc_and_get_section nkeynes@362: (bfd *abfd, asection *section, bfd_byte **buf); nkeynes@362: nkeynes@362: bfd_boolean bfd_copy_private_section_data nkeynes@362: (bfd *ibfd, asection *isec, bfd *obfd, asection *osec); nkeynes@362: nkeynes@362: #define bfd_copy_private_section_data(ibfd, isection, obfd, osection) \ nkeynes@362: BFD_SEND (obfd, _bfd_copy_private_section_data, \ nkeynes@362: (ibfd, isection, obfd, osection)) nkeynes@362: void _bfd_strip_section_from_output nkeynes@362: (struct bfd_link_info *info, asection *section); nkeynes@362: nkeynes@362: bfd_boolean bfd_generic_is_group_section (bfd *, const asection *sec); nkeynes@362: nkeynes@362: bfd_boolean bfd_generic_discard_group (bfd *abfd, asection *group); nkeynes@362: nkeynes@362: /* Extracted from archures.c. */ nkeynes@362: enum bfd_architecture nkeynes@362: { nkeynes@362: bfd_arch_unknown, /* File arch not known. */ nkeynes@362: bfd_arch_obscure, /* Arch known, not one of these. */ nkeynes@362: bfd_arch_m68k, /* Motorola 68xxx */ nkeynes@362: #define bfd_mach_m68000 1 nkeynes@362: #define bfd_mach_m68008 2 nkeynes@362: #define bfd_mach_m68010 3 nkeynes@362: #define bfd_mach_m68020 4 nkeynes@362: #define bfd_mach_m68030 5 nkeynes@362: #define bfd_mach_m68040 6 nkeynes@362: #define bfd_mach_m68060 7 nkeynes@362: #define bfd_mach_cpu32 8 nkeynes@362: #define bfd_mach_mcf5200 9 nkeynes@362: #define bfd_mach_mcf5206e 10 nkeynes@362: #define bfd_mach_mcf5307 11 nkeynes@362: #define bfd_mach_mcf5407 12 nkeynes@362: #define bfd_mach_mcf528x 13 nkeynes@362: #define bfd_mach_mcfv4e 14 nkeynes@362: #define bfd_mach_mcf521x 15 nkeynes@362: #define bfd_mach_mcf5249 16 nkeynes@362: #define bfd_mach_mcf547x 17 nkeynes@362: #define bfd_mach_mcf548x 18 nkeynes@362: bfd_arch_vax, /* DEC Vax */ nkeynes@362: bfd_arch_i960, /* Intel 960 */ nkeynes@362: /* The order of the following is important. nkeynes@362: lower number indicates a machine type that nkeynes@362: only accepts a subset of the instructions nkeynes@362: available to machines with higher numbers. nkeynes@362: The exception is the "ca", which is nkeynes@362: incompatible with all other machines except nkeynes@362: "core". */ nkeynes@362: nkeynes@362: #define bfd_mach_i960_core 1 nkeynes@362: #define bfd_mach_i960_ka_sa 2 nkeynes@362: #define bfd_mach_i960_kb_sb 3 nkeynes@362: #define bfd_mach_i960_mc 4 nkeynes@362: #define bfd_mach_i960_xa 5 nkeynes@362: #define bfd_mach_i960_ca 6 nkeynes@362: #define bfd_mach_i960_jx 7 nkeynes@362: #define bfd_mach_i960_hx 8 nkeynes@362: nkeynes@362: bfd_arch_or32, /* OpenRISC 32 */ nkeynes@362: nkeynes@362: bfd_arch_a29k, /* AMD 29000 */ nkeynes@362: bfd_arch_sparc, /* SPARC */ nkeynes@362: #define bfd_mach_sparc 1 nkeynes@362: /* The difference between v8plus and v9 is that v9 is a true 64 bit env. */ nkeynes@362: #define bfd_mach_sparc_sparclet 2 nkeynes@362: #define bfd_mach_sparc_sparclite 3 nkeynes@362: #define bfd_mach_sparc_v8plus 4 nkeynes@362: #define bfd_mach_sparc_v8plusa 5 /* with ultrasparc add'ns. */ nkeynes@362: #define bfd_mach_sparc_sparclite_le 6 nkeynes@362: #define bfd_mach_sparc_v9 7 nkeynes@362: #define bfd_mach_sparc_v9a 8 /* with ultrasparc add'ns. */ nkeynes@362: #define bfd_mach_sparc_v8plusb 9 /* with cheetah add'ns. */ nkeynes@362: #define bfd_mach_sparc_v9b 10 /* with cheetah add'ns. */ nkeynes@362: /* Nonzero if MACH has the v9 instruction set. */ nkeynes@362: #define bfd_mach_sparc_v9_p(mach) \ nkeynes@362: ((mach) >= bfd_mach_sparc_v8plus && (mach) <= bfd_mach_sparc_v9b \ nkeynes@362: && (mach) != bfd_mach_sparc_sparclite_le) nkeynes@362: /* Nonzero if MACH is a 64 bit sparc architecture. */ nkeynes@362: #define bfd_mach_sparc_64bit_p(mach) \ nkeynes@362: ((mach) >= bfd_mach_sparc_v9 && (mach) != bfd_mach_sparc_v8plusb) nkeynes@362: bfd_arch_mips, /* MIPS Rxxxx */ nkeynes@362: #define bfd_mach_mips3000 3000 nkeynes@362: #define bfd_mach_mips3900 3900 nkeynes@362: #define bfd_mach_mips4000 4000 nkeynes@362: #define bfd_mach_mips4010 4010 nkeynes@362: #define bfd_mach_mips4100 4100 nkeynes@362: #define bfd_mach_mips4111 4111 nkeynes@362: #define bfd_mach_mips4120 4120 nkeynes@362: #define bfd_mach_mips4300 4300 nkeynes@362: #define bfd_mach_mips4400 4400 nkeynes@362: #define bfd_mach_mips4600 4600 nkeynes@362: #define bfd_mach_mips4650 4650 nkeynes@362: #define bfd_mach_mips5000 5000 nkeynes@362: #define bfd_mach_mips5400 5400 nkeynes@362: #define bfd_mach_mips5500 5500 nkeynes@362: #define bfd_mach_mips6000 6000 nkeynes@362: #define bfd_mach_mips7000 7000 nkeynes@362: #define bfd_mach_mips8000 8000 nkeynes@362: #define bfd_mach_mips9000 9000 nkeynes@362: #define bfd_mach_mips10000 10000 nkeynes@362: #define bfd_mach_mips12000 12000 nkeynes@362: #define bfd_mach_mips16 16 nkeynes@362: #define bfd_mach_mips5 5 nkeynes@362: #define bfd_mach_mips_sb1 12310201 /* octal 'SB', 01 */ nkeynes@362: #define bfd_mach_mipsisa32 32 nkeynes@362: #define bfd_mach_mipsisa32r2 33 nkeynes@362: #define bfd_mach_mipsisa64 64 nkeynes@362: #define bfd_mach_mipsisa64r2 65 nkeynes@362: bfd_arch_i386, /* Intel 386 */ nkeynes@362: #define bfd_mach_i386_i386 1 nkeynes@362: #define bfd_mach_i386_i8086 2 nkeynes@362: #define bfd_mach_i386_i386_intel_syntax 3 nkeynes@362: #define bfd_mach_x86_64 64 nkeynes@362: #define bfd_mach_x86_64_intel_syntax 65 nkeynes@362: bfd_arch_we32k, /* AT&T WE32xxx */ nkeynes@362: bfd_arch_tahoe, /* CCI/Harris Tahoe */ nkeynes@362: bfd_arch_i860, /* Intel 860 */ nkeynes@362: bfd_arch_i370, /* IBM 360/370 Mainframes */ nkeynes@362: bfd_arch_romp, /* IBM ROMP PC/RT */ nkeynes@362: bfd_arch_alliant, /* Alliant */ nkeynes@362: bfd_arch_convex, /* Convex */ nkeynes@362: bfd_arch_m88k, /* Motorola 88xxx */ nkeynes@362: bfd_arch_m98k, /* Motorola 98xxx */ nkeynes@362: bfd_arch_pyramid, /* Pyramid Technology */ nkeynes@362: bfd_arch_h8300, /* Renesas H8/300 (formerly Hitachi H8/300) */ nkeynes@362: #define bfd_mach_h8300 1 nkeynes@362: #define bfd_mach_h8300h 2 nkeynes@362: #define bfd_mach_h8300s 3 nkeynes@362: #define bfd_mach_h8300hn 4 nkeynes@362: #define bfd_mach_h8300sn 5 nkeynes@362: #define bfd_mach_h8300sx 6 nkeynes@362: #define bfd_mach_h8300sxn 7 nkeynes@362: bfd_arch_pdp11, /* DEC PDP-11 */ nkeynes@362: bfd_arch_powerpc, /* PowerPC */ nkeynes@362: #define bfd_mach_ppc 32 nkeynes@362: #define bfd_mach_ppc64 64 nkeynes@362: #define bfd_mach_ppc_403 403 nkeynes@362: #define bfd_mach_ppc_403gc 4030 nkeynes@362: #define bfd_mach_ppc_505 505 nkeynes@362: #define bfd_mach_ppc_601 601 nkeynes@362: #define bfd_mach_ppc_602 602 nkeynes@362: #define bfd_mach_ppc_603 603 nkeynes@362: #define bfd_mach_ppc_ec603e 6031 nkeynes@362: #define bfd_mach_ppc_604 604 nkeynes@362: #define bfd_mach_ppc_620 620 nkeynes@362: #define bfd_mach_ppc_630 630 nkeynes@362: #define bfd_mach_ppc_750 750 nkeynes@362: #define bfd_mach_ppc_860 860 nkeynes@362: #define bfd_mach_ppc_a35 35 nkeynes@362: #define bfd_mach_ppc_rs64ii 642 nkeynes@362: #define bfd_mach_ppc_rs64iii 643 nkeynes@362: #define bfd_mach_ppc_7400 7400 nkeynes@362: #define bfd_mach_ppc_e500 500 nkeynes@362: bfd_arch_rs6000, /* IBM RS/6000 */ nkeynes@362: #define bfd_mach_rs6k 6000 nkeynes@362: #define bfd_mach_rs6k_rs1 6001 nkeynes@362: #define bfd_mach_rs6k_rsc 6003 nkeynes@362: #define bfd_mach_rs6k_rs2 6002 nkeynes@362: bfd_arch_hppa, /* HP PA RISC */ nkeynes@362: #define bfd_mach_hppa10 10 nkeynes@362: #define bfd_mach_hppa11 11 nkeynes@362: #define bfd_mach_hppa20 20 nkeynes@362: #define bfd_mach_hppa20w 25 nkeynes@362: bfd_arch_d10v, /* Mitsubishi D10V */ nkeynes@362: #define bfd_mach_d10v 1 nkeynes@362: #define bfd_mach_d10v_ts2 2 nkeynes@362: #define bfd_mach_d10v_ts3 3 nkeynes@362: bfd_arch_d30v, /* Mitsubishi D30V */ nkeynes@362: bfd_arch_dlx, /* DLX */ nkeynes@362: bfd_arch_m68hc11, /* Motorola 68HC11 */ nkeynes@362: bfd_arch_m68hc12, /* Motorola 68HC12 */ nkeynes@362: #define bfd_mach_m6812_default 0 nkeynes@362: #define bfd_mach_m6812 1 nkeynes@362: #define bfd_mach_m6812s 2 nkeynes@362: bfd_arch_z8k, /* Zilog Z8000 */ nkeynes@362: #define bfd_mach_z8001 1 nkeynes@362: #define bfd_mach_z8002 2 nkeynes@362: bfd_arch_h8500, /* Renesas H8/500 (formerly Hitachi H8/500) */ nkeynes@362: bfd_arch_sh, /* Renesas / SuperH SH (formerly Hitachi SH) */ nkeynes@362: #define bfd_mach_sh 1 nkeynes@362: #define bfd_mach_sh2 0x20 nkeynes@362: #define bfd_mach_sh_dsp 0x2d nkeynes@362: #define bfd_mach_sh2a 0x2a nkeynes@362: #define bfd_mach_sh2a_nofpu 0x2b nkeynes@362: #define bfd_mach_sh2a_nofpu_or_sh4_nommu_nofpu 0x2a1 nkeynes@362: #define bfd_mach_sh2a_nofpu_or_sh3_nommu 0x2a2 nkeynes@362: #define bfd_mach_sh2a_or_sh4 0x2a3 nkeynes@362: #define bfd_mach_sh2a_or_sh3e 0x2a4 nkeynes@362: #define bfd_mach_sh2e 0x2e nkeynes@362: #define bfd_mach_sh3 0x30 nkeynes@362: #define bfd_mach_sh3_nommu 0x31 nkeynes@362: #define bfd_mach_sh3_dsp 0x3d nkeynes@362: #define bfd_mach_sh3e 0x3e nkeynes@362: #define bfd_mach_sh4 0x40 nkeynes@362: #define bfd_mach_sh4_nofpu 0x41 nkeynes@362: #define bfd_mach_sh4_nommu_nofpu 0x42 nkeynes@362: #define bfd_mach_sh4a 0x4a nkeynes@362: #define bfd_mach_sh4a_nofpu 0x4b nkeynes@362: #define bfd_mach_sh4al_dsp 0x4d nkeynes@362: #define bfd_mach_sh5 0x50 nkeynes@362: bfd_arch_alpha, /* Dec Alpha */ nkeynes@362: #define bfd_mach_alpha_ev4 0x10 nkeynes@362: #define bfd_mach_alpha_ev5 0x20 nkeynes@362: #define bfd_mach_alpha_ev6 0x30 nkeynes@362: bfd_arch_arm, /* Advanced Risc Machines ARM. */ nkeynes@362: #define bfd_mach_arm_unknown 0 nkeynes@362: #define bfd_mach_arm_2 1 nkeynes@362: #define bfd_mach_arm_2a 2 nkeynes@362: #define bfd_mach_arm_3 3 nkeynes@362: #define bfd_mach_arm_3M 4 nkeynes@362: #define bfd_mach_arm_4 5 nkeynes@362: #define bfd_mach_arm_4T 6 nkeynes@362: #define bfd_mach_arm_5 7 nkeynes@362: #define bfd_mach_arm_5T 8 nkeynes@362: #define bfd_mach_arm_5TE 9 nkeynes@362: #define bfd_mach_arm_XScale 10 nkeynes@362: #define bfd_mach_arm_ep9312 11 nkeynes@362: #define bfd_mach_arm_iWMMXt 12 nkeynes@362: bfd_arch_ns32k, /* National Semiconductors ns32000 */ nkeynes@362: bfd_arch_w65, /* WDC 65816 */ nkeynes@362: bfd_arch_tic30, /* Texas Instruments TMS320C30 */ nkeynes@362: bfd_arch_tic4x, /* Texas Instruments TMS320C3X/4X */ nkeynes@362: #define bfd_mach_tic3x 30 nkeynes@362: #define bfd_mach_tic4x 40 nkeynes@362: bfd_arch_tic54x, /* Texas Instruments TMS320C54X */ nkeynes@362: bfd_arch_tic80, /* TI TMS320c80 (MVP) */ nkeynes@362: bfd_arch_v850, /* NEC V850 */ nkeynes@362: #define bfd_mach_v850 1 nkeynes@362: #define bfd_mach_v850e 'E' nkeynes@362: #define bfd_mach_v850e1 '1' nkeynes@362: bfd_arch_arc, /* ARC Cores */ nkeynes@362: #define bfd_mach_arc_5 5 nkeynes@362: #define bfd_mach_arc_6 6 nkeynes@362: #define bfd_mach_arc_7 7 nkeynes@362: #define bfd_mach_arc_8 8 nkeynes@362: bfd_arch_m32r, /* Renesas M32R (formerly Mitsubishi M32R/D) */ nkeynes@362: #define bfd_mach_m32r 1 /* For backwards compatibility. */ nkeynes@362: #define bfd_mach_m32rx 'x' nkeynes@362: #define bfd_mach_m32r2 '2' nkeynes@362: bfd_arch_mn10200, /* Matsushita MN10200 */ nkeynes@362: bfd_arch_mn10300, /* Matsushita MN10300 */ nkeynes@362: #define bfd_mach_mn10300 300 nkeynes@362: #define bfd_mach_am33 330 nkeynes@362: #define bfd_mach_am33_2 332 nkeynes@362: bfd_arch_fr30, nkeynes@362: #define bfd_mach_fr30 0x46523330 nkeynes@362: bfd_arch_frv, nkeynes@362: #define bfd_mach_frv 1 nkeynes@362: #define bfd_mach_frvsimple 2 nkeynes@362: #define bfd_mach_fr300 300 nkeynes@362: #define bfd_mach_fr400 400 nkeynes@362: #define bfd_mach_fr450 450 nkeynes@362: #define bfd_mach_frvtomcat 499 /* fr500 prototype */ nkeynes@362: #define bfd_mach_fr500 500 nkeynes@362: #define bfd_mach_fr550 550 nkeynes@362: bfd_arch_mcore, nkeynes@362: bfd_arch_ia64, /* HP/Intel ia64 */ nkeynes@362: #define bfd_mach_ia64_elf64 64 nkeynes@362: #define bfd_mach_ia64_elf32 32 nkeynes@362: bfd_arch_ip2k, /* Ubicom IP2K microcontrollers. */ nkeynes@362: #define bfd_mach_ip2022 1 nkeynes@362: #define bfd_mach_ip2022ext 2 nkeynes@362: bfd_arch_iq2000, /* Vitesse IQ2000. */ nkeynes@362: #define bfd_mach_iq2000 1 nkeynes@362: #define bfd_mach_iq10 2 nkeynes@362: bfd_arch_pj, nkeynes@362: bfd_arch_avr, /* Atmel AVR microcontrollers. */ nkeynes@362: #define bfd_mach_avr1 1 nkeynes@362: #define bfd_mach_avr2 2 nkeynes@362: #define bfd_mach_avr3 3 nkeynes@362: #define bfd_mach_avr4 4 nkeynes@362: #define bfd_mach_avr5 5 nkeynes@362: bfd_arch_cr16c, /* National Semiconductor CompactRISC. */ nkeynes@362: #define bfd_mach_cr16c 1 nkeynes@362: bfd_arch_crx, /* National Semiconductor CRX. */ nkeynes@362: #define bfd_mach_crx 1 nkeynes@362: bfd_arch_cris, /* Axis CRIS */ nkeynes@362: #define bfd_mach_cris_v0_v10 255 nkeynes@362: #define bfd_mach_cris_v32 32 nkeynes@362: #define bfd_mach_cris_v10_v32 1032 nkeynes@362: bfd_arch_s390, /* IBM s390 */ nkeynes@362: #define bfd_mach_s390_31 31 nkeynes@362: #define bfd_mach_s390_64 64 nkeynes@362: bfd_arch_openrisc, /* OpenRISC */ nkeynes@362: bfd_arch_mmix, /* Donald Knuth's educational processor. */ nkeynes@362: bfd_arch_xstormy16, nkeynes@362: #define bfd_mach_xstormy16 1 nkeynes@362: bfd_arch_msp430, /* Texas Instruments MSP430 architecture. */ nkeynes@362: #define bfd_mach_msp11 11 nkeynes@362: #define bfd_mach_msp110 110 nkeynes@362: #define bfd_mach_msp12 12 nkeynes@362: #define bfd_mach_msp13 13 nkeynes@362: #define bfd_mach_msp14 14 nkeynes@362: #define bfd_mach_msp15 15 nkeynes@362: #define bfd_mach_msp16 16 nkeynes@362: #define bfd_mach_msp31 31 nkeynes@362: #define bfd_mach_msp32 32 nkeynes@362: #define bfd_mach_msp33 33 nkeynes@362: #define bfd_mach_msp41 41 nkeynes@362: #define bfd_mach_msp42 42 nkeynes@362: #define bfd_mach_msp43 43 nkeynes@362: #define bfd_mach_msp44 44 nkeynes@362: bfd_arch_xtensa, /* Tensilica's Xtensa cores. */ nkeynes@362: #define bfd_mach_xtensa 1 nkeynes@362: bfd_arch_maxq, /* Dallas MAXQ 10/20 */ nkeynes@362: #define bfd_mach_maxq10 10 nkeynes@362: #define bfd_mach_maxq20 20 nkeynes@362: bfd_arch_last nkeynes@362: }; nkeynes@362: nkeynes@362: typedef struct bfd_arch_info nkeynes@362: { nkeynes@362: int bits_per_word; nkeynes@362: int bits_per_address; nkeynes@362: int bits_per_byte; nkeynes@362: enum bfd_architecture arch; nkeynes@362: unsigned long mach; nkeynes@362: const char *arch_name; nkeynes@362: const char *printable_name; nkeynes@362: unsigned int section_align_power; nkeynes@362: /* TRUE if this is the default machine for the architecture. nkeynes@362: The default arch should be the first entry for an arch so that nkeynes@362: all the entries for that arch can be accessed via <>. */ nkeynes@362: bfd_boolean the_default; nkeynes@362: const struct bfd_arch_info * (*compatible) nkeynes@362: (const struct bfd_arch_info *a, const struct bfd_arch_info *b); nkeynes@362: nkeynes@362: bfd_boolean (*scan) (const struct bfd_arch_info *, const char *); nkeynes@362: nkeynes@362: const struct bfd_arch_info *next; nkeynes@362: } nkeynes@362: bfd_arch_info_type; nkeynes@362: nkeynes@362: const char *bfd_printable_name (bfd *abfd); nkeynes@362: nkeynes@362: const bfd_arch_info_type *bfd_scan_arch (const char *string); nkeynes@362: nkeynes@362: const char **bfd_arch_list (void); nkeynes@362: nkeynes@362: const bfd_arch_info_type *bfd_arch_get_compatible nkeynes@362: (const bfd *abfd, const bfd *bbfd, bfd_boolean accept_unknowns); nkeynes@362: nkeynes@362: void bfd_set_arch_info (bfd *abfd, const bfd_arch_info_type *arg); nkeynes@362: nkeynes@362: enum bfd_architecture bfd_get_arch (bfd *abfd); nkeynes@362: nkeynes@362: unsigned long bfd_get_mach (bfd *abfd); nkeynes@362: nkeynes@362: unsigned int bfd_arch_bits_per_byte (bfd *abfd); nkeynes@362: nkeynes@362: unsigned int bfd_arch_bits_per_address (bfd *abfd); nkeynes@362: nkeynes@362: const bfd_arch_info_type *bfd_get_arch_info (bfd *abfd); nkeynes@362: nkeynes@362: const bfd_arch_info_type *bfd_lookup_arch nkeynes@362: (enum bfd_architecture arch, unsigned long machine); nkeynes@362: nkeynes@362: const char *bfd_printable_arch_mach nkeynes@362: (enum bfd_architecture arch, unsigned long machine); nkeynes@362: nkeynes@362: unsigned int bfd_octets_per_byte (bfd *abfd); nkeynes@362: nkeynes@362: unsigned int bfd_arch_mach_octets_per_byte nkeynes@362: (enum bfd_architecture arch, unsigned long machine); nkeynes@362: nkeynes@362: /* Extracted from reloc.c. */ nkeynes@362: typedef enum bfd_reloc_status nkeynes@362: { nkeynes@362: /* No errors detected. */ nkeynes@362: bfd_reloc_ok, nkeynes@362: nkeynes@362: /* The relocation was performed, but there was an overflow. */ nkeynes@362: bfd_reloc_overflow, nkeynes@362: nkeynes@362: /* The address to relocate was not within the section supplied. */ nkeynes@362: bfd_reloc_outofrange, nkeynes@362: nkeynes@362: /* Used by special functions. */ nkeynes@362: bfd_reloc_continue, nkeynes@362: nkeynes@362: /* Unsupported relocation size requested. */ nkeynes@362: bfd_reloc_notsupported, nkeynes@362: nkeynes@362: /* Unused. */ nkeynes@362: bfd_reloc_other, nkeynes@362: nkeynes@362: /* The symbol to relocate against was undefined. */ nkeynes@362: bfd_reloc_undefined, nkeynes@362: nkeynes@362: /* The relocation was performed, but may not be ok - presently nkeynes@362: generated only when linking i960 coff files with i960 b.out nkeynes@362: symbols. If this type is returned, the error_message argument nkeynes@362: to bfd_perform_relocation will be set. */ nkeynes@362: bfd_reloc_dangerous nkeynes@362: } nkeynes@362: bfd_reloc_status_type; nkeynes@362: nkeynes@362: nkeynes@362: typedef struct reloc_cache_entry nkeynes@362: { nkeynes@362: /* A pointer into the canonical table of pointers. */ nkeynes@362: struct bfd_symbol **sym_ptr_ptr; nkeynes@362: nkeynes@362: /* offset in section. */ nkeynes@362: bfd_size_type address; nkeynes@362: nkeynes@362: /* addend for relocation value. */ nkeynes@362: bfd_vma addend; nkeynes@362: nkeynes@362: /* Pointer to how to perform the required relocation. */ nkeynes@362: reloc_howto_type *howto; nkeynes@362: nkeynes@362: } nkeynes@362: arelent; nkeynes@362: nkeynes@362: enum complain_overflow nkeynes@362: { nkeynes@362: /* Do not complain on overflow. */ nkeynes@362: complain_overflow_dont, nkeynes@362: nkeynes@362: /* Complain if the bitfield overflows, whether it is considered nkeynes@362: as signed or unsigned. */ nkeynes@362: complain_overflow_bitfield, nkeynes@362: nkeynes@362: /* Complain if the value overflows when considered as signed nkeynes@362: number. */ nkeynes@362: complain_overflow_signed, nkeynes@362: nkeynes@362: /* Complain if the value overflows when considered as an nkeynes@362: unsigned number. */ nkeynes@362: complain_overflow_unsigned nkeynes@362: }; nkeynes@362: nkeynes@362: struct reloc_howto_struct nkeynes@362: { nkeynes@362: /* The type field has mainly a documentary use - the back end can nkeynes@362: do what it wants with it, though normally the back end's nkeynes@362: external idea of what a reloc number is stored nkeynes@362: in this field. For example, a PC relative word relocation nkeynes@362: in a coff environment has the type 023 - because that's nkeynes@362: what the outside world calls a R_PCRWORD reloc. */ nkeynes@362: unsigned int type; nkeynes@362: nkeynes@362: /* The value the final relocation is shifted right by. This drops nkeynes@362: unwanted data from the relocation. */ nkeynes@362: unsigned int rightshift; nkeynes@362: nkeynes@362: /* The size of the item to be relocated. This is *not* a nkeynes@362: power-of-two measure. To get the number of bytes operated nkeynes@362: on by a type of relocation, use bfd_get_reloc_size. */ nkeynes@362: int size; nkeynes@362: nkeynes@362: /* The number of bits in the item to be relocated. This is used nkeynes@362: when doing overflow checking. */ nkeynes@362: unsigned int bitsize; nkeynes@362: nkeynes@362: /* Notes that the relocation is relative to the location in the nkeynes@362: data section of the addend. The relocation function will nkeynes@362: subtract from the relocation value the address of the location nkeynes@362: being relocated. */ nkeynes@362: bfd_boolean pc_relative; nkeynes@362: nkeynes@362: /* The bit position of the reloc value in the destination. nkeynes@362: The relocated value is left shifted by this amount. */ nkeynes@362: unsigned int bitpos; nkeynes@362: nkeynes@362: /* What type of overflow error should be checked for when nkeynes@362: relocating. */ nkeynes@362: enum complain_overflow complain_on_overflow; nkeynes@362: nkeynes@362: /* If this field is non null, then the supplied function is nkeynes@362: called rather than the normal function. This allows really nkeynes@362: strange relocation methods to be accommodated (e.g., i960 callj nkeynes@362: instructions). */ nkeynes@362: bfd_reloc_status_type (*special_function) nkeynes@362: (bfd *, arelent *, struct bfd_symbol *, void *, asection *, nkeynes@362: bfd *, char **); nkeynes@362: nkeynes@362: /* The textual name of the relocation type. */ nkeynes@362: char *name; nkeynes@362: nkeynes@362: /* Some formats record a relocation addend in the section contents nkeynes@362: rather than with the relocation. For ELF formats this is the nkeynes@362: distinction between USE_REL and USE_RELA (though the code checks nkeynes@362: for USE_REL == 1/0). The value of this field is TRUE if the nkeynes@362: addend is recorded with the section contents; when performing a nkeynes@362: partial link (ld -r) the section contents (the data) will be nkeynes@362: modified. The value of this field is FALSE if addends are nkeynes@362: recorded with the relocation (in arelent.addend); when performing nkeynes@362: a partial link the relocation will be modified. nkeynes@362: All relocations for all ELF USE_RELA targets should set this field nkeynes@362: to FALSE (values of TRUE should be looked on with suspicion). nkeynes@362: However, the converse is not true: not all relocations of all ELF nkeynes@362: USE_REL targets set this field to TRUE. Why this is so is peculiar nkeynes@362: to each particular target. For relocs that aren't used in partial nkeynes@362: links (e.g. GOT stuff) it doesn't matter what this is set to. */ nkeynes@362: bfd_boolean partial_inplace; nkeynes@362: nkeynes@362: /* src_mask selects the part of the instruction (or data) to be used nkeynes@362: in the relocation sum. If the target relocations don't have an nkeynes@362: addend in the reloc, eg. ELF USE_REL, src_mask will normally equal nkeynes@362: dst_mask to extract the addend from the section contents. If nkeynes@362: relocations do have an addend in the reloc, eg. ELF USE_RELA, this nkeynes@362: field should be zero. Non-zero values for ELF USE_RELA targets are nkeynes@362: bogus as in those cases the value in the dst_mask part of the nkeynes@362: section contents should be treated as garbage. */ nkeynes@362: bfd_vma src_mask; nkeynes@362: nkeynes@362: /* dst_mask selects which parts of the instruction (or data) are nkeynes@362: replaced with a relocated value. */ nkeynes@362: bfd_vma dst_mask; nkeynes@362: nkeynes@362: /* When some formats create PC relative instructions, they leave nkeynes@362: the value of the pc of the place being relocated in the offset nkeynes@362: slot of the instruction, so that a PC relative relocation can nkeynes@362: be made just by adding in an ordinary offset (e.g., sun3 a.out). nkeynes@362: Some formats leave the displacement part of an instruction nkeynes@362: empty (e.g., m88k bcs); this flag signals the fact. */ nkeynes@362: bfd_boolean pcrel_offset; nkeynes@362: }; nkeynes@362: nkeynes@362: #define HOWTO(C, R, S, B, P, BI, O, SF, NAME, INPLACE, MASKSRC, MASKDST, PC) \ nkeynes@362: { (unsigned) C, R, S, B, P, BI, O, SF, NAME, INPLACE, MASKSRC, MASKDST, PC } nkeynes@362: #define NEWHOWTO(FUNCTION, NAME, SIZE, REL, IN) \ nkeynes@362: HOWTO (0, 0, SIZE, 0, REL, 0, complain_overflow_dont, FUNCTION, \ nkeynes@362: NAME, FALSE, 0, 0, IN) nkeynes@362: nkeynes@362: #define EMPTY_HOWTO(C) \ nkeynes@362: HOWTO ((C), 0, 0, 0, FALSE, 0, complain_overflow_dont, NULL, \ nkeynes@362: NULL, FALSE, 0, 0, FALSE) nkeynes@362: nkeynes@362: #define HOWTO_PREPARE(relocation, symbol) \ nkeynes@362: { \ nkeynes@362: if (symbol != NULL) \ nkeynes@362: { \ nkeynes@362: if (bfd_is_com_section (symbol->section)) \ nkeynes@362: { \ nkeynes@362: relocation = 0; \ nkeynes@362: } \ nkeynes@362: else \ nkeynes@362: { \ nkeynes@362: relocation = symbol->value; \ nkeynes@362: } \ nkeynes@362: } \ nkeynes@362: } nkeynes@362: nkeynes@362: unsigned int bfd_get_reloc_size (reloc_howto_type *); nkeynes@362: nkeynes@362: typedef struct relent_chain nkeynes@362: { nkeynes@362: arelent relent; nkeynes@362: struct relent_chain *next; nkeynes@362: } nkeynes@362: arelent_chain; nkeynes@362: nkeynes@362: bfd_reloc_status_type bfd_check_overflow nkeynes@362: (enum complain_overflow how, nkeynes@362: unsigned int bitsize, nkeynes@362: unsigned int rightshift, nkeynes@362: unsigned int addrsize, nkeynes@362: bfd_vma relocation); nkeynes@362: nkeynes@362: bfd_reloc_status_type bfd_perform_relocation nkeynes@362: (bfd *abfd, nkeynes@362: arelent *reloc_entry, nkeynes@362: void *data, nkeynes@362: asection *input_section, nkeynes@362: bfd *output_bfd, nkeynes@362: char **error_message); nkeynes@362: nkeynes@362: bfd_reloc_status_type bfd_install_relocation nkeynes@362: (bfd *abfd, nkeynes@362: arelent *reloc_entry, nkeynes@362: void *data, bfd_vma data_start, nkeynes@362: asection *input_section, nkeynes@362: char **error_message); nkeynes@362: nkeynes@362: enum bfd_reloc_code_real { nkeynes@362: _dummy_first_bfd_reloc_code_real, nkeynes@362: nkeynes@362: nkeynes@362: /* Basic absolute relocations of N bits. */ nkeynes@362: BFD_RELOC_64, nkeynes@362: BFD_RELOC_32, nkeynes@362: BFD_RELOC_26, nkeynes@362: BFD_RELOC_24, nkeynes@362: BFD_RELOC_16, nkeynes@362: BFD_RELOC_14, nkeynes@362: BFD_RELOC_8, nkeynes@362: nkeynes@362: /* PC-relative relocations. Sometimes these are relative to the address nkeynes@362: of the relocation itself; sometimes they are relative to the start of nkeynes@362: the section containing the relocation. It depends on the specific target. nkeynes@362: nkeynes@362: The 24-bit relocation is used in some Intel 960 configurations. */ nkeynes@362: BFD_RELOC_64_PCREL, nkeynes@362: BFD_RELOC_32_PCREL, nkeynes@362: BFD_RELOC_24_PCREL, nkeynes@362: BFD_RELOC_16_PCREL, nkeynes@362: BFD_RELOC_12_PCREL, nkeynes@362: BFD_RELOC_8_PCREL, nkeynes@362: nkeynes@362: /* Section relative relocations. Some targets need this for DWARF2. */ nkeynes@362: BFD_RELOC_32_SECREL, nkeynes@362: nkeynes@362: /* For ELF. */ nkeynes@362: BFD_RELOC_32_GOT_PCREL, nkeynes@362: BFD_RELOC_16_GOT_PCREL, nkeynes@362: BFD_RELOC_8_GOT_PCREL, nkeynes@362: BFD_RELOC_32_GOTOFF, nkeynes@362: BFD_RELOC_16_GOTOFF, nkeynes@362: BFD_RELOC_LO16_GOTOFF, nkeynes@362: BFD_RELOC_HI16_GOTOFF, nkeynes@362: BFD_RELOC_HI16_S_GOTOFF, nkeynes@362: BFD_RELOC_8_GOTOFF, nkeynes@362: BFD_RELOC_64_PLT_PCREL, nkeynes@362: BFD_RELOC_32_PLT_PCREL, nkeynes@362: BFD_RELOC_24_PLT_PCREL, nkeynes@362: BFD_RELOC_16_PLT_PCREL, nkeynes@362: BFD_RELOC_8_PLT_PCREL, nkeynes@362: BFD_RELOC_64_PLTOFF, nkeynes@362: BFD_RELOC_32_PLTOFF, nkeynes@362: BFD_RELOC_16_PLTOFF, nkeynes@362: BFD_RELOC_LO16_PLTOFF, nkeynes@362: BFD_RELOC_HI16_PLTOFF, nkeynes@362: BFD_RELOC_HI16_S_PLTOFF, nkeynes@362: BFD_RELOC_8_PLTOFF, nkeynes@362: nkeynes@362: /* Relocations used by 68K ELF. */ nkeynes@362: BFD_RELOC_68K_GLOB_DAT, nkeynes@362: BFD_RELOC_68K_JMP_SLOT, nkeynes@362: BFD_RELOC_68K_RELATIVE, nkeynes@362: nkeynes@362: /* Linkage-table relative. */ nkeynes@362: BFD_RELOC_32_BASEREL, nkeynes@362: BFD_RELOC_16_BASEREL, nkeynes@362: BFD_RELOC_LO16_BASEREL, nkeynes@362: BFD_RELOC_HI16_BASEREL, nkeynes@362: BFD_RELOC_HI16_S_BASEREL, nkeynes@362: BFD_RELOC_8_BASEREL, nkeynes@362: BFD_RELOC_RVA, nkeynes@362: nkeynes@362: /* Absolute 8-bit relocation, but used to form an address like 0xFFnn. */ nkeynes@362: BFD_RELOC_8_FFnn, nkeynes@362: nkeynes@362: /* These PC-relative relocations are stored as word displacements -- nkeynes@362: i.e., byte displacements shifted right two bits. The 30-bit word nkeynes@362: displacement (<<32_PCREL_S2>> -- 32 bits, shifted 2) is used on the nkeynes@362: SPARC. (SPARC tools generally refer to this as <>.) The nkeynes@362: signed 16-bit displacement is used on the MIPS, and the 23-bit nkeynes@362: displacement is used on the Alpha. */ nkeynes@362: BFD_RELOC_32_PCREL_S2, nkeynes@362: BFD_RELOC_16_PCREL_S2, nkeynes@362: BFD_RELOC_23_PCREL_S2, nkeynes@362: nkeynes@362: /* High 22 bits and low 10 bits of 32-bit value, placed into lower bits of nkeynes@362: the target word. These are used on the SPARC. */ nkeynes@362: BFD_RELOC_HI22, nkeynes@362: BFD_RELOC_LO10, nkeynes@362: nkeynes@362: /* For systems that allocate a Global Pointer register, these are nkeynes@362: displacements off that register. These relocation types are nkeynes@362: handled specially, because the value the register will have is nkeynes@362: decided relatively late. */ nkeynes@362: BFD_RELOC_GPREL16, nkeynes@362: BFD_RELOC_GPREL32, nkeynes@362: nkeynes@362: /* Reloc types used for i960/b.out. */ nkeynes@362: BFD_RELOC_I960_CALLJ, nkeynes@362: nkeynes@362: /* SPARC ELF relocations. There is probably some overlap with other nkeynes@362: relocation types already defined. */ nkeynes@362: BFD_RELOC_NONE, nkeynes@362: BFD_RELOC_SPARC_WDISP22, nkeynes@362: BFD_RELOC_SPARC22, nkeynes@362: BFD_RELOC_SPARC13, nkeynes@362: BFD_RELOC_SPARC_GOT10, nkeynes@362: BFD_RELOC_SPARC_GOT13, nkeynes@362: BFD_RELOC_SPARC_GOT22, nkeynes@362: BFD_RELOC_SPARC_PC10, nkeynes@362: BFD_RELOC_SPARC_PC22, nkeynes@362: BFD_RELOC_SPARC_WPLT30, nkeynes@362: BFD_RELOC_SPARC_COPY, nkeynes@362: BFD_RELOC_SPARC_GLOB_DAT, nkeynes@362: BFD_RELOC_SPARC_JMP_SLOT, nkeynes@362: BFD_RELOC_SPARC_RELATIVE, nkeynes@362: BFD_RELOC_SPARC_UA16, nkeynes@362: BFD_RELOC_SPARC_UA32, nkeynes@362: BFD_RELOC_SPARC_UA64, nkeynes@362: nkeynes@362: /* I think these are specific to SPARC a.out (e.g., Sun 4). */ nkeynes@362: BFD_RELOC_SPARC_BASE13, nkeynes@362: BFD_RELOC_SPARC_BASE22, nkeynes@362: nkeynes@362: /* SPARC64 relocations */ nkeynes@362: #define BFD_RELOC_SPARC_64 BFD_RELOC_64 nkeynes@362: BFD_RELOC_SPARC_10, nkeynes@362: BFD_RELOC_SPARC_11, nkeynes@362: BFD_RELOC_SPARC_OLO10, nkeynes@362: BFD_RELOC_SPARC_HH22, nkeynes@362: BFD_RELOC_SPARC_HM10, nkeynes@362: BFD_RELOC_SPARC_LM22, nkeynes@362: BFD_RELOC_SPARC_PC_HH22, nkeynes@362: BFD_RELOC_SPARC_PC_HM10, nkeynes@362: BFD_RELOC_SPARC_PC_LM22, nkeynes@362: BFD_RELOC_SPARC_WDISP16, nkeynes@362: BFD_RELOC_SPARC_WDISP19, nkeynes@362: BFD_RELOC_SPARC_7, nkeynes@362: BFD_RELOC_SPARC_6, nkeynes@362: BFD_RELOC_SPARC_5, nkeynes@362: #define BFD_RELOC_SPARC_DISP64 BFD_RELOC_64_PCREL nkeynes@362: BFD_RELOC_SPARC_PLT32, nkeynes@362: BFD_RELOC_SPARC_PLT64, nkeynes@362: BFD_RELOC_SPARC_HIX22, nkeynes@362: BFD_RELOC_SPARC_LOX10, nkeynes@362: BFD_RELOC_SPARC_H44, nkeynes@362: BFD_RELOC_SPARC_M44, nkeynes@362: BFD_RELOC_SPARC_L44, nkeynes@362: BFD_RELOC_SPARC_REGISTER, nkeynes@362: nkeynes@362: /* SPARC little endian relocation */ nkeynes@362: BFD_RELOC_SPARC_REV32, nkeynes@362: nkeynes@362: /* SPARC TLS relocations */ nkeynes@362: BFD_RELOC_SPARC_TLS_GD_HI22, nkeynes@362: BFD_RELOC_SPARC_TLS_GD_LO10, nkeynes@362: BFD_RELOC_SPARC_TLS_GD_ADD, nkeynes@362: BFD_RELOC_SPARC_TLS_GD_CALL, nkeynes@362: BFD_RELOC_SPARC_TLS_LDM_HI22, nkeynes@362: BFD_RELOC_SPARC_TLS_LDM_LO10, nkeynes@362: BFD_RELOC_SPARC_TLS_LDM_ADD, nkeynes@362: BFD_RELOC_SPARC_TLS_LDM_CALL, nkeynes@362: BFD_RELOC_SPARC_TLS_LDO_HIX22, nkeynes@362: BFD_RELOC_SPARC_TLS_LDO_LOX10, nkeynes@362: BFD_RELOC_SPARC_TLS_LDO_ADD, nkeynes@362: BFD_RELOC_SPARC_TLS_IE_HI22, nkeynes@362: BFD_RELOC_SPARC_TLS_IE_LO10, nkeynes@362: BFD_RELOC_SPARC_TLS_IE_LD, nkeynes@362: BFD_RELOC_SPARC_TLS_IE_LDX, nkeynes@362: BFD_RELOC_SPARC_TLS_IE_ADD, nkeynes@362: BFD_RELOC_SPARC_TLS_LE_HIX22, nkeynes@362: BFD_RELOC_SPARC_TLS_LE_LOX10, nkeynes@362: BFD_RELOC_SPARC_TLS_DTPMOD32, nkeynes@362: BFD_RELOC_SPARC_TLS_DTPMOD64, nkeynes@362: BFD_RELOC_SPARC_TLS_DTPOFF32, nkeynes@362: BFD_RELOC_SPARC_TLS_DTPOFF64, nkeynes@362: BFD_RELOC_SPARC_TLS_TPOFF32, nkeynes@362: BFD_RELOC_SPARC_TLS_TPOFF64, nkeynes@362: nkeynes@362: /* Alpha ECOFF and ELF relocations. Some of these treat the symbol or nkeynes@362: "addend" in some special way. nkeynes@362: For GPDISP_HI16 ("gpdisp") relocations, the symbol is ignored when nkeynes@362: writing; when reading, it will be the absolute section symbol. The nkeynes@362: addend is the displacement in bytes of the "lda" instruction from nkeynes@362: the "ldah" instruction (which is at the address of this reloc). */ nkeynes@362: BFD_RELOC_ALPHA_GPDISP_HI16, nkeynes@362: nkeynes@362: /* For GPDISP_LO16 ("ignore") relocations, the symbol is handled as nkeynes@362: with GPDISP_HI16 relocs. The addend is ignored when writing the nkeynes@362: relocations out, and is filled in with the file's GP value on nkeynes@362: reading, for convenience. */ nkeynes@362: BFD_RELOC_ALPHA_GPDISP_LO16, nkeynes@362: nkeynes@362: /* The ELF GPDISP relocation is exactly the same as the GPDISP_HI16 nkeynes@362: relocation except that there is no accompanying GPDISP_LO16 nkeynes@362: relocation. */ nkeynes@362: BFD_RELOC_ALPHA_GPDISP, nkeynes@362: nkeynes@362: /* The Alpha LITERAL/LITUSE relocs are produced by a symbol reference; nkeynes@362: the assembler turns it into a LDQ instruction to load the address of nkeynes@362: the symbol, and then fills in a register in the real instruction. nkeynes@362: nkeynes@362: The LITERAL reloc, at the LDQ instruction, refers to the .lita nkeynes@362: section symbol. The addend is ignored when writing, but is filled nkeynes@362: in with the file's GP value on reading, for convenience, as with the nkeynes@362: GPDISP_LO16 reloc. nkeynes@362: nkeynes@362: The ELF_LITERAL reloc is somewhere between 16_GOTOFF and GPDISP_LO16. nkeynes@362: It should refer to the symbol to be referenced, as with 16_GOTOFF, nkeynes@362: but it generates output not based on the position within the .got nkeynes@362: section, but relative to the GP value chosen for the file during the nkeynes@362: final link stage. nkeynes@362: nkeynes@362: The LITUSE reloc, on the instruction using the loaded address, gives nkeynes@362: information to the linker that it might be able to use to optimize nkeynes@362: away some literal section references. The symbol is ignored (read nkeynes@362: as the absolute section symbol), and the "addend" indicates the type nkeynes@362: of instruction using the register: nkeynes@362: 1 - "memory" fmt insn nkeynes@362: 2 - byte-manipulation (byte offset reg) nkeynes@362: 3 - jsr (target of branch) */ nkeynes@362: BFD_RELOC_ALPHA_LITERAL, nkeynes@362: BFD_RELOC_ALPHA_ELF_LITERAL, nkeynes@362: BFD_RELOC_ALPHA_LITUSE, nkeynes@362: nkeynes@362: /* The HINT relocation indicates a value that should be filled into the nkeynes@362: "hint" field of a jmp/jsr/ret instruction, for possible branch- nkeynes@362: prediction logic which may be provided on some processors. */ nkeynes@362: BFD_RELOC_ALPHA_HINT, nkeynes@362: nkeynes@362: /* The LINKAGE relocation outputs a linkage pair in the object file, nkeynes@362: which is filled by the linker. */ nkeynes@362: BFD_RELOC_ALPHA_LINKAGE, nkeynes@362: nkeynes@362: /* The CODEADDR relocation outputs a STO_CA in the object file, nkeynes@362: which is filled by the linker. */ nkeynes@362: BFD_RELOC_ALPHA_CODEADDR, nkeynes@362: nkeynes@362: /* The GPREL_HI/LO relocations together form a 32-bit offset from the nkeynes@362: GP register. */ nkeynes@362: BFD_RELOC_ALPHA_GPREL_HI16, nkeynes@362: BFD_RELOC_ALPHA_GPREL_LO16, nkeynes@362: nkeynes@362: /* Like BFD_RELOC_23_PCREL_S2, except that the source and target must nkeynes@362: share a common GP, and the target address is adjusted for nkeynes@362: STO_ALPHA_STD_GPLOAD. */ nkeynes@362: BFD_RELOC_ALPHA_BRSGP, nkeynes@362: nkeynes@362: /* Alpha thread-local storage relocations. */ nkeynes@362: BFD_RELOC_ALPHA_TLSGD, nkeynes@362: BFD_RELOC_ALPHA_TLSLDM, nkeynes@362: BFD_RELOC_ALPHA_DTPMOD64, nkeynes@362: BFD_RELOC_ALPHA_GOTDTPREL16, nkeynes@362: BFD_RELOC_ALPHA_DTPREL64, nkeynes@362: BFD_RELOC_ALPHA_DTPREL_HI16, nkeynes@362: BFD_RELOC_ALPHA_DTPREL_LO16, nkeynes@362: BFD_RELOC_ALPHA_DTPREL16, nkeynes@362: BFD_RELOC_ALPHA_GOTTPREL16, nkeynes@362: BFD_RELOC_ALPHA_TPREL64, nkeynes@362: BFD_RELOC_ALPHA_TPREL_HI16, nkeynes@362: BFD_RELOC_ALPHA_TPREL_LO16, nkeynes@362: BFD_RELOC_ALPHA_TPREL16, nkeynes@362: nkeynes@362: /* Bits 27..2 of the relocation address shifted right 2 bits; nkeynes@362: simple reloc otherwise. */ nkeynes@362: BFD_RELOC_MIPS_JMP, nkeynes@362: nkeynes@362: /* The MIPS16 jump instruction. */ nkeynes@362: BFD_RELOC_MIPS16_JMP, nkeynes@362: nkeynes@362: /* MIPS16 GP relative reloc. */ nkeynes@362: BFD_RELOC_MIPS16_GPREL, nkeynes@362: nkeynes@362: /* High 16 bits of 32-bit value; simple reloc. */ nkeynes@362: BFD_RELOC_HI16, nkeynes@362: nkeynes@362: /* High 16 bits of 32-bit value but the low 16 bits will be sign nkeynes@362: extended and added to form the final result. If the low 16 nkeynes@362: bits form a negative number, we need to add one to the high value nkeynes@362: to compensate for the borrow when the low bits are added. */ nkeynes@362: BFD_RELOC_HI16_S, nkeynes@362: nkeynes@362: /* Low 16 bits. */ nkeynes@362: BFD_RELOC_LO16, nkeynes@362: nkeynes@362: /* MIPS16 high 16 bits of 32-bit value. */ nkeynes@362: BFD_RELOC_MIPS16_HI16, nkeynes@362: nkeynes@362: /* MIPS16 high 16 bits of 32-bit value but the low 16 bits will be sign nkeynes@362: extended and added to form the final result. If the low 16 nkeynes@362: bits form a negative number, we need to add one to the high value nkeynes@362: to compensate for the borrow when the low bits are added. */ nkeynes@362: BFD_RELOC_MIPS16_HI16_S, nkeynes@362: nkeynes@362: /* MIPS16 low 16 bits. */ nkeynes@362: BFD_RELOC_MIPS16_LO16, nkeynes@362: nkeynes@362: /* Relocation against a MIPS literal section. */ nkeynes@362: BFD_RELOC_MIPS_LITERAL, nkeynes@362: nkeynes@362: /* MIPS ELF relocations. */ nkeynes@362: BFD_RELOC_MIPS_GOT16, nkeynes@362: BFD_RELOC_MIPS_CALL16, nkeynes@362: BFD_RELOC_MIPS_GOT_HI16, nkeynes@362: BFD_RELOC_MIPS_GOT_LO16, nkeynes@362: BFD_RELOC_MIPS_CALL_HI16, nkeynes@362: BFD_RELOC_MIPS_CALL_LO16, nkeynes@362: BFD_RELOC_MIPS_SUB, nkeynes@362: BFD_RELOC_MIPS_GOT_PAGE, nkeynes@362: BFD_RELOC_MIPS_GOT_OFST, nkeynes@362: BFD_RELOC_MIPS_GOT_DISP, nkeynes@362: BFD_RELOC_MIPS_SHIFT5, nkeynes@362: BFD_RELOC_MIPS_SHIFT6, nkeynes@362: BFD_RELOC_MIPS_INSERT_A, nkeynes@362: BFD_RELOC_MIPS_INSERT_B, nkeynes@362: BFD_RELOC_MIPS_DELETE, nkeynes@362: BFD_RELOC_MIPS_HIGHEST, nkeynes@362: BFD_RELOC_MIPS_HIGHER, nkeynes@362: BFD_RELOC_MIPS_SCN_DISP, nkeynes@362: BFD_RELOC_MIPS_REL16, nkeynes@362: BFD_RELOC_MIPS_RELGOT, nkeynes@362: BFD_RELOC_MIPS_JALR, nkeynes@362: BFD_RELOC_MIPS_TLS_DTPMOD32, nkeynes@362: BFD_RELOC_MIPS_TLS_DTPREL32, nkeynes@362: BFD_RELOC_MIPS_TLS_DTPMOD64, nkeynes@362: BFD_RELOC_MIPS_TLS_DTPREL64, nkeynes@362: BFD_RELOC_MIPS_TLS_GD, nkeynes@362: BFD_RELOC_MIPS_TLS_LDM, nkeynes@362: BFD_RELOC_MIPS_TLS_DTPREL_HI16, nkeynes@362: BFD_RELOC_MIPS_TLS_DTPREL_LO16, nkeynes@362: BFD_RELOC_MIPS_TLS_GOTTPREL, nkeynes@362: BFD_RELOC_MIPS_TLS_TPREL32, nkeynes@362: BFD_RELOC_MIPS_TLS_TPREL64, nkeynes@362: BFD_RELOC_MIPS_TLS_TPREL_HI16, nkeynes@362: BFD_RELOC_MIPS_TLS_TPREL_LO16, nkeynes@362: nkeynes@362: nkeynes@362: /* Fujitsu Frv Relocations. */ nkeynes@362: BFD_RELOC_FRV_LABEL16, nkeynes@362: BFD_RELOC_FRV_LABEL24, nkeynes@362: BFD_RELOC_FRV_LO16, nkeynes@362: BFD_RELOC_FRV_HI16, nkeynes@362: BFD_RELOC_FRV_GPREL12, nkeynes@362: BFD_RELOC_FRV_GPRELU12, nkeynes@362: BFD_RELOC_FRV_GPREL32, nkeynes@362: BFD_RELOC_FRV_GPRELHI, nkeynes@362: BFD_RELOC_FRV_GPRELLO, nkeynes@362: BFD_RELOC_FRV_GOT12, nkeynes@362: BFD_RELOC_FRV_GOTHI, nkeynes@362: BFD_RELOC_FRV_GOTLO, nkeynes@362: BFD_RELOC_FRV_FUNCDESC, nkeynes@362: BFD_RELOC_FRV_FUNCDESC_GOT12, nkeynes@362: BFD_RELOC_FRV_FUNCDESC_GOTHI, nkeynes@362: BFD_RELOC_FRV_FUNCDESC_GOTLO, nkeynes@362: BFD_RELOC_FRV_FUNCDESC_VALUE, nkeynes@362: BFD_RELOC_FRV_FUNCDESC_GOTOFF12, nkeynes@362: BFD_RELOC_FRV_FUNCDESC_GOTOFFHI, nkeynes@362: BFD_RELOC_FRV_FUNCDESC_GOTOFFLO, nkeynes@362: BFD_RELOC_FRV_GOTOFF12, nkeynes@362: BFD_RELOC_FRV_GOTOFFHI, nkeynes@362: BFD_RELOC_FRV_GOTOFFLO, nkeynes@362: BFD_RELOC_FRV_GETTLSOFF, nkeynes@362: BFD_RELOC_FRV_TLSDESC_VALUE, nkeynes@362: BFD_RELOC_FRV_GOTTLSDESC12, nkeynes@362: BFD_RELOC_FRV_GOTTLSDESCHI, nkeynes@362: BFD_RELOC_FRV_GOTTLSDESCLO, nkeynes@362: BFD_RELOC_FRV_TLSMOFF12, nkeynes@362: BFD_RELOC_FRV_TLSMOFFHI, nkeynes@362: BFD_RELOC_FRV_TLSMOFFLO, nkeynes@362: BFD_RELOC_FRV_GOTTLSOFF12, nkeynes@362: BFD_RELOC_FRV_GOTTLSOFFHI, nkeynes@362: BFD_RELOC_FRV_GOTTLSOFFLO, nkeynes@362: BFD_RELOC_FRV_TLSOFF, nkeynes@362: BFD_RELOC_FRV_TLSDESC_RELAX, nkeynes@362: BFD_RELOC_FRV_GETTLSOFF_RELAX, nkeynes@362: BFD_RELOC_FRV_TLSOFF_RELAX, nkeynes@362: BFD_RELOC_FRV_TLSMOFF, nkeynes@362: nkeynes@362: nkeynes@362: /* This is a 24bit GOT-relative reloc for the mn10300. */ nkeynes@362: BFD_RELOC_MN10300_GOTOFF24, nkeynes@362: nkeynes@362: /* This is a 32bit GOT-relative reloc for the mn10300, offset by two bytes nkeynes@362: in the instruction. */ nkeynes@362: BFD_RELOC_MN10300_GOT32, nkeynes@362: nkeynes@362: /* This is a 24bit GOT-relative reloc for the mn10300, offset by two bytes nkeynes@362: in the instruction. */ nkeynes@362: BFD_RELOC_MN10300_GOT24, nkeynes@362: nkeynes@362: /* This is a 16bit GOT-relative reloc for the mn10300, offset by two bytes nkeynes@362: in the instruction. */ nkeynes@362: BFD_RELOC_MN10300_GOT16, nkeynes@362: nkeynes@362: /* Copy symbol at runtime. */ nkeynes@362: BFD_RELOC_MN10300_COPY, nkeynes@362: nkeynes@362: /* Create GOT entry. */ nkeynes@362: BFD_RELOC_MN10300_GLOB_DAT, nkeynes@362: nkeynes@362: /* Create PLT entry. */ nkeynes@362: BFD_RELOC_MN10300_JMP_SLOT, nkeynes@362: nkeynes@362: /* Adjust by program base. */ nkeynes@362: BFD_RELOC_MN10300_RELATIVE, nkeynes@362: nkeynes@362: nkeynes@362: /* i386/elf relocations */ nkeynes@362: BFD_RELOC_386_GOT32, nkeynes@362: BFD_RELOC_386_PLT32, nkeynes@362: BFD_RELOC_386_COPY, nkeynes@362: BFD_RELOC_386_GLOB_DAT, nkeynes@362: BFD_RELOC_386_JUMP_SLOT, nkeynes@362: BFD_RELOC_386_RELATIVE, nkeynes@362: BFD_RELOC_386_GOTOFF, nkeynes@362: BFD_RELOC_386_GOTPC, nkeynes@362: BFD_RELOC_386_TLS_TPOFF, nkeynes@362: BFD_RELOC_386_TLS_IE, nkeynes@362: BFD_RELOC_386_TLS_GOTIE, nkeynes@362: BFD_RELOC_386_TLS_LE, nkeynes@362: BFD_RELOC_386_TLS_GD, nkeynes@362: BFD_RELOC_386_TLS_LDM, nkeynes@362: BFD_RELOC_386_TLS_LDO_32, nkeynes@362: BFD_RELOC_386_TLS_IE_32, nkeynes@362: BFD_RELOC_386_TLS_LE_32, nkeynes@362: BFD_RELOC_386_TLS_DTPMOD32, nkeynes@362: BFD_RELOC_386_TLS_DTPOFF32, nkeynes@362: BFD_RELOC_386_TLS_TPOFF32, nkeynes@362: nkeynes@362: /* x86-64/elf relocations */ nkeynes@362: BFD_RELOC_X86_64_GOT32, nkeynes@362: BFD_RELOC_X86_64_PLT32, nkeynes@362: BFD_RELOC_X86_64_COPY, nkeynes@362: BFD_RELOC_X86_64_GLOB_DAT, nkeynes@362: BFD_RELOC_X86_64_JUMP_SLOT, nkeynes@362: BFD_RELOC_X86_64_RELATIVE, nkeynes@362: BFD_RELOC_X86_64_GOTPCREL, nkeynes@362: BFD_RELOC_X86_64_32S, nkeynes@362: BFD_RELOC_X86_64_DTPMOD64, nkeynes@362: BFD_RELOC_X86_64_DTPOFF64, nkeynes@362: BFD_RELOC_X86_64_TPOFF64, nkeynes@362: BFD_RELOC_X86_64_TLSGD, nkeynes@362: BFD_RELOC_X86_64_TLSLD, nkeynes@362: BFD_RELOC_X86_64_DTPOFF32, nkeynes@362: BFD_RELOC_X86_64_GOTTPOFF, nkeynes@362: BFD_RELOC_X86_64_TPOFF32, nkeynes@362: nkeynes@362: /* ns32k relocations */ nkeynes@362: BFD_RELOC_NS32K_IMM_8, nkeynes@362: BFD_RELOC_NS32K_IMM_16, nkeynes@362: BFD_RELOC_NS32K_IMM_32, nkeynes@362: BFD_RELOC_NS32K_IMM_8_PCREL, nkeynes@362: BFD_RELOC_NS32K_IMM_16_PCREL, nkeynes@362: BFD_RELOC_NS32K_IMM_32_PCREL, nkeynes@362: BFD_RELOC_NS32K_DISP_8, nkeynes@362: BFD_RELOC_NS32K_DISP_16, nkeynes@362: BFD_RELOC_NS32K_DISP_32, nkeynes@362: BFD_RELOC_NS32K_DISP_8_PCREL, nkeynes@362: BFD_RELOC_NS32K_DISP_16_PCREL, nkeynes@362: BFD_RELOC_NS32K_DISP_32_PCREL, nkeynes@362: nkeynes@362: /* PDP11 relocations */ nkeynes@362: BFD_RELOC_PDP11_DISP_8_PCREL, nkeynes@362: BFD_RELOC_PDP11_DISP_6_PCREL, nkeynes@362: nkeynes@362: /* Picojava relocs. Not all of these appear in object files. */ nkeynes@362: BFD_RELOC_PJ_CODE_HI16, nkeynes@362: BFD_RELOC_PJ_CODE_LO16, nkeynes@362: BFD_RELOC_PJ_CODE_DIR16, nkeynes@362: BFD_RELOC_PJ_CODE_DIR32, nkeynes@362: BFD_RELOC_PJ_CODE_REL16, nkeynes@362: BFD_RELOC_PJ_CODE_REL32, nkeynes@362: nkeynes@362: /* Power(rs6000) and PowerPC relocations. */ nkeynes@362: BFD_RELOC_PPC_B26, nkeynes@362: BFD_RELOC_PPC_BA26, nkeynes@362: BFD_RELOC_PPC_TOC16, nkeynes@362: BFD_RELOC_PPC_B16, nkeynes@362: BFD_RELOC_PPC_B16_BRTAKEN, nkeynes@362: BFD_RELOC_PPC_B16_BRNTAKEN, nkeynes@362: BFD_RELOC_PPC_BA16, nkeynes@362: BFD_RELOC_PPC_BA16_BRTAKEN, nkeynes@362: BFD_RELOC_PPC_BA16_BRNTAKEN, nkeynes@362: BFD_RELOC_PPC_COPY, nkeynes@362: BFD_RELOC_PPC_GLOB_DAT, nkeynes@362: BFD_RELOC_PPC_JMP_SLOT, nkeynes@362: BFD_RELOC_PPC_RELATIVE, nkeynes@362: BFD_RELOC_PPC_LOCAL24PC, nkeynes@362: BFD_RELOC_PPC_EMB_NADDR32, nkeynes@362: BFD_RELOC_PPC_EMB_NADDR16, nkeynes@362: BFD_RELOC_PPC_EMB_NADDR16_LO, nkeynes@362: BFD_RELOC_PPC_EMB_NADDR16_HI, nkeynes@362: BFD_RELOC_PPC_EMB_NADDR16_HA, nkeynes@362: BFD_RELOC_PPC_EMB_SDAI16, nkeynes@362: BFD_RELOC_PPC_EMB_SDA2I16, nkeynes@362: BFD_RELOC_PPC_EMB_SDA2REL, nkeynes@362: BFD_RELOC_PPC_EMB_SDA21, nkeynes@362: BFD_RELOC_PPC_EMB_MRKREF, nkeynes@362: BFD_RELOC_PPC_EMB_RELSEC16, nkeynes@362: BFD_RELOC_PPC_EMB_RELST_LO, nkeynes@362: BFD_RELOC_PPC_EMB_RELST_HI, nkeynes@362: BFD_RELOC_PPC_EMB_RELST_HA, nkeynes@362: BFD_RELOC_PPC_EMB_BIT_FLD, nkeynes@362: BFD_RELOC_PPC_EMB_RELSDA, nkeynes@362: BFD_RELOC_PPC64_HIGHER, nkeynes@362: BFD_RELOC_PPC64_HIGHER_S, nkeynes@362: BFD_RELOC_PPC64_HIGHEST, nkeynes@362: BFD_RELOC_PPC64_HIGHEST_S, nkeynes@362: BFD_RELOC_PPC64_TOC16_LO, nkeynes@362: BFD_RELOC_PPC64_TOC16_HI, nkeynes@362: BFD_RELOC_PPC64_TOC16_HA, nkeynes@362: BFD_RELOC_PPC64_TOC, nkeynes@362: BFD_RELOC_PPC64_PLTGOT16, nkeynes@362: BFD_RELOC_PPC64_PLTGOT16_LO, nkeynes@362: BFD_RELOC_PPC64_PLTGOT16_HI, nkeynes@362: BFD_RELOC_PPC64_PLTGOT16_HA, nkeynes@362: BFD_RELOC_PPC64_ADDR16_DS, nkeynes@362: BFD_RELOC_PPC64_ADDR16_LO_DS, nkeynes@362: BFD_RELOC_PPC64_GOT16_DS, nkeynes@362: BFD_RELOC_PPC64_GOT16_LO_DS, nkeynes@362: BFD_RELOC_PPC64_PLT16_LO_DS, nkeynes@362: BFD_RELOC_PPC64_SECTOFF_DS, nkeynes@362: BFD_RELOC_PPC64_SECTOFF_LO_DS, nkeynes@362: BFD_RELOC_PPC64_TOC16_DS, nkeynes@362: BFD_RELOC_PPC64_TOC16_LO_DS, nkeynes@362: BFD_RELOC_PPC64_PLTGOT16_DS, nkeynes@362: BFD_RELOC_PPC64_PLTGOT16_LO_DS, nkeynes@362: nkeynes@362: /* PowerPC and PowerPC64 thread-local storage relocations. */ nkeynes@362: BFD_RELOC_PPC_TLS, nkeynes@362: BFD_RELOC_PPC_DTPMOD, nkeynes@362: BFD_RELOC_PPC_TPREL16, nkeynes@362: BFD_RELOC_PPC_TPREL16_LO, nkeynes@362: BFD_RELOC_PPC_TPREL16_HI, nkeynes@362: BFD_RELOC_PPC_TPREL16_HA, nkeynes@362: BFD_RELOC_PPC_TPREL, nkeynes@362: BFD_RELOC_PPC_DTPREL16, nkeynes@362: BFD_RELOC_PPC_DTPREL16_LO, nkeynes@362: BFD_RELOC_PPC_DTPREL16_HI, nkeynes@362: BFD_RELOC_PPC_DTPREL16_HA, nkeynes@362: BFD_RELOC_PPC_DTPREL, nkeynes@362: BFD_RELOC_PPC_GOT_TLSGD16, nkeynes@362: BFD_RELOC_PPC_GOT_TLSGD16_LO, nkeynes@362: BFD_RELOC_PPC_GOT_TLSGD16_HI, nkeynes@362: BFD_RELOC_PPC_GOT_TLSGD16_HA, nkeynes@362: BFD_RELOC_PPC_GOT_TLSLD16, nkeynes@362: BFD_RELOC_PPC_GOT_TLSLD16_LO, nkeynes@362: BFD_RELOC_PPC_GOT_TLSLD16_HI, nkeynes@362: BFD_RELOC_PPC_GOT_TLSLD16_HA, nkeynes@362: BFD_RELOC_PPC_GOT_TPREL16, nkeynes@362: BFD_RELOC_PPC_GOT_TPREL16_LO, nkeynes@362: BFD_RELOC_PPC_GOT_TPREL16_HI, nkeynes@362: BFD_RELOC_PPC_GOT_TPREL16_HA, nkeynes@362: BFD_RELOC_PPC_GOT_DTPREL16, nkeynes@362: BFD_RELOC_PPC_GOT_DTPREL16_LO, nkeynes@362: BFD_RELOC_PPC_GOT_DTPREL16_HI, nkeynes@362: BFD_RELOC_PPC_GOT_DTPREL16_HA, nkeynes@362: BFD_RELOC_PPC64_TPREL16_DS, nkeynes@362: BFD_RELOC_PPC64_TPREL16_LO_DS, nkeynes@362: BFD_RELOC_PPC64_TPREL16_HIGHER, nkeynes@362: BFD_RELOC_PPC64_TPREL16_HIGHERA, nkeynes@362: BFD_RELOC_PPC64_TPREL16_HIGHEST, nkeynes@362: BFD_RELOC_PPC64_TPREL16_HIGHESTA, nkeynes@362: BFD_RELOC_PPC64_DTPREL16_DS, nkeynes@362: BFD_RELOC_PPC64_DTPREL16_LO_DS, nkeynes@362: BFD_RELOC_PPC64_DTPREL16_HIGHER, nkeynes@362: BFD_RELOC_PPC64_DTPREL16_HIGHERA, nkeynes@362: BFD_RELOC_PPC64_DTPREL16_HIGHEST, nkeynes@362: BFD_RELOC_PPC64_DTPREL16_HIGHESTA, nkeynes@362: nkeynes@362: /* IBM 370/390 relocations */ nkeynes@362: BFD_RELOC_I370_D12, nkeynes@362: nkeynes@362: /* The type of reloc used to build a constructor table - at the moment nkeynes@362: probably a 32 bit wide absolute relocation, but the target can choose. nkeynes@362: It generally does map to one of the other relocation types. */ nkeynes@362: BFD_RELOC_CTOR, nkeynes@362: nkeynes@362: /* ARM 26 bit pc-relative branch. The lowest two bits must be zero and are nkeynes@362: not stored in the instruction. */ nkeynes@362: BFD_RELOC_ARM_PCREL_BRANCH, nkeynes@362: nkeynes@362: /* ARM 26 bit pc-relative branch. The lowest bit must be zero and is nkeynes@362: not stored in the instruction. The 2nd lowest bit comes from a 1 bit nkeynes@362: field in the instruction. */ nkeynes@362: BFD_RELOC_ARM_PCREL_BLX, nkeynes@362: nkeynes@362: /* Thumb 22 bit pc-relative branch. The lowest bit must be zero and is nkeynes@362: not stored in the instruction. The 2nd lowest bit comes from a 1 bit nkeynes@362: field in the instruction. */ nkeynes@362: BFD_RELOC_THUMB_PCREL_BLX, nkeynes@362: nkeynes@362: /* These relocs are only used within the ARM assembler. They are not nkeynes@362: (at present) written to any object files. */ nkeynes@362: BFD_RELOC_ARM_IMMEDIATE, nkeynes@362: BFD_RELOC_ARM_ADRL_IMMEDIATE, nkeynes@362: BFD_RELOC_ARM_OFFSET_IMM, nkeynes@362: BFD_RELOC_ARM_SHIFT_IMM, nkeynes@362: BFD_RELOC_ARM_SMI, nkeynes@362: BFD_RELOC_ARM_SWI, nkeynes@362: BFD_RELOC_ARM_MULTI, nkeynes@362: BFD_RELOC_ARM_CP_OFF_IMM, nkeynes@362: BFD_RELOC_ARM_CP_OFF_IMM_S2, nkeynes@362: BFD_RELOC_ARM_ADR_IMM, nkeynes@362: BFD_RELOC_ARM_LDR_IMM, nkeynes@362: BFD_RELOC_ARM_LITERAL, nkeynes@362: BFD_RELOC_ARM_IN_POOL, nkeynes@362: BFD_RELOC_ARM_OFFSET_IMM8, nkeynes@362: BFD_RELOC_ARM_HWLITERAL, nkeynes@362: BFD_RELOC_ARM_THUMB_ADD, nkeynes@362: BFD_RELOC_ARM_THUMB_IMM, nkeynes@362: BFD_RELOC_ARM_THUMB_SHIFT, nkeynes@362: BFD_RELOC_ARM_THUMB_OFFSET, nkeynes@362: BFD_RELOC_ARM_GOT12, nkeynes@362: BFD_RELOC_ARM_GOT32, nkeynes@362: BFD_RELOC_ARM_JUMP_SLOT, nkeynes@362: BFD_RELOC_ARM_COPY, nkeynes@362: BFD_RELOC_ARM_GLOB_DAT, nkeynes@362: BFD_RELOC_ARM_PLT32, nkeynes@362: BFD_RELOC_ARM_RELATIVE, nkeynes@362: BFD_RELOC_ARM_GOTOFF, nkeynes@362: BFD_RELOC_ARM_GOTPC, nkeynes@362: nkeynes@362: /* Pc-relative or absolute relocation depending on target. Used for nkeynes@362: entries in .init_array sections. */ nkeynes@362: BFD_RELOC_ARM_TARGET1, nkeynes@362: nkeynes@362: /* Read-only segment base relative address. */ nkeynes@362: BFD_RELOC_ARM_ROSEGREL32, nkeynes@362: nkeynes@362: /* Data segment base relative address. */ nkeynes@362: BFD_RELOC_ARM_SBREL32, nkeynes@362: nkeynes@362: /* This reloc is used for References to RTTI dta from exception handling nkeynes@362: tables. The actual definition depends on the target. It may be a nkeynes@362: pc-relative or some form of GOT-indirect relocation. */ nkeynes@362: BFD_RELOC_ARM_TARGET2, nkeynes@362: nkeynes@362: /* 31-bit PC relative address. */ nkeynes@362: BFD_RELOC_ARM_PREL31, nkeynes@362: nkeynes@362: /* Renesas / SuperH SH relocs. Not all of these appear in object files. */ nkeynes@362: BFD_RELOC_SH_PCDISP8BY2, nkeynes@362: BFD_RELOC_SH_PCDISP12BY2, nkeynes@362: BFD_RELOC_SH_IMM3, nkeynes@362: BFD_RELOC_SH_IMM3U, nkeynes@362: BFD_RELOC_SH_DISP12, nkeynes@362: BFD_RELOC_SH_DISP12BY2, nkeynes@362: BFD_RELOC_SH_DISP12BY4, nkeynes@362: BFD_RELOC_SH_DISP12BY8, nkeynes@362: BFD_RELOC_SH_DISP20, nkeynes@362: BFD_RELOC_SH_DISP20BY8, nkeynes@362: BFD_RELOC_SH_IMM4, nkeynes@362: BFD_RELOC_SH_IMM4BY2, nkeynes@362: BFD_RELOC_SH_IMM4BY4, nkeynes@362: BFD_RELOC_SH_IMM8, nkeynes@362: BFD_RELOC_SH_IMM8BY2, nkeynes@362: BFD_RELOC_SH_IMM8BY4, nkeynes@362: BFD_RELOC_SH_PCRELIMM8BY2, nkeynes@362: BFD_RELOC_SH_PCRELIMM8BY4, nkeynes@362: BFD_RELOC_SH_SWITCH16, nkeynes@362: BFD_RELOC_SH_SWITCH32, nkeynes@362: BFD_RELOC_SH_USES, nkeynes@362: BFD_RELOC_SH_COUNT, nkeynes@362: BFD_RELOC_SH_ALIGN, nkeynes@362: BFD_RELOC_SH_CODE, nkeynes@362: BFD_RELOC_SH_DATA, nkeynes@362: BFD_RELOC_SH_LABEL, nkeynes@362: BFD_RELOC_SH_LOOP_START, nkeynes@362: BFD_RELOC_SH_LOOP_END, nkeynes@362: BFD_RELOC_SH_COPY, nkeynes@362: BFD_RELOC_SH_GLOB_DAT, nkeynes@362: BFD_RELOC_SH_JMP_SLOT, nkeynes@362: BFD_RELOC_SH_RELATIVE, nkeynes@362: BFD_RELOC_SH_GOTPC, nkeynes@362: BFD_RELOC_SH_GOT_LOW16, nkeynes@362: BFD_RELOC_SH_GOT_MEDLOW16, nkeynes@362: BFD_RELOC_SH_GOT_MEDHI16, nkeynes@362: BFD_RELOC_SH_GOT_HI16, nkeynes@362: BFD_RELOC_SH_GOTPLT_LOW16, nkeynes@362: BFD_RELOC_SH_GOTPLT_MEDLOW16, nkeynes@362: BFD_RELOC_SH_GOTPLT_MEDHI16, nkeynes@362: BFD_RELOC_SH_GOTPLT_HI16, nkeynes@362: BFD_RELOC_SH_PLT_LOW16, nkeynes@362: BFD_RELOC_SH_PLT_MEDLOW16, nkeynes@362: BFD_RELOC_SH_PLT_MEDHI16, nkeynes@362: BFD_RELOC_SH_PLT_HI16, nkeynes@362: BFD_RELOC_SH_GOTOFF_LOW16, nkeynes@362: BFD_RELOC_SH_GOTOFF_MEDLOW16, nkeynes@362: BFD_RELOC_SH_GOTOFF_MEDHI16, nkeynes@362: BFD_RELOC_SH_GOTOFF_HI16, nkeynes@362: BFD_RELOC_SH_GOTPC_LOW16, nkeynes@362: BFD_RELOC_SH_GOTPC_MEDLOW16, nkeynes@362: BFD_RELOC_SH_GOTPC_MEDHI16, nkeynes@362: BFD_RELOC_SH_GOTPC_HI16, nkeynes@362: BFD_RELOC_SH_COPY64, nkeynes@362: BFD_RELOC_SH_GLOB_DAT64, nkeynes@362: BFD_RELOC_SH_JMP_SLOT64, nkeynes@362: BFD_RELOC_SH_RELATIVE64, nkeynes@362: BFD_RELOC_SH_GOT10BY4, nkeynes@362: BFD_RELOC_SH_GOT10BY8, nkeynes@362: BFD_RELOC_SH_GOTPLT10BY4, nkeynes@362: BFD_RELOC_SH_GOTPLT10BY8, nkeynes@362: BFD_RELOC_SH_GOTPLT32, nkeynes@362: BFD_RELOC_SH_SHMEDIA_CODE, nkeynes@362: BFD_RELOC_SH_IMMU5, nkeynes@362: BFD_RELOC_SH_IMMS6, nkeynes@362: BFD_RELOC_SH_IMMS6BY32, nkeynes@362: BFD_RELOC_SH_IMMU6, nkeynes@362: BFD_RELOC_SH_IMMS10, nkeynes@362: BFD_RELOC_SH_IMMS10BY2, nkeynes@362: BFD_RELOC_SH_IMMS10BY4, nkeynes@362: BFD_RELOC_SH_IMMS10BY8, nkeynes@362: BFD_RELOC_SH_IMMS16, nkeynes@362: BFD_RELOC_SH_IMMU16, nkeynes@362: BFD_RELOC_SH_IMM_LOW16, nkeynes@362: BFD_RELOC_SH_IMM_LOW16_PCREL, nkeynes@362: BFD_RELOC_SH_IMM_MEDLOW16, nkeynes@362: BFD_RELOC_SH_IMM_MEDLOW16_PCREL, nkeynes@362: BFD_RELOC_SH_IMM_MEDHI16, nkeynes@362: BFD_RELOC_SH_IMM_MEDHI16_PCREL, nkeynes@362: BFD_RELOC_SH_IMM_HI16, nkeynes@362: BFD_RELOC_SH_IMM_HI16_PCREL, nkeynes@362: BFD_RELOC_SH_PT_16, nkeynes@362: BFD_RELOC_SH_TLS_GD_32, nkeynes@362: BFD_RELOC_SH_TLS_LD_32, nkeynes@362: BFD_RELOC_SH_TLS_LDO_32, nkeynes@362: BFD_RELOC_SH_TLS_IE_32, nkeynes@362: BFD_RELOC_SH_TLS_LE_32, nkeynes@362: BFD_RELOC_SH_TLS_DTPMOD32, nkeynes@362: BFD_RELOC_SH_TLS_DTPOFF32, nkeynes@362: BFD_RELOC_SH_TLS_TPOFF32, nkeynes@362: nkeynes@362: /* Thumb 23-, 12- and 9-bit pc-relative branches. The lowest bit must nkeynes@362: be zero and is not stored in the instruction. */ nkeynes@362: BFD_RELOC_THUMB_PCREL_BRANCH9, nkeynes@362: BFD_RELOC_THUMB_PCREL_BRANCH12, nkeynes@362: BFD_RELOC_THUMB_PCREL_BRANCH23, nkeynes@362: nkeynes@362: /* ARC Cores relocs. nkeynes@362: ARC 22 bit pc-relative branch. The lowest two bits must be zero and are nkeynes@362: not stored in the instruction. The high 20 bits are installed in bits 26 nkeynes@362: through 7 of the instruction. */ nkeynes@362: BFD_RELOC_ARC_B22_PCREL, nkeynes@362: nkeynes@362: /* ARC 26 bit absolute branch. The lowest two bits must be zero and are not nkeynes@362: stored in the instruction. The high 24 bits are installed in bits 23 nkeynes@362: through 0. */ nkeynes@362: BFD_RELOC_ARC_B26, nkeynes@362: nkeynes@362: /* Mitsubishi D10V relocs. nkeynes@362: This is a 10-bit reloc with the right 2 bits nkeynes@362: assumed to be 0. */ nkeynes@362: BFD_RELOC_D10V_10_PCREL_R, nkeynes@362: nkeynes@362: /* Mitsubishi D10V relocs. nkeynes@362: This is a 10-bit reloc with the right 2 bits nkeynes@362: assumed to be 0. This is the same as the previous reloc nkeynes@362: except it is in the left container, i.e., nkeynes@362: shifted left 15 bits. */ nkeynes@362: BFD_RELOC_D10V_10_PCREL_L, nkeynes@362: nkeynes@362: /* This is an 18-bit reloc with the right 2 bits nkeynes@362: assumed to be 0. */ nkeynes@362: BFD_RELOC_D10V_18, nkeynes@362: nkeynes@362: /* This is an 18-bit reloc with the right 2 bits nkeynes@362: assumed to be 0. */ nkeynes@362: BFD_RELOC_D10V_18_PCREL, nkeynes@362: nkeynes@362: /* Mitsubishi D30V relocs. nkeynes@362: This is a 6-bit absolute reloc. */ nkeynes@362: BFD_RELOC_D30V_6, nkeynes@362: nkeynes@362: /* This is a 6-bit pc-relative reloc with nkeynes@362: the right 3 bits assumed to be 0. */ nkeynes@362: BFD_RELOC_D30V_9_PCREL, nkeynes@362: nkeynes@362: /* This is a 6-bit pc-relative reloc with nkeynes@362: the right 3 bits assumed to be 0. Same nkeynes@362: as the previous reloc but on the right side nkeynes@362: of the container. */ nkeynes@362: BFD_RELOC_D30V_9_PCREL_R, nkeynes@362: nkeynes@362: /* This is a 12-bit absolute reloc with the nkeynes@362: right 3 bitsassumed to be 0. */ nkeynes@362: BFD_RELOC_D30V_15, nkeynes@362: nkeynes@362: /* This is a 12-bit pc-relative reloc with nkeynes@362: the right 3 bits assumed to be 0. */ nkeynes@362: BFD_RELOC_D30V_15_PCREL, nkeynes@362: nkeynes@362: /* This is a 12-bit pc-relative reloc with nkeynes@362: the right 3 bits assumed to be 0. Same nkeynes@362: as the previous reloc but on the right side nkeynes@362: of the container. */ nkeynes@362: BFD_RELOC_D30V_15_PCREL_R, nkeynes@362: nkeynes@362: /* This is an 18-bit absolute reloc with nkeynes@362: the right 3 bits assumed to be 0. */ nkeynes@362: BFD_RELOC_D30V_21, nkeynes@362: nkeynes@362: /* This is an 18-bit pc-relative reloc with nkeynes@362: the right 3 bits assumed to be 0. */ nkeynes@362: BFD_RELOC_D30V_21_PCREL, nkeynes@362: nkeynes@362: /* This is an 18-bit pc-relative reloc with nkeynes@362: the right 3 bits assumed to be 0. Same nkeynes@362: as the previous reloc but on the right side nkeynes@362: of the container. */ nkeynes@362: BFD_RELOC_D30V_21_PCREL_R, nkeynes@362: nkeynes@362: /* This is a 32-bit absolute reloc. */ nkeynes@362: BFD_RELOC_D30V_32, nkeynes@362: nkeynes@362: /* This is a 32-bit pc-relative reloc. */ nkeynes@362: BFD_RELOC_D30V_32_PCREL, nkeynes@362: nkeynes@362: /* DLX relocs */ nkeynes@362: BFD_RELOC_DLX_HI16_S, nkeynes@362: nkeynes@362: /* DLX relocs */ nkeynes@362: BFD_RELOC_DLX_LO16, nkeynes@362: nkeynes@362: /* DLX relocs */ nkeynes@362: BFD_RELOC_DLX_JMP26, nkeynes@362: nkeynes@362: /* Renesas M32R (formerly Mitsubishi M32R) relocs. nkeynes@362: This is a 24 bit absolute address. */ nkeynes@362: BFD_RELOC_M32R_24, nkeynes@362: nkeynes@362: /* This is a 10-bit pc-relative reloc with the right 2 bits assumed to be 0. */ nkeynes@362: BFD_RELOC_M32R_10_PCREL, nkeynes@362: nkeynes@362: /* This is an 18-bit reloc with the right 2 bits assumed to be 0. */ nkeynes@362: BFD_RELOC_M32R_18_PCREL, nkeynes@362: nkeynes@362: /* This is a 26-bit reloc with the right 2 bits assumed to be 0. */ nkeynes@362: BFD_RELOC_M32R_26_PCREL, nkeynes@362: nkeynes@362: /* This is a 16-bit reloc containing the high 16 bits of an address nkeynes@362: used when the lower 16 bits are treated as unsigned. */ nkeynes@362: BFD_RELOC_M32R_HI16_ULO, nkeynes@362: nkeynes@362: /* This is a 16-bit reloc containing the high 16 bits of an address nkeynes@362: used when the lower 16 bits are treated as signed. */ nkeynes@362: BFD_RELOC_M32R_HI16_SLO, nkeynes@362: nkeynes@362: /* This is a 16-bit reloc containing the lower 16 bits of an address. */ nkeynes@362: BFD_RELOC_M32R_LO16, nkeynes@362: nkeynes@362: /* This is a 16-bit reloc containing the small data area offset for use in nkeynes@362: add3, load, and store instructions. */ nkeynes@362: BFD_RELOC_M32R_SDA16, nkeynes@362: nkeynes@362: /* For PIC. */ nkeynes@362: BFD_RELOC_M32R_GOT24, nkeynes@362: BFD_RELOC_M32R_26_PLTREL, nkeynes@362: BFD_RELOC_M32R_COPY, nkeynes@362: BFD_RELOC_M32R_GLOB_DAT, nkeynes@362: BFD_RELOC_M32R_JMP_SLOT, nkeynes@362: BFD_RELOC_M32R_RELATIVE, nkeynes@362: BFD_RELOC_M32R_GOTOFF, nkeynes@362: BFD_RELOC_M32R_GOTOFF_HI_ULO, nkeynes@362: BFD_RELOC_M32R_GOTOFF_HI_SLO, nkeynes@362: BFD_RELOC_M32R_GOTOFF_LO, nkeynes@362: BFD_RELOC_M32R_GOTPC24, nkeynes@362: BFD_RELOC_M32R_GOT16_HI_ULO, nkeynes@362: BFD_RELOC_M32R_GOT16_HI_SLO, nkeynes@362: BFD_RELOC_M32R_GOT16_LO, nkeynes@362: BFD_RELOC_M32R_GOTPC_HI_ULO, nkeynes@362: BFD_RELOC_M32R_GOTPC_HI_SLO, nkeynes@362: BFD_RELOC_M32R_GOTPC_LO, nkeynes@362: nkeynes@362: /* This is a 9-bit reloc */ nkeynes@362: BFD_RELOC_V850_9_PCREL, nkeynes@362: nkeynes@362: /* This is a 22-bit reloc */ nkeynes@362: BFD_RELOC_V850_22_PCREL, nkeynes@362: nkeynes@362: /* This is a 16 bit offset from the short data area pointer. */ nkeynes@362: BFD_RELOC_V850_SDA_16_16_OFFSET, nkeynes@362: nkeynes@362: /* This is a 16 bit offset (of which only 15 bits are used) from the nkeynes@362: short data area pointer. */ nkeynes@362: BFD_RELOC_V850_SDA_15_16_OFFSET, nkeynes@362: nkeynes@362: /* This is a 16 bit offset from the zero data area pointer. */ nkeynes@362: BFD_RELOC_V850_ZDA_16_16_OFFSET, nkeynes@362: nkeynes@362: /* This is a 16 bit offset (of which only 15 bits are used) from the nkeynes@362: zero data area pointer. */ nkeynes@362: BFD_RELOC_V850_ZDA_15_16_OFFSET, nkeynes@362: nkeynes@362: /* This is an 8 bit offset (of which only 6 bits are used) from the nkeynes@362: tiny data area pointer. */ nkeynes@362: BFD_RELOC_V850_TDA_6_8_OFFSET, nkeynes@362: nkeynes@362: /* This is an 8bit offset (of which only 7 bits are used) from the tiny nkeynes@362: data area pointer. */ nkeynes@362: BFD_RELOC_V850_TDA_7_8_OFFSET, nkeynes@362: nkeynes@362: /* This is a 7 bit offset from the tiny data area pointer. */ nkeynes@362: BFD_RELOC_V850_TDA_7_7_OFFSET, nkeynes@362: nkeynes@362: /* This is a 16 bit offset from the tiny data area pointer. */ nkeynes@362: BFD_RELOC_V850_TDA_16_16_OFFSET, nkeynes@362: nkeynes@362: /* This is a 5 bit offset (of which only 4 bits are used) from the tiny nkeynes@362: data area pointer. */ nkeynes@362: BFD_RELOC_V850_TDA_4_5_OFFSET, nkeynes@362: nkeynes@362: /* This is a 4 bit offset from the tiny data area pointer. */ nkeynes@362: BFD_RELOC_V850_TDA_4_4_OFFSET, nkeynes@362: nkeynes@362: /* This is a 16 bit offset from the short data area pointer, with the nkeynes@362: bits placed non-contiguously in the instruction. */ nkeynes@362: BFD_RELOC_V850_SDA_16_16_SPLIT_OFFSET, nkeynes@362: nkeynes@362: /* This is a 16 bit offset from the zero data area pointer, with the nkeynes@362: bits placed non-contiguously in the instruction. */ nkeynes@362: BFD_RELOC_V850_ZDA_16_16_SPLIT_OFFSET, nkeynes@362: nkeynes@362: /* This is a 6 bit offset from the call table base pointer. */ nkeynes@362: BFD_RELOC_V850_CALLT_6_7_OFFSET, nkeynes@362: nkeynes@362: /* This is a 16 bit offset from the call table base pointer. */ nkeynes@362: BFD_RELOC_V850_CALLT_16_16_OFFSET, nkeynes@362: nkeynes@362: /* Used for relaxing indirect function calls. */ nkeynes@362: BFD_RELOC_V850_LONGCALL, nkeynes@362: nkeynes@362: /* Used for relaxing indirect jumps. */ nkeynes@362: BFD_RELOC_V850_LONGJUMP, nkeynes@362: nkeynes@362: /* Used to maintain alignment whilst relaxing. */ nkeynes@362: BFD_RELOC_V850_ALIGN, nkeynes@362: nkeynes@362: /* This is a variation of BFD_RELOC_LO16 that can be used in v850e ld.bu nkeynes@362: instructions. */ nkeynes@362: BFD_RELOC_V850_LO16_SPLIT_OFFSET, nkeynes@362: nkeynes@362: /* This is a 32bit pcrel reloc for the mn10300, offset by two bytes in the nkeynes@362: instruction. */ nkeynes@362: BFD_RELOC_MN10300_32_PCREL, nkeynes@362: nkeynes@362: /* This is a 16bit pcrel reloc for the mn10300, offset by two bytes in the nkeynes@362: instruction. */ nkeynes@362: BFD_RELOC_MN10300_16_PCREL, nkeynes@362: nkeynes@362: /* This is a 8bit DP reloc for the tms320c30, where the most nkeynes@362: significant 8 bits of a 24 bit word are placed into the least nkeynes@362: significant 8 bits of the opcode. */ nkeynes@362: BFD_RELOC_TIC30_LDP, nkeynes@362: nkeynes@362: /* This is a 7bit reloc for the tms320c54x, where the least nkeynes@362: significant 7 bits of a 16 bit word are placed into the least nkeynes@362: significant 7 bits of the opcode. */ nkeynes@362: BFD_RELOC_TIC54X_PARTLS7, nkeynes@362: nkeynes@362: /* This is a 9bit DP reloc for the tms320c54x, where the most nkeynes@362: significant 9 bits of a 16 bit word are placed into the least nkeynes@362: significant 9 bits of the opcode. */ nkeynes@362: BFD_RELOC_TIC54X_PARTMS9, nkeynes@362: nkeynes@362: /* This is an extended address 23-bit reloc for the tms320c54x. */ nkeynes@362: BFD_RELOC_TIC54X_23, nkeynes@362: nkeynes@362: /* This is a 16-bit reloc for the tms320c54x, where the least nkeynes@362: significant 16 bits of a 23-bit extended address are placed into nkeynes@362: the opcode. */ nkeynes@362: BFD_RELOC_TIC54X_16_OF_23, nkeynes@362: nkeynes@362: /* This is a reloc for the tms320c54x, where the most nkeynes@362: significant 7 bits of a 23-bit extended address are placed into nkeynes@362: the opcode. */ nkeynes@362: BFD_RELOC_TIC54X_MS7_OF_23, nkeynes@362: nkeynes@362: /* This is a 48 bit reloc for the FR30 that stores 32 bits. */ nkeynes@362: BFD_RELOC_FR30_48, nkeynes@362: nkeynes@362: /* This is a 32 bit reloc for the FR30 that stores 20 bits split up into nkeynes@362: two sections. */ nkeynes@362: BFD_RELOC_FR30_20, nkeynes@362: nkeynes@362: /* This is a 16 bit reloc for the FR30 that stores a 6 bit word offset in nkeynes@362: 4 bits. */ nkeynes@362: BFD_RELOC_FR30_6_IN_4, nkeynes@362: nkeynes@362: /* This is a 16 bit reloc for the FR30 that stores an 8 bit byte offset nkeynes@362: into 8 bits. */ nkeynes@362: BFD_RELOC_FR30_8_IN_8, nkeynes@362: nkeynes@362: /* This is a 16 bit reloc for the FR30 that stores a 9 bit short offset nkeynes@362: into 8 bits. */ nkeynes@362: BFD_RELOC_FR30_9_IN_8, nkeynes@362: nkeynes@362: /* This is a 16 bit reloc for the FR30 that stores a 10 bit word offset nkeynes@362: into 8 bits. */ nkeynes@362: BFD_RELOC_FR30_10_IN_8, nkeynes@362: nkeynes@362: /* This is a 16 bit reloc for the FR30 that stores a 9 bit pc relative nkeynes@362: short offset into 8 bits. */ nkeynes@362: BFD_RELOC_FR30_9_PCREL, nkeynes@362: nkeynes@362: /* This is a 16 bit reloc for the FR30 that stores a 12 bit pc relative nkeynes@362: short offset into 11 bits. */ nkeynes@362: BFD_RELOC_FR30_12_PCREL, nkeynes@362: nkeynes@362: /* Motorola Mcore relocations. */ nkeynes@362: BFD_RELOC_MCORE_PCREL_IMM8BY4, nkeynes@362: BFD_RELOC_MCORE_PCREL_IMM11BY2, nkeynes@362: BFD_RELOC_MCORE_PCREL_IMM4BY2, nkeynes@362: BFD_RELOC_MCORE_PCREL_32, nkeynes@362: BFD_RELOC_MCORE_PCREL_JSR_IMM11BY2, nkeynes@362: BFD_RELOC_MCORE_RVA, nkeynes@362: nkeynes@362: /* These are relocations for the GETA instruction. */ nkeynes@362: BFD_RELOC_MMIX_GETA, nkeynes@362: BFD_RELOC_MMIX_GETA_1, nkeynes@362: BFD_RELOC_MMIX_GETA_2, nkeynes@362: BFD_RELOC_MMIX_GETA_3, nkeynes@362: nkeynes@362: /* These are relocations for a conditional branch instruction. */ nkeynes@362: BFD_RELOC_MMIX_CBRANCH, nkeynes@362: BFD_RELOC_MMIX_CBRANCH_J, nkeynes@362: BFD_RELOC_MMIX_CBRANCH_1, nkeynes@362: BFD_RELOC_MMIX_CBRANCH_2, nkeynes@362: BFD_RELOC_MMIX_CBRANCH_3, nkeynes@362: nkeynes@362: /* These are relocations for the PUSHJ instruction. */ nkeynes@362: BFD_RELOC_MMIX_PUSHJ, nkeynes@362: BFD_RELOC_MMIX_PUSHJ_1, nkeynes@362: BFD_RELOC_MMIX_PUSHJ_2, nkeynes@362: BFD_RELOC_MMIX_PUSHJ_3, nkeynes@362: BFD_RELOC_MMIX_PUSHJ_STUBBABLE, nkeynes@362: nkeynes@362: /* These are relocations for the JMP instruction. */ nkeynes@362: BFD_RELOC_MMIX_JMP, nkeynes@362: BFD_RELOC_MMIX_JMP_1, nkeynes@362: BFD_RELOC_MMIX_JMP_2, nkeynes@362: BFD_RELOC_MMIX_JMP_3, nkeynes@362: nkeynes@362: /* This is a relocation for a relative address as in a GETA instruction or nkeynes@362: a branch. */ nkeynes@362: BFD_RELOC_MMIX_ADDR19, nkeynes@362: nkeynes@362: /* This is a relocation for a relative address as in a JMP instruction. */ nkeynes@362: BFD_RELOC_MMIX_ADDR27, nkeynes@362: nkeynes@362: /* This is a relocation for an instruction field that may be a general nkeynes@362: register or a value 0..255. */ nkeynes@362: BFD_RELOC_MMIX_REG_OR_BYTE, nkeynes@362: nkeynes@362: /* This is a relocation for an instruction field that may be a general nkeynes@362: register. */ nkeynes@362: BFD_RELOC_MMIX_REG, nkeynes@362: nkeynes@362: /* This is a relocation for two instruction fields holding a register and nkeynes@362: an offset, the equivalent of the relocation. */ nkeynes@362: BFD_RELOC_MMIX_BASE_PLUS_OFFSET, nkeynes@362: nkeynes@362: /* This relocation is an assertion that the expression is not allocated as nkeynes@362: a global register. It does not modify contents. */ nkeynes@362: BFD_RELOC_MMIX_LOCAL, nkeynes@362: nkeynes@362: /* This is a 16 bit reloc for the AVR that stores 8 bit pc relative nkeynes@362: short offset into 7 bits. */ nkeynes@362: BFD_RELOC_AVR_7_PCREL, nkeynes@362: nkeynes@362: /* This is a 16 bit reloc for the AVR that stores 13 bit pc relative nkeynes@362: short offset into 12 bits. */ nkeynes@362: BFD_RELOC_AVR_13_PCREL, nkeynes@362: nkeynes@362: /* This is a 16 bit reloc for the AVR that stores 17 bit value (usually nkeynes@362: program memory address) into 16 bits. */ nkeynes@362: BFD_RELOC_AVR_16_PM, nkeynes@362: nkeynes@362: /* This is a 16 bit reloc for the AVR that stores 8 bit value (usually nkeynes@362: data memory address) into 8 bit immediate value of LDI insn. */ nkeynes@362: BFD_RELOC_AVR_LO8_LDI, nkeynes@362: nkeynes@362: /* This is a 16 bit reloc for the AVR that stores 8 bit value (high 8 bit nkeynes@362: of data memory address) into 8 bit immediate value of LDI insn. */ nkeynes@362: BFD_RELOC_AVR_HI8_LDI, nkeynes@362: nkeynes@362: /* This is a 16 bit reloc for the AVR that stores 8 bit value (most high 8 bit nkeynes@362: of program memory address) into 8 bit immediate value of LDI insn. */ nkeynes@362: BFD_RELOC_AVR_HH8_LDI, nkeynes@362: nkeynes@362: /* This is a 16 bit reloc for the AVR that stores negated 8 bit value nkeynes@362: (usually data memory address) into 8 bit immediate value of SUBI insn. */ nkeynes@362: BFD_RELOC_AVR_LO8_LDI_NEG, nkeynes@362: nkeynes@362: /* This is a 16 bit reloc for the AVR that stores negated 8 bit value nkeynes@362: (high 8 bit of data memory address) into 8 bit immediate value of nkeynes@362: SUBI insn. */ nkeynes@362: BFD_RELOC_AVR_HI8_LDI_NEG, nkeynes@362: nkeynes@362: /* This is a 16 bit reloc for the AVR that stores negated 8 bit value nkeynes@362: (most high 8 bit of program memory address) into 8 bit immediate value nkeynes@362: of LDI or SUBI insn. */ nkeynes@362: BFD_RELOC_AVR_HH8_LDI_NEG, nkeynes@362: nkeynes@362: /* This is a 16 bit reloc for the AVR that stores 8 bit value (usually nkeynes@362: command address) into 8 bit immediate value of LDI insn. */ nkeynes@362: BFD_RELOC_AVR_LO8_LDI_PM, nkeynes@362: nkeynes@362: /* This is a 16 bit reloc for the AVR that stores 8 bit value (high 8 bit nkeynes@362: of command address) into 8 bit immediate value of LDI insn. */ nkeynes@362: BFD_RELOC_AVR_HI8_LDI_PM, nkeynes@362: nkeynes@362: /* This is a 16 bit reloc for the AVR that stores 8 bit value (most high 8 bit nkeynes@362: of command address) into 8 bit immediate value of LDI insn. */ nkeynes@362: BFD_RELOC_AVR_HH8_LDI_PM, nkeynes@362: nkeynes@362: /* This is a 16 bit reloc for the AVR that stores negated 8 bit value nkeynes@362: (usually command address) into 8 bit immediate value of SUBI insn. */ nkeynes@362: BFD_RELOC_AVR_LO8_LDI_PM_NEG, nkeynes@362: nkeynes@362: /* This is a 16 bit reloc for the AVR that stores negated 8 bit value nkeynes@362: (high 8 bit of 16 bit command address) into 8 bit immediate value nkeynes@362: of SUBI insn. */ nkeynes@362: BFD_RELOC_AVR_HI8_LDI_PM_NEG, nkeynes@362: nkeynes@362: /* This is a 16 bit reloc for the AVR that stores negated 8 bit value nkeynes@362: (high 6 bit of 22 bit command address) into 8 bit immediate nkeynes@362: value of SUBI insn. */ nkeynes@362: BFD_RELOC_AVR_HH8_LDI_PM_NEG, nkeynes@362: nkeynes@362: /* This is a 32 bit reloc for the AVR that stores 23 bit value nkeynes@362: into 22 bits. */ nkeynes@362: BFD_RELOC_AVR_CALL, nkeynes@362: nkeynes@362: /* This is a 16 bit reloc for the AVR that stores all needed bits nkeynes@362: for absolute addressing with ldi with overflow check to linktime */ nkeynes@362: BFD_RELOC_AVR_LDI, nkeynes@362: nkeynes@362: /* This is a 6 bit reloc for the AVR that stores offset for ldd/std nkeynes@362: instructions */ nkeynes@362: BFD_RELOC_AVR_6, nkeynes@362: nkeynes@362: /* This is a 6 bit reloc for the AVR that stores offset for adiw/sbiw nkeynes@362: instructions */ nkeynes@362: BFD_RELOC_AVR_6_ADIW, nkeynes@362: nkeynes@362: /* Direct 12 bit. */ nkeynes@362: BFD_RELOC_390_12, nkeynes@362: nkeynes@362: /* 12 bit GOT offset. */ nkeynes@362: BFD_RELOC_390_GOT12, nkeynes@362: nkeynes@362: /* 32 bit PC relative PLT address. */ nkeynes@362: BFD_RELOC_390_PLT32, nkeynes@362: nkeynes@362: /* Copy symbol at runtime. */ nkeynes@362: BFD_RELOC_390_COPY, nkeynes@362: nkeynes@362: /* Create GOT entry. */ nkeynes@362: BFD_RELOC_390_GLOB_DAT, nkeynes@362: nkeynes@362: /* Create PLT entry. */ nkeynes@362: BFD_RELOC_390_JMP_SLOT, nkeynes@362: nkeynes@362: /* Adjust by program base. */ nkeynes@362: BFD_RELOC_390_RELATIVE, nkeynes@362: nkeynes@362: /* 32 bit PC relative offset to GOT. */ nkeynes@362: BFD_RELOC_390_GOTPC, nkeynes@362: nkeynes@362: /* 16 bit GOT offset. */ nkeynes@362: BFD_RELOC_390_GOT16, nkeynes@362: nkeynes@362: /* PC relative 16 bit shifted by 1. */ nkeynes@362: BFD_RELOC_390_PC16DBL, nkeynes@362: nkeynes@362: /* 16 bit PC rel. PLT shifted by 1. */ nkeynes@362: BFD_RELOC_390_PLT16DBL, nkeynes@362: nkeynes@362: /* PC relative 32 bit shifted by 1. */ nkeynes@362: BFD_RELOC_390_PC32DBL, nkeynes@362: nkeynes@362: /* 32 bit PC rel. PLT shifted by 1. */ nkeynes@362: BFD_RELOC_390_PLT32DBL, nkeynes@362: nkeynes@362: /* 32 bit PC rel. GOT shifted by 1. */ nkeynes@362: BFD_RELOC_390_GOTPCDBL, nkeynes@362: nkeynes@362: /* 64 bit GOT offset. */ nkeynes@362: BFD_RELOC_390_GOT64, nkeynes@362: nkeynes@362: /* 64 bit PC relative PLT address. */ nkeynes@362: BFD_RELOC_390_PLT64, nkeynes@362: nkeynes@362: /* 32 bit rel. offset to GOT entry. */ nkeynes@362: BFD_RELOC_390_GOTENT, nkeynes@362: nkeynes@362: /* 64 bit offset to GOT. */ nkeynes@362: BFD_RELOC_390_GOTOFF64, nkeynes@362: nkeynes@362: /* 12-bit offset to symbol-entry within GOT, with PLT handling. */ nkeynes@362: BFD_RELOC_390_GOTPLT12, nkeynes@362: nkeynes@362: /* 16-bit offset to symbol-entry within GOT, with PLT handling. */ nkeynes@362: BFD_RELOC_390_GOTPLT16, nkeynes@362: nkeynes@362: /* 32-bit offset to symbol-entry within GOT, with PLT handling. */ nkeynes@362: BFD_RELOC_390_GOTPLT32, nkeynes@362: nkeynes@362: /* 64-bit offset to symbol-entry within GOT, with PLT handling. */ nkeynes@362: BFD_RELOC_390_GOTPLT64, nkeynes@362: nkeynes@362: /* 32-bit rel. offset to symbol-entry within GOT, with PLT handling. */ nkeynes@362: BFD_RELOC_390_GOTPLTENT, nkeynes@362: nkeynes@362: /* 16-bit rel. offset from the GOT to a PLT entry. */ nkeynes@362: BFD_RELOC_390_PLTOFF16, nkeynes@362: nkeynes@362: /* 32-bit rel. offset from the GOT to a PLT entry. */ nkeynes@362: BFD_RELOC_390_PLTOFF32, nkeynes@362: nkeynes@362: /* 64-bit rel. offset from the GOT to a PLT entry. */ nkeynes@362: BFD_RELOC_390_PLTOFF64, nkeynes@362: nkeynes@362: /* s390 tls relocations. */ nkeynes@362: BFD_RELOC_390_TLS_LOAD, nkeynes@362: BFD_RELOC_390_TLS_GDCALL, nkeynes@362: BFD_RELOC_390_TLS_LDCALL, nkeynes@362: BFD_RELOC_390_TLS_GD32, nkeynes@362: BFD_RELOC_390_TLS_GD64, nkeynes@362: BFD_RELOC_390_TLS_GOTIE12, nkeynes@362: BFD_RELOC_390_TLS_GOTIE32, nkeynes@362: BFD_RELOC_390_TLS_GOTIE64, nkeynes@362: BFD_RELOC_390_TLS_LDM32, nkeynes@362: BFD_RELOC_390_TLS_LDM64, nkeynes@362: BFD_RELOC_390_TLS_IE32, nkeynes@362: BFD_RELOC_390_TLS_IE64, nkeynes@362: BFD_RELOC_390_TLS_IEENT, nkeynes@362: BFD_RELOC_390_TLS_LE32, nkeynes@362: BFD_RELOC_390_TLS_LE64, nkeynes@362: BFD_RELOC_390_TLS_LDO32, nkeynes@362: BFD_RELOC_390_TLS_LDO64, nkeynes@362: BFD_RELOC_390_TLS_DTPMOD, nkeynes@362: BFD_RELOC_390_TLS_DTPOFF, nkeynes@362: BFD_RELOC_390_TLS_TPOFF, nkeynes@362: nkeynes@362: /* Long displacement extension. */ nkeynes@362: BFD_RELOC_390_20, nkeynes@362: BFD_RELOC_390_GOT20, nkeynes@362: BFD_RELOC_390_GOTPLT20, nkeynes@362: BFD_RELOC_390_TLS_GOTIE20, nkeynes@362: nkeynes@362: /* Scenix IP2K - 9-bit register number / data address */ nkeynes@362: BFD_RELOC_IP2K_FR9, nkeynes@362: nkeynes@362: /* Scenix IP2K - 4-bit register/data bank number */ nkeynes@362: BFD_RELOC_IP2K_BANK, nkeynes@362: nkeynes@362: /* Scenix IP2K - low 13 bits of instruction word address */ nkeynes@362: BFD_RELOC_IP2K_ADDR16CJP, nkeynes@362: nkeynes@362: /* Scenix IP2K - high 3 bits of instruction word address */ nkeynes@362: BFD_RELOC_IP2K_PAGE3, nkeynes@362: nkeynes@362: /* Scenix IP2K - ext/low/high 8 bits of data address */ nkeynes@362: BFD_RELOC_IP2K_LO8DATA, nkeynes@362: BFD_RELOC_IP2K_HI8DATA, nkeynes@362: BFD_RELOC_IP2K_EX8DATA, nkeynes@362: nkeynes@362: /* Scenix IP2K - low/high 8 bits of instruction word address */ nkeynes@362: BFD_RELOC_IP2K_LO8INSN, nkeynes@362: BFD_RELOC_IP2K_HI8INSN, nkeynes@362: nkeynes@362: /* Scenix IP2K - even/odd PC modifier to modify snb pcl.0 */ nkeynes@362: BFD_RELOC_IP2K_PC_SKIP, nkeynes@362: nkeynes@362: /* Scenix IP2K - 16 bit word address in text section. */ nkeynes@362: BFD_RELOC_IP2K_TEXT, nkeynes@362: nkeynes@362: /* Scenix IP2K - 7-bit sp or dp offset */ nkeynes@362: BFD_RELOC_IP2K_FR_OFFSET, nkeynes@362: nkeynes@362: /* Scenix VPE4K coprocessor - data/insn-space addressing */ nkeynes@362: BFD_RELOC_VPE4KMATH_DATA, nkeynes@362: BFD_RELOC_VPE4KMATH_INSN, nkeynes@362: nkeynes@362: /* These two relocations are used by the linker to determine which of nkeynes@362: the entries in a C++ virtual function table are actually used. When nkeynes@362: the --gc-sections option is given, the linker will zero out the entries nkeynes@362: that are not used, so that the code for those functions need not be nkeynes@362: included in the output. nkeynes@362: nkeynes@362: VTABLE_INHERIT is a zero-space relocation used to describe to the nkeynes@362: linker the inheritance tree of a C++ virtual function table. The nkeynes@362: relocation's symbol should be the parent class' vtable, and the nkeynes@362: relocation should be located at the child vtable. nkeynes@362: nkeynes@362: VTABLE_ENTRY is a zero-space relocation that describes the use of a nkeynes@362: virtual function table entry. The reloc's symbol should refer to the nkeynes@362: table of the class mentioned in the code. Off of that base, an offset nkeynes@362: describes the entry that is being used. For Rela hosts, this offset nkeynes@362: is stored in the reloc's addend. For Rel hosts, we are forced to put nkeynes@362: this offset in the reloc's section offset. */ nkeynes@362: BFD_RELOC_VTABLE_INHERIT, nkeynes@362: BFD_RELOC_VTABLE_ENTRY, nkeynes@362: nkeynes@362: /* Intel IA64 Relocations. */ nkeynes@362: BFD_RELOC_IA64_IMM14, nkeynes@362: BFD_RELOC_IA64_IMM22, nkeynes@362: BFD_RELOC_IA64_IMM64, nkeynes@362: BFD_RELOC_IA64_DIR32MSB, nkeynes@362: BFD_RELOC_IA64_DIR32LSB, nkeynes@362: BFD_RELOC_IA64_DIR64MSB, nkeynes@362: BFD_RELOC_IA64_DIR64LSB, nkeynes@362: BFD_RELOC_IA64_GPREL22, nkeynes@362: BFD_RELOC_IA64_GPREL64I, nkeynes@362: BFD_RELOC_IA64_GPREL32MSB, nkeynes@362: BFD_RELOC_IA64_GPREL32LSB, nkeynes@362: BFD_RELOC_IA64_GPREL64MSB, nkeynes@362: BFD_RELOC_IA64_GPREL64LSB, nkeynes@362: BFD_RELOC_IA64_LTOFF22, nkeynes@362: BFD_RELOC_IA64_LTOFF64I, nkeynes@362: BFD_RELOC_IA64_PLTOFF22, nkeynes@362: BFD_RELOC_IA64_PLTOFF64I, nkeynes@362: BFD_RELOC_IA64_PLTOFF64MSB, nkeynes@362: BFD_RELOC_IA64_PLTOFF64LSB, nkeynes@362: BFD_RELOC_IA64_FPTR64I, nkeynes@362: BFD_RELOC_IA64_FPTR32MSB, nkeynes@362: BFD_RELOC_IA64_FPTR32LSB, nkeynes@362: BFD_RELOC_IA64_FPTR64MSB, nkeynes@362: BFD_RELOC_IA64_FPTR64LSB, nkeynes@362: BFD_RELOC_IA64_PCREL21B, nkeynes@362: BFD_RELOC_IA64_PCREL21BI, nkeynes@362: BFD_RELOC_IA64_PCREL21M, nkeynes@362: BFD_RELOC_IA64_PCREL21F, nkeynes@362: BFD_RELOC_IA64_PCREL22, nkeynes@362: BFD_RELOC_IA64_PCREL60B, nkeynes@362: BFD_RELOC_IA64_PCREL64I, nkeynes@362: BFD_RELOC_IA64_PCREL32MSB, nkeynes@362: BFD_RELOC_IA64_PCREL32LSB, nkeynes@362: BFD_RELOC_IA64_PCREL64MSB, nkeynes@362: BFD_RELOC_IA64_PCREL64LSB, nkeynes@362: BFD_RELOC_IA64_LTOFF_FPTR22, nkeynes@362: BFD_RELOC_IA64_LTOFF_FPTR64I, nkeynes@362: BFD_RELOC_IA64_LTOFF_FPTR32MSB, nkeynes@362: BFD_RELOC_IA64_LTOFF_FPTR32LSB, nkeynes@362: BFD_RELOC_IA64_LTOFF_FPTR64MSB, nkeynes@362: BFD_RELOC_IA64_LTOFF_FPTR64LSB, nkeynes@362: BFD_RELOC_IA64_SEGREL32MSB, nkeynes@362: BFD_RELOC_IA64_SEGREL32LSB, nkeynes@362: BFD_RELOC_IA64_SEGREL64MSB, nkeynes@362: BFD_RELOC_IA64_SEGREL64LSB, nkeynes@362: BFD_RELOC_IA64_SECREL32MSB, nkeynes@362: BFD_RELOC_IA64_SECREL32LSB, nkeynes@362: BFD_RELOC_IA64_SECREL64MSB, nkeynes@362: BFD_RELOC_IA64_SECREL64LSB, nkeynes@362: BFD_RELOC_IA64_REL32MSB, nkeynes@362: BFD_RELOC_IA64_REL32LSB, nkeynes@362: BFD_RELOC_IA64_REL64MSB, nkeynes@362: BFD_RELOC_IA64_REL64LSB, nkeynes@362: BFD_RELOC_IA64_LTV32MSB, nkeynes@362: BFD_RELOC_IA64_LTV32LSB, nkeynes@362: BFD_RELOC_IA64_LTV64MSB, nkeynes@362: BFD_RELOC_IA64_LTV64LSB, nkeynes@362: BFD_RELOC_IA64_IPLTMSB, nkeynes@362: BFD_RELOC_IA64_IPLTLSB, nkeynes@362: BFD_RELOC_IA64_COPY, nkeynes@362: BFD_RELOC_IA64_LTOFF22X, nkeynes@362: BFD_RELOC_IA64_LDXMOV, nkeynes@362: BFD_RELOC_IA64_TPREL14, nkeynes@362: BFD_RELOC_IA64_TPREL22, nkeynes@362: BFD_RELOC_IA64_TPREL64I, nkeynes@362: BFD_RELOC_IA64_TPREL64MSB, nkeynes@362: BFD_RELOC_IA64_TPREL64LSB, nkeynes@362: BFD_RELOC_IA64_LTOFF_TPREL22, nkeynes@362: BFD_RELOC_IA64_DTPMOD64MSB, nkeynes@362: BFD_RELOC_IA64_DTPMOD64LSB, nkeynes@362: BFD_RELOC_IA64_LTOFF_DTPMOD22, nkeynes@362: BFD_RELOC_IA64_DTPREL14, nkeynes@362: BFD_RELOC_IA64_DTPREL22, nkeynes@362: BFD_RELOC_IA64_DTPREL64I, nkeynes@362: BFD_RELOC_IA64_DTPREL32MSB, nkeynes@362: BFD_RELOC_IA64_DTPREL32LSB, nkeynes@362: BFD_RELOC_IA64_DTPREL64MSB, nkeynes@362: BFD_RELOC_IA64_DTPREL64LSB, nkeynes@362: BFD_RELOC_IA64_LTOFF_DTPREL22, nkeynes@362: nkeynes@362: /* Motorola 68HC11 reloc. nkeynes@362: This is the 8 bit high part of an absolute address. */ nkeynes@362: BFD_RELOC_M68HC11_HI8, nkeynes@362: nkeynes@362: /* Motorola 68HC11 reloc. nkeynes@362: This is the 8 bit low part of an absolute address. */ nkeynes@362: BFD_RELOC_M68HC11_LO8, nkeynes@362: nkeynes@362: /* Motorola 68HC11 reloc. nkeynes@362: This is the 3 bit of a value. */ nkeynes@362: BFD_RELOC_M68HC11_3B, nkeynes@362: nkeynes@362: /* Motorola 68HC11 reloc. nkeynes@362: This reloc marks the beginning of a jump/call instruction. nkeynes@362: It is used for linker relaxation to correctly identify beginning nkeynes@362: of instruction and change some branches to use PC-relative nkeynes@362: addressing mode. */ nkeynes@362: BFD_RELOC_M68HC11_RL_JUMP, nkeynes@362: nkeynes@362: /* Motorola 68HC11 reloc. nkeynes@362: This reloc marks a group of several instructions that gcc generates nkeynes@362: and for which the linker relaxation pass can modify and/or remove nkeynes@362: some of them. */ nkeynes@362: BFD_RELOC_M68HC11_RL_GROUP, nkeynes@362: nkeynes@362: /* Motorola 68HC11 reloc. nkeynes@362: This is the 16-bit lower part of an address. It is used for 'call' nkeynes@362: instruction to specify the symbol address without any special nkeynes@362: transformation (due to memory bank window). */ nkeynes@362: BFD_RELOC_M68HC11_LO16, nkeynes@362: nkeynes@362: /* Motorola 68HC11 reloc. nkeynes@362: This is a 8-bit reloc that specifies the page number of an address. nkeynes@362: It is used by 'call' instruction to specify the page number of nkeynes@362: the symbol. */ nkeynes@362: BFD_RELOC_M68HC11_PAGE, nkeynes@362: nkeynes@362: /* Motorola 68HC11 reloc. nkeynes@362: This is a 24-bit reloc that represents the address with a 16-bit nkeynes@362: value and a 8-bit page number. The symbol address is transformed nkeynes@362: to follow the 16K memory bank of 68HC12 (seen as mapped in the window). */ nkeynes@362: BFD_RELOC_M68HC11_24, nkeynes@362: nkeynes@362: /* Motorola 68HC12 reloc. nkeynes@362: This is the 5 bits of a value. */ nkeynes@362: BFD_RELOC_M68HC12_5B, nkeynes@362: nkeynes@362: /* NS CR16C Relocations. */ nkeynes@362: BFD_RELOC_16C_NUM08, nkeynes@362: BFD_RELOC_16C_NUM08_C, nkeynes@362: BFD_RELOC_16C_NUM16, nkeynes@362: BFD_RELOC_16C_NUM16_C, nkeynes@362: BFD_RELOC_16C_NUM32, nkeynes@362: BFD_RELOC_16C_NUM32_C, nkeynes@362: BFD_RELOC_16C_DISP04, nkeynes@362: BFD_RELOC_16C_DISP04_C, nkeynes@362: BFD_RELOC_16C_DISP08, nkeynes@362: BFD_RELOC_16C_DISP08_C, nkeynes@362: BFD_RELOC_16C_DISP16, nkeynes@362: BFD_RELOC_16C_DISP16_C, nkeynes@362: BFD_RELOC_16C_DISP24, nkeynes@362: BFD_RELOC_16C_DISP24_C, nkeynes@362: BFD_RELOC_16C_DISP24a, nkeynes@362: BFD_RELOC_16C_DISP24a_C, nkeynes@362: BFD_RELOC_16C_REG04, nkeynes@362: BFD_RELOC_16C_REG04_C, nkeynes@362: BFD_RELOC_16C_REG04a, nkeynes@362: BFD_RELOC_16C_REG04a_C, nkeynes@362: BFD_RELOC_16C_REG14, nkeynes@362: BFD_RELOC_16C_REG14_C, nkeynes@362: BFD_RELOC_16C_REG16, nkeynes@362: BFD_RELOC_16C_REG16_C, nkeynes@362: BFD_RELOC_16C_REG20, nkeynes@362: BFD_RELOC_16C_REG20_C, nkeynes@362: BFD_RELOC_16C_ABS20, nkeynes@362: BFD_RELOC_16C_ABS20_C, nkeynes@362: BFD_RELOC_16C_ABS24, nkeynes@362: BFD_RELOC_16C_ABS24_C, nkeynes@362: BFD_RELOC_16C_IMM04, nkeynes@362: BFD_RELOC_16C_IMM04_C, nkeynes@362: BFD_RELOC_16C_IMM16, nkeynes@362: BFD_RELOC_16C_IMM16_C, nkeynes@362: BFD_RELOC_16C_IMM20, nkeynes@362: BFD_RELOC_16C_IMM20_C, nkeynes@362: BFD_RELOC_16C_IMM24, nkeynes@362: BFD_RELOC_16C_IMM24_C, nkeynes@362: BFD_RELOC_16C_IMM32, nkeynes@362: BFD_RELOC_16C_IMM32_C, nkeynes@362: nkeynes@362: /* NS CRX Relocations. */ nkeynes@362: BFD_RELOC_CRX_REL4, nkeynes@362: BFD_RELOC_CRX_REL8, nkeynes@362: BFD_RELOC_CRX_REL8_CMP, nkeynes@362: BFD_RELOC_CRX_REL16, nkeynes@362: BFD_RELOC_CRX_REL24, nkeynes@362: BFD_RELOC_CRX_REL32, nkeynes@362: BFD_RELOC_CRX_REGREL12, nkeynes@362: BFD_RELOC_CRX_REGREL22, nkeynes@362: BFD_RELOC_CRX_REGREL28, nkeynes@362: BFD_RELOC_CRX_REGREL32, nkeynes@362: BFD_RELOC_CRX_ABS16, nkeynes@362: BFD_RELOC_CRX_ABS32, nkeynes@362: BFD_RELOC_CRX_NUM8, nkeynes@362: BFD_RELOC_CRX_NUM16, nkeynes@362: BFD_RELOC_CRX_NUM32, nkeynes@362: BFD_RELOC_CRX_IMM16, nkeynes@362: BFD_RELOC_CRX_IMM32, nkeynes@362: BFD_RELOC_CRX_SWITCH8, nkeynes@362: BFD_RELOC_CRX_SWITCH16, nkeynes@362: BFD_RELOC_CRX_SWITCH32, nkeynes@362: nkeynes@362: /* These relocs are only used within the CRIS assembler. They are not nkeynes@362: (at present) written to any object files. */ nkeynes@362: BFD_RELOC_CRIS_BDISP8, nkeynes@362: BFD_RELOC_CRIS_UNSIGNED_5, nkeynes@362: BFD_RELOC_CRIS_SIGNED_6, nkeynes@362: BFD_RELOC_CRIS_UNSIGNED_6, nkeynes@362: BFD_RELOC_CRIS_SIGNED_8, nkeynes@362: BFD_RELOC_CRIS_UNSIGNED_8, nkeynes@362: BFD_RELOC_CRIS_SIGNED_16, nkeynes@362: BFD_RELOC_CRIS_UNSIGNED_16, nkeynes@362: BFD_RELOC_CRIS_LAPCQ_OFFSET, nkeynes@362: BFD_RELOC_CRIS_UNSIGNED_4, nkeynes@362: nkeynes@362: /* Relocs used in ELF shared libraries for CRIS. */ nkeynes@362: BFD_RELOC_CRIS_COPY, nkeynes@362: BFD_RELOC_CRIS_GLOB_DAT, nkeynes@362: BFD_RELOC_CRIS_JUMP_SLOT, nkeynes@362: BFD_RELOC_CRIS_RELATIVE, nkeynes@362: nkeynes@362: /* 32-bit offset to symbol-entry within GOT. */ nkeynes@362: BFD_RELOC_CRIS_32_GOT, nkeynes@362: nkeynes@362: /* 16-bit offset to symbol-entry within GOT. */ nkeynes@362: BFD_RELOC_CRIS_16_GOT, nkeynes@362: nkeynes@362: /* 32-bit offset to symbol-entry within GOT, with PLT handling. */ nkeynes@362: BFD_RELOC_CRIS_32_GOTPLT, nkeynes@362: nkeynes@362: /* 16-bit offset to symbol-entry within GOT, with PLT handling. */ nkeynes@362: BFD_RELOC_CRIS_16_GOTPLT, nkeynes@362: nkeynes@362: /* 32-bit offset to symbol, relative to GOT. */ nkeynes@362: BFD_RELOC_CRIS_32_GOTREL, nkeynes@362: nkeynes@362: /* 32-bit offset to symbol with PLT entry, relative to GOT. */ nkeynes@362: BFD_RELOC_CRIS_32_PLT_GOTREL, nkeynes@362: nkeynes@362: /* 32-bit offset to symbol with PLT entry, relative to this relocation. */ nkeynes@362: BFD_RELOC_CRIS_32_PLT_PCREL, nkeynes@362: nkeynes@362: /* Intel i860 Relocations. */ nkeynes@362: BFD_RELOC_860_COPY, nkeynes@362: BFD_RELOC_860_GLOB_DAT, nkeynes@362: BFD_RELOC_860_JUMP_SLOT, nkeynes@362: BFD_RELOC_860_RELATIVE, nkeynes@362: BFD_RELOC_860_PC26, nkeynes@362: BFD_RELOC_860_PLT26, nkeynes@362: BFD_RELOC_860_PC16, nkeynes@362: BFD_RELOC_860_LOW0, nkeynes@362: BFD_RELOC_860_SPLIT0, nkeynes@362: BFD_RELOC_860_LOW1, nkeynes@362: BFD_RELOC_860_SPLIT1, nkeynes@362: BFD_RELOC_860_LOW2, nkeynes@362: BFD_RELOC_860_SPLIT2, nkeynes@362: BFD_RELOC_860_LOW3, nkeynes@362: BFD_RELOC_860_LOGOT0, nkeynes@362: BFD_RELOC_860_SPGOT0, nkeynes@362: BFD_RELOC_860_LOGOT1, nkeynes@362: BFD_RELOC_860_SPGOT1, nkeynes@362: BFD_RELOC_860_LOGOTOFF0, nkeynes@362: BFD_RELOC_860_SPGOTOFF0, nkeynes@362: BFD_RELOC_860_LOGOTOFF1, nkeynes@362: BFD_RELOC_860_SPGOTOFF1, nkeynes@362: BFD_RELOC_860_LOGOTOFF2, nkeynes@362: BFD_RELOC_860_LOGOTOFF3, nkeynes@362: BFD_RELOC_860_LOPC, nkeynes@362: BFD_RELOC_860_HIGHADJ, nkeynes@362: BFD_RELOC_860_HAGOT, nkeynes@362: BFD_RELOC_860_HAGOTOFF, nkeynes@362: BFD_RELOC_860_HAPC, nkeynes@362: BFD_RELOC_860_HIGH, nkeynes@362: BFD_RELOC_860_HIGOT, nkeynes@362: BFD_RELOC_860_HIGOTOFF, nkeynes@362: nkeynes@362: /* OpenRISC Relocations. */ nkeynes@362: BFD_RELOC_OPENRISC_ABS_26, nkeynes@362: BFD_RELOC_OPENRISC_REL_26, nkeynes@362: nkeynes@362: /* H8 elf Relocations. */ nkeynes@362: BFD_RELOC_H8_DIR16A8, nkeynes@362: BFD_RELOC_H8_DIR16R8, nkeynes@362: BFD_RELOC_H8_DIR24A8, nkeynes@362: BFD_RELOC_H8_DIR24R8, nkeynes@362: BFD_RELOC_H8_DIR32A16, nkeynes@362: nkeynes@362: /* Sony Xstormy16 Relocations. */ nkeynes@362: BFD_RELOC_XSTORMY16_REL_12, nkeynes@362: BFD_RELOC_XSTORMY16_12, nkeynes@362: BFD_RELOC_XSTORMY16_24, nkeynes@362: BFD_RELOC_XSTORMY16_FPTR16, nkeynes@362: nkeynes@362: /* Relocations used by VAX ELF. */ nkeynes@362: BFD_RELOC_VAX_GLOB_DAT, nkeynes@362: BFD_RELOC_VAX_JMP_SLOT, nkeynes@362: BFD_RELOC_VAX_RELATIVE, nkeynes@362: nkeynes@362: /* msp430 specific relocation codes */ nkeynes@362: BFD_RELOC_MSP430_10_PCREL, nkeynes@362: BFD_RELOC_MSP430_16_PCREL, nkeynes@362: BFD_RELOC_MSP430_16, nkeynes@362: BFD_RELOC_MSP430_16_PCREL_BYTE, nkeynes@362: BFD_RELOC_MSP430_16_BYTE, nkeynes@362: BFD_RELOC_MSP430_2X_PCREL, nkeynes@362: BFD_RELOC_MSP430_RL_PCREL, nkeynes@362: nkeynes@362: /* IQ2000 Relocations. */ nkeynes@362: BFD_RELOC_IQ2000_OFFSET_16, nkeynes@362: BFD_RELOC_IQ2000_OFFSET_21, nkeynes@362: BFD_RELOC_IQ2000_UHI16, nkeynes@362: nkeynes@362: /* Special Xtensa relocation used only by PLT entries in ELF shared nkeynes@362: objects to indicate that the runtime linker should set the value nkeynes@362: to one of its own internal functions or data structures. */ nkeynes@362: BFD_RELOC_XTENSA_RTLD, nkeynes@362: nkeynes@362: /* Xtensa relocations for ELF shared objects. */ nkeynes@362: BFD_RELOC_XTENSA_GLOB_DAT, nkeynes@362: BFD_RELOC_XTENSA_JMP_SLOT, nkeynes@362: BFD_RELOC_XTENSA_RELATIVE, nkeynes@362: nkeynes@362: /* Xtensa relocation used in ELF object files for symbols that may require nkeynes@362: PLT entries. Otherwise, this is just a generic 32-bit relocation. */ nkeynes@362: BFD_RELOC_XTENSA_PLT, nkeynes@362: nkeynes@362: /* Xtensa relocations to mark the difference of two local symbols. nkeynes@362: These are only needed to support linker relaxation and can be ignored nkeynes@362: when not relaxing. The field is set to the value of the difference nkeynes@362: assuming no relaxation. The relocation encodes the position of the nkeynes@362: first symbol so the linker can determine whether to adjust the field nkeynes@362: value. */ nkeynes@362: BFD_RELOC_XTENSA_DIFF8, nkeynes@362: BFD_RELOC_XTENSA_DIFF16, nkeynes@362: BFD_RELOC_XTENSA_DIFF32, nkeynes@362: nkeynes@362: /* Generic Xtensa relocations for instruction operands. Only the slot nkeynes@362: number is encoded in the relocation. The relocation applies to the nkeynes@362: last PC-relative immediate operand, or if there are no PC-relative nkeynes@362: immediates, to the last immediate operand. */ nkeynes@362: BFD_RELOC_XTENSA_SLOT0_OP, nkeynes@362: BFD_RELOC_XTENSA_SLOT1_OP, nkeynes@362: BFD_RELOC_XTENSA_SLOT2_OP, nkeynes@362: BFD_RELOC_XTENSA_SLOT3_OP, nkeynes@362: BFD_RELOC_XTENSA_SLOT4_OP, nkeynes@362: BFD_RELOC_XTENSA_SLOT5_OP, nkeynes@362: BFD_RELOC_XTENSA_SLOT6_OP, nkeynes@362: BFD_RELOC_XTENSA_SLOT7_OP, nkeynes@362: BFD_RELOC_XTENSA_SLOT8_OP, nkeynes@362: BFD_RELOC_XTENSA_SLOT9_OP, nkeynes@362: BFD_RELOC_XTENSA_SLOT10_OP, nkeynes@362: BFD_RELOC_XTENSA_SLOT11_OP, nkeynes@362: BFD_RELOC_XTENSA_SLOT12_OP, nkeynes@362: BFD_RELOC_XTENSA_SLOT13_OP, nkeynes@362: BFD_RELOC_XTENSA_SLOT14_OP, nkeynes@362: nkeynes@362: /* Alternate Xtensa relocations. Only the slot is encoded in the nkeynes@362: relocation. The meaning of these relocations is opcode-specific. */ nkeynes@362: BFD_RELOC_XTENSA_SLOT0_ALT, nkeynes@362: BFD_RELOC_XTENSA_SLOT1_ALT, nkeynes@362: BFD_RELOC_XTENSA_SLOT2_ALT, nkeynes@362: BFD_RELOC_XTENSA_SLOT3_ALT, nkeynes@362: BFD_RELOC_XTENSA_SLOT4_ALT, nkeynes@362: BFD_RELOC_XTENSA_SLOT5_ALT, nkeynes@362: BFD_RELOC_XTENSA_SLOT6_ALT, nkeynes@362: BFD_RELOC_XTENSA_SLOT7_ALT, nkeynes@362: BFD_RELOC_XTENSA_SLOT8_ALT, nkeynes@362: BFD_RELOC_XTENSA_SLOT9_ALT, nkeynes@362: BFD_RELOC_XTENSA_SLOT10_ALT, nkeynes@362: BFD_RELOC_XTENSA_SLOT11_ALT, nkeynes@362: BFD_RELOC_XTENSA_SLOT12_ALT, nkeynes@362: BFD_RELOC_XTENSA_SLOT13_ALT, nkeynes@362: BFD_RELOC_XTENSA_SLOT14_ALT, nkeynes@362: nkeynes@362: /* Xtensa relocations for backward compatibility. These have all been nkeynes@362: replaced by BFD_RELOC_XTENSA_SLOT0_OP. */ nkeynes@362: BFD_RELOC_XTENSA_OP0, nkeynes@362: BFD_RELOC_XTENSA_OP1, nkeynes@362: BFD_RELOC_XTENSA_OP2, nkeynes@362: nkeynes@362: /* Xtensa relocation to mark that the assembler expanded the nkeynes@362: instructions from an original target. The expansion size is nkeynes@362: encoded in the reloc size. */ nkeynes@362: BFD_RELOC_XTENSA_ASM_EXPAND, nkeynes@362: nkeynes@362: /* Xtensa relocation to mark that the linker should simplify nkeynes@362: assembler-expanded instructions. This is commonly used nkeynes@362: internally by the linker after analysis of a nkeynes@362: BFD_RELOC_XTENSA_ASM_EXPAND. */ nkeynes@362: BFD_RELOC_XTENSA_ASM_SIMPLIFY, nkeynes@362: BFD_RELOC_UNUSED }; nkeynes@362: typedef enum bfd_reloc_code_real bfd_reloc_code_real_type; nkeynes@362: reloc_howto_type *bfd_reloc_type_lookup nkeynes@362: (bfd *abfd, bfd_reloc_code_real_type code); nkeynes@362: nkeynes@362: const char *bfd_get_reloc_code_name (bfd_reloc_code_real_type code); nkeynes@362: nkeynes@362: /* Extracted from syms.c. */ nkeynes@362: nkeynes@362: typedef struct bfd_symbol nkeynes@362: { nkeynes@362: /* A pointer to the BFD which owns the symbol. This information nkeynes@362: is necessary so that a back end can work out what additional nkeynes@362: information (invisible to the application writer) is carried nkeynes@362: with the symbol. nkeynes@362: nkeynes@362: This field is *almost* redundant, since you can use section->owner nkeynes@362: instead, except that some symbols point to the global sections nkeynes@362: bfd_{abs,com,und}_section. This could be fixed by making nkeynes@362: these globals be per-bfd (or per-target-flavor). FIXME. */ nkeynes@362: struct bfd *the_bfd; /* Use bfd_asymbol_bfd(sym) to access this field. */ nkeynes@362: nkeynes@362: /* The text of the symbol. The name is left alone, and not copied; the nkeynes@362: application may not alter it. */ nkeynes@362: const char *name; nkeynes@362: nkeynes@362: /* The value of the symbol. This really should be a union of a nkeynes@362: numeric value with a pointer, since some flags indicate that nkeynes@362: a pointer to another symbol is stored here. */ nkeynes@362: symvalue value; nkeynes@362: nkeynes@362: /* Attributes of a symbol. */ nkeynes@362: #define BSF_NO_FLAGS 0x00 nkeynes@362: nkeynes@362: /* The symbol has local scope; <> in <>. The value nkeynes@362: is the offset into the section of the data. */ nkeynes@362: #define BSF_LOCAL 0x01 nkeynes@362: nkeynes@362: /* The symbol has global scope; initialized data in <>. The nkeynes@362: value is the offset into the section of the data. */ nkeynes@362: #define BSF_GLOBAL 0x02 nkeynes@362: nkeynes@362: /* The symbol has global scope and is exported. The value is nkeynes@362: the offset into the section of the data. */ nkeynes@362: #define BSF_EXPORT BSF_GLOBAL /* No real difference. */ nkeynes@362: nkeynes@362: /* A normal C symbol would be one of: nkeynes@362: <>, <>, <> or nkeynes@362: <>. */ nkeynes@362: nkeynes@362: /* The symbol is a debugging record. The value has an arbitrary nkeynes@362: meaning, unless BSF_DEBUGGING_RELOC is also set. */ nkeynes@362: #define BSF_DEBUGGING 0x08 nkeynes@362: nkeynes@362: /* The symbol denotes a function entry point. Used in ELF, nkeynes@362: perhaps others someday. */ nkeynes@362: #define BSF_FUNCTION 0x10 nkeynes@362: nkeynes@362: /* Used by the linker. */ nkeynes@362: #define BSF_KEEP 0x20 nkeynes@362: #define BSF_KEEP_G 0x40 nkeynes@362: nkeynes@362: /* A weak global symbol, overridable without warnings by nkeynes@362: a regular global symbol of the same name. */ nkeynes@362: #define BSF_WEAK 0x80 nkeynes@362: nkeynes@362: /* This symbol was created to point to a section, e.g. ELF's nkeynes@362: STT_SECTION symbols. */ nkeynes@362: #define BSF_SECTION_SYM 0x100 nkeynes@362: nkeynes@362: /* The symbol used to be a common symbol, but now it is nkeynes@362: allocated. */ nkeynes@362: #define BSF_OLD_COMMON 0x200 nkeynes@362: nkeynes@362: /* The default value for common data. */ nkeynes@362: #define BFD_FORT_COMM_DEFAULT_VALUE 0 nkeynes@362: nkeynes@362: /* In some files the type of a symbol sometimes alters its nkeynes@362: location in an output file - ie in coff a <> symbol nkeynes@362: which is also <> symbol appears where it was nkeynes@362: declared and not at the end of a section. This bit is set nkeynes@362: by the target BFD part to convey this information. */ nkeynes@362: #define BSF_NOT_AT_END 0x400 nkeynes@362: nkeynes@362: /* Signal that the symbol is the label of constructor section. */ nkeynes@362: #define BSF_CONSTRUCTOR 0x800 nkeynes@362: nkeynes@362: /* Signal that the symbol is a warning symbol. The name is a nkeynes@362: warning. The name of the next symbol is the one to warn about; nkeynes@362: if a reference is made to a symbol with the same name as the next nkeynes@362: symbol, a warning is issued by the linker. */ nkeynes@362: #define BSF_WARNING 0x1000 nkeynes@362: nkeynes@362: /* Signal that the symbol is indirect. This symbol is an indirect nkeynes@362: pointer to the symbol with the same name as the next symbol. */ nkeynes@362: #define BSF_INDIRECT 0x2000 nkeynes@362: nkeynes@362: /* BSF_FILE marks symbols that contain a file name. This is used nkeynes@362: for ELF STT_FILE symbols. */ nkeynes@362: #define BSF_FILE 0x4000 nkeynes@362: nkeynes@362: /* Symbol is from dynamic linking information. */ nkeynes@362: #define BSF_DYNAMIC 0x8000 nkeynes@362: nkeynes@362: /* The symbol denotes a data object. Used in ELF, and perhaps nkeynes@362: others someday. */ nkeynes@362: #define BSF_OBJECT 0x10000 nkeynes@362: nkeynes@362: /* This symbol is a debugging symbol. The value is the offset nkeynes@362: into the section of the data. BSF_DEBUGGING should be set nkeynes@362: as well. */ nkeynes@362: #define BSF_DEBUGGING_RELOC 0x20000 nkeynes@362: nkeynes@362: /* This symbol is thread local. Used in ELF. */ nkeynes@362: #define BSF_THREAD_LOCAL 0x40000 nkeynes@362: nkeynes@362: flagword flags; nkeynes@362: nkeynes@362: /* A pointer to the section to which this symbol is nkeynes@362: relative. This will always be non NULL, there are special nkeynes@362: sections for undefined and absolute symbols. */ nkeynes@362: struct bfd_section *section; nkeynes@362: nkeynes@362: /* Back end special data. */ nkeynes@362: union nkeynes@362: { nkeynes@362: void *p; nkeynes@362: bfd_vma i; nkeynes@362: } nkeynes@362: udata; nkeynes@362: } nkeynes@362: asymbol; nkeynes@362: nkeynes@362: #define bfd_get_symtab_upper_bound(abfd) \ nkeynes@362: BFD_SEND (abfd, _bfd_get_symtab_upper_bound, (abfd)) nkeynes@362: nkeynes@362: bfd_boolean bfd_is_local_label (bfd *abfd, asymbol *sym); nkeynes@362: nkeynes@362: bfd_boolean bfd_is_local_label_name (bfd *abfd, const char *name); nkeynes@362: nkeynes@362: #define bfd_is_local_label_name(abfd, name) \ nkeynes@362: BFD_SEND (abfd, _bfd_is_local_label_name, (abfd, name)) nkeynes@362: nkeynes@362: bfd_boolean bfd_is_target_special_symbol (bfd *abfd, asymbol *sym); nkeynes@362: nkeynes@362: #define bfd_is_target_special_symbol(abfd, sym) \ nkeynes@362: BFD_SEND (abfd, _bfd_is_target_special_symbol, (abfd, sym)) nkeynes@362: nkeynes@362: #define bfd_canonicalize_symtab(abfd, location) \ nkeynes@362: BFD_SEND (abfd, _bfd_canonicalize_symtab, (abfd, location)) nkeynes@362: nkeynes@362: bfd_boolean bfd_set_symtab nkeynes@362: (bfd *abfd, asymbol **location, unsigned int count); nkeynes@362: nkeynes@362: void bfd_print_symbol_vandf (bfd *abfd, void *file, asymbol *symbol); nkeynes@362: nkeynes@362: #define bfd_make_empty_symbol(abfd) \ nkeynes@362: BFD_SEND (abfd, _bfd_make_empty_symbol, (abfd)) nkeynes@362: nkeynes@362: asymbol *_bfd_generic_make_empty_symbol (bfd *); nkeynes@362: nkeynes@362: #define bfd_make_debug_symbol(abfd,ptr,size) \ nkeynes@362: BFD_SEND (abfd, _bfd_make_debug_symbol, (abfd, ptr, size)) nkeynes@362: nkeynes@362: int bfd_decode_symclass (asymbol *symbol); nkeynes@362: nkeynes@362: bfd_boolean bfd_is_undefined_symclass (int symclass); nkeynes@362: nkeynes@362: void bfd_symbol_info (asymbol *symbol, symbol_info *ret); nkeynes@362: nkeynes@362: bfd_boolean bfd_copy_private_symbol_data nkeynes@362: (bfd *ibfd, asymbol *isym, bfd *obfd, asymbol *osym); nkeynes@362: nkeynes@362: #define bfd_copy_private_symbol_data(ibfd, isymbol, obfd, osymbol) \ nkeynes@362: BFD_SEND (obfd, _bfd_copy_private_symbol_data, \ nkeynes@362: (ibfd, isymbol, obfd, osymbol)) nkeynes@362: nkeynes@362: /* Extracted from bfd.c. */ nkeynes@362: struct bfd nkeynes@362: { nkeynes@362: /* A unique identifier of the BFD */ nkeynes@362: unsigned int id; nkeynes@362: nkeynes@362: /* The filename the application opened the BFD with. */ nkeynes@362: const char *filename; nkeynes@362: nkeynes@362: /* A pointer to the target jump table. */ nkeynes@362: const struct bfd_target *xvec; nkeynes@362: nkeynes@362: /* The IOSTREAM, and corresponding IO vector that provide access nkeynes@362: to the file backing the BFD. */ nkeynes@362: void *iostream; nkeynes@362: const struct bfd_iovec *iovec; nkeynes@362: nkeynes@362: /* Is the file descriptor being cached? That is, can it be closed as nkeynes@362: needed, and re-opened when accessed later? */ nkeynes@362: bfd_boolean cacheable; nkeynes@362: nkeynes@362: /* Marks whether there was a default target specified when the nkeynes@362: BFD was opened. This is used to select which matching algorithm nkeynes@362: to use to choose the back end. */ nkeynes@362: bfd_boolean target_defaulted; nkeynes@362: nkeynes@362: /* The caching routines use these to maintain a nkeynes@362: least-recently-used list of BFDs. */ nkeynes@362: struct bfd *lru_prev, *lru_next; nkeynes@362: nkeynes@362: /* When a file is closed by the caching routines, BFD retains nkeynes@362: state information on the file here... */ nkeynes@362: ufile_ptr where; nkeynes@362: nkeynes@362: /* ... and here: (``once'' means at least once). */ nkeynes@362: bfd_boolean opened_once; nkeynes@362: nkeynes@362: /* Set if we have a locally maintained mtime value, rather than nkeynes@362: getting it from the file each time. */ nkeynes@362: bfd_boolean mtime_set; nkeynes@362: nkeynes@362: /* File modified time, if mtime_set is TRUE. */ nkeynes@362: long mtime; nkeynes@362: nkeynes@362: /* Reserved for an unimplemented file locking extension. */ nkeynes@362: int ifd; nkeynes@362: nkeynes@362: /* The format which belongs to the BFD. (object, core, etc.) */ nkeynes@362: bfd_format format; nkeynes@362: nkeynes@362: /* The direction with which the BFD was opened. */ nkeynes@362: enum bfd_direction nkeynes@362: { nkeynes@362: no_direction = 0, nkeynes@362: read_direction = 1, nkeynes@362: write_direction = 2, nkeynes@362: both_direction = 3 nkeynes@362: } nkeynes@362: direction; nkeynes@362: nkeynes@362: /* Format_specific flags. */ nkeynes@362: flagword flags; nkeynes@362: nkeynes@362: /* Currently my_archive is tested before adding origin to nkeynes@362: anything. I believe that this can become always an add of nkeynes@362: origin, with origin set to 0 for non archive files. */ nkeynes@362: ufile_ptr origin; nkeynes@362: nkeynes@362: /* Remember when output has begun, to stop strange things nkeynes@362: from happening. */ nkeynes@362: bfd_boolean output_has_begun; nkeynes@362: nkeynes@362: /* A hash table for section names. */ nkeynes@362: struct bfd_hash_table section_htab; nkeynes@362: nkeynes@362: /* Pointer to linked list of sections. */ nkeynes@362: struct bfd_section *sections; nkeynes@362: nkeynes@362: /* The place where we add to the section list. */ nkeynes@362: struct bfd_section **section_tail; nkeynes@362: nkeynes@362: /* The number of sections. */ nkeynes@362: unsigned int section_count; nkeynes@362: nkeynes@362: /* Stuff only useful for object files: nkeynes@362: The start address. */ nkeynes@362: bfd_vma start_address; nkeynes@362: nkeynes@362: /* Used for input and output. */ nkeynes@362: unsigned int symcount; nkeynes@362: nkeynes@362: /* Symbol table for output BFD (with symcount entries). */ nkeynes@362: struct bfd_symbol **outsymbols; nkeynes@362: nkeynes@362: /* Used for slurped dynamic symbol tables. */ nkeynes@362: unsigned int dynsymcount; nkeynes@362: nkeynes@362: /* Pointer to structure which contains architecture information. */ nkeynes@362: const struct bfd_arch_info *arch_info; nkeynes@362: nkeynes@362: /* Flag set if symbols from this BFD should not be exported. */ nkeynes@362: bfd_boolean no_export; nkeynes@362: nkeynes@362: /* Stuff only useful for archives. */ nkeynes@362: void *arelt_data; nkeynes@362: struct bfd *my_archive; /* The containing archive BFD. */ nkeynes@362: struct bfd *next; /* The next BFD in the archive. */ nkeynes@362: struct bfd *archive_head; /* The first BFD in the archive. */ nkeynes@362: bfd_boolean has_armap; nkeynes@362: nkeynes@362: /* A chain of BFD structures involved in a link. */ nkeynes@362: struct bfd *link_next; nkeynes@362: nkeynes@362: /* A field used by _bfd_generic_link_add_archive_symbols. This will nkeynes@362: be used only for archive elements. */ nkeynes@362: int archive_pass; nkeynes@362: nkeynes@362: /* Used by the back end to hold private data. */ nkeynes@362: union nkeynes@362: { nkeynes@362: struct aout_data_struct *aout_data; nkeynes@362: struct artdata *aout_ar_data; nkeynes@362: struct _oasys_data *oasys_obj_data; nkeynes@362: struct _oasys_ar_data *oasys_ar_data; nkeynes@362: struct coff_tdata *coff_obj_data; nkeynes@362: struct pe_tdata *pe_obj_data; nkeynes@362: struct xcoff_tdata *xcoff_obj_data; nkeynes@362: struct ecoff_tdata *ecoff_obj_data; nkeynes@362: struct ieee_data_struct *ieee_data; nkeynes@362: struct ieee_ar_data_struct *ieee_ar_data; nkeynes@362: struct srec_data_struct *srec_data; nkeynes@362: struct ihex_data_struct *ihex_data; nkeynes@362: struct tekhex_data_struct *tekhex_data; nkeynes@362: struct elf_obj_tdata *elf_obj_data; nkeynes@362: struct nlm_obj_tdata *nlm_obj_data; nkeynes@362: struct bout_data_struct *bout_data; nkeynes@362: struct mmo_data_struct *mmo_data; nkeynes@362: struct sun_core_struct *sun_core_data; nkeynes@362: struct sco5_core_struct *sco5_core_data; nkeynes@362: struct trad_core_struct *trad_core_data; nkeynes@362: struct som_data_struct *som_data; nkeynes@362: struct hpux_core_struct *hpux_core_data; nkeynes@362: struct hppabsd_core_struct *hppabsd_core_data; nkeynes@362: struct sgi_core_struct *sgi_core_data; nkeynes@362: struct lynx_core_struct *lynx_core_data; nkeynes@362: struct osf_core_struct *osf_core_data; nkeynes@362: struct cisco_core_struct *cisco_core_data; nkeynes@362: struct versados_data_struct *versados_data; nkeynes@362: struct netbsd_core_struct *netbsd_core_data; nkeynes@362: struct mach_o_data_struct *mach_o_data; nkeynes@362: struct mach_o_fat_data_struct *mach_o_fat_data; nkeynes@362: struct bfd_pef_data_struct *pef_data; nkeynes@362: struct bfd_pef_xlib_data_struct *pef_xlib_data; nkeynes@362: struct bfd_sym_data_struct *sym_data; nkeynes@362: void *any; nkeynes@362: } nkeynes@362: tdata; nkeynes@362: nkeynes@362: /* Used by the application to hold private data. */ nkeynes@362: void *usrdata; nkeynes@362: nkeynes@362: /* Where all the allocated stuff under this BFD goes. This is a nkeynes@362: struct objalloc *, but we use void * to avoid requiring the inclusion nkeynes@362: of objalloc.h. */ nkeynes@362: void *memory; nkeynes@362: }; nkeynes@362: nkeynes@362: typedef enum bfd_error nkeynes@362: { nkeynes@362: bfd_error_no_error = 0, nkeynes@362: bfd_error_system_call, nkeynes@362: bfd_error_invalid_target, nkeynes@362: bfd_error_wrong_format, nkeynes@362: bfd_error_wrong_object_format, nkeynes@362: bfd_error_invalid_operation, nkeynes@362: bfd_error_no_memory, nkeynes@362: bfd_error_no_symbols, nkeynes@362: bfd_error_no_armap, nkeynes@362: bfd_error_no_more_archived_files, nkeynes@362: bfd_error_malformed_archive, nkeynes@362: bfd_error_file_not_recognized, nkeynes@362: bfd_error_file_ambiguously_recognized, nkeynes@362: bfd_error_no_contents, nkeynes@362: bfd_error_nonrepresentable_section, nkeynes@362: bfd_error_no_debug_section, nkeynes@362: bfd_error_bad_value, nkeynes@362: bfd_error_file_truncated, nkeynes@362: bfd_error_file_too_big, nkeynes@362: bfd_error_invalid_error_code nkeynes@362: } nkeynes@362: bfd_error_type; nkeynes@362: nkeynes@362: bfd_error_type bfd_get_error (void); nkeynes@362: nkeynes@362: void bfd_set_error (bfd_error_type error_tag); nkeynes@362: nkeynes@362: const char *bfd_errmsg (bfd_error_type error_tag); nkeynes@362: nkeynes@362: void bfd_perror (const char *message); nkeynes@362: nkeynes@362: typedef void (*bfd_error_handler_type) (const char *, ...); nkeynes@362: nkeynes@362: bfd_error_handler_type bfd_set_error_handler (bfd_error_handler_type); nkeynes@362: nkeynes@362: void bfd_set_error_program_name (const char *); nkeynes@362: nkeynes@362: bfd_error_handler_type bfd_get_error_handler (void); nkeynes@362: nkeynes@362: long bfd_get_reloc_upper_bound (bfd *abfd, asection *sect); nkeynes@362: nkeynes@362: long bfd_canonicalize_reloc nkeynes@362: (bfd *abfd, asection *sec, arelent **loc, asymbol **syms); nkeynes@362: nkeynes@362: void bfd_set_reloc nkeynes@362: (bfd *abfd, asection *sec, arelent **rel, unsigned int count); nkeynes@362: nkeynes@362: bfd_boolean bfd_set_file_flags (bfd *abfd, flagword flags); nkeynes@362: nkeynes@362: int bfd_get_arch_size (bfd *abfd); nkeynes@362: nkeynes@362: int bfd_get_sign_extend_vma (bfd *abfd); nkeynes@362: nkeynes@362: bfd_boolean bfd_set_start_address (bfd *abfd, bfd_vma vma); nkeynes@362: nkeynes@362: unsigned int bfd_get_gp_size (bfd *abfd); nkeynes@362: nkeynes@362: void bfd_set_gp_size (bfd *abfd, unsigned int i); nkeynes@362: nkeynes@362: bfd_vma bfd_scan_vma (const char *string, const char **end, int base); nkeynes@362: nkeynes@362: bfd_boolean bfd_copy_private_header_data (bfd *ibfd, bfd *obfd); nkeynes@362: nkeynes@362: #define bfd_copy_private_header_data(ibfd, obfd) \ nkeynes@362: BFD_SEND (obfd, _bfd_copy_private_header_data, \ nkeynes@362: (ibfd, obfd)) nkeynes@362: bfd_boolean bfd_copy_private_bfd_data (bfd *ibfd, bfd *obfd); nkeynes@362: nkeynes@362: #define bfd_copy_private_bfd_data(ibfd, obfd) \ nkeynes@362: BFD_SEND (obfd, _bfd_copy_private_bfd_data, \ nkeynes@362: (ibfd, obfd)) nkeynes@362: bfd_boolean bfd_merge_private_bfd_data (bfd *ibfd, bfd *obfd); nkeynes@362: nkeynes@362: #define bfd_merge_private_bfd_data(ibfd, obfd) \ nkeynes@362: BFD_SEND (obfd, _bfd_merge_private_bfd_data, \ nkeynes@362: (ibfd, obfd)) nkeynes@362: bfd_boolean bfd_set_private_flags (bfd *abfd, flagword flags); nkeynes@362: nkeynes@362: #define bfd_set_private_flags(abfd, flags) \ nkeynes@362: BFD_SEND (abfd, _bfd_set_private_flags, (abfd, flags)) nkeynes@362: #define bfd_sizeof_headers(abfd, reloc) \ nkeynes@362: BFD_SEND (abfd, _bfd_sizeof_headers, (abfd, reloc)) nkeynes@362: nkeynes@362: #define bfd_find_nearest_line(abfd, sec, syms, off, file, func, line) \ nkeynes@362: BFD_SEND (abfd, _bfd_find_nearest_line, \ nkeynes@362: (abfd, sec, syms, off, file, func, line)) nkeynes@362: nkeynes@362: #define bfd_debug_info_start(abfd) \ nkeynes@362: BFD_SEND (abfd, _bfd_debug_info_start, (abfd)) nkeynes@362: nkeynes@362: #define bfd_debug_info_end(abfd) \ nkeynes@362: BFD_SEND (abfd, _bfd_debug_info_end, (abfd)) nkeynes@362: nkeynes@362: #define bfd_debug_info_accumulate(abfd, section) \ nkeynes@362: BFD_SEND (abfd, _bfd_debug_info_accumulate, (abfd, section)) nkeynes@362: nkeynes@362: #define bfd_stat_arch_elt(abfd, stat) \ nkeynes@362: BFD_SEND (abfd, _bfd_stat_arch_elt,(abfd, stat)) nkeynes@362: nkeynes@362: #define bfd_update_armap_timestamp(abfd) \ nkeynes@362: BFD_SEND (abfd, _bfd_update_armap_timestamp, (abfd)) nkeynes@362: nkeynes@362: #define bfd_set_arch_mach(abfd, arch, mach)\ nkeynes@362: BFD_SEND ( abfd, _bfd_set_arch_mach, (abfd, arch, mach)) nkeynes@362: nkeynes@362: #define bfd_relax_section(abfd, section, link_info, again) \ nkeynes@362: BFD_SEND (abfd, _bfd_relax_section, (abfd, section, link_info, again)) nkeynes@362: nkeynes@362: #define bfd_gc_sections(abfd, link_info) \ nkeynes@362: BFD_SEND (abfd, _bfd_gc_sections, (abfd, link_info)) nkeynes@362: nkeynes@362: #define bfd_merge_sections(abfd, link_info) \ nkeynes@362: BFD_SEND (abfd, _bfd_merge_sections, (abfd, link_info)) nkeynes@362: nkeynes@362: #define bfd_is_group_section(abfd, sec) \ nkeynes@362: BFD_SEND (abfd, _bfd_is_group_section, (abfd, sec)) nkeynes@362: nkeynes@362: #define bfd_discard_group(abfd, sec) \ nkeynes@362: BFD_SEND (abfd, _bfd_discard_group, (abfd, sec)) nkeynes@362: nkeynes@362: #define bfd_link_hash_table_create(abfd) \ nkeynes@362: BFD_SEND (abfd, _bfd_link_hash_table_create, (abfd)) nkeynes@362: nkeynes@362: #define bfd_link_hash_table_free(abfd, hash) \ nkeynes@362: BFD_SEND (abfd, _bfd_link_hash_table_free, (hash)) nkeynes@362: nkeynes@362: #define bfd_link_add_symbols(abfd, info) \ nkeynes@362: BFD_SEND (abfd, _bfd_link_add_symbols, (abfd, info)) nkeynes@362: nkeynes@362: #define bfd_link_just_syms(abfd, sec, info) \ nkeynes@362: BFD_SEND (abfd, _bfd_link_just_syms, (sec, info)) nkeynes@362: nkeynes@362: #define bfd_final_link(abfd, info) \ nkeynes@362: BFD_SEND (abfd, _bfd_final_link, (abfd, info)) nkeynes@362: nkeynes@362: #define bfd_free_cached_info(abfd) \ nkeynes@362: BFD_SEND (abfd, _bfd_free_cached_info, (abfd)) nkeynes@362: nkeynes@362: #define bfd_get_dynamic_symtab_upper_bound(abfd) \ nkeynes@362: BFD_SEND (abfd, _bfd_get_dynamic_symtab_upper_bound, (abfd)) nkeynes@362: nkeynes@362: #define bfd_print_private_bfd_data(abfd, file)\ nkeynes@362: BFD_SEND (abfd, _bfd_print_private_bfd_data, (abfd, file)) nkeynes@362: nkeynes@362: #define bfd_canonicalize_dynamic_symtab(abfd, asymbols) \ nkeynes@362: BFD_SEND (abfd, _bfd_canonicalize_dynamic_symtab, (abfd, asymbols)) nkeynes@362: nkeynes@362: #define bfd_get_synthetic_symtab(abfd, count, syms, dyncount, dynsyms, ret) \ nkeynes@362: BFD_SEND (abfd, _bfd_get_synthetic_symtab, (abfd, count, syms, \ nkeynes@362: dyncount, dynsyms, ret)) nkeynes@362: nkeynes@362: #define bfd_get_dynamic_reloc_upper_bound(abfd) \ nkeynes@362: BFD_SEND (abfd, _bfd_get_dynamic_reloc_upper_bound, (abfd)) nkeynes@362: nkeynes@362: #define bfd_canonicalize_dynamic_reloc(abfd, arels, asyms) \ nkeynes@362: BFD_SEND (abfd, _bfd_canonicalize_dynamic_reloc, (abfd, arels, asyms)) nkeynes@362: nkeynes@362: extern bfd_byte *bfd_get_relocated_section_contents nkeynes@362: (bfd *, struct bfd_link_info *, struct bfd_link_order *, bfd_byte *, nkeynes@362: bfd_boolean, asymbol **); nkeynes@362: nkeynes@362: bfd_boolean bfd_alt_mach_code (bfd *abfd, int alternative); nkeynes@362: nkeynes@362: struct bfd_preserve nkeynes@362: { nkeynes@362: void *marker; nkeynes@362: void *tdata; nkeynes@362: flagword flags; nkeynes@362: const struct bfd_arch_info *arch_info; nkeynes@362: struct bfd_section *sections; nkeynes@362: struct bfd_section **section_tail; nkeynes@362: unsigned int section_count; nkeynes@362: struct bfd_hash_table section_htab; nkeynes@362: }; nkeynes@362: nkeynes@362: bfd_boolean bfd_preserve_save (bfd *, struct bfd_preserve *); nkeynes@362: nkeynes@362: void bfd_preserve_restore (bfd *, struct bfd_preserve *); nkeynes@362: nkeynes@362: void bfd_preserve_finish (bfd *, struct bfd_preserve *); nkeynes@362: nkeynes@362: /* Extracted from archive.c. */ nkeynes@362: symindex bfd_get_next_mapent nkeynes@362: (bfd *abfd, symindex previous, carsym **sym); nkeynes@362: nkeynes@362: bfd_boolean bfd_set_archive_head (bfd *output, bfd *new_head); nkeynes@362: nkeynes@362: bfd *bfd_openr_next_archived_file (bfd *archive, bfd *previous); nkeynes@362: nkeynes@362: /* Extracted from corefile.c. */ nkeynes@362: const char *bfd_core_file_failing_command (bfd *abfd); nkeynes@362: nkeynes@362: int bfd_core_file_failing_signal (bfd *abfd); nkeynes@362: nkeynes@362: bfd_boolean core_file_matches_executable_p nkeynes@362: (bfd *core_bfd, bfd *exec_bfd); nkeynes@362: nkeynes@362: /* Extracted from targets.c. */ nkeynes@362: #define BFD_SEND(bfd, message, arglist) \ nkeynes@362: ((*((bfd)->xvec->message)) arglist) nkeynes@362: nkeynes@362: #ifdef DEBUG_BFD_SEND nkeynes@362: #undef BFD_SEND nkeynes@362: #define BFD_SEND(bfd, message, arglist) \ nkeynes@362: (((bfd) && (bfd)->xvec && (bfd)->xvec->message) ? \ nkeynes@362: ((*((bfd)->xvec->message)) arglist) : \ nkeynes@362: (bfd_assert (__FILE__,__LINE__), NULL)) nkeynes@362: #endif nkeynes@362: #define BFD_SEND_FMT(bfd, message, arglist) \ nkeynes@362: (((bfd)->xvec->message[(int) ((bfd)->format)]) arglist) nkeynes@362: nkeynes@362: #ifdef DEBUG_BFD_SEND nkeynes@362: #undef BFD_SEND_FMT nkeynes@362: #define BFD_SEND_FMT(bfd, message, arglist) \ nkeynes@362: (((bfd) && (bfd)->xvec && (bfd)->xvec->message) ? \ nkeynes@362: (((bfd)->xvec->message[(int) ((bfd)->format)]) arglist) : \ nkeynes@362: (bfd_assert (__FILE__,__LINE__), NULL)) nkeynes@362: #endif nkeynes@362: nkeynes@362: enum bfd_flavour nkeynes@362: { nkeynes@362: bfd_target_unknown_flavour, nkeynes@362: bfd_target_aout_flavour, nkeynes@362: bfd_target_coff_flavour, nkeynes@362: bfd_target_ecoff_flavour, nkeynes@362: bfd_target_xcoff_flavour, nkeynes@362: bfd_target_elf_flavour, nkeynes@362: bfd_target_ieee_flavour, nkeynes@362: bfd_target_nlm_flavour, nkeynes@362: bfd_target_oasys_flavour, nkeynes@362: bfd_target_tekhex_flavour, nkeynes@362: bfd_target_srec_flavour, nkeynes@362: bfd_target_ihex_flavour, nkeynes@362: bfd_target_som_flavour, nkeynes@362: bfd_target_os9k_flavour, nkeynes@362: bfd_target_versados_flavour, nkeynes@362: bfd_target_msdos_flavour, nkeynes@362: bfd_target_ovax_flavour, nkeynes@362: bfd_target_evax_flavour, nkeynes@362: bfd_target_mmo_flavour, nkeynes@362: bfd_target_mach_o_flavour, nkeynes@362: bfd_target_pef_flavour, nkeynes@362: bfd_target_pef_xlib_flavour, nkeynes@362: bfd_target_sym_flavour nkeynes@362: }; nkeynes@362: nkeynes@362: enum bfd_endian { BFD_ENDIAN_BIG, BFD_ENDIAN_LITTLE, BFD_ENDIAN_UNKNOWN }; nkeynes@362: nkeynes@362: /* Forward declaration. */ nkeynes@362: typedef struct bfd_link_info _bfd_link_info; nkeynes@362: nkeynes@362: typedef struct bfd_target nkeynes@362: { nkeynes@362: /* Identifies the kind of target, e.g., SunOS4, Ultrix, etc. */ nkeynes@362: char *name; nkeynes@362: nkeynes@362: /* The "flavour" of a back end is a general indication about nkeynes@362: the contents of a file. */ nkeynes@362: enum bfd_flavour flavour; nkeynes@362: nkeynes@362: /* The order of bytes within the data area of a file. */ nkeynes@362: enum bfd_endian byteorder; nkeynes@362: nkeynes@362: /* The order of bytes within the header parts of a file. */ nkeynes@362: enum bfd_endian header_byteorder; nkeynes@362: nkeynes@362: /* A mask of all the flags which an executable may have set - nkeynes@362: from the set <>, <>, ...<>. */ nkeynes@362: flagword object_flags; nkeynes@362: nkeynes@362: /* A mask of all the flags which a section may have set - from nkeynes@362: the set <>, <>, ...<>. */ nkeynes@362: flagword section_flags; nkeynes@362: nkeynes@362: /* The character normally found at the front of a symbol. nkeynes@362: (if any), perhaps `_'. */ nkeynes@362: char symbol_leading_char; nkeynes@362: nkeynes@362: /* The pad character for file names within an archive header. */ nkeynes@362: char ar_pad_char; nkeynes@362: nkeynes@362: /* The maximum number of characters in an archive header. */ nkeynes@362: unsigned short ar_max_namelen; nkeynes@362: nkeynes@362: /* Entries for byte swapping for data. These are different from the nkeynes@362: other entry points, since they don't take a BFD as the first argument. nkeynes@362: Certain other handlers could do the same. */ nkeynes@362: bfd_uint64_t (*bfd_getx64) (const void *); nkeynes@362: bfd_int64_t (*bfd_getx_signed_64) (const void *); nkeynes@362: void (*bfd_putx64) (bfd_uint64_t, void *); nkeynes@362: bfd_vma (*bfd_getx32) (const void *); nkeynes@362: bfd_signed_vma (*bfd_getx_signed_32) (const void *); nkeynes@362: void (*bfd_putx32) (bfd_vma, void *); nkeynes@362: bfd_vma (*bfd_getx16) (const void *); nkeynes@362: bfd_signed_vma (*bfd_getx_signed_16) (const void *); nkeynes@362: void (*bfd_putx16) (bfd_vma, void *); nkeynes@362: nkeynes@362: /* Byte swapping for the headers. */ nkeynes@362: bfd_uint64_t (*bfd_h_getx64) (const void *); nkeynes@362: bfd_int64_t (*bfd_h_getx_signed_64) (const void *); nkeynes@362: void (*bfd_h_putx64) (bfd_uint64_t, void *); nkeynes@362: bfd_vma (*bfd_h_getx32) (const void *); nkeynes@362: bfd_signed_vma (*bfd_h_getx_signed_32) (const void *); nkeynes@362: void (*bfd_h_putx32) (bfd_vma, void *); nkeynes@362: bfd_vma (*bfd_h_getx16) (const void *); nkeynes@362: bfd_signed_vma (*bfd_h_getx_signed_16) (const void *); nkeynes@362: void (*bfd_h_putx16) (bfd_vma, void *); nkeynes@362: nkeynes@362: /* Format dependent routines: these are vectors of entry points nkeynes@362: within the target vector structure, one for each format to check. */ nkeynes@362: nkeynes@362: /* Check the format of a file being read. Return a <> or zero. */ nkeynes@362: const struct bfd_target *(*_bfd_check_format[bfd_type_end]) (bfd *); nkeynes@362: nkeynes@362: /* Set the format of a file being written. */ nkeynes@362: bfd_boolean (*_bfd_set_format[bfd_type_end]) (bfd *); nkeynes@362: nkeynes@362: /* Write cached information into a file being written, at <>. */ nkeynes@362: bfd_boolean (*_bfd_write_contents[bfd_type_end]) (bfd *); nkeynes@362: nkeynes@362: nkeynes@362: /* Generic entry points. */ nkeynes@362: #define BFD_JUMP_TABLE_GENERIC(NAME) \ nkeynes@362: NAME##_close_and_cleanup, \ nkeynes@362: NAME##_bfd_free_cached_info, \ nkeynes@362: NAME##_new_section_hook, \ nkeynes@362: NAME##_get_section_contents, \ nkeynes@362: NAME##_get_section_contents_in_window nkeynes@362: nkeynes@362: /* Called when the BFD is being closed to do any necessary cleanup. */ nkeynes@362: bfd_boolean (*_close_and_cleanup) (bfd *); nkeynes@362: /* Ask the BFD to free all cached information. */ nkeynes@362: bfd_boolean (*_bfd_free_cached_info) (bfd *); nkeynes@362: /* Called when a new section is created. */ nkeynes@362: bfd_boolean (*_new_section_hook) (bfd *, sec_ptr); nkeynes@362: /* Read the contents of a section. */ nkeynes@362: bfd_boolean (*_bfd_get_section_contents) nkeynes@362: (bfd *, sec_ptr, void *, file_ptr, bfd_size_type); nkeynes@362: bfd_boolean (*_bfd_get_section_contents_in_window) nkeynes@362: (bfd *, sec_ptr, bfd_window *, file_ptr, bfd_size_type); nkeynes@362: nkeynes@362: /* Entry points to copy private data. */ nkeynes@362: #define BFD_JUMP_TABLE_COPY(NAME) \ nkeynes@362: NAME##_bfd_copy_private_bfd_data, \ nkeynes@362: NAME##_bfd_merge_private_bfd_data, \ nkeynes@362: NAME##_bfd_copy_private_section_data, \ nkeynes@362: NAME##_bfd_copy_private_symbol_data, \ nkeynes@362: NAME##_bfd_copy_private_header_data, \ nkeynes@362: NAME##_bfd_set_private_flags, \ nkeynes@362: NAME##_bfd_print_private_bfd_data nkeynes@362: nkeynes@362: /* Called to copy BFD general private data from one object file nkeynes@362: to another. */ nkeynes@362: bfd_boolean (*_bfd_copy_private_bfd_data) (bfd *, bfd *); nkeynes@362: /* Called to merge BFD general private data from one object file nkeynes@362: to a common output file when linking. */ nkeynes@362: bfd_boolean (*_bfd_merge_private_bfd_data) (bfd *, bfd *); nkeynes@362: /* Called to copy BFD private section data from one object file nkeynes@362: to another. */ nkeynes@362: bfd_boolean (*_bfd_copy_private_section_data) nkeynes@362: (bfd *, sec_ptr, bfd *, sec_ptr); nkeynes@362: /* Called to copy BFD private symbol data from one symbol nkeynes@362: to another. */ nkeynes@362: bfd_boolean (*_bfd_copy_private_symbol_data) nkeynes@362: (bfd *, asymbol *, bfd *, asymbol *); nkeynes@362: /* Called to copy BFD private header data from one object file nkeynes@362: to another. */ nkeynes@362: bfd_boolean (*_bfd_copy_private_header_data) nkeynes@362: (bfd *, bfd *); nkeynes@362: /* Called to set private backend flags. */ nkeynes@362: bfd_boolean (*_bfd_set_private_flags) (bfd *, flagword); nkeynes@362: nkeynes@362: /* Called to print private BFD data. */ nkeynes@362: bfd_boolean (*_bfd_print_private_bfd_data) (bfd *, void *); nkeynes@362: nkeynes@362: /* Core file entry points. */ nkeynes@362: #define BFD_JUMP_TABLE_CORE(NAME) \ nkeynes@362: NAME##_core_file_failing_command, \ nkeynes@362: NAME##_core_file_failing_signal, \ nkeynes@362: NAME##_core_file_matches_executable_p nkeynes@362: nkeynes@362: char * (*_core_file_failing_command) (bfd *); nkeynes@362: int (*_core_file_failing_signal) (bfd *); nkeynes@362: bfd_boolean (*_core_file_matches_executable_p) (bfd *, bfd *); nkeynes@362: nkeynes@362: /* Archive entry points. */ nkeynes@362: #define BFD_JUMP_TABLE_ARCHIVE(NAME) \ nkeynes@362: NAME##_slurp_armap, \ nkeynes@362: NAME##_slurp_extended_name_table, \ nkeynes@362: NAME##_construct_extended_name_table, \ nkeynes@362: NAME##_truncate_arname, \ nkeynes@362: NAME##_write_armap, \ nkeynes@362: NAME##_read_ar_hdr, \ nkeynes@362: NAME##_openr_next_archived_file, \ nkeynes@362: NAME##_get_elt_at_index, \ nkeynes@362: NAME##_generic_stat_arch_elt, \ nkeynes@362: NAME##_update_armap_timestamp nkeynes@362: nkeynes@362: bfd_boolean (*_bfd_slurp_armap) (bfd *); nkeynes@362: bfd_boolean (*_bfd_slurp_extended_name_table) (bfd *); nkeynes@362: bfd_boolean (*_bfd_construct_extended_name_table) nkeynes@362: (bfd *, char **, bfd_size_type *, const char **); nkeynes@362: void (*_bfd_truncate_arname) (bfd *, const char *, char *); nkeynes@362: bfd_boolean (*write_armap) nkeynes@362: (bfd *, unsigned int, struct orl *, unsigned int, int); nkeynes@362: void * (*_bfd_read_ar_hdr_fn) (bfd *); nkeynes@362: bfd * (*openr_next_archived_file) (bfd *, bfd *); nkeynes@362: #define bfd_get_elt_at_index(b,i) BFD_SEND (b, _bfd_get_elt_at_index, (b,i)) nkeynes@362: bfd * (*_bfd_get_elt_at_index) (bfd *, symindex); nkeynes@362: int (*_bfd_stat_arch_elt) (bfd *, struct stat *); nkeynes@362: bfd_boolean (*_bfd_update_armap_timestamp) (bfd *); nkeynes@362: nkeynes@362: /* Entry points used for symbols. */ nkeynes@362: #define BFD_JUMP_TABLE_SYMBOLS(NAME) \ nkeynes@362: NAME##_get_symtab_upper_bound, \ nkeynes@362: NAME##_canonicalize_symtab, \ nkeynes@362: NAME##_make_empty_symbol, \ nkeynes@362: NAME##_print_symbol, \ nkeynes@362: NAME##_get_symbol_info, \ nkeynes@362: NAME##_bfd_is_local_label_name, \ nkeynes@362: NAME##_bfd_is_target_special_symbol, \ nkeynes@362: NAME##_get_lineno, \ nkeynes@362: NAME##_find_nearest_line, \ nkeynes@362: NAME##_bfd_make_debug_symbol, \ nkeynes@362: NAME##_read_minisymbols, \ nkeynes@362: NAME##_minisymbol_to_symbol nkeynes@362: nkeynes@362: long (*_bfd_get_symtab_upper_bound) (bfd *); nkeynes@362: long (*_bfd_canonicalize_symtab) nkeynes@362: (bfd *, struct bfd_symbol **); nkeynes@362: struct bfd_symbol * nkeynes@362: (*_bfd_make_empty_symbol) (bfd *); nkeynes@362: void (*_bfd_print_symbol) nkeynes@362: (bfd *, void *, struct bfd_symbol *, bfd_print_symbol_type); nkeynes@362: #define bfd_print_symbol(b,p,s,e) BFD_SEND (b, _bfd_print_symbol, (b,p,s,e)) nkeynes@362: void (*_bfd_get_symbol_info) nkeynes@362: (bfd *, struct bfd_symbol *, symbol_info *); nkeynes@362: #define bfd_get_symbol_info(b,p,e) BFD_SEND (b, _bfd_get_symbol_info, (b,p,e)) nkeynes@362: bfd_boolean (*_bfd_is_local_label_name) (bfd *, const char *); nkeynes@362: bfd_boolean (*_bfd_is_target_special_symbol) (bfd *, asymbol *); nkeynes@362: alent * (*_get_lineno) (bfd *, struct bfd_symbol *); nkeynes@362: bfd_boolean (*_bfd_find_nearest_line) nkeynes@362: (bfd *, struct bfd_section *, struct bfd_symbol **, bfd_vma, nkeynes@362: const char **, const char **, unsigned int *); nkeynes@362: /* Back-door to allow format-aware applications to create debug symbols nkeynes@362: while using BFD for everything else. Currently used by the assembler nkeynes@362: when creating COFF files. */ nkeynes@362: asymbol * (*_bfd_make_debug_symbol) nkeynes@362: (bfd *, void *, unsigned long size); nkeynes@362: #define bfd_read_minisymbols(b, d, m, s) \ nkeynes@362: BFD_SEND (b, _read_minisymbols, (b, d, m, s)) nkeynes@362: long (*_read_minisymbols) nkeynes@362: (bfd *, bfd_boolean, void **, unsigned int *); nkeynes@362: #define bfd_minisymbol_to_symbol(b, d, m, f) \ nkeynes@362: BFD_SEND (b, _minisymbol_to_symbol, (b, d, m, f)) nkeynes@362: asymbol * (*_minisymbol_to_symbol) nkeynes@362: (bfd *, bfd_boolean, const void *, asymbol *); nkeynes@362: nkeynes@362: /* Routines for relocs. */ nkeynes@362: #define BFD_JUMP_TABLE_RELOCS(NAME) \ nkeynes@362: NAME##_get_reloc_upper_bound, \ nkeynes@362: NAME##_canonicalize_reloc, \ nkeynes@362: NAME##_bfd_reloc_type_lookup nkeynes@362: nkeynes@362: long (*_get_reloc_upper_bound) (bfd *, sec_ptr); nkeynes@362: long (*_bfd_canonicalize_reloc) nkeynes@362: (bfd *, sec_ptr, arelent **, struct bfd_symbol **); nkeynes@362: /* See documentation on reloc types. */ nkeynes@362: reloc_howto_type * nkeynes@362: (*reloc_type_lookup) (bfd *, bfd_reloc_code_real_type); nkeynes@362: nkeynes@362: /* Routines used when writing an object file. */ nkeynes@362: #define BFD_JUMP_TABLE_WRITE(NAME) \ nkeynes@362: NAME##_set_arch_mach, \ nkeynes@362: NAME##_set_section_contents nkeynes@362: nkeynes@362: bfd_boolean (*_bfd_set_arch_mach) nkeynes@362: (bfd *, enum bfd_architecture, unsigned long); nkeynes@362: bfd_boolean (*_bfd_set_section_contents) nkeynes@362: (bfd *, sec_ptr, const void *, file_ptr, bfd_size_type); nkeynes@362: nkeynes@362: /* Routines used by the linker. */ nkeynes@362: #define BFD_JUMP_TABLE_LINK(NAME) \ nkeynes@362: NAME##_sizeof_headers, \ nkeynes@362: NAME##_bfd_get_relocated_section_contents, \ nkeynes@362: NAME##_bfd_relax_section, \ nkeynes@362: NAME##_bfd_link_hash_table_create, \ nkeynes@362: NAME##_bfd_link_hash_table_free, \ nkeynes@362: NAME##_bfd_link_add_symbols, \ nkeynes@362: NAME##_bfd_link_just_syms, \ nkeynes@362: NAME##_bfd_final_link, \ nkeynes@362: NAME##_bfd_link_split_section, \ nkeynes@362: NAME##_bfd_gc_sections, \ nkeynes@362: NAME##_bfd_merge_sections, \ nkeynes@362: NAME##_bfd_is_group_section, \ nkeynes@362: NAME##_bfd_discard_group, \ nkeynes@362: NAME##_section_already_linked \ nkeynes@362: nkeynes@362: int (*_bfd_sizeof_headers) (bfd *, bfd_boolean); nkeynes@362: bfd_byte * (*_bfd_get_relocated_section_contents) nkeynes@362: (bfd *, struct bfd_link_info *, struct bfd_link_order *, nkeynes@362: bfd_byte *, bfd_boolean, struct bfd_symbol **); nkeynes@362: nkeynes@362: bfd_boolean (*_bfd_relax_section) nkeynes@362: (bfd *, struct bfd_section *, struct bfd_link_info *, bfd_boolean *); nkeynes@362: nkeynes@362: /* Create a hash table for the linker. Different backends store nkeynes@362: different information in this table. */ nkeynes@362: struct bfd_link_hash_table * nkeynes@362: (*_bfd_link_hash_table_create) (bfd *); nkeynes@362: nkeynes@362: /* Release the memory associated with the linker hash table. */ nkeynes@362: void (*_bfd_link_hash_table_free) (struct bfd_link_hash_table *); nkeynes@362: nkeynes@362: /* Add symbols from this object file into the hash table. */ nkeynes@362: bfd_boolean (*_bfd_link_add_symbols) (bfd *, struct bfd_link_info *); nkeynes@362: nkeynes@362: /* Indicate that we are only retrieving symbol values from this section. */ nkeynes@362: void (*_bfd_link_just_syms) (asection *, struct bfd_link_info *); nkeynes@362: nkeynes@362: /* Do a link based on the link_order structures attached to each nkeynes@362: section of the BFD. */ nkeynes@362: bfd_boolean (*_bfd_final_link) (bfd *, struct bfd_link_info *); nkeynes@362: nkeynes@362: /* Should this section be split up into smaller pieces during linking. */ nkeynes@362: bfd_boolean (*_bfd_link_split_section) (bfd *, struct bfd_section *); nkeynes@362: nkeynes@362: /* Remove sections that are not referenced from the output. */ nkeynes@362: bfd_boolean (*_bfd_gc_sections) (bfd *, struct bfd_link_info *); nkeynes@362: nkeynes@362: /* Attempt to merge SEC_MERGE sections. */ nkeynes@362: bfd_boolean (*_bfd_merge_sections) (bfd *, struct bfd_link_info *); nkeynes@362: nkeynes@362: /* Is this section a member of a group? */ nkeynes@362: bfd_boolean (*_bfd_is_group_section) (bfd *, const struct bfd_section *); nkeynes@362: nkeynes@362: /* Discard members of a group. */ nkeynes@362: bfd_boolean (*_bfd_discard_group) (bfd *, struct bfd_section *); nkeynes@362: nkeynes@362: /* Check if SEC has been already linked during a reloceatable or nkeynes@362: final link. */ nkeynes@362: void (*_section_already_linked) (bfd *, struct bfd_section *); nkeynes@362: nkeynes@362: /* Routines to handle dynamic symbols and relocs. */ nkeynes@362: #define BFD_JUMP_TABLE_DYNAMIC(NAME) \ nkeynes@362: NAME##_get_dynamic_symtab_upper_bound, \ nkeynes@362: NAME##_canonicalize_dynamic_symtab, \ nkeynes@362: NAME##_get_synthetic_symtab, \ nkeynes@362: NAME##_get_dynamic_reloc_upper_bound, \ nkeynes@362: NAME##_canonicalize_dynamic_reloc nkeynes@362: nkeynes@362: /* Get the amount of memory required to hold the dynamic symbols. */ nkeynes@362: long (*_bfd_get_dynamic_symtab_upper_bound) (bfd *); nkeynes@362: /* Read in the dynamic symbols. */ nkeynes@362: long (*_bfd_canonicalize_dynamic_symtab) nkeynes@362: (bfd *, struct bfd_symbol **); nkeynes@362: /* Create synthetized symbols. */ nkeynes@362: long (*_bfd_get_synthetic_symtab) nkeynes@362: (bfd *, long, struct bfd_symbol **, long, struct bfd_symbol **, nkeynes@362: struct bfd_symbol **); nkeynes@362: /* Get the amount of memory required to hold the dynamic relocs. */ nkeynes@362: long (*_bfd_get_dynamic_reloc_upper_bound) (bfd *); nkeynes@362: /* Read in the dynamic relocs. */ nkeynes@362: long (*_bfd_canonicalize_dynamic_reloc) nkeynes@362: (bfd *, arelent **, struct bfd_symbol **); nkeynes@362: nkeynes@362: /* Opposite endian version of this target. */ nkeynes@362: const struct bfd_target * alternative_target; nkeynes@362: nkeynes@362: /* Data for use by back-end routines, which isn't nkeynes@362: generic enough to belong in this structure. */ nkeynes@362: const void *backend_data; nkeynes@362: nkeynes@362: } bfd_target; nkeynes@362: nkeynes@362: bfd_boolean bfd_set_default_target (const char *name); nkeynes@362: nkeynes@362: const bfd_target *bfd_find_target (const char *target_name, bfd *abfd); nkeynes@362: nkeynes@362: const char ** bfd_target_list (void); nkeynes@362: nkeynes@362: const bfd_target *bfd_search_for_target nkeynes@362: (int (*search_func) (const bfd_target *, void *), nkeynes@362: void *); nkeynes@362: nkeynes@362: /* Extracted from format.c. */ nkeynes@362: bfd_boolean bfd_check_format (bfd *abfd, bfd_format format); nkeynes@362: nkeynes@362: bfd_boolean bfd_check_format_matches nkeynes@362: (bfd *abfd, bfd_format format, char ***matching); nkeynes@362: nkeynes@362: bfd_boolean bfd_set_format (bfd *abfd, bfd_format format); nkeynes@362: nkeynes@362: const char *bfd_format_string (bfd_format format); nkeynes@362: nkeynes@362: /* Extracted from linker.c. */ nkeynes@362: bfd_boolean bfd_link_split_section (bfd *abfd, asection *sec); nkeynes@362: nkeynes@362: #define bfd_link_split_section(abfd, sec) \ nkeynes@362: BFD_SEND (abfd, _bfd_link_split_section, (abfd, sec)) nkeynes@362: nkeynes@362: void bfd_section_already_linked (bfd *abfd, asection *sec); nkeynes@362: nkeynes@362: #define bfd_section_already_linked(abfd, sec) \ nkeynes@362: BFD_SEND (abfd, _section_already_linked, (abfd, sec)) nkeynes@362: nkeynes@362: /* Extracted from simple.c. */ nkeynes@362: bfd_byte *bfd_simple_get_relocated_section_contents nkeynes@362: (bfd *abfd, asection *sec, bfd_byte *outbuf, asymbol **symbol_table); nkeynes@362: nkeynes@362: #ifdef __cplusplus nkeynes@362: } nkeynes@362: #endif nkeynes@362: #endif