mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-06-06 07:28:44 +08:00
* elf32-rl78.c (elf32_rl78_relax_delete_bytes): Make sure relocs
are loaded before trying to use them.
This commit is contained in:
@ -1,3 +1,8 @@
|
|||||||
|
2013-11-05 DJ Delorie <dj@redhat.com>
|
||||||
|
|
||||||
|
* elf32-rl78.c (elf32_rl78_relax_delete_bytes): Make sure relocs
|
||||||
|
are loaded before trying to use them.
|
||||||
|
|
||||||
2013-11-05 H.J. Lu <hongjiu.lu@intel.com>
|
2013-11-05 H.J. Lu <hongjiu.lu@intel.com>
|
||||||
Bernhard Rosenkränzer <bernhard.rosenkranzer@linaro.org>
|
Bernhard Rosenkränzer <bernhard.rosenkranzer@linaro.org>
|
||||||
|
|
||||||
|
@ -1481,6 +1481,12 @@ elf32_rl78_relax_delete_bytes (bfd *abfd, asection *sec, bfd_vma addr, int count
|
|||||||
toaddr = alignment_rel->r_offset;
|
toaddr = alignment_rel->r_offset;
|
||||||
|
|
||||||
irel = elf_section_data (sec)->relocs;
|
irel = elf_section_data (sec)->relocs;
|
||||||
|
if (irel == NULL)
|
||||||
|
{
|
||||||
|
_bfd_elf_link_read_relocs (sec->owner, sec, NULL, NULL, TRUE);
|
||||||
|
irel = elf_section_data (sec)->relocs;
|
||||||
|
}
|
||||||
|
|
||||||
irelend = irel + sec->reloc_count;
|
irelend = irel + sec->reloc_count;
|
||||||
|
|
||||||
/* Actually delete the bytes. */
|
/* Actually delete the bytes. */
|
||||||
@ -1496,7 +1502,7 @@ elf32_rl78_relax_delete_bytes (bfd *abfd, asection *sec, bfd_vma addr, int count
|
|||||||
memset (contents + toaddr - count, 0x03, count);
|
memset (contents + toaddr - count, 0x03, count);
|
||||||
|
|
||||||
/* Adjust all the relocs. */
|
/* Adjust all the relocs. */
|
||||||
for (irel = elf_section_data (sec)->relocs; irel < irelend; irel++)
|
for (; irel && irel < irelend; irel++)
|
||||||
{
|
{
|
||||||
/* Get the new reloc address. */
|
/* Get the new reloc address. */
|
||||||
if (irel->r_offset > addr
|
if (irel->r_offset > addr
|
||||||
|
Reference in New Issue
Block a user