aboutsummaryrefslogtreecommitdiff
path: root/ld
diff options
context:
space:
mode:
authorJulian Brown <julian@codesourcery.com>2009-05-01 13:49:19 +0000
committerJulian Brown <julian@codesourcery.com>2009-05-01 13:49:19 +0000
commit49dff77b6e4a99a16583b1466e260e679661e0de (patch)
tree90ab3aff36aaa5845d951d9159d2d8eeafeb0131 /ld
parent35684040ac057c519aa51ed8a6b854aa4812c537 (diff)
downloadgdb-49dff77b6e4a99a16583b1466e260e679661e0de.zip
gdb-49dff77b6e4a99a16583b1466e260e679661e0de.tar.gz
gdb-49dff77b6e4a99a16583b1466e260e679661e0de.tar.bz2
ld/testsuite/
* ld-arm/arm-elf.exp (armeabitests): Add thumb2-bl-blx-interwork test. * ld-arm/thumb2-bl-blx-interwork.s: New. * ld-arm/thumb2-bl-blx-interwork.d: New.
Diffstat (limited to 'ld')
-rw-r--r--ld/testsuite/ChangeLog6
-rw-r--r--ld/testsuite/ld-arm/arm-elf.exp3
-rw-r--r--ld/testsuite/ld-arm/thumb2-bl-blx-interwork.d71
-rw-r--r--ld/testsuite/ld-arm/thumb2-bl-blx-interwork.s87
4 files changed, 167 insertions, 0 deletions
diff --git a/ld/testsuite/ChangeLog b/ld/testsuite/ChangeLog
index 91bb3ed..63c51ff 100644
--- a/ld/testsuite/ChangeLog
+++ b/ld/testsuite/ChangeLog
@@ -1,3 +1,9 @@
+2009-05-01 Julian Brown <julian@codesourcery.com>
+
+ * ld-arm/arm-elf.exp (armeabitests): Add thumb2-bl-blx-interwork test.
+ * ld-arm/thumb2-bl-blx-interwork.s: New.
+ * ld-arm/thumb2-bl-blx-interwork.d: New.
+
2009-04-30 Nick Clifton <nickc@redhat.com>
* ld-ifunc: New directory.
diff --git a/ld/testsuite/ld-arm/arm-elf.exp b/ld/testsuite/ld-arm/arm-elf.exp
index 04bbcf2..218bfb5 100644
--- a/ld/testsuite/ld-arm/arm-elf.exp
+++ b/ld/testsuite/ld-arm/arm-elf.exp
@@ -247,6 +247,9 @@ set armeabitests {
{"Thumb-2 Interworked branch" "-T arm.ld" "" {thumb2-b-interwork.s}
{{objdump -dr thumb2-b-interwork.d}}
"thumb2-b-interwork"}
+ {"BL/BLX interworking" "-T arm.ld" "" {thumb2-bl-blx-interwork.s}
+ {{objdump -dr thumb2-bl-blx-interwork.d}}
+ "thumb2-bl-blx-interwork"}
{"ARMv4 interworking" "-static -T arm.ld --fix-v4bx-interworking" "--fix-v4bx -meabi=4" {armv4-bx.s}
{{objdump -d armv4-bx.d}}
"armv4-bx"}
diff --git a/ld/testsuite/ld-arm/thumb2-bl-blx-interwork.d b/ld/testsuite/ld-arm/thumb2-bl-blx-interwork.d
new file mode 100644
index 0000000..ba5a732
--- /dev/null
+++ b/ld/testsuite/ld-arm/thumb2-bl-blx-interwork.d
@@ -0,0 +1,71 @@
+
+.*: file format .*
+
+
+Disassembly of section \.text:
+
+00008000 <_start>:
+ 8000: f000 e81a blx 8038 <arm0>
+ 8004: f000 e81e blx 8044 <arm4>
+ 8008: bf00 nop
+ 800a: f000 e816 blx 8038 <arm0>
+ 800e: f000 e81a blx 8044 <arm4>
+ 8012: bf00 nop
+ 8014: f000 f818 bl 8048 <thumb0>
+ 8018: f000 f81b bl 8052 <thumb2>
+ 801c: f000 f81e bl 805c <thumb4>
+ 8020: f000 f821 bl 8066 <thumb6>
+ 8024: bf00 nop
+ 8026: f000 f80f bl 8048 <thumb0>
+ 802a: f000 f812 bl 8052 <thumb2>
+ 802e: f000 f815 bl 805c <thumb4>
+ 8032: f000 f818 bl 8066 <thumb6>
+ 8036: bf00 nop
+
+00008038 <arm0>:
+ 8038: e12fff1e bx lr
+ 803c: e320f000 nop \{0\}
+ 8040: e320f000 nop \{0\}
+
+00008044 <arm4>:
+ 8044: e12fff1e bx lr
+
+00008048 <thumb0>:
+ 8048: 4770 bx lr
+ 804a: bf00 nop
+ 804c: f3af 8000 nop\.w
+ 8050: bf00 nop
+
+00008052 <thumb2>:
+ 8052: 4770 bx lr
+ 8054: f3af 8000 nop\.w
+ 8058: bf00 nop
+ 805a: bf00 nop
+
+0000805c <thumb4>:
+ 805c: 4770 bx lr
+ 805e: bf00 nop
+ 8060: bf00 nop
+ 8062: bf00 nop
+ 8064: bf00 nop
+
+00008066 <thumb6>:
+ 8066: 4770 bx lr
+
+00008068 <backwards>:
+ 8068: f7ff efe6 blx 8038 <arm0>
+ 806c: f7ff efea blx 8044 <arm4>
+ 8070: bf00 nop
+ 8072: f7ff efe2 blx 8038 <arm0>
+ 8076: f7ff efe6 blx 8044 <arm4>
+ 807a: bf00 nop
+ 807c: f7ff ffe4 bl 8048 <thumb0>
+ 8080: f7ff ffe7 bl 8052 <thumb2>
+ 8084: f7ff ffea bl 805c <thumb4>
+ 8088: f7ff ffed bl 8066 <thumb6>
+ 808c: bf00 nop
+ 808e: f7ff ffdb bl 8048 <thumb0>
+ 8092: f7ff ffde bl 8052 <thumb2>
+ 8096: f7ff ffe1 bl 805c <thumb4>
+ 809a: f7ff ffe4 bl 8066 <thumb6>
+ 809e: bf00 nop
diff --git a/ld/testsuite/ld-arm/thumb2-bl-blx-interwork.s b/ld/testsuite/ld-arm/thumb2-bl-blx-interwork.s
new file mode 100644
index 0000000..dba46af
--- /dev/null
+++ b/ld/testsuite/ld-arm/thumb2-bl-blx-interwork.s
@@ -0,0 +1,87 @@
+ .arch armv7-a
+ .global _start
+ .syntax unified
+ .text
+ .thumb
+
+ .macro do_calls
+ @ The following four instructions are accepted by gas, but generate
+ @ meaningless code.
+ @bl.w arm0
+ @bl.w arm4
+ @nop
+ @bl.w arm0
+ @bl.w arm4
+ @nop
+ blx.w arm0
+ blx.w arm4
+ nop
+ blx.w arm0
+ blx.w arm4
+ nop
+ bl.w thumb0
+ bl.w thumb2
+ bl.w thumb4
+ bl.w thumb6
+ nop
+ bl.w thumb0
+ bl.w thumb2
+ bl.w thumb4
+ bl.w thumb6
+ nop
+ @ These eight are all accepted by gas, but generate bad code.
+ @blx.w thumb0
+ @blx.w thumb2
+ @blx.w thumb4
+ @blx.w thumb6
+ @nop
+ @blx.w thumb0
+ @blx.w thumb2
+ @blx.w thumb4
+ @blx.w thumb6
+ .endm
+
+ .thumb_func
+ .align 3
+_start:
+ do_calls
+
+ .arm
+ .align 3
+arm0:
+ bx lr
+
+ .align 3
+ nop
+arm4:
+ bx lr
+
+ .thumb
+ .thumb_func
+ .align 3
+thumb0:
+ bx lr
+
+ .thumb_func
+ .align 3
+ nop
+thumb2:
+ bx lr
+
+ .thumb_func
+ .align 3
+ nop
+ nop
+thumb4:
+ bx lr
+
+ .thumb_func
+ .align 3
+ nop
+ nop
+ nop
+thumb6:
+ bx lr
+
+backwards:
+ do_calls