summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoland McGrath <mcgrathr@chromium.org>2015-05-28 17:16:55 -0700
committerRoland McGrath <mcgrathr@chromium.org>2015-05-28 17:16:55 -0700
commit0339c7336686d8a75bc8bcf5e04152dc95286a10 (patch)
treebe492906eb081321250fb9f259616a97bd738183
parent2f0c68f23bb3132cd5ac466ca8775c0d9e4960cd (diff)
downloadbinutils-gdb-users/roland/osabi-assert.tar.gz
Do not crash on unrecognized GNU .note.ABI-tag valuesusers/roland/osabi-assert
Diagnosis of unexpected input (in this case, in an executable file) should not crash as if it were a bug in GDB. gdb/ * osabi.c (generic_elf_osabi_sniff_abi_tag_sections): Use warning rather than internal_error for an unrecognized value.
-rw-r--r--gdb/ChangeLog9
-rw-r--r--gdb/osabi.c13
2 files changed, 13 insertions, 9 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index ab10166a27d..0c28e0344f2 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,8 @@
+2015-05-28 Roland McGrath <mcgrathr@google.com>
+
+ * osabi.c (generic_elf_osabi_sniff_abi_tag_sections): Use warning
+ rather than internal_error for an unrecognized value.
+
2015-05-28 Don Breazeal <donb@codesourcery.com>
* infrun.c (follow_fork_inferior): Ensure the use of
@@ -640,7 +645,7 @@
linux_enable_event_reporting.
(_initialize_linux_nat): Delete call to
linux_ptrace_set_additional_flags.
- * nat/linux-ptrace.c (current_ptrace_options): Rename to
+ * nat/linux-ptrace.c (current_ptrace_options): Rename to
supported_ptrace_options.
(additional_flags): Delete variable.
(linux_check_ptrace_features): Use supported_ptrace_options.
@@ -648,7 +653,7 @@
Likewise, and remove additional_flags check.
(linux_enable_event_reporting): Change 'attached' argument to
'options'. Use supported_ptrace_options.
- (ptrace_supports_feature): Change comment. Use
+ (ptrace_supports_feature): Change comment. Use
supported_ptrace_options.
(linux_ptrace_set_additional_flags): Delete function.
* nat/linux-ptrace.h (linux_ptrace_set_additional_flags):
diff --git a/gdb/osabi.c b/gdb/osabi.c
index 9d90c55959b..abf4bd44870 100644
--- a/gdb/osabi.c
+++ b/gdb/osabi.c
@@ -134,7 +134,7 @@ osabi_from_tdesc_string (const char *name)
/* Handler for a given architecture/OS ABI pair. There should be only
one handler for a given OS ABI each architecture family. */
-struct gdb_osabi_handler
+struct gdb_osabi_handler
{
struct gdb_osabi_handler *next;
const struct bfd_arch_info *arch_info;
@@ -253,7 +253,7 @@ gdbarch_lookup_osabi (bfd *abfd)
/* If we don't have a binary, just return unknown. The caller may
have other sources the OSABI can be extracted from, e.g., the
target description. */
- if (abfd == NULL)
+ if (abfd == NULL)
return GDB_OSABI_UNKNOWN;
match = GDB_OSABI_UNKNOWN;
@@ -493,10 +493,9 @@ generic_elf_osabi_sniff_abi_tag_sections (bfd *abfd, asection *sect, void *obj)
break;
default:
- internal_error (__FILE__, __LINE__,
- _("generic_elf_osabi_sniff_abi_tag_sections: "
- "unknown OS number %d"),
- abi_tag);
+ warning ("GNU ABI tag value %u unrecognized.\n", abi_tag);
+ *osabi = GDB_OSABI_UNKNOWN;
+ break;
}
return;
}
@@ -512,7 +511,7 @@ generic_elf_osabi_sniff_abi_tag_sections (bfd *abfd, asection *sect, void *obj)
return;
}
-
+
/* .note.netbsd.ident notes, used by NetBSD. */
if (strcmp (name, ".note.netbsd.ident") == 0
&& check_note (abfd, sect, note, &sectsize, "NetBSD", 4, NT_NETBSD_IDENT))