summaryrefslogtreecommitdiff
path: root/bfd/elfcode.h
diff options
context:
space:
mode:
authorDaniel Jacobowitz <dan@debian.org>2002-09-18 02:39:43 +0000
committerDaniel Jacobowitz <dan@debian.org>2002-09-18 02:39:43 +0000
commit43b2afb0ec0c5b43ded0e5369fcdb1ce81131c74 (patch)
treec4cc542754253099a38332257b33beee62dbcff3 /bfd/elfcode.h
parente5797ecf2bb34e19a29774ffa14a62e6d45a97b2 (diff)
downloadgdb-43b2afb0ec0c5b43ded0e5369fcdb1ce81131c74.tar.gz
* bfd-in.h (bfd_get_dynamic_symcount): Define.
* bfd.c (struct _bfd): Add dynsymcount. * bfd-in2.h: Regenerated. * elf.c (_bfd_elf_canonicalize_dynamic_symtab): Set abfd->dynsymcount. * elfcode.h (elf_slurp_reloc_table_from_section): Check for overflow.
Diffstat (limited to 'bfd/elfcode.h')
-rw-r--r--bfd/elfcode.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/bfd/elfcode.h b/bfd/elfcode.h
index eb667eb50e2..7f9ed5fe3af 100644
--- a/bfd/elfcode.h
+++ b/bfd/elfcode.h
@@ -1421,6 +1421,13 @@ elf_slurp_reloc_table_from_section (abfd, asect, rel_hdr, reloc_count,
if (ELF_R_SYM (rela.r_info) == 0)
relent->sym_ptr_ptr = bfd_abs_section_ptr->symbol_ptr_ptr;
+ else if (ELF_R_SYM (rela.r_info) > bfd_get_dynamic_symcount (abfd))
+ {
+ (*_bfd_error_handler)
+ (_("%s(%s): relocation %d has invalid symbol index %ld"),
+ abfd->filename, asect->name, i, ELF_R_SYM (rela.r_info));
+ relent->sym_ptr_ptr = bfd_abs_section.symbol_ptr_ptr;
+ }
else
{
asymbol **ps, *s;