mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-12-16 23:04:21 +08:00
PR 3298 Fix SuperH relaxation overriding wrong intruction
when doing load store switching it wrongly adjusts the address of the R_SH_USES reloc and not the actual offset from that instruction. This is an issue if the pc-relative function call relaxation gets done in a later pass wich will result in overriding the wrong instruction.
This commit is contained in:
@@ -1429,9 +1429,9 @@ sh_elf_swap_insns (bfd *abfd, asection *sec, void *relocs,
|
|||||||
|
|
||||||
off = irel->r_offset + 4 + irel->r_addend;
|
off = irel->r_offset + 4 + irel->r_addend;
|
||||||
if (off == addr)
|
if (off == addr)
|
||||||
irel->r_offset += 2;
|
irel->r_addend += 2;
|
||||||
else if (off == addr + 2)
|
else if (off == addr + 2)
|
||||||
irel->r_offset -= 2;
|
irel->r_addend -= 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (irel->r_offset == addr)
|
if (irel->r_offset == addr)
|
||||||
|
|||||||
Reference in New Issue
Block a user