diff options
author | Roland McGrath <mcgrathr@google.com> | 2013-11-06 14:47:05 -0800 |
---|---|---|
committer | Roland McGrath <mcgrathr@google.com> | 2013-11-07 10:00:32 -0800 |
commit | 64b384e1e821cedccefa24f6d5bb82d353546ca1 (patch) | |
tree | 3cea205679e69281b5bd339f9f505da76ea415b5 /bfd/elf64-x86-64.c | |
parent | d40af490aad3df00a8ee52db589480d6ac5fdfd5 (diff) | |
download | gdb-64b384e1e821cedccefa24f6d5bb82d353546ca1.zip gdb-64b384e1e821cedccefa24f6d5bb82d353546ca1.tar.gz gdb-64b384e1e821cedccefa24f6d5bb82d353546ca1.tar.bz2 |
Set CPU type in BFD backend for x86_64-nacl* and i?86-nacl* targets
bfd/
* archures.c (bfd_mach_i386_nacl): Fix definition so it doesn't
collide with bfd_mach_l1om.
* bfd-in2.h: Regenerate.
* elf32-i386.c (elf32_i386_nacl_elf_object_p): New function.
(elf_backend_object_p): Use that in elf32-i386-nacl definition.
* elf64-x86-64.c (elf64_x86_64_nacl_elf_object_p): New function.
(elf_backend_object_p): Use that in elf64-x86-64-nacl definition.
(elf32_x86_64_nacl_elf_object_p): New function.
(elf_backend_object_p): Use that in elf32-x86-64-nacl definition.
binutils/
* objdump.c (dump_dwarf): Grok bfd_mach_x86_64_nacl and
bfd_mach_x64_32_nacl as equivalent to bfd_mach_x86_64.
ld/testsuite/
* ld-x86-64/x86-64.exp (mixed1, mixed2): Loosen error string match
so it accepts "i386:nacl" in place of "i386".
* ld-x86-64/ilp32-2.d: Likewise.
* ld-x86-64/ilp32-3.d: Likewise.
* ld-x86-64/lp64-2.d: Likewise.
* ld-x86-64/lp64-3.d: Likewise.
Diffstat (limited to 'bfd/elf64-x86-64.c')
-rw-r--r-- | bfd/elf64-x86-64.c | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/bfd/elf64-x86-64.c b/bfd/elf64-x86-64.c index c95fdf5..3b3f890 100644 --- a/bfd/elf64-x86-64.c +++ b/bfd/elf64-x86-64.c @@ -5348,6 +5348,14 @@ static const struct bfd_elf_special_section /* Native Client support. */ +static bfd_boolean +elf64_x86_64_nacl_elf_object_p (bfd *abfd) +{ + /* Set the right machine number for a NaCl x86-64 ELF64 file. */ + bfd_default_set_arch_mach (abfd, bfd_arch_i386, bfd_mach_x86_64_nacl); + return TRUE; +} + #undef TARGET_LITTLE_SYM #define TARGET_LITTLE_SYM bfd_elf64_x86_64_nacl_vec #undef TARGET_LITTLE_NAME @@ -5480,6 +5488,8 @@ static const struct elf_x86_64_backend_data elf_x86_64_nacl_arch_bed = #undef elf_backend_arch_data #define elf_backend_arch_data &elf_x86_64_nacl_arch_bed +#undef elf_backend_object_p +#define elf_backend_object_p elf64_x86_64_nacl_elf_object_p #undef elf_backend_modify_segment_map #define elf_backend_modify_segment_map nacl_modify_segment_map #undef elf_backend_modify_program_headers @@ -5491,6 +5501,14 @@ static const struct elf_x86_64_backend_data elf_x86_64_nacl_arch_bed = /* Native Client x32 support. */ +static bfd_boolean +elf32_x86_64_nacl_elf_object_p (bfd *abfd) +{ + /* Set the right machine number for a NaCl x86-64 ELF32 file. */ + bfd_default_set_arch_mach (abfd, bfd_arch_i386, bfd_mach_x64_32_nacl); + return TRUE; +} + #undef TARGET_LITTLE_SYM #define TARGET_LITTLE_SYM bfd_elf32_x86_64_nacl_vec #undef TARGET_LITTLE_NAME @@ -5511,7 +5529,7 @@ static const struct elf_x86_64_backend_data elf_x86_64_nacl_arch_bed = #undef elf_backend_object_p #define elf_backend_object_p \ - elf32_x86_64_elf_object_p + elf32_x86_64_nacl_elf_object_p #undef elf_backend_bfd_from_remote_memory #define elf_backend_bfd_from_remote_memory \ |