/* 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. */
#define bfd_mach_sparc_v9_p(mach) \
((mach) >= bfd_mach_sparc_v8plus && (mach) <= bfd_mach_sparc_v9a)
bfd_arch_mips, /* MIPS Rxxxx */
+#define bfd_mach_mips3000 3000
+#define bfd_mach_mips6000 6000
+#define bfd_mach_mips4000 4000
+#define bfd_mach_mips8000 8000
+#define bfd_mach_mips16 16
+ /* start-sanitize-vr5400 */
+#define bfd_mach_vr5400 5400
+#define bfd_mach_vr5000 5000
+ /* end-sanitize-vr5400 */
bfd_arch_i386, /* Intel 386 */
#define bfd_mach_i386_i386 0
#define bfd_mach_i386_i8086 1
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-v850 */
+ /* start-sanitize-tic80 */
+ bfd_arch_tic80, /* TI TMS320c80 (MVP) */
+ /* end-sanitize-tic80 */
+ /* start-sanitize-sky */
+ bfd_arch_txvu, /* TX VU */
+#define bfd_mach_txvu 0
+ /* end-sanitize-sky */
bfd_arch_v850, /* NEC V850 */
- /* end-sanitize-v850 */
- /* start-sanitize-arc */
+#define bfd_mach_v850 0
+ /* start-sanitize-v850e */
+#define bfd_mach_v850e 'E'
+#define bfd_mach_v850ea 'A'
+ /* end-sanitize-v850e */
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 */
+#define bfd_mach_m32r 0 /* backwards compatibility */
+ /* start-sanitize-m32rx */
+#define bfd_mach_m32rx 'x'
+ /* end-sanitize-m32rx */
bfd_arch_mn10200, /* Matsushita MN10200 */
bfd_arch_mn10300, /* Matsushita MN10300 */
bfd_arch_last
const bfd_arch_info_type *
bfd_scan_arch PARAMS ((const char *string));
+const char **
+bfd_arch_list PARAMS ((void));
+
const bfd_arch_info_type *
bfd_arch_get_compatible PARAMS ((
const bfd *abfd,
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
} arelent_chain;
bfd_reloc_status_type
+bfd_check_overflow
+ PARAMS ((enum complain_overflow how,
+ unsigned int bitsize,
+ unsigned int rightshift,
+ bfd_vma relocation));
+
+bfd_reloc_status_type
+
bfd_perform_relocation
PARAMS ((bfd *abfd,
arelent *reloc_entry,
BFD_RELOC_64,
BFD_RELOC_32,
BFD_RELOC_26,
+ BFD_RELOC_24,
BFD_RELOC_16,
BFD_RELOC_14,
BFD_RELOC_8,
BFD_RELOC_SPARC_BASE13,
BFD_RELOC_SPARC_BASE22,
-/* Some relocations we're using for SPARC V9 -- subject to change. */
+/* SPARC64 relocations */
#define BFD_RELOC_SPARC_64 BFD_RELOC_64
BFD_RELOC_SPARC_10,
BFD_RELOC_SPARC_11,
BFD_RELOC_SPARC_PC_LM22,
BFD_RELOC_SPARC_WDISP16,
BFD_RELOC_SPARC_WDISP19,
- BFD_RELOC_SPARC_GLOB_JMP,
BFD_RELOC_SPARC_7,
BFD_RELOC_SPARC_6,
BFD_RELOC_SPARC_5,
+#define BFD_RELOC_SPARC_DISP64 BFD_RELOC_64_PCREL
+ BFD_RELOC_SPARC_PLT64,
+ BFD_RELOC_SPARC_HIX22,
+ BFD_RELOC_SPARC_LOX10,
+ BFD_RELOC_SPARC_H44,
+ BFD_RELOC_SPARC_M44,
+ BFD_RELOC_SPARC_L44,
+ BFD_RELOC_SPARC_REGISTER,
/* Alpha ECOFF and ELF relocations. Some of these treat the symbol or
"addend" in some special way.
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,
+
+/* This is a 6-bit pc-relative reloc with
+the right 3 bits assumed to be 0. */
+ BFD_RELOC_D30V_9_PCREL,
+
+/* This is a 6-bit pc-relative reloc with
+the right 3 bits assumed to be 0. Same
+as the previous reloc but on the right side
+of the container. */
+ BFD_RELOC_D30V_9_PCREL_R,
+
+/* This is a 12-bit absolute reloc with the
+right 3 bitsassumed to be 0. */
+ BFD_RELOC_D30V_15,
+
+/* This is a 12-bit pc-relative reloc with
+the right 3 bits assumed to be 0. */
+ BFD_RELOC_D30V_15_PCREL,
+
+/* This is a 12-bit pc-relative reloc with
+the right 3 bits assumed to be 0. Same
+as the previous reloc but on the right side
+of the container. */
+ BFD_RELOC_D30V_15_PCREL_R,
+
+/* 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 an 18-bit pc-relative reloc with
+the right 3 bits assumed to be 0. Same
+as the previous reloc but on the right side
+of the container. */
+ BFD_RELOC_D30V_21_PCREL_R,
+
+/* 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 */
-/* start-sanitize-v850 */
+/* 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,
/* This is a 9-bit reloc */
BFD_RELOC_V850_9_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 a 16 bit offset from the short data area pointer. */
+ BFD_RELOC_V850_SDA_16_16_OFFSET,
+
+/* This is a 16 bit offset (of which only 15 bits are used) from the
+short data area pointer. */
+ BFD_RELOC_V850_SDA_15_16_OFFSET,
+
+/* This is a 16 bit offset from the zero data area pointer. */
+ BFD_RELOC_V850_ZDA_16_16_OFFSET,
+
+/* This is a 16 bit offset (of which only 15 bits are used) from the
+zero data area pointer. */
+ BFD_RELOC_V850_ZDA_15_16_OFFSET,
+
+/* This is an 8 bit offset (of which only 6 bits are used) from the
+tiny data area pointer. */
+ BFD_RELOC_V850_TDA_6_8_OFFSET,
-/* This is an offset from the zero data area pointer.. */
- BFD_RELOC_V850_ZDA_OFFSET,
+/* This is an 8bit offset (of which only 7 bits are used) from the tiny
+data area pointer. */
+ BFD_RELOC_V850_TDA_7_8_OFFSET,
-/* This is an offset from the tiny data area pointer.. */
- BFD_RELOC_V850_TDA_OFFSET,
-/* end-sanitize-v850 */
+/* This is a 7 bit offset from the tiny data area pointer. */
+ BFD_RELOC_V850_TDA_7_7_OFFSET,
+
+/* This is a 16 bit offset from the tiny data area pointer. */
+ BFD_RELOC_V850_TDA_16_16_OFFSET,
+/* start-sanitize-v850e */
+
+/* This is a 5 bit offset (of which only 4 bits are used) from the tiny
+data area pointer. */
+ BFD_RELOC_V850_TDA_4_5_OFFSET,
+
+/* This is a 4 bit offset from the tiny data area pointer. */
+ BFD_RELOC_V850_TDA_4_4_OFFSET,
+
+/* This is a 16 bit offset from the short data area pointer, with the
+bits placed non-contigously in the instruction. */
+ BFD_RELOC_V850_SDA_16_16_SPLIT_OFFSET,
+
+/* This is a 16 bit offset from the zero data area pointer, with the
+bits placed non-contigously in the instruction. */
+ BFD_RELOC_V850_ZDA_16_16_SPLIT_OFFSET,
+
+/* This is a 6 bit offset from the call table base pointer. */
+ BFD_RELOC_V850_CALLT_6_7_OFFSET,
+
+/* This is a 16 bit offset from the call table base pointer. */
+ BFD_RELOC_V850_CALLT_16_16_OFFSET,
+/* end-sanitize-v850e */
/* This is a 32bit pcrel reloc for the mn10300, offset by two bytes in the
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));