summaryrefslogtreecommitdiff
path: root/gnu/usr.bin/binutils
diff options
context:
space:
mode:
authorMark Kettenis <kettenis@cvs.openbsd.org>2015-08-28 19:57:27 +0000
committerMark Kettenis <kettenis@cvs.openbsd.org>2015-08-28 19:57:27 +0000
commitdb9237421c64b7ec3ebb1e46039297194ced53c7 (patch)
treee3f575b042cf64b30a2d3311baa636b6d61d84eb /gnu/usr.bin/binutils
parent57544f989048664828fb6d9c2b5f7ba6b8bfdad7 (diff)
Make gdb work again on mips64 PIE binaries by making sure that we select
a reasonable 64-bit ABI for 64-bit ELF files instead of a 32-bit ABI.
Diffstat (limited to 'gnu/usr.bin/binutils')
-rw-r--r--gnu/usr.bin/binutils/gdb/mips-tdep.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/gnu/usr.bin/binutils/gdb/mips-tdep.c b/gnu/usr.bin/binutils/gdb/mips-tdep.c
index cdde8eb9ba9..cdc5907100b 100644
--- a/gnu/usr.bin/binutils/gdb/mips-tdep.c
+++ b/gnu/usr.bin/binutils/gdb/mips-tdep.c
@@ -4722,12 +4722,18 @@ mips_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
/* On Irix, ELF64 executables use the N64 ABI. The
pseudo-sections which describe the ABI aren't present
on IRIX. (Even for executables created by gcc.) */
- if (bfd_get_flavour (info.abfd) == bfd_target_elf_flavour
+ if (info.abfd
+ && bfd_get_flavour (info.abfd) == bfd_target_elf_flavour
&& elf_elfheader (info.abfd)->e_ident[EI_CLASS] == ELFCLASS64)
found_abi = MIPS_ABI_N64;
else
found_abi = MIPS_ABI_N32;
break;
+ default:
+ if (info.abfd
+ && bfd_get_flavour (info.abfd) == bfd_target_elf_flavour
+ && elf_elfheader (info.abfd)->e_ident[EI_CLASS] == ELFCLASS64)
+ found_abi = MIPS_ABI_N64;
}
}