From: Nick Clifton Date: Mon, 4 Sep 2017 14:51:32 +0000 (+0100) Subject: Import patch from mainline to replace an abort when parsing a corrupt COFF binary... X-Git-Tag: binutils-2_29_1~30 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=353c8680bcb654ab104cccf5647126226cac868b;p=thirdparty%2Fbinutils-gdb.git Import patch from mainline to replace an abort when parsing a corrupt COFF binary with an error message instead. PR binutils/21781 * coffcode.h (handle_COMDAT): Replace abort with an error message and return. --- diff --git a/bfd/ChangeLog b/bfd/ChangeLog index 9df9bc6646b..9384d3ac287 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,3 +1,11 @@ +2017-09-04 Nick Clifton + + Import from mainline: + + PR binutils/21781 + * coffcode.h (handle_COMDAT): Replace abort with an error message + and return. + 2017-09-04 Alan Modra PR 22067 diff --git a/bfd/coffcode.h b/bfd/coffcode.h index 4aa974136af..6d2a007ad39 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