This is the mail archive of the
binutils-cvs@sourceware.org
mailing list for the binutils project.
[binutils-gdb] Fix runtime failure triggered by a corrupt ecoff input file.
- From: Nick Clifton <nickc at sourceware dot org>
- To: bfd-cvs at sourceware dot org
- Date: 18 Jul 2017 14:46:49 -0000
- Subject: [binutils-gdb] Fix runtime failure triggered by a corrupt ecoff input file.
https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=e4e21d9ed14c74304bc060a9d892c0edfc4c8ab4
commit e4e21d9ed14c74304bc060a9d892c0edfc4c8ab4
Author: Nick Clifton <nickc@redhat.com>
Date: Tue Jul 18 15:46:13 2017 +0100
Fix runtime failure triggered by a corrupt ecoff input file.
PR binutils/21781
* coffcode.h (handle_COMDAT): Replace abort with an error message
and return.
Diff:
---
bfd/ChangeLog | 6 ++++++
bfd/coffcode.h | 8 +++++++-
2 files changed, 13 insertions(+), 1 deletion(-)
diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index a439c16..f9eb98f 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -1,3 +1,9 @@
+2017-07-18 Nick Clifton <nickc@redhat.com>
+
+ PR binutils/21781
+ * coffcode.h (handle_COMDAT): Replace abort with an error message
+ and return.
+
2017-07-17 H.J. Lu <hongjiu.lu@intel.com>
PR ld/21782
diff --git a/bfd/coffcode.h b/bfd/coffcode.h
index 898327b..21308de 100644
--- a/bfd/coffcode.h
+++ b/bfd/coffcode.h
@@ -997,7 +997,13 @@ handle_COMDAT (bfd * abfd,
|| isym.n_sclass == C_EXT)
&& BTYPE (isym.n_type) == T_NULL
&& isym.n_value == 0))
- abort ();
+ {
+ /* Malformed input files can trigger this test.
+ cf PR 21781. */
+ _bfd_error_handler (_("%B: error: unexpected symbol '%s' in COMDAT section"),
+ abfd, symname);
+ goto breakloop;
+ }
/* FIXME LATER: MSVC generates section names
like .text for comdats. Gas generates