diff options
author | Mark Mitchell <mark@codesourcery.com> | 1999-06-12 17:56:26 +0000 |
---|---|---|
committer | Mark Mitchell <mark@codesourcery.com> | 1999-06-12 17:56:26 +0000 |
commit | 57e21befb98e8ad0b2c6dda814869145a8bcd60b (patch) | |
tree | ee5a479109b5326a711fe7146bddfd2a242d4d9b | |
parent | b9e57a387a6bdc15fd8bf477dc4d45131f0307d6 (diff) | |
download | gdb-57e21befb98e8ad0b2c6dda814869145a8bcd60b.zip gdb-57e21befb98e8ad0b2c6dda814869145a8bcd60b.tar.gz gdb-57e21befb98e8ad0b2c6dda814869145a8bcd60b.tar.bz2 |
* elfcode.h (elf_slurp_reloc_table_from_section): Don't assume
asect->reloc_count is valid.
-rw-r--r-- | bfd/ChangeLog | 5 | ||||
-rw-r--r-- | bfd/elfcode.h | 10 |
2 files changed, 13 insertions, 2 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog index 7670efc..d778609 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,3 +1,8 @@ +1999-06-12 Mark Mitchell <mark@codesourcery.com> + + * elfcode.h (elf_slurp_reloc_table_from_section): Don't assume + asect->reloc_count is valid. + 1999-06-12 Ian Lance Taylor <ian@zembu.com> * elf32-mips.c (mips_elf32_section_processing): Permit a diff --git a/bfd/elfcode.h b/bfd/elfcode.h index a13bda6..29a1943 100644 --- a/bfd/elfcode.h +++ b/bfd/elfcode.h @@ -1335,16 +1335,22 @@ elf_slurp_reloc_table (abfd, asect, symbols, dynamic) } else { + /* Note that ASECT->RELOC_COUNT tends not to be accurate in this + case because relocations against this section may use the + dynamic symbol table, and in that case bfd_section_from_shdr + in elf.c does not update the RELOC_COUNT. */ if (asect->_raw_size == 0) return true; rel_hdr = &d->this_hdr; reloc_count = rel_hdr->sh_size / rel_hdr->sh_entsize; rel_hdr2 = NULL; + reloc_count2 = 0; } - relents = (arelent *) bfd_alloc (abfd, - asect->reloc_count * sizeof (arelent)); + relents = ((arelent *) + bfd_alloc (abfd, + (reloc_count + reloc_count2) * sizeof (arelent))); if (relents == NULL) return false; |