From: H.J. Lu Date: Tue, 6 May 2003 00:28:25 +0000 (+0000) Subject: 2003-05-05 H.J. Lu X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=d8dbbec1ca5c4db8b0d01a3d3e4a67fa5456a6f5;p=binutils-gdb.git 2003-05-05 H.J. Lu * config/tc-mips.c (tc_gen_reloc): Add addend just once if howto->partial_inplace is false. --- diff --git a/gas/ChangeLog b/gas/ChangeLog index 0b23d58c3c1..f5ea030db42 100644 --- a/gas/ChangeLog +++ b/gas/ChangeLog @@ -1,3 +1,8 @@ +2003-05-05 H.J. Lu + + * config/tc-mips.c (tc_gen_reloc): Add addend just once if + howto->partial_inplace is false. + 2003-05-05 Daniel Jacobowitz * config/tc-mips.c (mips_need_elf_addend_fixup): Remove diff --git a/gas/config/tc-mips.c b/gas/config/tc-mips.c index 59f0b3d4043..1c5602f18a6 100644 --- a/gas/config/tc-mips.c +++ b/gas/config/tc-mips.c @@ -13940,7 +13940,15 @@ tc_gen_reloc (section, fixp) && (code == BFD_RELOC_GPREL16 || code == BFD_RELOC_MIPS16_GPREL) && reloc->addend != 0 && mips_need_elf_addend_fixup (fixp)) - reloc->addend += S_GET_VALUE (fixp->fx_addsy); + { + /* If howto->partial_inplace is false, md_apply_fix3 will only + subtract it once. */ + reloc_howto_type *howto; + + howto = bfd_reloc_type_lookup (stdoutput, fixp->fx_r_type); + if (howto->partial_inplace) + reloc->addend += S_GET_VALUE (fixp->fx_addsy); + } #endif /* To support a PC relative reloc when generating embedded PIC code