aboutsummaryrefslogtreecommitdiff
path: root/ld
diff options
context:
space:
mode:
Diffstat (limited to 'ld')
-rw-r--r--ld/ChangeLog9
-rw-r--r--ld/testsuite/ld-aarch64/aarch64-elf.exp2
-rw-r--r--ld/testsuite/ld-aarch64/undef-tls.d17
-rw-r--r--ld/testsuite/ld-aarch64/undef-tls.s13
-rw-r--r--ld/testsuite/ld-aarch64/weak-tls.d8
-rw-r--r--ld/testsuite/ld-aarch64/weak-tls.s16
6 files changed, 65 insertions, 0 deletions
diff --git a/ld/ChangeLog b/ld/ChangeLog
index 4f71ce8..ed646ac 100644
--- a/ld/ChangeLog
+++ b/ld/ChangeLog
@@ -1,3 +1,12 @@
+2019-08-22 Tamar Christina <tamar.christina@arm.com>
+
+ PR ld/24601
+ * testsuite/ld-aarch64/aarch64-elf.exp (undef-tls, weak-tls): New.
+ * testsuite/ld-aarch64/undef-tls.d: New test.
+ * testsuite/ld-aarch64/undef-tls.s: New test.
+ * testsuite/ld-aarch64/weak-tls.d: New test.
+ * testsuite/ld-aarch64/weak-tls.s: New test.
+
2019-08-20 Tamar Christina <tamar.christina@arm.com>
* testsuite/ld-arm/cortex-a8-fix-b-plt.d: Update Testcase.
diff --git a/ld/testsuite/ld-aarch64/aarch64-elf.exp b/ld/testsuite/ld-aarch64/aarch64-elf.exp
index ab8d152..631fde0 100644
--- a/ld/testsuite/ld-aarch64/aarch64-elf.exp
+++ b/ld/testsuite/ld-aarch64/aarch64-elf.exp
@@ -424,3 +424,5 @@ run_dump_test "bti-pac-plt-1"
run_dump_test "bti-pac-plt-2"
run_dump_test "bti-warn"
+run_dump_test "weak-tls"
+run_dump_test "undef-tls"
diff --git a/ld/testsuite/ld-aarch64/undef-tls.d b/ld/testsuite/ld-aarch64/undef-tls.d
new file mode 100644
index 0000000..8b43ca4
--- /dev/null
+++ b/ld/testsuite/ld-aarch64/undef-tls.d
@@ -0,0 +1,17 @@
+#source: undef-tls.s
+#ld: -e0 --emit-relocs
+#objdump: -dr
+#...
+#error:.*: in function `get':.*
+#error:.*: undefined reference to `tls'.*
+#error:.*: TLS relocation R_AARCH64_TLSLE_ADD_TPREL_HI12 against undefined symbol `tls'.*
+#error:.*: dangerous relocation: unsupported relocation.*
+#error:.*: undefined reference to `tls'.*
+#error:.*: TLS relocation R_AARCH64_TLSLE_ADD_TPREL_LO12_NC against undefined symbol `tls'.*
+#error:.*: dangerous relocation: unsupported relocation.*
+#error:.*: undefined reference to `dtl'.*
+#error:.*: TLS relocation R_AARCH64_TLSLD_ADD_DTPREL_HI12 against undefined symbol `dtl'.*
+#error:.*: dangerous relocation: unsupported relocation.*
+#error:.*: undefined reference to `dtl'.*
+#error:.*: TLS relocation R_AARCH64_TLSLD_ADD_DTPREL_LO12 against undefined symbol `dtl'.*
+#error:.*: dangerous relocation: unsupported relocation.*
diff --git a/ld/testsuite/ld-aarch64/undef-tls.s b/ld/testsuite/ld-aarch64/undef-tls.s
new file mode 100644
index 0000000..6d57afb
--- /dev/null
+++ b/ld/testsuite/ld-aarch64/undef-tls.s
@@ -0,0 +1,13 @@
+ .global get
+ .type get, %function
+get:
+.LFB0:
+ mrs x0, tpidr_el0
+ add x0, x0, #:tprel_hi12:tls, lsl #12
+ add x0, x0, #:tprel_lo12_nc:tls
+ add x0, x0, #:dtprel_hi12:dtl
+ add x0, x0, #:dtprel_lo12:dtl
+ ret
+.LFE0:
+ .size get, .-get
+
diff --git a/ld/testsuite/ld-aarch64/weak-tls.d b/ld/testsuite/ld-aarch64/weak-tls.d
new file mode 100644
index 0000000..a826940
--- /dev/null
+++ b/ld/testsuite/ld-aarch64/weak-tls.d
@@ -0,0 +1,8 @@
+#source: weak-tls.s
+#ld: -e0 --emit-relocs
+#objdump: -dr
+#...
+#error:.*: warning: Weak TLS is implementation defined and may not work as expected.*
+#error:.*: warning: Weak TLS is implementation defined and may not work as expected.*
+#error:.*: in function `get':.*
+#error:.*: relocation truncated to fit: R_AARCH64_TLSLD_ADD_DTPREL_LO12 against undefined symbol `dtl'.*
diff --git a/ld/testsuite/ld-aarch64/weak-tls.s b/ld/testsuite/ld-aarch64/weak-tls.s
new file mode 100644
index 0000000..3520a85
--- /dev/null
+++ b/ld/testsuite/ld-aarch64/weak-tls.s
@@ -0,0 +1,16 @@
+ .global get
+ .type get, %function
+ .global dtl
+ .weak dtl
+get:
+.LFB0:
+ mrs x0, tpidr_el0
+ add x0, x0, #:tprel_hi12:tls, lsl #12
+ add x0, x0, #:tprel_lo12_nc:tls
+ add x0, x0, #:dtprel_hi12:dtl
+ add x0, x0, #:dtprel_lo12:dtl
+ ret
+.LFE0:
+ .size get, .-get
+ .weak tls
+