diff options
author | Alan Modra <amodra@gmail.com> | 2006-09-22 13:16:45 +0000 |
---|---|---|
committer | Alan Modra <amodra@gmail.com> | 2006-09-22 13:16:45 +0000 |
commit | 8384fb8f0c3c451f7aa8164fc87e162eb9816925 (patch) | |
tree | fead06b59caade8d3776b88a06b2b74c75b13e6b /bfd/elf.c | |
parent | 885afe7b6fda4324ac445cfdd9e37630f5061dc0 (diff) | |
download | gdb-8384fb8f0c3c451f7aa8164fc87e162eb9816925.zip gdb-8384fb8f0c3c451f7aa8164fc87e162eb9816925.tar.gz gdb-8384fb8f0c3c451f7aa8164fc87e162eb9816925.tar.bz2 |
* elfcode.h (elf_swap_symbol_in): Return bfd_boolean. Don't abort
on error.
* elf-bfd.h (elf_size_info <swap_symbol_in>): Adjust decl.
(bfd_elf32_swap_symbol_in, bfd_elf64_swap_symbol_in): Likewise.
* elf.c (bfd_elf_get_elf_syms): Test return of swap_symbol_in,
and report error.
* elf32-arm.c (elf32_arm_swap_symbol_in): Return bfd_boolean.
Diffstat (limited to 'bfd/elf.c')
-rw-r--r-- | bfd/elf.c | 10 |
1 files changed, 9 insertions, 1 deletions
@@ -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) |