aboutsummaryrefslogtreecommitdiff
path: root/ld/testsuite
diff options
context:
space:
mode:
authorMax Filippov <jcmvbkbc@gmail.com>2019-02-15 16:43:23 -0800
committerMax Filippov <jcmvbkbc@gmail.com>2019-02-20 02:51:01 -0800
commiteed62915fd5b733632af343fbf3d47c7364f8e36 (patch)
treeeaa3e22f860ab7872196fea0cd0f7740d4b6da80 /ld/testsuite
parente6c3b5bfb449d1a02d26f3c4bae5b732951479fc (diff)
downloadgdb-eed62915fd5b733632af343fbf3d47c7364f8e36.zip
gdb-eed62915fd5b733632af343fbf3d47c7364f8e36.tar.gz
gdb-eed62915fd5b733632af343fbf3d47c7364f8e36.tar.bz2
bfd: xtensa: fix callx relaxation
Big section alignment requirements between source and destination of a long call can result in making call range bigger than what's reachable by the call opcode. Add biggest section alignment of sections between the call site and call destination to the call distance when making long call relaxation decision. 2019-02-20 Eric Tsai <erictsai@cadence.com> bfd/ * elf32-xtensa.c (is_resolvable_asm_expansion): Scan output sections between the call site and call destination and adjust call distance by the largest alignment. ld/ * testsuite/ld-xtensa/call_overflow.d: New test definition. * testsuite/ld-xtensa/call_overflow1.s: New test source. * testsuite/ld-xtensa/call_overflow2.s: New test source. * testsuite/ld-xtensa/call_overflow3.s: New test source. * testsuite/ld-xtensa/xtensa.exp: Add call_overflow test.
Diffstat (limited to 'ld/testsuite')
-rw-r--r--ld/testsuite/ld-xtensa/call_overflow.d7
-rw-r--r--ld/testsuite/ld-xtensa/call_overflow1.s9
-rw-r--r--ld/testsuite/ld-xtensa/call_overflow2.s14
-rw-r--r--ld/testsuite/ld-xtensa/call_overflow3.s5
-rw-r--r--ld/testsuite/ld-xtensa/xtensa.exp1
5 files changed, 36 insertions, 0 deletions
diff --git a/ld/testsuite/ld-xtensa/call_overflow.d b/ld/testsuite/ld-xtensa/call_overflow.d
new file mode 100644
index 0000000..9572848
--- /dev/null
+++ b/ld/testsuite/ld-xtensa/call_overflow.d
@@ -0,0 +1,7 @@
+#source: call_overflow1.s
+#source: call_overflow2.s
+#source: call_overflow3.s
+#as: --longcalls
+#ld:
+#objdump: -d
+#...
diff --git a/ld/testsuite/ld-xtensa/call_overflow1.s b/ld/testsuite/ld-xtensa/call_overflow1.s
new file mode 100644
index 0000000..8b03289
--- /dev/null
+++ b/ld/testsuite/ld-xtensa/call_overflow1.s
@@ -0,0 +1,9 @@
+ .text
+ .global _start
+ .align 4
+_start:
+ call8 a
+ .rep 2051
+ nop.n
+ nop.n
+ .endr
diff --git a/ld/testsuite/ld-xtensa/call_overflow2.s b/ld/testsuite/ld-xtensa/call_overflow2.s
new file mode 100644
index 0000000..c3f36fa
--- /dev/null
+++ b/ld/testsuite/ld-xtensa/call_overflow2.s
@@ -0,0 +1,14 @@
+ .text
+ .global a
+ .align 4
+a:
+ j a
+
+ .align 4
+x:
+ call8 b
+#29
+ .rep 131070
+ nop.n
+ nop.n
+ .endr
diff --git a/ld/testsuite/ld-xtensa/call_overflow3.s b/ld/testsuite/ld-xtensa/call_overflow3.s
new file mode 100644
index 0000000..33f59d8
--- /dev/null
+++ b/ld/testsuite/ld-xtensa/call_overflow3.s
@@ -0,0 +1,5 @@
+ .text
+ .align 32
+ .global b
+b:
+ j b
diff --git a/ld/testsuite/ld-xtensa/xtensa.exp b/ld/testsuite/ld-xtensa/xtensa.exp
index e8befa9..91b2314 100644
--- a/ld/testsuite/ld-xtensa/xtensa.exp
+++ b/ld/testsuite/ld-xtensa/xtensa.exp
@@ -23,6 +23,7 @@ if { !([istarget "xtensa*-*-*"]) } {
return
}
+run_dump_test "call_overflow"
run_dump_test "coalesce"
run_dump_test "diff_overflow"
run_dump_test "lcall"