diff options
author | Maciej W. Rozycki <macro@linux-mips.org> | 2002-06-13 10:10:51 +0000 |
---|---|---|
committer | Maciej W. Rozycki <macro@linux-mips.org> | 2002-06-13 10:10:51 +0000 |
commit | d6e9d61afd4cad78a2aff2a5dc6ad3aefa1c8341 (patch) | |
tree | 26ceea7e87e9b45f01e99abec881c6f31ac376e2 | |
parent | c4bb8067a5599a2f618238f8b12ad14b6629ff8b (diff) | |
download | gdb-d6e9d61afd4cad78a2aff2a5dc6ad3aefa1c8341.zip gdb-d6e9d61afd4cad78a2aff2a5dc6ad3aefa1c8341.tar.gz gdb-d6e9d61afd4cad78a2aff2a5dc6ad3aefa1c8341.tar.bz2 |
* config/tc-mips.c (md_apply_fix3): Don't subtract the symbol's
value twice for RELA relocations.
-rw-r--r-- | gas/ChangeLog | 5 | ||||
-rw-r--r-- | gas/config/tc-mips.c | 9 |
2 files changed, 9 insertions, 5 deletions
diff --git a/gas/ChangeLog b/gas/ChangeLog index a97948e..f2a39b1 100644 --- a/gas/ChangeLog +++ b/gas/ChangeLog @@ -1,3 +1,8 @@ +2002-06-13 Maciej W. Rozycki <macro@ds2.pg.gda.pl> + + * config/tc-mips.c (md_apply_fix3): Don't subtract the symbol's + value twice for RELA relocations. + 2002-06-12 Ben Elliston <bje@redhat.com> * symbols.c (resolve_symbol_value): Initialise final_val. diff --git a/gas/config/tc-mips.c b/gas/config/tc-mips.c index 7a973c1..acd9cde 100644 --- a/gas/config/tc-mips.c +++ b/gas/config/tc-mips.c @@ -10892,10 +10892,13 @@ md_apply_fix3 (fixP, valP, seg) { if (mips_need_elf_addend_fixup (fixP)) { + reloc_howto_type *howto; valueT symval = S_GET_VALUE (fixP->fx_addsy); value -= symval; - if (value != 0 && ! fixP->fx_pcrel) + + howto = bfd_reloc_type_lookup (stdoutput, fixP->fx_r_type); + if (value != 0 && howto->partial_inplace && ! fixP->fx_pcrel) { /* In this case, the bfd_install_relocation routine will incorrectly add the symbol value back in. We just want @@ -10913,12 +10916,8 @@ md_apply_fix3 (fixP, valP, seg) leave the matching HI16 in-place addends as zero. */ if (fixP->fx_r_type != BFD_RELOC_HI16_S) { - reloc_howto_type *howto; bfd_vma contents, mask, field; - howto = bfd_reloc_type_lookup (stdoutput, - fixP->fx_r_type); - contents = bfd_get_bits (fixP->fx_frag->fr_literal + fixP->fx_where, fixP->fx_size * 8, |