]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
Import patch from mainline to replace an abort when parsing a corrupt COFF binary...
authorNick Clifton <nickc@redhat.com>
Mon, 4 Sep 2017 14:51:32 +0000 (15:51 +0100)
committerNick Clifton <nickc@redhat.com>
Mon, 4 Sep 2017 14:51:32 +0000 (15:51 +0100)
PR binutils/21781
* coffcode.h (handle_COMDAT): Replace abort with an error message
and return.

bfd/ChangeLog
bfd/coffcode.h

index 9df9bc6646bc3d398a22d7e6366790a2b0c5d47d..9384d3ac287d86bf347b23663f18ad3e81d0d2e3 100644 (file)
@@ -1,3 +1,11 @@
+2017-09-04  Nick Clifton  <nickc@redhat.com>
+
+       Import from mainline:
+
+       PR binutils/21781
+       * coffcode.h (handle_COMDAT): Replace abort with an error message
+       and return.
+
 2017-09-04  Alan Modra  <amodra@gmail.com>
 
        PR 22067
index 4aa974136afc5ae9432d8dd2d3ce44212f41efb3..6d2a007ad39f3004c5ced685efc69f88a1b8d2af 100644 (file)
@@ -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