From b131d1fcfa5978f105a9ac39057475f54bab9202 Mon Sep 17 00:00:00 2001 From: Kaz Kojima Date: Fri, 1 Aug 2014 19:13:39 +0900 Subject: Fix PR10378 which is SH relax bug. --- gas/ChangeLog | 6 ++++++ gas/config/tc-sh.c | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) (limited to 'gas') diff --git a/gas/ChangeLog b/gas/ChangeLog index 72d54db..b7926f4 100644 --- a/gas/ChangeLog +++ b/gas/ChangeLog @@ -1,3 +1,9 @@ +2014-08-01 Takashi Yoshii + + PR 10378 + * config/tc-sh.c (tc_gen_reloc): Fix initialization of addend in + SWITCH_TABLE case. + 2014-07-29 Matthew Fortune * config/tc-mips.c: Rename INSN_LOAD_COPROC_DELAY to INSN_LOAD_COPROC diff --git a/gas/config/tc-sh.c b/gas/config/tc-sh.c index a0cd212..6e9ae92 100644 --- a/gas/config/tc-sh.c +++ b/gas/config/tc-sh.c @@ -4435,7 +4435,7 @@ tc_gen_reloc (asection *section ATTRIBUTE_UNUSED, fixS *fixp) if (SWITCH_TABLE (fixp)) { *rel->sym_ptr_ptr = symbol_get_bfdsym (fixp->fx_subsy); - rel->addend = 0; + rel->addend = rel->address - S_GET_VALUE(fixp->fx_subsy); if (r_type == BFD_RELOC_16) r_type = BFD_RELOC_SH_SWITCH16; else if (r_type == BFD_RELOC_8) -- cgit v1.1