/* Main header file for the bfd library -- portable access to object files.
==> The bfd.h file is generated from bfd-in.h and various .c files; if you
==> change it, your changes will probably be lost.
- Copyright 1990, 1991, 1992 Free Software Foundation, Inc.
+ Copyright 1990, 1991, 1992, 1993 Free Software Foundation, Inc.
Contributed by Cygnus Support.
This file is part of BFD, the Binary File Descriptor library.
#include "ansidecl.h"
#include "obstack.h"
-#define BFD_VERSION "2.0"
+#define BFD_VERSION "2.1"
/* forward declaration */
typedef struct _bfd bfd;
#define bfd_get_output_section(x) ((x)->section->output_section)
#define bfd_set_section(x,y) ((x)->section) = (y)
#define bfd_asymbol_base(x) ((x)->section->vma)
-#define bfd_asymbol_value(x) (bfd_asymbol_base(x) + x->value)
+#define bfd_asymbol_value(x) (bfd_asymbol_base(x) + (x)->value)
#define bfd_asymbol_name(x) ((x)->name)
/*Perhaps future: #define bfd_asymbol_bfd(x) ((x)->section->owner)*/
#define bfd_asymbol_bfd(x) ((x)->the_bfd)
#define bfd_get_section_flags(bfd, ptr) ((ptr)->flags + 0)
#define bfd_get_section_userdata(bfd, ptr) ((ptr)->userdata)
+#define bfd_is_com_section(ptr) (((ptr)->flags & SEC_IS_COMMON) != 0)
+
#define bfd_set_section_vma(bfd, ptr, val) (((ptr)->vma = (val)), ((ptr)->user_set_vma = true), true)
#define bfd_set_section_alignment(bfd, ptr, val) (((ptr)->alignment_power = (val)),true)
#define bfd_set_section_userdata(bfd, ptr, val) (((ptr)->userdata = (val)),true)
CAT(NAME,_bfd_debug_info_end),\
CAT(NAME,_bfd_debug_info_accumulate),\
CAT(NAME,_bfd_get_relocated_section_contents),\
-CAT(NAME,_bfd_relax_section)
+CAT(NAME,_bfd_relax_section),\
+CAT(NAME,_bfd_seclet_link),\
+CAT(NAME,_bfd_reloc_type_lookup),\
+CAT(NAME,_bfd_make_debug_symbol)
#define COFF_SWAP_TABLE (PTR) &bfd_coff_std_swap_table
/* The section is a constuctor, and should be placed at the
end of the . */
-
#define SEC_CONSTRUCTOR_TEXT 0x1100
#define SEC_CONSTRUCTOR_DATA 0x2100
#define SEC_CONSTRUCTOR_BSS 0x3100
-
- /* The section has contents - a bss section could be
+ /* The section has contents - a data section could be
<<SEC_ALLOC>> | <<SEC_HAS_CONTENTS>>, a debug section could be
<<SEC_HAS_CONTENTS>> */
#define SEC_SHARED_LIBRARY 0x800
+ /* The section is a common section (symbols may be defined
+ multiple times, the value of a symbol is the amount of
+ space it requires, and the largest symbol value is the one
+ used). Most targets have exactly one of these (.bss), but
+ ECOFF has two. */
+
+#define SEC_IS_COMMON 0x8000
bfd_vma vma;
boolean user_set_vma;
#define BFD_ABS_SECTION_NAME "*ABS*"
#define BFD_UND_SECTION_NAME "*UND*"
#define BFD_COM_SECTION_NAME "*COM*"
+#define BFD_IND_SECTION_NAME "*IND*"
/* the absolute section */
extern asection bfd_abs_section;
extern asection bfd_und_section;
/* Pointer to the common section */
extern asection bfd_com_section;
+ /* Pointer to the indirect section */
+ extern asection bfd_ind_section;
extern struct symbol_cache_entry *bfd_abs_symbol;
extern struct symbol_cache_entry *bfd_com_symbol;
extern struct symbol_cache_entry *bfd_und_symbol;
+ extern struct symbol_cache_entry *bfd_ind_symbol;
#define bfd_get_section_size_before_reloc(section) \
(section->reloc_done ? (abort(),1): (section)->_raw_size)
#define bfd_get_section_size_after_reloc(section) \
bfd_arch_z8k, /* Zilog Z8000 */
#define bfd_mach_z8001 1
#define bfd_mach_z8002 2
+ bfd_arch_h8500, /* Hitachi H8/500 */
bfd_arch_last
};
unsigned int rightshift;
/* The size of the item to be relocated - 0, is one byte, 1 is 2
- bytes, 3 is four bytes. A negative value indicates that the
+ bytes, 2 is four bytes. A negative value indicates that the
result is to be subtracted from the data. */
int size;
#define HOWTO_PREPARE(relocation, symbol) \
{ \
if (symbol != (asymbol *)NULL) { \
- if (symbol->section == &bfd_com_section) { \
+ if (bfd_is_com_section (symbol->section)) { \
relocation = 0; \
} \
else { \
/* this one is a.out specific? */
BFD_RELOC_SPARC_BASE22,
+ /* Bits 27..2 of the relocation address shifted right 2 bits;
+ simple reloc otherwise. */
+ BFD_RELOC_MIPS_JMP,
+
+ /* signed 16-bit pc-relative, shifted right 2 bits (e.g. for MIPS) */
+ BFD_RELOC_16_PCREL_S2,
+
+ /* High 16 bits of 32-bit value; simple reloc. */
+ BFD_RELOC_HI16,
+ /* High 16 bits of 32-bit value but the low 16 bits will be sign
+ extended and added to form the final result. If the low 16
+ bits form a negative number, we need to add one to the high value
+ to compensate for the borrow when the low bits are added. */
+ BFD_RELOC_HI16_S,
+ /* Low 16 bits. */
+ BFD_RELOC_LO16,
+
/* this must be the highest numeric value */
BFD_RELOC_UNUSED
} bfd_reloc_code_real_type;
struct _oasys_data *oasys_obj_data;
struct _oasys_ar_data *oasys_ar_data;
struct coff_tdata *coff_obj_data;
+ struct ecoff_tdata *ecoff_obj_data;
struct ieee_data_struct *ieee_data;
struct ieee_ar_data_struct *ieee_ar_data;
struct srec_data_struct *srec_data;
#define bfd_set_arch_mach(abfd, arch, mach)\
BFD_SEND ( abfd, _bfd_set_arch_mach, (abfd, arch, mach))
-#define bfd_get_relocated_section_contents(abfd, seclet, data) \
- BFD_SEND (abfd, _bfd_get_relocated_section_contents, (abfd, seclet, data))
+#define bfd_get_relocated_section_contents(abfd, seclet, data, relocateable) \
+ BFD_SEND (abfd, _bfd_get_relocated_section_contents, (abfd, seclet, data, relocateable))
#define bfd_relax_section(abfd, section, symbols) \
BFD_SEND (abfd, _bfd_relax_section, (abfd, section, symbols))
+
+#define bfd_seclet_link(abfd, data, relocateable) \
+ BFD_SEND (abfd, _bfd_seclet_link, (abfd, data, relocateable))
symindex
bfd_get_next_mapent PARAMS ((bfd *, symindex previous, carsym ** sym));
bfd_target_unknown_flavour,
bfd_target_aout_flavour,
bfd_target_coff_flavour,
+ bfd_target_ecoff_flavour,
bfd_target_elf_flavour,
bfd_target_ieee_flavour,
bfd_target_oasys_flavour,
void (*_bfd_debug_info_accumulate) PARAMS ((bfd *, struct sec *));
bfd_byte * (*_bfd_get_relocated_section_contents) PARAMS ((bfd *,
- struct bfd_seclet *, bfd_byte *data));
+ struct bfd_seclet *, bfd_byte *data,
+ boolean relocateable));
boolean (*_bfd_relax_section) PARAMS ((bfd *, struct sec *,
struct symbol_cache_entry **));
+
+ boolean (*_bfd_seclet_link) PARAMS ((bfd *, PTR data,
+ boolean relocateable));
/* See documentation on reloc types. */
CONST struct reloc_howto_struct *
(*reloc_type_lookup) PARAMS ((bfd *abfd,