aboutsummaryrefslogtreecommitdiff
path: root/ld/testsuite
diff options
context:
space:
mode:
authorAndre Vieria <andre.simoesdiasvieira@arm.com>2016-07-05 11:39:06 +0100
committerRichard Earnshaw <Richard.Earnshaw@arm.com>2016-07-05 11:39:06 +0100
commitd5a67c02901c0abe946546f2b3b1a3b67a876136 (patch)
tree795164805b191fd91aeb8bb584ab88e8d337b2b4 /ld/testsuite
parentf0728ee368f217f2473798ad7ccfe9feae4412ce (diff)
downloadgdb-d5a67c02901c0abe946546f2b3b1a3b67a876136.zip
gdb-d5a67c02901c0abe946546f2b3b1a3b67a876136.tar.gz
gdb-d5a67c02901c0abe946546f2b3b1a3b67a876136.tar.bz2
[ARM] Purecode compatible long branch veneer for M-profile targets with MOVW.
2016-07-05 Andre Vieria <andre.simoesdiasvieira@arm.com> * elf32-arm.c (THUMB32_MOVT): New veneer macro. (THUMB32_MOVW): Likewise. (elf32_arm_stub_long_branch_thumb2_only_pure): New. (DEF_STUBS): Define long_branch_thumb2_only_pure. (arm_stub_is_thumb): Add new veneer stub. (arm_type_of_stub): Use new veneer. (arm_stub_required_alignment): Add new veneer. 2016-07-05 Andre Vieria <andre.simoesdiasvieira@arm.com> * testsuite/ld-arm/farcall-thumb2-purecode.d: New test result. * testsuite/ld-arm/farcall-thumb2-purecode.s: New test. * testsuite/ld-arm/arm-elf.exp: Run it.
Diffstat (limited to 'ld/testsuite')
-rw-r--r--ld/testsuite/ld-arm/arm-elf.exp3
-rw-r--r--ld/testsuite/ld-arm/farcall-thumb2-purecode.d22
-rw-r--r--ld/testsuite/ld-arm/farcall-thumb2-purecode.s19
3 files changed, 44 insertions, 0 deletions
diff --git a/ld/testsuite/ld-arm/arm-elf.exp b/ld/testsuite/ld-arm/arm-elf.exp
index 597bdcf..d0c9a2f 100644
--- a/ld/testsuite/ld-arm/arm-elf.exp
+++ b/ld/testsuite/ld-arm/arm-elf.exp
@@ -505,6 +505,9 @@ set armeabitests_nonacl {
{farcall-thumb-thumb-m-no-profile-a.s farcall-thumb-thumb-m-no-profile-b.s}
{{objdump -d farcall-thumb-thumb-m-no-profile.d}}
"farcall-thumb-thumb-m-no-profile"}
+ {"Thumb2 purecode farcall" "-Ttext 0x1000 --section-start .foo=0x2001020" "" "" {farcall-thumb2-purecode.s}
+ {{objdump -d farcall-thumb2-purecode.d}}
+ "farcall-thumb2-purecode"}
{"Thumb-ARM farcall" "-Ttext 0x1c01010 --section-start .foo=0x2001014" "" "-W" {farcall-thumb-arm.s}
{{objdump -d farcall-thumb-arm.d}}
diff --git a/ld/testsuite/ld-arm/farcall-thumb2-purecode.d b/ld/testsuite/ld-arm/farcall-thumb2-purecode.d
new file mode 100644
index 0000000..2a62fe4
--- /dev/null
+++ b/ld/testsuite/ld-arm/farcall-thumb2-purecode.d
@@ -0,0 +1,22 @@
+.*: file format .*
+
+Disassembly of section .text:
+
+00001000 <bar>:
+ 1000: 4770 bx lr
+
+Disassembly of section .foo:
+
+02001020 <_start>:
+ 2001020: f000 f802 bl 2001028 <__bar_veneer>
+ 2001024: 0000 movs r0, r0
+ \.\.\.
+
+02001028 <__bar_veneer>:
+ 2001028: f241 0c01 movw ip, #4097 ; 0x1001
+ 200102c: f2c0 0c00 movt ip, #0
+ 2001030: 4760 bx ip
+ 2001032: 0000 movs r0, r0
+ 2001034: 0000 movs r0, r0
+ \.\.\.
+
diff --git a/ld/testsuite/ld-arm/farcall-thumb2-purecode.s b/ld/testsuite/ld-arm/farcall-thumb2-purecode.s
new file mode 100644
index 0000000..a16731a
--- /dev/null
+++ b/ld/testsuite/ld-arm/farcall-thumb2-purecode.s
@@ -0,0 +1,19 @@
+@ Test to ensure that a purecode Thumb2 call exceeding 4Mb generates a stub.
+
+ .global _start
+ .syntax unified
+ .arch armv7-m
+ .thumb
+ .thumb_func
+
+@ We will place the section .text at 0x1000.
+
+ .text
+bar:
+ bx lr
+
+@ We will place the section .foo at 0x02001014.
+
+ .section .foo, "0x20000006"
+_start:
+ bl bar