ld/testsuite/
authorJulian Brown <julian@codesourcery.com>
Fri, 1 May 2009 13:49:19 +0000 (13:49 +0000)
committerJulian Brown <julian@codesourcery.com>
Fri, 1 May 2009 13:49:19 +0000 (13:49 +0000)
* 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.

ld/testsuite/ChangeLog
ld/testsuite/ld-arm/arm-elf.exp
ld/testsuite/ld-arm/thumb2-bl-blx-interwork.d [new file with mode: 0644]
ld/testsuite/ld-arm/thumb2-bl-blx-interwork.s [new file with mode: 0644]

index 91bb3ed274b5c6d6426a37e19c8bc46f92cb844b..63c51ffc89f3ae171e1dbde4728bf242a44e6a12 100644 (file)
@@ -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.
index 04bbcf2a84a48c322e0b3d25798297f847548c77..218bfb5302ca8d0713fca84179d9110210b4389f 100644 (file)
@@ -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 (file)
index 0000000..ba5a732
--- /dev/null
@@ -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 (file)
index 0000000..dba46af
--- /dev/null
@@ -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