* config/tc-fr30.c (md_parse_option <c,arg>): Add ATTRIBUTE_UNUSED.
[deliverable/binutils-gdb.git] / gdb / osabi.c
index 4186cbd52456b17a50da370619df5a19df89ab08..06d9c908bcbc84ee527d7098fc5a83305d035eeb 100644 (file)
@@ -19,6 +19,7 @@
    Boston, MA 02111-1307, USA.  */
 
 #include "defs.h"
+#include "gdb_string.h"
 #include "osabi.h"
 
 #include "elf-bfd.h"
@@ -40,6 +41,13 @@ static const char * const gdb_osabi_names[] =
   "NetBSD a.out",
   "NetBSD ELF",
   "Windows CE",
+  "DJGPP",
+  "NetWare",
+  "Irix",
+  "LynxOS",
+  "Interix",
+  "HP/UX ELF",
+  "HP/UX SOM",
 
   "ARM EABI v1",
   "ARM EABI v2",
@@ -228,13 +236,8 @@ gdbarch_init_osabi (struct gdbarch_info info, struct gdbarch *gdbarch,
 
   if (osabi == GDB_OSABI_UNKNOWN)
     {
-      /* Don't complain about not knowing the OS ABI if we don't
-        have an inferior.  */
-      if (info.abfd)
-       fprintf_filtered
-         (gdb_stderr, "GDB doesn't recognize the OS ABI of the inferior.  "
-          "Attempting to continue with the default %s settings",
-          bfd_printable_arch_mach (arch_info->arch, arch_info->mach));
+      /* Don't complain about an unknown OSABI.  Assume the user knows
+         what they are doing.  */
       return;
     }
 
@@ -403,6 +406,19 @@ generic_elf_osabi_sniffer (bfd *abfd)
     case ELFOSABI_SOLARIS:
       osabi = GDB_OSABI_SOLARIS;
       break;
+
+    case ELFOSABI_HPUX:
+      osabi = GDB_OSABI_HPUX_ELF;
+      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;
This page took 0.023097 seconds and 4 git commands to generate.