summaryrefslogtreecommitdiffstats
path: root/bfd/elfcode.h
diff options
context:
space:
mode:
authorDaniel Jacobowitz <drow@false.org>2002-09-18 02:39:43 +0000
committerDaniel Jacobowitz <drow@false.org>2002-09-18 02:39:43 +0000
commit1f70368c21a866f7379c02da316ae0e2f355d610 (patch)
tree9f66ae0f8d9e0754cc634684f5dd1c6f8bebe48c /bfd/elfcode.h
parented6fb7bdf57feb3050b00774d383e945434b6813 (diff)
downloadppe42-binutils-1f70368c21a866f7379c02da316ae0e2f355d610.tar.gz
ppe42-binutils-1f70368c21a866f7379c02da316ae0e2f355d610.zip
* 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 eb667eb50e..7f9ed5fe3a 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;
OpenPOWER on IntegriCloud