From 75485f7b8af69467f8e0602b23707583536b8d7f Mon Sep 17 00:00:00 2001 From: kettenis Date: Thu, 4 Jul 2002 15:36:50 +0000 Subject: [PATCH] * osabi.c (generic_elf_osabi_sniffer): Add check for FreeBSD 3.x's traditonal string branding within the ELF header. --- gdb/ChangeLog | 5 +++++ gdb/osabi.c | 9 +++++++++ 2 files changed, 14 insertions(+) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 94263bc295..96e274fafb 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,8 @@ +2002-07-04 Mark Kettenis + + * osabi.c (generic_elf_osabi_sniffer): Add check for FreeBSD 3.x's + traditonal string branding within the ELF header. + 2002-07-04 Daniel Jacobowitz * symtab.c (remove_params): New function. diff --git a/gdb/osabi.c b/gdb/osabi.c index 1e122b8fb9..c152cb4464 100644 --- a/gdb/osabi.c +++ b/gdb/osabi.c @@ -408,6 +408,15 @@ generic_elf_osabi_sniffer (bfd *abfd) break; } + if (osabi == GDB_OSABI_UNKNOWN) + { + /* The FreeBSD folks have been naughty; they stored the string + "FreeBSD" in the padding of the e_ident field of the ELF + header to "brand" their ELF binaries in FreeBSD 3.x. */ + if (strcmp (&elf_elfheader (abfd)->e_ident[8], "FreeBSD") == 0) + osabi = GDB_OSABI_FREEBSD_ELF; + } + return osabi; } -- 2.11.0