mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-06-25 13:09:23 +08:00
* elf32-sh.c (sh_elf_relax_delete_bytes): Fix setting of
start / stop for recalculating of r_addend of R_SH_SWITCH*.
This commit is contained in:
@ -1,3 +1,8 @@
|
|||||||
|
Fri Jun 4 03:10:49 1999 J"orn Rennecke <amylaar@cygnus.co.uk>
|
||||||
|
|
||||||
|
* elf32-sh.c (sh_elf_relax_delete_bytes): Fix setting of
|
||||||
|
start / stop for recalculating of r_addend of R_SH_SWITCH*.
|
||||||
|
|
||||||
Fri Jun 4 02:53:13 1999 J"orn Rennecke <amylaar@cygnus.co.uk>
|
Fri Jun 4 02:53:13 1999 J"orn Rennecke <amylaar@cygnus.co.uk>
|
||||||
|
|
||||||
* elf32-sh.c (sh_elf_relax_delete_bytes): Handle R_SH_SWITCH32
|
* elf32-sh.c (sh_elf_relax_delete_bytes): Handle R_SH_SWITCH32
|
||||||
|
@ -1161,13 +1161,15 @@ sh_elf_relax_delete_bytes (abfd, sec, addr, count)
|
|||||||
case R_SH_SWITCH32:
|
case R_SH_SWITCH32:
|
||||||
/* These relocs types represent
|
/* These relocs types represent
|
||||||
.word L2-L1
|
.word L2-L1
|
||||||
The r_offset field holds the difference between the reloc
|
The r_addend field holds the difference between the reloc
|
||||||
address and L1. That is the start of the reloc, and
|
address and L1. That is the start of the reloc, and
|
||||||
adding in the contents gives us the top. We must adjust
|
adding in the contents gives us the top. We must adjust
|
||||||
both the r_offset field and the section contents. */
|
both the r_offset field and the section contents.
|
||||||
|
N.B. in gas / coff bfd, the elf bfd r_addend is called r_offset,
|
||||||
|
and the elf bfd r_offset is called r_vaddr. */
|
||||||
|
|
||||||
start = irel->r_offset;
|
stop = irel->r_offset;
|
||||||
stop = (bfd_vma) ((bfd_signed_vma) start - (long) irel->r_addend);
|
start = (bfd_vma) ((bfd_signed_vma) stop - (long) irel->r_addend);
|
||||||
|
|
||||||
if (start > addr
|
if (start > addr
|
||||||
&& start < toaddr
|
&& start < toaddr
|
||||||
@ -1178,8 +1180,6 @@ sh_elf_relax_delete_bytes (abfd, sec, addr, count)
|
|||||||
&& (start <= addr || start >= toaddr))
|
&& (start <= addr || start >= toaddr))
|
||||||
irel->r_addend -= count;
|
irel->r_addend -= count;
|
||||||
|
|
||||||
start = stop;
|
|
||||||
|
|
||||||
if (ELF32_R_TYPE (irel->r_info) == (int) R_SH_SWITCH16)
|
if (ELF32_R_TYPE (irel->r_info) == (int) R_SH_SWITCH16)
|
||||||
voff = bfd_get_signed_16 (abfd, contents + nraddr);
|
voff = bfd_get_signed_16 (abfd, contents + nraddr);
|
||||||
else if (ELF32_R_TYPE (irel->r_info) == (int) R_SH_SWITCH8)
|
else if (ELF32_R_TYPE (irel->r_info) == (int) R_SH_SWITCH8)
|
||||||
|
Reference in New Issue
Block a user