Summary: | SH: jump table for switch/case got invalid adjustment during relaxing. | ||
---|---|---|---|
Product: | binutils | Reporter: | Takashi YOSHII <yoshii.takashi> |
Component: | ld | Assignee: | unassigned |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | bug-binutils, kkojima, olegendo |
Priority: | P2 | ||
Version: | unspecified | ||
Target Milestone: | --- | ||
Host: | Target: | sh | |
Build: | Last reconfirmed: | ||
Attachments: |
test program
patch to fix |
Description
Takashi YOSHII
2009-07-08 05:56:49 UTC
Created attachment 4044 [details]
test program
as -relax adjsw8.s -o adjsw8.o; ld -relax adjsw8.o; objdump -t; objdump -s
and see if first 3 bytes are L1-L0,L2-L0,L3-L0 (should be 04 08 0c).
HEAD of CVS produces 04 06 0a.
Created attachment 4045 [details]
patch to fix
I added small code to gas as bfd/elf-sh.c expects r_addend holds the different
between reloc address and label1. I can't find any official documents(ELF-ps or
so), though.
Tested for target=sh4-unknown-linux-gnu host=build=x86_64-pc-linux-gnu with
$ make check-bfd check-gas check-ld RUNTESTFLAGS="--target_board=sh-sim
SIM=$PWD/sim/sh/run"
New test case and even old sh.exp:"SH relaxing execution" can detect this
issue.
The issue has been fixed on trunk and should be available in the next release that follows binutils 2.24. |