aboutsummaryrefslogtreecommitdiff
path: root/ld/testsuite/ld-arm
diff options
context:
space:
mode:
Diffstat (limited to 'ld/testsuite/ld-arm')
-rw-r--r--ld/testsuite/ld-arm/arm-elf.exp3
-rw-r--r--ld/testsuite/ld-arm/farcall-thumb2-purecode-consecutive-veneer.d28
-rw-r--r--ld/testsuite/ld-arm/farcall-thumb2-purecode-consecutive-veneer.s25
-rw-r--r--ld/testsuite/ld-arm/farcall-thumb2-purecode.d2
4 files changed, 57 insertions, 1 deletions
diff --git a/ld/testsuite/ld-arm/arm-elf.exp b/ld/testsuite/ld-arm/arm-elf.exp
index be49d8f..cacd3bd 100644
--- a/ld/testsuite/ld-arm/arm-elf.exp
+++ b/ld/testsuite/ld-arm/arm-elf.exp
@@ -604,6 +604,9 @@ set armeabitests_nonacl {
{"Thumb2 purecode farcall" "-Ttext 0x1000 --section-start .foo=0x2001020" "" "" {farcall-thumb2-purecode.s}
{{objdump -d farcall-thumb2-purecode.d}}
"farcall-thumb2-purecode"}
+ {"Thumb2 purecode farcall consecutive veneer" "-Ttext 0x1000 --section-start .foo=0x2001020" "" "" {farcall-thumb2-purecode-consecutive-veneer.s}
+ {{objdump -d farcall-thumb2-purecode-consecutive-veneer.d}}
+ "farcall-thumb2-purecode-consecutive-veneer"}
{"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-consecutive-veneer.d b/ld/testsuite/ld-arm/farcall-thumb2-purecode-consecutive-veneer.d
new file mode 100644
index 0000000..b89da03
--- /dev/null
+++ b/ld/testsuite/ld-arm/farcall-thumb2-purecode-consecutive-veneer.d
@@ -0,0 +1,28 @@
+.*: file format .*
+
+Disassembly of section .text:
+
+00001000 <bar>:
+ 1000: 4770 bx lr
+
+00001002 <baz>:
+ 1002: 4770 bx lr
+
+Disassembly of section .foo:
+
+02001020 <_start>:
+ 2001020: f000 f802 bl 2001028 <__bar_veneer>
+ 2001024: f000 f806 bl 2001034 <__baz_veneer>
+
+02001028 <__bar_veneer>:
+ 2001028: f241 0c01 movw ip, #4097 @ 0x1001
+ 200102c: f2c0 0c00 movt ip, #0
+ 2001030: 4760 bx ip
+ 2001032: bf00 nop
+
+02001034 <__baz_veneer>:
+ 2001034: f241 0c03 movw ip, #4099 @ 0x1003
+ 2001038: f2c0 0c00 movt ip, #0
+ 200103c: 4760 bx ip
+ 200103e: bf00 nop
+ \.\.\.
diff --git a/ld/testsuite/ld-arm/farcall-thumb2-purecode-consecutive-veneer.s b/ld/testsuite/ld-arm/farcall-thumb2-purecode-consecutive-veneer.s
new file mode 100644
index 0000000..ee3d6c1
--- /dev/null
+++ b/ld/testsuite/ld-arm/farcall-thumb2-purecode-consecutive-veneer.s
@@ -0,0 +1,25 @@
+@ 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.
+
+ .section .text, "0x20000006"
+ .type bar, %function
+ .type baz, %function
+bar:
+ bx lr
+
+baz:
+ bx lr
+
+@ We will place the section .foo at 0x02001014.
+
+ .section .foo, "0x20000006"
+_start:
+ bl bar
+ bl baz
diff --git a/ld/testsuite/ld-arm/farcall-thumb2-purecode.d b/ld/testsuite/ld-arm/farcall-thumb2-purecode.d
index 4518326..00a070e 100644
--- a/ld/testsuite/ld-arm/farcall-thumb2-purecode.d
+++ b/ld/testsuite/ld-arm/farcall-thumb2-purecode.d
@@ -16,7 +16,7 @@ Disassembly of section .foo:
2001028: f241 0c01 movw ip, #4097 @ 0x1001
200102c: f2c0 0c00 movt ip, #0
2001030: 4760 bx ip
- 2001032: 0000 movs r0, r0
+ 2001032: bf00 nop
2001034: 0000 movs r0, r0
\.\.\.