summaryrefslogtreecommitdiff
path: root/ld
diff options
context:
space:
mode:
Diffstat (limited to 'ld')
-rw-r--r--ld/testsuite/ld-plugin/lto.exp12
-rw-r--r--ld/testsuite/ld-plugin/pr22721.t7
-rw-r--r--ld/testsuite/ld-plugin/pr22721a.s8
-rw-r--r--ld/testsuite/ld-plugin/pr22721b.c7
4 files changed, 34 insertions, 0 deletions
diff --git a/ld/testsuite/ld-plugin/lto.exp b/ld/testsuite/ld-plugin/lto.exp
index 93f964921a2..2d9dd3b9b3d 100644
--- a/ld/testsuite/ld-plugin/lto.exp
+++ b/ld/testsuite/ld-plugin/lto.exp
@@ -304,6 +304,18 @@ set lto_link_elf_tests [list \
[list {Build pr22220main.o} \
{} {-flto} \
{pr22220main.cc} {} {} {c++}] \
+ [list "Build pr22721a.so" \
+ "-shared -nostdlib -nostartfiles -Wl,-version-script,pr22721.t" \
+ "" \
+ {pr22721a.s} {} "pr22721a.so"] \
+ [list "Build pr22721b.o" \
+ "$plug_opt" "-O2 -fPIC -flto $lto_no_fat" \
+ {pr22721b.c} ] \
+ [list "Build PR ld/pr22721" \
+ "-O2 -flto -fuse-linker-plugin -nostdlib -nostartfiles -Wl,-e,_start \
+ tmpdir/pr22721b.o tmpdir/pr22721a.so" \
+ "" \
+ {dummy.c} {} "pr22721.exe"] \
]
# PR 14918 checks that libgcc is not spuriously included in a shared link of
diff --git a/ld/testsuite/ld-plugin/pr22721.t b/ld/testsuite/ld-plugin/pr22721.t
new file mode 100644
index 00000000000..92695296ba0
--- /dev/null
+++ b/ld/testsuite/ld-plugin/pr22721.t
@@ -0,0 +1,7 @@
+SUNWprivate_1.1 {
+global:
+ __tls_get_addr;
+ ___tls_get_addr;
+local:
+ *;
+};
diff --git a/ld/testsuite/ld-plugin/pr22721a.s b/ld/testsuite/ld-plugin/pr22721a.s
new file mode 100644
index 00000000000..e06079ee9b7
--- /dev/null
+++ b/ld/testsuite/ld-plugin/pr22721a.s
@@ -0,0 +1,8 @@
+ .text
+ .globl __tls_get_addr
+ .globl ___tls_get_addr
+ .type __tls_get_addr,%function
+ .set ___tls_get_addr, __tls_get_addr
+__tls_get_addr:
+ .byte 0
+ .size __tls_get_addr, .-__tls_get_addr
diff --git a/ld/testsuite/ld-plugin/pr22721b.c b/ld/testsuite/ld-plugin/pr22721b.c
new file mode 100644
index 00000000000..ec42cdc3bd5
--- /dev/null
+++ b/ld/testsuite/ld-plugin/pr22721b.c
@@ -0,0 +1,7 @@
+__thread int foo_var = 1;
+
+int
+_start (void)
+{
+ return foo_var;
+}