/* 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, 1993 Free Software Foundation, Inc.
Contributed by Cygnus Support.
+** NOTE: bfd.h and bfd-in2.h are GENERATED files. Don't change them;
+** instead, change bfd-in.h or the other BFD source files processed to
+** generate these files.
+
This file is part of BFD, the Binary File Descriptor library.
This program is free software; you can redistribute it and/or modify
#define BFD64
#endif
+#ifndef INLINE
+#if __GNUC__ >= 2
+#define INLINE __inline__
+#else
+#define INLINE
+#endif
+#endif
+
/* 64-bit type definition (if any) from bfd's sysdep.h goes here */
the standard routine suffix), or it must #define the routines that
are not so named, before calling JUMP_TABLE in the initializer. */
-/* Semi-portable string concatenation in cpp */
+/* Semi-portable string concatenation in cpp.
+ The CAT4 hack is to avoid a problem with some strict ANSI C preprocessors.
+ The problem is, "32_" is not a valid preprocessing token, and we don't
+ want extra underscores (e.g., "nlm_32_"). The XCAT2 macro will cause the
+ inner CAT macros to be evaluated first, producing still-valid pp-tokens.
+ Then the final concatenation can be done. (Sigh.) */
#ifndef CAT
+#ifdef SABER
+#define CAT(a,b) a##b
+#define CAT3(a,b,c) a##b##c
+#define CAT4(a,b,c,d) a##b##c##d
+#else
#ifdef __STDC__
#define CAT(a,b) a##b
#define CAT3(a,b,c) a##b##c
+#define XCAT2(a,b) CAT(a,b)
+#define CAT4(a,b,c,d) XCAT2(CAT(a,b),CAT(c,d))
#else
#define CAT(a,b) a/**/b
#define CAT3(a,b,c) a/**/b/**/c
+#define CAT4(a,b,c,d) a/**/b/**/c/**/d
+#endif
#endif
#endif
CAT(NAME,_slurp_extended_name_table),\
CAT(NAME,_truncate_arname),\
CAT(NAME,_write_armap),\
-CAT(NAME,_close_and_cleanup), \
+CAT(NAME,_close_and_cleanup),\
CAT(NAME,_set_section_contents),\
CAT(NAME,_get_section_contents),\
CAT(NAME,_new_section_hook),\
bfd_alloc_size PARAMS ((bfd *abfd));
bfd *
-bfd_create PARAMS ((CONST char *filename, bfd *template));
+bfd_create PARAMS ((CONST char *filename, bfd *templ));
/* Byte swapping macros for user section data. */
CONST char *name;
-
/* Which section is it 0.nth */
int index;
/* Tells the OS to allocate space for this section when loaded.
This would clear for a section containing debug information
only. */
-
#define SEC_ALLOC 0x001
+
/* Tells the OS to load the section from the file when loading.
This would be clear for a .bss section */
#define SEC_LOAD 0x002
+
/* The section contains data still to be relocated, so there will
be some relocation information too. */
/* A signal to the OS that the section contains read only
data. */
+
#define SEC_READONLY 0x010
/* The section contains code only. */
end of the . */
#define SEC_CONSTRUCTOR_TEXT 0x1100
-
#define SEC_CONSTRUCTOR_DATA 0x2100
-
#define SEC_CONSTRUCTOR_BSS 0x3100
/* The section has contents - a data section could be
/* The virtual memory address of the section - where it will be
at run time - the symbols are relocated against this */
+
bfd_vma vma;
/* The load address of the section - where it would be in a
rom image, really only used for writing section header information */
+
bfd_vma lma;
boolean user_set_vma;
unsigned reloc_count;
/* Information below is back end specific - and not always used
- or updated
+ or updated. */
- File position of section data */
+ /* File position of section data */
file_ptr filepos;
/* A symbol which points at this section only */
struct symbol_cache_entry *symbol;
struct symbol_cache_entry **symbol_ptr_ptr;
+
struct bfd_seclet *seclets_head;
struct bfd_seclet *seclets_tail;
} asection ;
#define BFD_IND_SECTION_NAME "*IND*"
/* the absolute section */
- extern asection bfd_abs_section;
+extern asection bfd_abs_section;
/* Pointer to the undefined section */
- extern asection bfd_und_section;
+extern asection bfd_und_section;
/* Pointer to the common section */
- extern asection bfd_com_section;
+extern asection bfd_com_section;
/* Pointer to the indirect section */
- extern asection bfd_ind_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;
+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) \
CONST struct reloc_howto_struct *howto;
} arelent;
+enum complain_overflow
+{
+ /* Do not complain on overflow. */
+ complain_overflow_dont,
+
+ /* Complain if the bitfield overflows, whether it is considered
+ as signed or unsigned. */
+ complain_overflow_bitfield,
+
+ /* Complain if the value overflows when considered as signed
+ number. */
+ complain_overflow_signed,
+
+ /* Complain if the value overflows when considered as an
+ unsigned number. */
+ complain_overflow_unsigned
+};
typedef CONST struct reloc_howto_struct
{
result is to be subtracted from the data. */
int size;
- /* Now obsolete? But m68k-coff still uses it... */
+ /* The number of bits in the item to be relocated. This is used
+ when doing overflow checking. */
unsigned int bitsize;
/* Notes that the relocation is relative to the location in the
being relocated. */
boolean pc_relative;
+ /* The bit position of the reloc value in the destination.
+ The relocated value is left shifted by this amount. */
unsigned int bitpos;
- /* Now obsolete */
- boolean absolute;
-
- /* Causes the relocation routine to return an error if overflow
- is detected when relocating. */
- boolean complain_on_overflow;
+ /* What type of overflow error should be checked for when
+ relocating. */
+ enum complain_overflow complain_on_overflow;
/* If this field is non null, then the supplied function is
called rather than the normal function. This allows really
boolean pcrel_offset;
} reloc_howto_type;
-#define HOWTO(C, R,S,B, P, BI, ABS, O, SF, NAME, INPLACE, MASKSRC, MASKDST, PC) \
- {(unsigned)C,R,S,B, P, BI, ABS,O,SF,NAME,INPLACE,MASKSRC,MASKDST,PC}
-#define NEWHOWTO( FUNCTION, NAME,SIZE,REL,IN) HOWTO(0,0,SIZE,0,REL,0,false,false,FUNCTION, NAME,false,0,0,IN)
+#define HOWTO(C, R,S,B, P, BI, O, SF, NAME, INPLACE, MASKSRC, MASKDST, PC) \
+ {(unsigned)C,R,S,B, P, BI, O,SF,NAME,INPLACE,MASKSRC,MASKDST,PC}
+#define NEWHOWTO( FUNCTION, NAME,SIZE,REL,IN) HOWTO(0,0,SIZE,0,REL,0,complain_overflow_dont,FUNCTION, NAME,false,0,0,IN)
#define HOWTO_PREPARE(relocation, symbol) \
{ \
typedef enum bfd_reloc_code_real
{
- /* 64 bits wide, simple reloc */
+ /* 64 bits wide, simple reloc */
BFD_RELOC_64,
- /* 64 bits, PC-relative */
+ /* 64 bits, PC-relative */
BFD_RELOC_64_PCREL,
- /* 32 bits wide, simple reloc */
+ /* 32 bits wide, simple reloc */
BFD_RELOC_32,
- /* 32 bits, PC-relative */
+ /* 32 bits, PC-relative */
BFD_RELOC_32_PCREL,
- /* 16 bits wide, simple reloc */
+ /* 16 bits wide, simple reloc */
BFD_RELOC_16,
- /* 16 bits, PC-relative */
+ /* 16 bits, PC-relative */
BFD_RELOC_16_PCREL,
- /* 8 bits wide, simple */
+ /* 8 bits wide, simple */
BFD_RELOC_8,
- /* 8 bits wide, pc relative */
+ /* 8 bits wide, pc relative */
BFD_RELOC_8_PCREL,
- /* 8 bits wide, but used to form an address like 0xffnn */
+ /* 8 bits wide, but used to form an address like 0xffnn */
BFD_RELOC_8_FFnn,
- /* The type of reloc used to build a contructor table - at the
- moment probably a 32 bit wide abs address, but the cpu can
- choose. */
-
+ /* The type of reloc used to build a contructor table - at the moment
+ probably a 32 bit wide abs address, but the cpu can choose. */
BFD_RELOC_CTOR,
- /* High 22 bits of 32-bit value; simple reloc. */
+ /* High 22 bits of 32-bit value; simple reloc. */
BFD_RELOC_HI22,
- /* Low 10 bits. */
+ /* Low 10 bits. */
BFD_RELOC_LO10,
- /* Reloc types used for i960/b.out. */
+ /* Reloc types used for i960/b.out. */
BFD_RELOC_24_PCREL,
BFD_RELOC_I960_CALLJ,
- /* 32-bit pc-relative, shifted right 2 bits (i.e., 30-bit
- word displacement, e.g. for SPARC) */
+ /* 32-bit pc-relative, shifted right 2 bits (i.e., 30-bit
+ word displacement, e.g. for SPARC) */
BFD_RELOC_32_PCREL_S2,
/* now for the sparc/elf codes */
BFD_RELOC_SPARC_RELATIVE,
BFD_RELOC_SPARC_UA32,
- /* this one is a.out specific? */
+ /* these are a.out specific? */
BFD_RELOC_SPARC_BASE13,
BFD_RELOC_SPARC_BASE22,
BFD_RELOC_SPARC_LO7,
/* end-sanitize-v9 */
- /* Bits 27..2 of the relocation address shifted right 2 bits;
- simple reloc otherwise. */
+ /* 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) */
+ /* 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. */
+ /* 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. */
+ /* 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. */
+ /* Low 16 bits. */
BFD_RELOC_LO16,
- /* 16 bit relocation relative to the global pointer. */
+ /* 16 bit relocation relative to the global pointer. */
BFD_RELOC_MIPS_GPREL,
- /* These are, so far, specific to HPPA processors. I'm not sure that
- some don't duplicate other reloc types, such as BFD_RELOC_32 and
- _32_PCREL. Also, many more were in the list I got that don't
- fit in well in the model BFD uses, so I've omitted them for now.
- If we do make this reloc type get used for code that really does
- implement the funky reloc types, they'll have to be added to this
- list. */
+ /* These are, so far, specific to HPPA processors. I'm not sure that some
+ don't duplicate other reloc types, such as BFD_RELOC_32 and _32_PCREL.
+ Also, many more were in the list I got that don't fit in well in the
+ model BFD uses, so I've omitted them for now. If we do make this reloc
+ type get used for code that really does implement the funky reloc types,
+ they'll have to be added to this list. */
BFD_RELOC_HPPA_32,
BFD_RELOC_HPPA_11,
BFD_RELOC_HPPA_14,
BFD_RELOC_HPPA_17,
+
BFD_RELOC_HPPA_L21,
BFD_RELOC_HPPA_R11,
BFD_RELOC_HPPA_R14,
BFD_RELOC_HPPA_LR21,
BFD_RELOC_HPPA_RR14,
BFD_RELOC_HPPA_RR17,
+
BFD_RELOC_HPPA_GOTOFF_11,
BFD_RELOC_HPPA_GOTOFF_14,
BFD_RELOC_HPPA_GOTOFF_L21,
BFD_RELOC_HPPA_GOTOFF_RD14,
BFD_RELOC_HPPA_GOTOFF_LR21,
BFD_RELOC_HPPA_GOTOFF_RR14,
+
BFD_RELOC_HPPA_DLT_32,
BFD_RELOC_HPPA_DLT_11,
BFD_RELOC_HPPA_DLT_14,
BFD_RELOC_HPPA_DLT_L21,
BFD_RELOC_HPPA_DLT_R11,
BFD_RELOC_HPPA_DLT_R14,
+
BFD_RELOC_HPPA_ABS_CALL_11,
BFD_RELOC_HPPA_ABS_CALL_14,
BFD_RELOC_HPPA_ABS_CALL_17,
BFD_RELOC_HPPA_ABS_CALL_LR21,
BFD_RELOC_HPPA_ABS_CALL_RR14,
BFD_RELOC_HPPA_ABS_CALL_RR17,
+
BFD_RELOC_HPPA_PCREL_CALL_11,
BFD_RELOC_HPPA_PCREL_CALL_12,
BFD_RELOC_HPPA_PCREL_CALL_14,
BFD_RELOC_HPPA_PCREL_CALL_LR21,
BFD_RELOC_HPPA_PCREL_CALL_RR14,
BFD_RELOC_HPPA_PCREL_CALL_RR17,
+
BFD_RELOC_HPPA_PLABEL_32,
BFD_RELOC_HPPA_PLABEL_11,
BFD_RELOC_HPPA_PLABEL_14,
BFD_RELOC_HPPA_PLABEL_L21,
BFD_RELOC_HPPA_PLABEL_R11,
BFD_RELOC_HPPA_PLABEL_R14,
+
BFD_RELOC_HPPA_UNWIND_ENTRY,
BFD_RELOC_HPPA_UNWIND_ENTRIES,
+ /* i386/elf relocations */
+ BFD_RELOC_386_GOT32,
+ BFD_RELOC_386_PLT32,
+ BFD_RELOC_386_COPY,
+ BFD_RELOC_386_GLOB_DAT,
+ BFD_RELOC_386_JUMP_SLOT,
+ BFD_RELOC_386_RELATIVE,
+ BFD_RELOC_386_GOTOFF,
+ BFD_RELOC_386_GOTPC,
+
/* this must be the highest numeric value */
BFD_RELOC_UNUSED
} bfd_reloc_code_real_type;
bfd_reloc_type_lookup PARAMS ((bfd *abfd, bfd_reloc_code_real_type code));
+
typedef struct symbol_cache_entry
{
/* A pointer to the BFD which owns the symbol. This information
/* The symbol has global scope, and is exported. The value is
the offset into the section of the data. */
-#define BSF_EXPORT 0x04
+#define BSF_EXPORT BSF_GLOBAL /* no real difference */
/* A normal C symbol would be one of:
<<BSF_LOCAL>>, <<BSF_FORT_COMM>>, <<BSF_UNDEFINED>> or
- <<BSF_EXPORT|BSD_GLOBAL>> */
+ <<BSF_GLOBAL>> */
/* The symbol is a debugging record. The value has an arbitary
meaning. */
#define BSF_KEEP 0x20
#define BSF_KEEP_G 0x40
- /* ... document me ... */
+ /* A weak global symbol, overridable without warnings by
+ a regular global symbol of the same name. */
#define BSF_WEAK 0x80
/* This symbol was created to point to a section, e.g. ELF's
struct srec_data_struct *srec_data;
struct tekhex_data_struct *tekhex_data;
struct elf_obj_tdata *elf_obj_data;
+ struct nlm_obj_tdata *nlm_obj_data;
struct bout_data_struct *bout_data;
struct sun_core_struct *sun_core_data;
struct trad_core_struct *trad_core_data;
struct hppa_data_struct *hppa_data;
- struct hppa_core_struct *hppa_core_data;
+ struct hpux_core_struct *hpux_core_data;
struct sgi_core_struct *sgi_core_data;
PTR any;
} tdata;
void
bfd_set_gp_size PARAMS ((bfd *, int));
+bfd_vma
+bfd_scan_vma PARAMS ((CONST char *string, CONST char **end, int base));
+
#define bfd_sizeof_headers(abfd, reloc) \
BFD_SEND (abfd, _bfd_sizeof_headers, (abfd, reloc))
bfd_target_ecoff_flavour,
bfd_target_elf_flavour,
bfd_target_ieee_flavour,
+ bfd_target_nlm_flavour,
bfd_target_oasys_flavour,
bfd_target_tekhex_flavour,
bfd_target_srec_flavour,