aboutsummaryrefslogtreecommitdiff
path: root/ld/testsuite/ld-aarch64
diff options
context:
space:
mode:
Diffstat (limited to 'ld/testsuite/ld-aarch64')
-rw-r--r--ld/testsuite/ld-aarch64/aarch64-elf.exp1
-rw-r--r--ld/testsuite/ld-aarch64/tprel_g2_overflow.d6
-rw-r--r--ld/testsuite/ld-aarch64/tprel_g2_overflow.s22
3 files changed, 29 insertions, 0 deletions
diff --git a/ld/testsuite/ld-aarch64/aarch64-elf.exp b/ld/testsuite/ld-aarch64/aarch64-elf.exp
index 9b715bb..7d421a5 100644
--- a/ld/testsuite/ld-aarch64/aarch64-elf.exp
+++ b/ld/testsuite/ld-aarch64/aarch64-elf.exp
@@ -131,6 +131,7 @@ run_dump_test "gc-plt-relocs"
run_dump_test "gc-relocs-257-dyn"
run_dump_test "gc-relocs-257"
run_dump_test "pr17415"
+run_dump_test "tprel_g2_overflow"
# ifunc tests
run_dump_test "ifunc-1"
diff --git a/ld/testsuite/ld-aarch64/tprel_g2_overflow.d b/ld/testsuite/ld-aarch64/tprel_g2_overflow.d
new file mode 100644
index 0000000..8dcbe87
--- /dev/null
+++ b/ld/testsuite/ld-aarch64/tprel_g2_overflow.d
@@ -0,0 +1,6 @@
+#name: TLS offset out of range - TPREL_G2
+#source: tprel_g2_overflow.s
+#as:
+#ld: -e0
+#error: .*\(.text\+0x\d+\): relocation truncated to fit: R_AARCH64_TLSLE_MOVW_TPREL_G2 against symbol `i' .*
+
diff --git a/ld/testsuite/ld-aarch64/tprel_g2_overflow.s b/ld/testsuite/ld-aarch64/tprel_g2_overflow.s
new file mode 100644
index 0000000..d94a30d
--- /dev/null
+++ b/ld/testsuite/ld-aarch64/tprel_g2_overflow.s
@@ -0,0 +1,22 @@
+ .cpu generic
+ .global ff
+ .section .tbss,"awT",%nobits
+ .align 3
+ .type ff, %object
+ .size ff, 562949953421312
+ff:
+ .zero 562949953421312
+ .global i
+ .align 2
+ .type i, %object
+ .size i, 4
+i:
+ .zero 4
+ .text
+ .align 2
+ .global main
+ .type main, %function
+main:
+ movz x0, #:tprel_g2:i
+ ret
+ .size main, .-main