/* Main header file for the bfd library -- portable access to object files.
- Copyright 1990, 91, 92, 93, 94, 95, 1996 Free Software Foundation, Inc.
+ Copyright 1990, 91, 92, 93, 94, 95, 96, 1997 Free Software Foundation, Inc.
Contributed by Cygnus Support.
** NOTE: bfd.h and bfd-in2.h are GENERATED files. Don't change them;
#endif
#include "ansidecl.h"
-#include "obstack.h"
/* These two lines get substitutions done by commands in Makefile.in. */
#define BFD_VERSION "@VERSION@"
#define bfd_section_name(bfd, ptr) ((ptr)->name)
#define bfd_section_size(bfd, ptr) (bfd_get_section_size_before_reloc(ptr))
#define bfd_section_vma(bfd, ptr) ((ptr)->vma)
+#define bfd_section_lma(bfd, ptr) ((ptr)->lma)
#define bfd_section_alignment(bfd, ptr) ((ptr)->alignment_power)
#define bfd_get_section_flags(bfd, ptr) ((ptr)->flags + 0)
#define bfd_get_section_userdata(bfd, ptr) ((ptr)->userdata)
struct bfd_hash_entry *(*newfunc) PARAMS ((struct bfd_hash_entry *,
struct bfd_hash_table *,
const char *));
- /* An obstack for this hash table. */
- struct obstack memory;
+ /* An objalloc for this hash table. This is a struct objalloc *,
+ but we use PTR to avoid requiring the inclusion of objalloc.h. */
+ PTR memory;
};
/* Initialize a hash table. */
struct symbol_cache_entry;
struct bfd_link_info;
struct bfd_link_hash_entry;
+struct bfd_elf_version_tree;
#endif
extern bfd_vma bfd_ecoff_get_gp_value PARAMS ((bfd * abfd));
extern boolean bfd_ecoff_set_gp_value PARAMS ((bfd *abfd, bfd_vma gp_value));
extern struct bfd_link_needed_list *bfd_elf_get_needed_list
PARAMS ((bfd *, struct bfd_link_info *));
extern boolean bfd_elf32_size_dynamic_sections
- PARAMS ((bfd *, const char *, const char *, boolean,
- struct bfd_link_info *, struct sec **));
+ PARAMS ((bfd *, const char *, const char *, boolean, const char *,
+ const char * const *, struct bfd_link_info *, struct sec **,
+ struct bfd_elf_version_tree *));
extern boolean bfd_elf64_size_dynamic_sections
- PARAMS ((bfd *, const char *, const char *, boolean,
- struct bfd_link_info *, struct sec **));
+ PARAMS ((bfd *, const char *, const char *, boolean, const char *,
+ const char * const *, struct bfd_link_info *, struct sec **,
+ struct bfd_elf_version_tree *));
extern void bfd_elf_set_dt_needed_name PARAMS ((bfd *, const char *));
extern const char *bfd_elf_get_dt_soname PARAMS ((bfd *));
PARAMS ((bfd *, struct bfd_link_info *));
extern boolean bfd_m68klinux_size_dynamic_sections
PARAMS ((bfd *, struct bfd_link_info *));
+extern boolean bfd_sparclinux_size_dynamic_sections
+ PARAMS ((bfd *, struct bfd_link_info *));
/* mmap hacks */
bfd_fdopenr PARAMS ((CONST char *filename, CONST char *target, int fd));
bfd *
-bfd_openstreamr PARAMS (());
+bfd_openstreamr PARAMS ((const char *, const char *, PTR));
bfd *
bfd_openw PARAMS ((CONST char *filename, CONST char *target));
boolean
bfd_close_all_done PARAMS ((bfd *));
-bfd_size_type
-bfd_alloc_size PARAMS ((bfd *abfd));
-
bfd *
bfd_create PARAMS ((CONST char *filename, bfd *templ));
contents. */
#define SEC_LINK_DUPLICATES_SAME_CONTENTS 0x600000
+ /* This section was created by the linker as part of dynamic
+ relocation or other arcane processing. It is skipped when
+ going through the first-pass output, trusting that someone
+ else up the line will take care of it later. */
+#define SEC_LINKER_CREATED 0x800000
+
/* End of section flags. */
/* Some internal packed boolean fields. */
bfd_arch_powerpc, /* PowerPC */
bfd_arch_rs6000, /* IBM RS/6000 */
bfd_arch_hppa, /* HP PA RISC */
- /* start-sanitize-d10v */
bfd_arch_d10v, /* Mitsubishi D10V */
- /* end-sanitize-d10v */
+ /* start-sanitize-d30v */
+ bfd_arch_d30v, /* Mitsubishi D30V */
+ /* end-sanitize-d30v */
bfd_arch_z8k, /* Zilog Z8000 */
#define bfd_mach_z8001 1
#define bfd_mach_z8002 2
bfd_arch_h8500, /* Hitachi H8/500 */
bfd_arch_sh, /* Hitachi SH */
- /* start-sanitize-tic80 */
- bfd_arch_tic80, /* TI TMS320C80 (MVP) */
- /* end-sanitize-tic80 */
+#define bfd_mach_sh 0
+#define bfd_mach_sh3 0x30
+#define bfd_mach_sh3e 0x3e
+ /* start-sanitize-sh4 */
+#define bfd_mach_sh4 0x40
+ /* end-sanitize-sh4 */
bfd_arch_alpha, /* Dec Alpha */
bfd_arch_arm, /* Advanced Risc Machines ARM */
+#define bfd_mach_arm_2 1
+#define bfd_mach_arm_2a 2
+#define bfd_mach_arm_3 3
+#define bfd_mach_arm_3M 4
+#define bfd_mach_arm_4 5
+#define bfd_mach_arm_4T 6
bfd_arch_ns32k, /* National Semiconductors ns32000 */
bfd_arch_w65, /* WDC 65816 */
+ /* start-sanitize-tic80 */
+ bfd_arch_tic80, /* TI TMS320c80 (MVP) */
+ /* end-sanitize-tic80 */
/* start-sanitize-v850 */
bfd_arch_v850, /* NEC V850 */
+#define bfd_mach_v850 0
+ /* start-sanitize-v850e */
+#define bfd_mach_v850e 'E'
+ /* end-sanitize-v850e */
+ /* start-sanitize-v850eq */
+#define bfd_mach_v850eq 'Q'
+ /* end-sanitize-v850eq */
/* end-sanitize-v850 */
- /* start-sanitize-arc */
bfd_arch_arc, /* Argonaut RISC Core */
#define bfd_mach_arc_base 0
-#define bfd_mach_arc_host 1
-#define bfd_mach_arc_graphics 2
-#define bfd_mach_arc_audio 3
- /* end-sanitize-arc */
- /* start-sanitize-m32r */
- bfd_arch_m32r, /* Mitsubishi M32R */
- /* end-sanitize-m32r */
+ bfd_arch_m32r, /* Mitsubishi M32R/D */
bfd_arch_mn10200, /* Matsushita MN10200 */
bfd_arch_mn10300, /* Matsushita MN10300 */
bfd_arch_last
struct reloc_howto_struct
{
- /* The type field has mainly a documetary use - the back end can
+ /* The type field has mainly a documentary use - the back end can
do what it wants with it, though normally the back end's
external idea of what a reloc number is stored
in this field. For example, a PC relative word relocation
BFD_RELOC_64,
BFD_RELOC_32,
BFD_RELOC_26,
+ BFD_RELOC_24,
BFD_RELOC_16,
BFD_RELOC_14,
BFD_RELOC_8,
which is filled by the linker. */
BFD_RELOC_ALPHA_LINKAGE,
+/* The CODEADDR relocation outputs a STO_CA in the object file,
+which is filled by the linker. */
+ BFD_RELOC_ALPHA_CODEADDR,
+
/* Bits 27..2 of the relocation address shifted right 2 bits;
simple reloc otherwise. */
BFD_RELOC_MIPS_JMP,
/* The MIPS16 jump instruction. */
BFD_RELOC_MIPS16_JMP,
+/* MIPS16 GP relative reloc. */
+ BFD_RELOC_MIPS16_GPREL,
+
/* High 16 bits of 32-bit value; simple reloc. */
BFD_RELOC_HI16,
BFD_RELOC_SH_CODE,
BFD_RELOC_SH_DATA,
BFD_RELOC_SH_LABEL,
-/* start-sanitize-arc */
+
+/* Thumb 23-, 12- and 9-bit pc-relative branches. The lowest bit must
+be zero and is not stored in the instruction. */
+ BFD_RELOC_THUMB_PCREL_BRANCH9,
+ BFD_RELOC_THUMB_PCREL_BRANCH12,
+ BFD_RELOC_THUMB_PCREL_BRANCH23,
/* Argonaut RISC Core (ARC) relocs.
ARC 22 bit pc-relative branch. The lowest two bits must be zero and are
stored in the instruction. The high 24 bits are installed in bits 23
through 0. */
BFD_RELOC_ARC_B26,
-/* end-sanitize-arc */
-
-/* start-sanitize-d10v */
/* Mitsubishi D10V relocs.
This is a 10-bit reloc with the right 2 bits
/* This is an 18-bit reloc with the right 2 bits
assumed to be 0. */
BFD_RELOC_D10V_18_PCREL,
-/* end-sanitize-d10v */
-/* start-sanitize-m32r */
+/* start-sanitize-d30v */
+
+/* Mitsubishi D30V relocs.
+This is a 6-bit absolute reloc. */
+ BFD_RELOC_D30V_6,
+
+/* Mitsubishi D30V relocs.
+This is a 12-bit absolute reloc with the
+right 3 bitsassumed to be 0. */
+ BFD_RELOC_D30V_15,
+
+/* Mitsubishi D30V relocs.
+This is a 12-bit pc-relative reloc with
+the right 3 bits assumed to be 0. */
+ BFD_RELOC_D30V_15_PCREL,
+
+/* This is an 18-bit absolute reloc with
+the right 3 bits assumed to be 0. */
+ BFD_RELOC_D30V_21,
+
+/* This is an 18-bit pc-relative reloc with
+the right 3 bits assumed to be 0. */
+ BFD_RELOC_D30V_21_PCREL,
+
+/* This is a 32-bit absolute reloc. */
+ BFD_RELOC_D30V_32,
+
+/* This is a 32-bit pc-relative reloc. */
+ BFD_RELOC_D30V_32_PCREL,
+/* end-sanitize-d30v */
+
/* Mitsubishi M32R relocs.
This is a 24 bit absolute address. */
/* This is an 18-bit reloc with the right 2 bits assumed to be 0. */
BFD_RELOC_M32R_18_PCREL,
-/* This is an 26-bit reloc with the right 2 bits assumed to be 0. */
+/* This is a 26-bit reloc with the right 2 bits assumed to be 0. */
BFD_RELOC_M32R_26_PCREL,
-/* end-sanitize-m32r */
+/* This is a 16-bit reloc containing the high 16 bits of an address
+used when the lower 16 bits are treated as unsigned. */
+ BFD_RELOC_M32R_HI16_ULO,
+
+/* This is a 16-bit reloc containing the high 16 bits of an address
+used when the lower 16 bits are treated as signed. */
+ BFD_RELOC_M32R_HI16_SLO,
+
+/* This is a 16-bit reloc containing the lower 16 bits of an address. */
+ BFD_RELOC_M32R_LO16,
+
+/* This is a 16-bit reloc containing the small data area offset for use in
+add3, load, and store instructions. */
+ BFD_RELOC_M32R_SDA16,
/* start-sanitize-v850 */
/* This is a 9-bit reloc */
BFD_RELOC_V850_9_PCREL,
+/* This is a 16-bit reloc */
+ BFD_RELOC_V850_16_PCREL,
+
/* This is a 22-bit reloc */
BFD_RELOC_V850_22_PCREL,
-/* This is an offset from the short data area pointer.. */
- BFD_RELOC_V850_SDA_OFFSET,
-
-/* This is an offset from the zero data area pointer.. */
- BFD_RELOC_V850_ZDA_OFFSET,
-
-/* This is an offset from the tiny data area pointer.. */
- BFD_RELOC_V850_TDA_OFFSET,
+ BFD_RELOC_V850_SDA_16_16_OFFSET, /* A 16 bit reloc in the small data area. */
+ BFD_RELOC_V850_SDA_15_16_OFFSET, /* A 16 bit reloc (of which only 15 bits are used) in the small data area. */
+ BFD_RELOC_V850_ZDA_16_16_OFFSET, /* A 16 bit reloc in the zero data area. */
+ BFD_RELOC_V850_ZDA_15_16_OFFSET, /* A 16 bit reloc (of which only 15 bits are used) in the zero data area. */
+ BFD_RELOC_V850_TDA_6_8_OFFSET, /* An 8 bit reloc (of which only 6 bits are used) in the tiny data area. */
+ BFD_RELOC_V850_TDA_7_8_OFFSET, /* An 8 bit reloc (of which only 7 bits are used) in the tiny data area. */
+ BFD_RELOC_V850_TDA_7_7_OFFSET, /* A 7 bit reloc in the tiny data area. */
+/* start-sanitize-v850e */
+ BFD_RELOC_V850_TDA_4_5_OFFSET, /* A 5 bit reloc (of which only 4 bits are used) in the tiny data area. */
+ BFD_RELOC_V850_TDA_4_4_OFFSET, /* A 4 bit reloc in the tiny data area. */
+ BFD_RELOC_V850_SDA_16_16_SPLIT_OFFSET, /* A 16 bit reloc (but the bits are not contiguous) in the small data area. */
+ BFD_RELOC_V850_ZDA_16_16_SPLIT_OFFSET, /* A 16 bit reloc (but the bits are not contiguous) in the zero data area. */
+/* end-santize-v850e */
/* end-sanitize-v850 */
boolean
bfd_is_local_label PARAMS ((bfd *abfd, asymbol *sym));
-#define bfd_is_local_label(abfd, sym) \
- BFD_SEND (abfd, _bfd_is_local_label,(abfd, sym))
+boolean
+bfd_is_local_label_name PARAMS ((bfd *abfd, const char *name));
+
+#define bfd_is_local_label_name(abfd, name) \
+ BFD_SEND (abfd, _bfd_is_local_label_name, (abfd, name))
#define bfd_canonicalize_symtab(abfd, location) \
BFD_SEND (abfd, _bfd_canonicalize_symtab,\
(abfd, location))
/* Used by the application to hold private data*/
PTR usrdata;
- /* Where all the allocated stuff under this BFD goes */
- struct obstack memory;
+ /* Where all the allocated stuff under this BFD goes. This is a
+ struct objalloc *, but we use PTR to avoid requiring the inclusion of
+ objalloc.h. */
+ PTR memory;
};
typedef enum bfd_error
CAT(NAME,_make_empty_symbol),\
CAT(NAME,_print_symbol),\
CAT(NAME,_get_symbol_info),\
-CAT(NAME,_bfd_is_local_label),\
+CAT(NAME,_bfd_is_local_label_name),\
CAT(NAME,_get_lineno),\
CAT(NAME,_find_nearest_line),\
CAT(NAME,_bfd_make_debug_symbol),\
struct symbol_cache_entry *,
symbol_info *));
#define bfd_get_symbol_info(b,p,e) BFD_SEND(b, _bfd_get_symbol_info, (b,p,e))
- boolean (*_bfd_is_local_label) PARAMS ((bfd *, asymbol *));
+ boolean (*_bfd_is_local_label_name) PARAMS ((bfd *, const char *));
alent * (*_get_lineno) PARAMS ((bfd *, struct symbol_cache_entry *));
boolean (*_bfd_find_nearest_line) PARAMS ((bfd *abfd,
PTR backend_data;
} bfd_target;
+boolean
+bfd_set_default_target PARAMS ((const char *name));
+
const bfd_target *
bfd_find_target PARAMS ((CONST char *target_name, bfd *abfd));