PR24339, segfault on NULL symbol section
authorAlan Modra <amodra@gmail.com>
Fri, 15 Mar 2019 06:19:59 +0000 (16:49 +1030)
committerAlan Modra <amodra@gmail.com>
Fri, 15 Mar 2019 09:35:18 +0000 (20:05 +1030)
PR 24339
* elflink.c (elf_link_add_object_symbols): Bail out on a local
symbol after globals if elf_bad_symtab is not set.

bfd/ChangeLog
bfd/elflink.c

index eacd828d7e364be4bfa4e87444a9c8114adb77be..b044fad208f903236353aea4df84b11fb404f5b0 100644 (file)
@@ -1,3 +1,9 @@
+2019-03-15  Alan Modra  <amodra@gmail.com>
+
+       PR 24339
+       * elflink.c (elf_link_add_object_symbols): Bail out on a local
+       symbol after globals if elf_bad_symtab is not set.
+
 2019-03-15  Alan Modra  <amodra@gmail.com>
 
        PR 24337
index 2600c3934b12652741afca3cfafde61f09b57be3..09990a438f6c7b13fea4da90778c4720665367bb 100644 (file)
@@ -4442,7 +4442,13 @@ error_free_dyn:
             global symbols follow all local symbols, and that sh_info
             point to the first global symbol.  Unfortunately, Irix 5
             screws this up.  */
-         continue;
+         if (elf_bad_symtab (abfd))
+           continue;
+
+         /* If we aren't prepared to handle locals within the globals
+             then we'll likely segfault on a NULL section.  */
+         bfd_set_error (bfd_error_bad_value);
+         goto error_free_vers;
 
        case STB_GLOBAL:
          if (isym->st_shndx != SHN_UNDEF && !common)
This page took 0.048983 seconds and 4 git commands to generate.