* elfcode.h (elf_swap_symbol_in): Return bfd_boolean. Don't abort
[deliverable/binutils-gdb.git] / bfd / elf.c
index 8ce0933ad958d466b8e85227de3d5aaa4433ece3..73a8713e218334000c7e4bc2c1b74c068a2c902f 100644 (file)
--- a/bfd/elf.c
+++ b/bfd/elf.c
@@ -400,7 +400,15 @@ bfd_elf_get_elf_syms (bfd *ibfd,
   for (esym = extsym_buf, isym = intsym_buf, shndx = extshndx_buf;
        isym < isymend;
        esym += extsym_size, isym++, shndx = shndx != NULL ? shndx + 1 : NULL)
-    (*bed->s->swap_symbol_in) (ibfd, esym, shndx, isym);
+    if (!(*bed->s->swap_symbol_in) (ibfd, esym, shndx, isym))
+      {
+       symoffset += (esym - (bfd_byte *) extsym_buf) / extsym_size;
+       (*_bfd_error_handler) (_("%B symbol number %lu references "
+                                "nonexistent SHT_SYMTAB_SHNDX section"),
+                              ibfd, (unsigned long) symoffset);
+       intsym_buf = NULL;
+       goto out;
+      }
 
  out:
   if (alloc_ext != NULL)
This page took 0.024187 seconds and 4 git commands to generate.