diff options
author | Ian Lance Taylor <ian@airs.com> | 1993-11-09 21:08:58 +0000 |
---|---|---|
committer | Ian Lance Taylor <ian@airs.com> | 1993-11-09 21:08:58 +0000 |
commit | a5ccdad1fcaacb2c0943ed562d2f9176bffe742d (patch) | |
tree | 66d01e8a39570658dae698a5886fe6419ebe842a /bfd/libelf.h | |
parent | e4d7f4c779f203d6e299c13038e5a54f23de963e (diff) | |
download | gdb-a5ccdad1fcaacb2c0943ed562d2f9176bffe742d.zip gdb-a5ccdad1fcaacb2c0943ed562d2f9176bffe742d.tar.gz gdb-a5ccdad1fcaacb2c0943ed562d2f9176bffe742d.tar.bz2 |
* elfcode.h (elf_object_p): Rather than looking through an array
of architectures, get the ELF EM_xxx code from the backend
information. Let the generic ELF target match any EM_xxx code not
matched by another ELF target. Call elf_backend_object_p to let
the backend do more checks and set global information.
* libelf.h (struct elf_backend_data): Added elf_machine_code and
elf_backend_object_p fields.
(struct bfd_elf_arch_map): Removed.
(bfd_elf_arch_map, bfd_elf_arch_map_size): Don't declare.
* elf32-target.h, elf64-target.h: Initialize elf_machine_code
field with ELF_MACHINE_CODE. Initialize elf_backend_object_p
field with elf_backend_object_p (if it is defined).
* elf32-gen.c, elf32-hppa.c, elf32-i386.c, elf32-i860.c,
elf32-m68k.c, elf32-m88k.c, elf32-mips.c, elf32-sparc.c,
elf64-gen.c (ELF_MACHINE_CODE): Defined.
* elf32-mips.c: Include ecoffswap.h to get ECOFF swapping
routines.
(mips_elf_object_p): Set the right machine number.
(mips_elf_ecoff_debug_swap): Defined.
(elf_backend_object_p): Defined to be mips_elf_object_p.
(elf_backend_ecoff_debug_swap): Defined to be
mips_elf_ecoff_debug_swap.
* elf.c (bfd_elf_arch_map, bfd_elf_arch_map_size): Removed.
* elf32-mips.c (elf_mips_howto_table): Don't complain on overflow
for R_MIPS_26. Correct overflow detection requires matching the
upper four bits of the destination against the PC. From Ted Lemon
<mellon@pepper.ncd.com>.
* elf32-hppa.c (elf_hppa_reloc_type_lookup): Return type
should point to const data.
Diffstat (limited to 'bfd/libelf.h')
-rw-r--r-- | bfd/libelf.h | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/bfd/libelf.h b/bfd/libelf.h index 2c0969a..4d58293 100644 --- a/bfd/libelf.h +++ b/bfd/libelf.h @@ -77,6 +77,9 @@ struct elf_backend_data /* The architecture for this backend. */ enum bfd_architecture arch; + /* The ELF machine code (EM_xxxx) for this backend. */ + int elf_machine_code; + /* The maximum page size for this backend. */ bfd_vma maxpagesize; @@ -93,6 +96,14 @@ struct elf_backend_data /* The remaining functions are hooks which are called only if they are not NULL. */ + /* A function to permit a backend specific check on whether a + particular BFD format is relevant for an object file, and to + permit the backend to set any global information it wishes. When + this is called elf_elfheader is set, but anything else should be + used with caution. If this returns false, the check_format + routine will return a wrong_format error. */ + boolean (*elf_backend_object_p) PARAMS ((bfd *)); + /* A function to do additional symbol processing when reading the ELF symbol table. This is where any processor-specific special section indices are handled. */ @@ -142,14 +153,6 @@ struct elf_sym_extra typedef struct elf_sym_extra Elf_Sym_Extra; -struct bfd_elf_arch_map { - enum bfd_architecture bfd_arch; - int elf_arch; -}; - -extern const struct bfd_elf_arch_map bfd_elf_arch_map[]; -extern const int bfd_elf_arch_map_size; - struct bfd_elf_section_data { Elf_Internal_Shdr this_hdr; Elf_Internal_Shdr rel_hdr; |