aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStephane Carrez <stcarrez@nerim.fr>2002-12-01 13:25:05 +0000
committerStephane Carrez <stcarrez@nerim.fr>2002-12-01 13:25:05 +0000
commita4ff0c7986624c9e8c12f5d3f2342837a4c36052 (patch)
treeafb0c75bbaf214770a0f6da9d63ae8a8977a3c6d
parent304916478207cd089d547802cf04dc810b718a6d (diff)
downloadgdb-a4ff0c7986624c9e8c12f5d3f2342837a4c36052.zip
gdb-a4ff0c7986624c9e8c12f5d3f2342837a4c36052.tar.gz
gdb-a4ff0c7986624c9e8c12f5d3f2342837a4c36052.tar.bz2
Fix PR savannah/1417:
* ld-m68hc11/bug-1417.s: New test. * ld-m68hc11/bug-1417.d: Likewise.
-rw-r--r--ld/testsuite/ChangeLog6
-rw-r--r--ld/testsuite/ld-m68hc11/bug-1417.d15
-rw-r--r--ld/testsuite/ld-m68hc11/bug-1417.s21
3 files changed, 42 insertions, 0 deletions
diff --git a/ld/testsuite/ChangeLog b/ld/testsuite/ChangeLog
index 0d835d4..2f8179b 100644
--- a/ld/testsuite/ChangeLog
+++ b/ld/testsuite/ChangeLog
@@ -1,3 +1,9 @@
+2002-12-01 Stephane Carrez <stcarrez@nerim.fr>
+
+ Fix PR savannah/1417:
+ * ld-m68hc11/bug-1417.s: New test.
+ * ld-m68hc11/bug-1417.d: Likewise.
+
2002-11-28 Jakub Jelinek <jakub@redhat.com>
* ld-i386/tlsnopic.rd: Change NOTYPE to TLS for UND sg* symbols.
diff --git a/ld/testsuite/ld-m68hc11/bug-1417.d b/ld/testsuite/ld-m68hc11/bug-1417.d
new file mode 100644
index 0000000..d1e7c42
--- /dev/null
+++ b/ld/testsuite/ld-m68hc11/bug-1417.d
@@ -0,0 +1,15 @@
+#source: bug-1417.s
+#as: -m68hc11
+#ld: --relax
+#objdump: -d --prefix-addresses -r
+#target: m6811-*-* m6812-*-*
+
+.*: +file format elf32-m68hc11
+
+Disassembly of section .text:
+0+8000 <_start> tst 0+ <__bss_size>
+0+8003 <_start\+0x3> bne 0+8008 <L1>
+0+8005 <_start\+0x5> jsr 0+800c <foo>
+0+8008 <L1> bset \*0+ <__bss_size> \#\$04
+0+800b <L2> rts
+0+800c <foo> rts
diff --git a/ld/testsuite/ld-m68hc11/bug-1417.s b/ld/testsuite/ld-m68hc11/bug-1417.s
new file mode 100644
index 0000000..2b3e6a1
--- /dev/null
+++ b/ld/testsuite/ld-m68hc11/bug-1417.s
@@ -0,0 +1,21 @@
+;;; Bug #1417: Branch wrong after linker relaxation
+;;; http://savannah.gnu.org/bugs/?func=detailbug&bug_id=1417&group_id=2424
+;;;
+ .sect .text
+ .globl _start
+_start:
+ tst table
+ bne L1 ; Branch was adjusted but it must not
+ jsr foo
+L1:
+ .relax L2
+ ldx #table ; Instruction removed
+ bset 0,x #4 ; Changed to bset *table #4
+L2:
+ rts
+foo:
+ rts
+
+ .sect .page0
+ .globl table
+table: .long 0