* elfcode.h (elf_slurp_reloc_table_from_section): Check
correct relocation count.
This commit is contained in:
parent
cb7e422f1e
commit
05a487dc8c
2 changed files with 12 additions and 1 deletions
|
@ -1,3 +1,8 @@
|
||||||
|
2002-09-18 Daniel Jacobowitz <drow@mvista.com>
|
||||||
|
|
||||||
|
* elfcode.h (elf_slurp_reloc_table_from_section): Check
|
||||||
|
correct relocation count.
|
||||||
|
|
||||||
2002-09-17 Daniel Jacobowitz <drow@mvista.com>
|
2002-09-17 Daniel Jacobowitz <drow@mvista.com>
|
||||||
|
|
||||||
* bfd-in.h (bfd_get_dynamic_symcount): Define.
|
* bfd-in.h (bfd_get_dynamic_symcount): Define.
|
||||||
|
|
|
@ -1377,6 +1377,7 @@ elf_slurp_reloc_table_from_section (abfd, asect, rel_hdr, reloc_count,
|
||||||
arelent *relent;
|
arelent *relent;
|
||||||
unsigned int i;
|
unsigned int i;
|
||||||
int entsize;
|
int entsize;
|
||||||
|
long symcount;
|
||||||
|
|
||||||
allocated = (PTR) bfd_malloc (rel_hdr->sh_size);
|
allocated = (PTR) bfd_malloc (rel_hdr->sh_size);
|
||||||
if (allocated == NULL)
|
if (allocated == NULL)
|
||||||
|
@ -1419,9 +1420,14 @@ elf_slurp_reloc_table_from_section (abfd, asect, rel_hdr, reloc_count,
|
||||||
else
|
else
|
||||||
relent->address = rela.r_offset - asect->vma;
|
relent->address = rela.r_offset - asect->vma;
|
||||||
|
|
||||||
|
if (dynamic)
|
||||||
|
symcount = bfd_get_dynamic_symcount (abfd);
|
||||||
|
else
|
||||||
|
symcount = bfd_get_symcount (abfd);
|
||||||
|
|
||||||
if (ELF_R_SYM (rela.r_info) == 0)
|
if (ELF_R_SYM (rela.r_info) == 0)
|
||||||
relent->sym_ptr_ptr = bfd_abs_section_ptr->symbol_ptr_ptr;
|
relent->sym_ptr_ptr = bfd_abs_section_ptr->symbol_ptr_ptr;
|
||||||
else if (ELF_R_SYM (rela.r_info) > bfd_get_dynamic_symcount (abfd))
|
else if (ELF_R_SYM (rela.r_info) > symcount)
|
||||||
{
|
{
|
||||||
(*_bfd_error_handler)
|
(*_bfd_error_handler)
|
||||||
(_("%s(%s): relocation %d has invalid symbol index %ld"),
|
(_("%s(%s): relocation %d has invalid symbol index %ld"),
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue