aboutsummaryrefslogtreecommitdiff
path: root/gas/config
diff options
context:
space:
mode:
authorNick Clifton <nickc@redhat.com>2007-05-15 09:21:24 +0000
committerNick Clifton <nickc@redhat.com>2007-05-15 09:21:24 +0000
commit1c3f20b4d1bae5fb56f265da94b18101f7dab390 (patch)
tree671d1daed8d045bfb42ef9307d573c020ff3ec5b /gas/config
parent0414f35b827c242a1541214a9f59ddb41ecd59f8 (diff)
downloadgdb-1c3f20b4d1bae5fb56f265da94b18101f7dab390.zip
gdb-1c3f20b4d1bae5fb56f265da94b18101f7dab390.tar.gz
gdb-1c3f20b4d1bae5fb56f265da94b18101f7dab390.tar.bz2
PR gas/3041
* config/tc-m68k.c (relaxable_symbol): Make sure that the correct addend is stored for relocs against weak symbols. (md_apply_fix): So not loose track of addend for relocs against weak symbols. * testsuite/gas/m68k/p3041.s: New test case. * testsuite/gas/m68k/p3041.d: New expected disassembly. * testsuite/gas/m68k/all.exp: Run new test for m68k-*-netbsd toolchains. Only run arch-cpu-1 test for ELF based toolchains. Tidy ups for m68k-netbsd gas toolchain: * testsuite/gas/m68k/cpu32.d: Allow for extra text after expected disassembly. * testsuite/gas/m68k/mcf-trap.d: Allow for alternative trap mnemonics. * testsuite/gas/m68k/br-isab.d: Fix name of test. * testsuite/gas/m68k/br-isac.d: Fix name of test.
Diffstat (limited to 'gas/config')
-rw-r--r--gas/config/tc-m68k.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/gas/config/tc-m68k.c b/gas/config/tc-m68k.c
index dd95139..8ae1f3c 100644
--- a/gas/config/tc-m68k.c
+++ b/gas/config/tc-m68k.c
@@ -1160,8 +1160,9 @@ tc_gen_reloc (asection *section ATTRIBUTE_UNUSED, fixS *fixp)
&& S_IS_WEAK (fixp->fx_addsy)
&& ! bfd_is_und_section (S_GET_SEGMENT (fixp->fx_addsy)))
/* PR gas/3041 Adjust addend in order to force bfd_install_relocation()
- to put a zero value into frags referencing a weak symbol. */
- reloc->addend = - S_GET_VALUE (fixp->fx_addsy);
+ to put the symbol offset into frags referencing a weak symbol. */
+ reloc->addend = fixp->fx_addnumber
+ - (S_GET_VALUE (fixp->fx_addsy) * 2);
else
reloc->addend = 0;
#else
@@ -4702,10 +4703,11 @@ md_apply_fix (fixS *fixP, valueT *valP, segT seg ATTRIBUTE_UNUSED)
return;
}
#elif defined(OBJ_AOUT)
- /* PR gas/3041 Always put zero values into frags referencing a weak symbol. */
+ /* PR gas/3041 Do not fix frags referencing a weak symbol. */
if (fixP->fx_addsy && S_IS_WEAK (fixP->fx_addsy))
{
memset (buf, 0, fixP->fx_size);
+ fixP->fx_addnumber = val; /* Remember value for emit_reloc. */
return;
}
#endif