R_SH_SWITCH8(.byte Label2-Label1) can be alterd if codes between two labels got shorter by relaxing. But currently the adjustment value seems to be bad.
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.
I believe this is a (partial) dup of PR 3298.
The issue has been fixed on trunk and should be available in the next release that follows binutils 2.24.