From 49dff77b6e4a99a16583b1466e260e679661e0de Mon Sep 17 00:00:00 2001 From: Julian Brown Date: Fri, 1 May 2009 13:49:19 +0000 Subject: [PATCH] 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. --- ld/testsuite/ChangeLog | 6 ++ ld/testsuite/ld-arm/arm-elf.exp | 3 + ld/testsuite/ld-arm/thumb2-bl-blx-interwork.d | 71 +++++++++++++++ ld/testsuite/ld-arm/thumb2-bl-blx-interwork.s | 87 +++++++++++++++++++ 4 files changed, 167 insertions(+) create mode 100644 ld/testsuite/ld-arm/thumb2-bl-blx-interwork.d create mode 100644 ld/testsuite/ld-arm/thumb2-bl-blx-interwork.s diff --git a/ld/testsuite/ChangeLog b/ld/testsuite/ChangeLog index 91bb3ed274b..63c51ffc89f 100644 --- a/ld/testsuite/ChangeLog +++ b/ld/testsuite/ChangeLog @@ -1,3 +1,9 @@ +2009-05-01 Julian Brown + + * 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 * ld-ifunc: New directory. diff --git a/ld/testsuite/ld-arm/arm-elf.exp b/ld/testsuite/ld-arm/arm-elf.exp index 04bbcf2a84a..218bfb5302c 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 00000000000..ba5a73287c4 --- /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 + 8004: f000 e81e blx 8044 + 8008: bf00 nop + 800a: f000 e816 blx 8038 + 800e: f000 e81a blx 8044 + 8012: bf00 nop + 8014: f000 f818 bl 8048 + 8018: f000 f81b bl 8052 + 801c: f000 f81e bl 805c + 8020: f000 f821 bl 8066 + 8024: bf00 nop + 8026: f000 f80f bl 8048 + 802a: f000 f812 bl 8052 + 802e: f000 f815 bl 805c + 8032: f000 f818 bl 8066 + 8036: bf00 nop + +00008038 : + 8038: e12fff1e bx lr + 803c: e320f000 nop \{0\} + 8040: e320f000 nop \{0\} + +00008044 : + 8044: e12fff1e bx lr + +00008048 : + 8048: 4770 bx lr + 804a: bf00 nop + 804c: f3af 8000 nop\.w + 8050: bf00 nop + +00008052 : + 8052: 4770 bx lr + 8054: f3af 8000 nop\.w + 8058: bf00 nop + 805a: bf00 nop + +0000805c : + 805c: 4770 bx lr + 805e: bf00 nop + 8060: bf00 nop + 8062: bf00 nop + 8064: bf00 nop + +00008066 : + 8066: 4770 bx lr + +00008068 : + 8068: f7ff efe6 blx 8038 + 806c: f7ff efea blx 8044 + 8070: bf00 nop + 8072: f7ff efe2 blx 8038 + 8076: f7ff efe6 blx 8044 + 807a: bf00 nop + 807c: f7ff ffe4 bl 8048 + 8080: f7ff ffe7 bl 8052 + 8084: f7ff ffea bl 805c + 8088: f7ff ffed bl 8066 + 808c: bf00 nop + 808e: f7ff ffdb bl 8048 + 8092: f7ff ffde bl 8052 + 8096: f7ff ffe1 bl 805c + 809a: f7ff ffe4 bl 8066 + 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 00000000000..dba46af7529 --- /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 -- 2.30.2