aboutsummaryrefslogtreecommitdiff
path: root/gas/testsuite
diff options
context:
space:
mode:
authorNick Clifton <nickc@redhat.com>2017-05-15 15:29:02 +0100
committerNick Clifton <nickc@redhat.com>2017-05-15 15:29:02 +0100
commit52a86f843b6dee1de9977293da9786649b146b05 (patch)
tree51bb23eaae6f8107c8256739bd57d25d050a7868 /gas/testsuite
parentb32465c97c12cc6049cefcde1beb3e2bfbfa232c (diff)
downloadgdb-52a86f843b6dee1de9977293da9786649b146b05.zip
gdb-52a86f843b6dee1de9977293da9786649b146b05.tar.gz
gdb-52a86f843b6dee1de9977293da9786649b146b05.tar.bz2
Fix use of ARM ADR and ADRl pseudo-instructions with thumb function symbols.
PR gas/21458 * config/tc-arm.c (do_adr): If the ADR involves a thumb function symbol, ensure that the T bit will be set. (do_adrl): Likewise. (do_t_adr): Likewise. * testsuite/gas/arm/pr21458.s: New test. * testsuite/gas/arm/pr21458.d: New test driver.
Diffstat (limited to 'gas/testsuite')
-rw-r--r--gas/testsuite/gas/arm/pr21458.d27
-rw-r--r--gas/testsuite/gas/arm/pr21458.s40
2 files changed, 67 insertions, 0 deletions
diff --git a/gas/testsuite/gas/arm/pr21458.d b/gas/testsuite/gas/arm/pr21458.d
new file mode 100644
index 0000000..c0b1d12
--- /dev/null
+++ b/gas/testsuite/gas/arm/pr21458.d
@@ -0,0 +1,27 @@
+#objdump: -d --prefix-addresses --show-raw-insn
+#name: ADR(L) for Thumb functions
+#skip: *-*-pe *-wince-* *-*-coff *-*-vxworks
+
+# Test that using ADR(L) on thumb function symbols sets the T bit.
+
+.*: +file format .*arm.*
+
+Disassembly of section .text:
+0+00000 <.*> 4770[ ]+bx[ ]+lr
+0+00002 <.*> 46c0[ ]+nop[ ]+; \(mov r8, r8\)
+0+00004 <.*> e12fff1e[ ]+bx[ ]+lr
+0+00008 <.*> f2af 000b[ ]+subw[ ]+r0, pc, #11
+0+0000c <.*> 4780[ ]+blx[ ]+r0
+0+0000e <.*> f2af 020c[ ]+subw[ ]+r2, pc, #12
+0+00012 <.*> 4790[ ]+blx[ ]+r2
+0+00014 <.*> e24f401b[ ]+sub[ ]+r4, pc, #27
+0+00018 <.*> e1a00000[ ]+nop[ ]+; \(mov r0, r0\)
+0+0001c <.*> e12fff34[ ]+blx[ ]+r4
+0+00020 <.*> e24f6024[ ]+sub[ ]+r6, pc, #36[ ]+; 0x24
+0+00024 <.*> e1a00000[ ]+nop[ ]+; \(mov r0, r0\)
+0+00028 <.*> e12fff36[ ]+blx[ ]+r6
+0+0002c <.*> e24f8033[ ]+sub[ ]+r8, pc, #51[ ]+; 0x33
+0+00030 <.*> e12fff38[ ]+blx[ ]+r8
+0+00034 <.*> e24fa038[ ]+sub[ ]+sl, pc, #56[ ]+; 0x38
+0+00038 <.*> e12fff3a[ ]+blx[ ]+sl
+0+0003c <.*> 324fc043[ ]+subcc[ ]+ip, pc, #67[ ]+; 0x43
diff --git a/gas/testsuite/gas/arm/pr21458.s b/gas/testsuite/gas/arm/pr21458.s
new file mode 100644
index 0000000..0d89b0c
--- /dev/null
+++ b/gas/testsuite/gas/arm/pr21458.s
@@ -0,0 +1,40 @@
+.syntax unified
+.thumb
+.text
+.align 2
+.global __thumbFn
+.type __testFn, %function
+.thumb_func
+__thumbFn:
+ bx lr
+ nop
+
+.arm
+.global __armFn
+.type __armFn, %function
+__armFn:
+ bx lr
+
+.thumb
+.global __test_thumb
+.type __test_thumb, %function
+.thumb_func
+__test_thumb:
+ ADR R0,__thumbFn
+ BLX R0
+ ADR R2,__armFn
+ BLX R2
+
+.arm
+.global __test_arm
+.type __test_arm, %function
+__test_arm:
+ ADRL R4,__thumbFn
+ BLX R4
+ ADRL R6,__armFn
+ BLX R6
+ ADR r8, __thumbFn
+ blx r8
+ ADR r10, __armFn
+ blx r10
+ adrlo r12, __thumbFn