aboutsummaryrefslogtreecommitdiff
path: root/gas
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
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')
-rw-r--r--gas/ChangeLog8
-rw-r--r--gas/config/tc-m68k.c8
-rw-r--r--gas/testsuite/ChangeLog16
-rw-r--r--gas/testsuite/gas/m68k/all.exp8
-rw-r--r--gas/testsuite/gas/m68k/br-isab.d2
-rw-r--r--gas/testsuite/gas/m68k/br-isac.d2
-rw-r--r--gas/testsuite/gas/m68k/cpu32.d1
-rw-r--r--gas/testsuite/gas/m68k/mcf-trap.d12
-rw-r--r--gas/testsuite/gas/m68k/p3041.d15
-rw-r--r--gas/testsuite/gas/m68k/p3041.s6
10 files changed, 66 insertions, 12 deletions
diff --git a/gas/ChangeLog b/gas/ChangeLog
index 3f0e5e8..2a03e5a 100644
--- a/gas/ChangeLog
+++ b/gas/ChangeLog
@@ -1,3 +1,11 @@
+2007-05-15 Vincent Riviere <vincent.riviere@freesbee.fr>
+
+ 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.
+
2007-05-14 Thiemo Seufer <ths@mips.com>
* config/tc-mips.c (md_parse_option): Fix parsing of -O option.
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
diff --git a/gas/testsuite/ChangeLog b/gas/testsuite/ChangeLog
index f707a6a..4b4b2db 100644
--- a/gas/testsuite/ChangeLog
+++ b/gas/testsuite/ChangeLog
@@ -1,3 +1,19 @@
+2007-05-15 Vincent Riviere <vincent.riviere@freesbee.fr>
+ Nick Clifton <nickc@redhat.com>
+
+ PR gas/3041
+ * gas/m68k/p3041.s: New test case.
+ * gas/m68k/p3041.d: New expected disassembly.
+ * 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:
+ * gas/m68k/cpu32.d: Allow for extra text after expected
+ disassembly.
+ * gas/m68k/mcf-trap.d: Allow for alternative trap mnemonics.
+ * gas/m68k/br-isab.d: Fix name of test.
+ * gas/m68k/br-isac.d: Fix name of test.
+
2007-05-14 H.J. Lu <hongjiu.lu@intel.com>
PR binutils/4502
diff --git a/gas/testsuite/gas/m68k/all.exp b/gas/testsuite/gas/m68k/all.exp
index 7153e7b..cafae92 100644
--- a/gas/testsuite/gas/m68k/all.exp
+++ b/gas/testsuite/gas/m68k/all.exp
@@ -54,7 +54,9 @@ if { [istarget m68*-*-*] || [istarget fido*-*-*] } then {
run_dump_test mcf-emac
run_dump_test mcf-fpu
run_dump_test mcf-trap
- run_dump_test arch-cpu-1
+ if { [istarget *-*-elf] || [istarget *-*-linux*] } then {
+ run_dump_test arch-cpu-1
+ }
run_dump_test cpu32
run_dump_test br-isaa
@@ -64,6 +66,10 @@ if { [istarget m68*-*-*] || [istarget fido*-*-*] } then {
run_dump_test ctrl-1
run_dump_test ctrl-2
+ if { [istarget *-*-netbsd] } then {
+ run_dump_test p3041
+ }
+
set testname "68000 operands"
gas_run "operands.s" "-m68000" "2>err.out"
if ![string match "child process exited abnormally" $comp_output] then {
diff --git a/gas/testsuite/gas/m68k/br-isab.d b/gas/testsuite/gas/m68k/br-isab.d
index 7ba48ff..20e093f 100644
--- a/gas/testsuite/gas/m68k/br-isab.d
+++ b/gas/testsuite/gas/m68k/br-isab.d
@@ -1,4 +1,4 @@
-#name: br-isaa.d
+#name: br-isab.d
#objdump: -d
#as: -march=isab -pcrel
diff --git a/gas/testsuite/gas/m68k/br-isac.d b/gas/testsuite/gas/m68k/br-isac.d
index 4a420ea..126ff46 100644
--- a/gas/testsuite/gas/m68k/br-isac.d
+++ b/gas/testsuite/gas/m68k/br-isac.d
@@ -1,4 +1,4 @@
-#name: br-isaa.d
+#name: br-isac.d
#objdump: -d
#as: -march=isac -pcrel
diff --git a/gas/testsuite/gas/m68k/cpu32.d b/gas/testsuite/gas/m68k/cpu32.d
index 84f1d67..e7054a3 100644
--- a/gas/testsuite/gas/m68k/cpu32.d
+++ b/gas/testsuite/gas/m68k/cpu32.d
@@ -32,3 +32,4 @@ Disassembly of section .text:
[ 0-9a-f]+: f810 1d00 tblsnb %a0@,%d1
[ 0-9a-f]+: f810 1d40 tblsnw %a0@,%d1
[ 0-9a-f]+: f810 1d80 tblsnl %a0@,%d1
+#...
diff --git a/gas/testsuite/gas/m68k/mcf-trap.d b/gas/testsuite/gas/m68k/mcf-trap.d
index f899b69..63d18fd 100644
--- a/gas/testsuite/gas/m68k/mcf-trap.d
+++ b/gas/testsuite/gas/m68k/mcf-trap.d
@@ -7,9 +7,9 @@
Disassembly of section .text:
0+ <.text>:
-[ 0-9a-f]+: 51fc tpf
-[ 0-9a-f]+: 51fa 1234 tpfw #4660
-[ 0-9a-f]+: 51fb 1234 5678 tpfl #305419896
-[ 0-9a-f]+: 51fc tpf
-[ 0-9a-f]+: 51fa 1234 tpfw #4660
-[ 0-9a-f]+: 51fb 1234 5678 tpfl #305419896
+[ 0-9a-f]+: 51fc t[rap]*f
+[ 0-9a-f]+: 51fa 1234 t[rap]*fw #4660
+[ 0-9a-f]+: 51fb 1234 5678 t[rap]*fl #305419896
+[ 0-9a-f]+: 51fc t[rap]*f
+[ 0-9a-f]+: 51fa 1234 t[rap]*fw #4660
+[ 0-9a-f]+: 51fb 1234 5678 t[rap]*fl #305419896
diff --git a/gas/testsuite/gas/m68k/p3041.d b/gas/testsuite/gas/m68k/p3041.d
new file mode 100644
index 0000000..b4a41c4
--- /dev/null
+++ b/gas/testsuite/gas/m68k/p3041.d
@@ -0,0 +1,15 @@
+#name: PR 3041
+#objdump: -dr
+
+.*: file format .*
+
+Disassembly of section .text:
+
+0+ <.*>:
+ 0: 4ef9 0000 0002 [ ]+jmp 2 <mylabel-0x6>
+ 2: .* mylabel
+ 6: 4e71 [ ]+nop
+
+0+8 <mylabel>:
+ 8: 4e71 [ ]+nop
+ a: 4e71 [ ]+nop
diff --git a/gas/testsuite/gas/m68k/p3041.s b/gas/testsuite/gas/m68k/p3041.s
new file mode 100644
index 0000000..96a8910
--- /dev/null
+++ b/gas/testsuite/gas/m68k/p3041.s
@@ -0,0 +1,6 @@
+ jmp mylabel+2
+ nop
+ .weak mylabel
+mylabel:
+ nop
+ nop