From: Ian Lance Taylor Date: Mon, 3 Feb 1997 17:56:00 +0000 (+0000) Subject: * config/tc-mips.c (md_apply_fix): If we aren't adjusting this X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=1748b9d8f026c5de3119dafef4ecbdef19016512;p=binutils-gdb.git * config/tc-mips.c (md_apply_fix): If we aren't adjusting this fixup to be against the section symbol, adjust the value accordingly. --- diff --git a/gas/ChangeLog b/gas/ChangeLog index 51d9df0aef7..a861a8f919c 100644 --- a/gas/ChangeLog +++ b/gas/ChangeLog @@ -1,5 +1,9 @@ Mon Feb 3 12:35:54 1997 Ian Lance Taylor + * config/tc-mips.c (md_apply_fix): If we aren't adjusting this + fixup to be against the section symbol, adjust the value + accordingly. + * symbols.c (resolve_symbol_value): Don't change X_add_number for an equated symbol. * write.c (write_relocs): Avoid looping on equated symbols. diff --git a/gas/config/tc-mips.c b/gas/config/tc-mips.c index 4a59ab9a1e2..52f8c0ba461 100644 --- a/gas/config/tc-mips.c +++ b/gas/config/tc-mips.c @@ -8217,6 +8217,27 @@ md_apply_fix (fixP, valueP) || fixP->fx_r_type == BFD_RELOC_64); value = *valueP; + + /* If we aren't adjusting this fixup to be against the section + symbol, we need to adjust the value. */ +#ifdef S_GET_OTHER + if (fixP->fx_addsy != NULL + && (S_IS_EXTERNAL (fixP->fx_addsy) + || S_IS_WEAK (fixP->fx_addsy)) + && OUTPUT_FLAVOR == bfd_target_elf_flavour + && S_GET_OTHER (fixP->fx_addsy) == STO_MIPS16) + { + value -= S_GET_VALUE (fixP->fx_addsy); + if (value != 0 && ! fixP->fx_pcrel) + { + /* In this case, the bfd_install_relocation routine will + incorrectly add the symbol value back in. We just want + the addend to appear in the object file. */ + value -= S_GET_VALUE (fixP->fx_addsy); + } + } +#endif + fixP->fx_addnumber = value; /* Remember value for tc_gen_reloc */ if (fixP->fx_addsy == NULL && ! fixP->fx_pcrel)