Fix runtime failure triggered by a corrupt ecoff input file.
authorNick Clifton <nickc@redhat.com>
Tue, 18 Jul 2017 14:46:13 +0000 (15:46 +0100)
committerNick Clifton <nickc@redhat.com>
Tue, 18 Jul 2017 14:46:13 +0000 (15:46 +0100)
PR binutils/21781
* coffcode.h (handle_COMDAT): Replace abort with an error message
and return.

bfd/ChangeLog
bfd/coffcode.h

index a439c16ace8bd9bb57246ae946ad6793de17aa95..f9eb98f4f3243c8ef0a4a4a9e733c5887d040033 100644 (file)
@@ -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
index 898327b3288cb8ba340baba1681c2395ae872583..21308de8c31351da3694b2790b7b99e54b77188c 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
This page took 0.02999 seconds and 4 git commands to generate.