diff options
author | Andreas Schwab <schwab@linux-m68k.org> | 2024-08-14 18:48:56 +0200 |
---|---|---|
committer | Andreas Schwab <schwab@linux-m68k.org> | 2024-08-19 19:28:49 +0200 |
commit | 03b09d2e34c3bd04f5e6e450a94b027c33aa6491 (patch) | |
tree | 8eddd1a94002c46b6e93c04e1430f72be8621567 | |
parent | 8be66a3708a98e8fccdc79218f7dde3fef63ee41 (diff) | |
download | binutils-03b09d2e34c3bd04f5e6e450a94b027c33aa6491.zip binutils-03b09d2e34c3bd04f5e6e450a94b027c33aa6491.tar.gz binutils-03b09d2e34c3bd04f5e6e450a94b027c33aa6491.tar.bz2 |
Fix m68k OS ABI sniffer
Do not override the generic OS ABI sniffer.
Fixes: 3eba3a011a8 ("Various m68k fixes for gdb")
-rw-r--r-- | gdb/m68k-tdep.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/gdb/m68k-tdep.c b/gdb/m68k-tdep.c index 1b8cc92..375d5e6 100644 --- a/gdb/m68k-tdep.c +++ b/gdb/m68k-tdep.c @@ -1350,11 +1350,19 @@ static enum gdb_osabi m68k_osabi_sniffer (bfd *abfd) { unsigned int elfosabi = elf_elfheader (abfd)->e_ident[EI_OSABI]; + enum gdb_osabi osabi = GDB_OSABI_UNKNOWN; if (elfosabi == ELFOSABI_NONE) - return GDB_OSABI_SVR4; + { + /* Check note sections. */ + for (asection *sect : gdb_bfd_sections (abfd)) + generic_elf_osabi_sniff_abi_tag_sections (abfd, sect, &osabi); + + if (osabi == GDB_OSABI_UNKNOWN) + osabi = GDB_OSABI_SVR4; + } - return GDB_OSABI_UNKNOWN; + return osabi; } void _initialize_m68k_tdep (); |