aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--bfd/elf.c1
-rw-r--r--ld/testsuite/ld-elf/linux-x86.exp17
-rw-r--r--ld/testsuite/ld-elf/pr28158-1.c1
-rw-r--r--ld/testsuite/ld-elf/pr28158-2.S16
-rw-r--r--ld/testsuite/ld-elf/pr28158.nd3
-rw-r--r--ld/testsuite/ld-elf/pr28158.rd7
-rw-r--r--ld/testsuite/ld-elf/pr28158.t6
-rw-r--r--ld/testsuite/ld-elfvers/vers19.dsym2
-rw-r--r--ld/testsuite/ld-elfvers/vers2.dsym2
-rw-r--r--ld/testsuite/ld-elfvers/vers22.dsym2
-rw-r--r--ld/testsuite/ld-elfvers/vers23.dsym2
-rw-r--r--ld/testsuite/ld-elfvers/vers23d.dsym4
-rw-r--r--ld/testsuite/ld-elfvers/vers27d4.dsym2
-rw-r--r--ld/testsuite/ld-elfvers/vers28c.dsym2
-rw-r--r--ld/testsuite/ld-elfvers/vers3.dsym2
-rw-r--r--ld/testsuite/ld-elfvers/vers6.dsym6
16 files changed, 63 insertions, 12 deletions
diff --git a/bfd/elf.c b/bfd/elf.c
index d089885..5941eeb 100644
--- a/bfd/elf.c
+++ b/bfd/elf.c
@@ -1944,6 +1944,7 @@ _bfd_elf_get_symbol_version_string (bfd *abfd, asymbol *symbol,
{
if (a->vna_other == vernum)
{
+ *hidden = true;
version_string = a->vna_nodename;
break;
}
diff --git a/ld/testsuite/ld-elf/linux-x86.exp b/ld/testsuite/ld-elf/linux-x86.exp
index 8192374..ee03b56 100644
--- a/ld/testsuite/ld-elf/linux-x86.exp
+++ b/ld/testsuite/ld-elf/linux-x86.exp
@@ -117,6 +117,23 @@ run_cc_link_tests [list \
{{readelf -rn indirect-extern-access-3.rd}} \
"indirect-extern-access-2b" \
] \
+ [list \
+ "Build pr28158.so" \
+ "-shared -Wl,-version-script,pr27128.t" \
+ "-fPIC" \
+ { pr28158-1.c } \
+ {} \
+ "pr28158.so" \
+ ] \
+ [list \
+ "Build pr28158" \
+ "$NOPIE_LDFLAGS -Wl,--no-as-needed \
+ tmpdir/pr28158.so" \
+ "" \
+ { pr28158-2.S } \
+ {{readelf {--dyn-syms -W} pr28158.rd} {nm -D pr28158.nd}} \
+ "pr28158" \
+ ] \
]
run_ld_link_exec_tests [list \
diff --git a/ld/testsuite/ld-elf/pr28158-1.c b/ld/testsuite/ld-elf/pr28158-1.c
new file mode 100644
index 0000000..2bc87d0
--- /dev/null
+++ b/ld/testsuite/ld-elf/pr28158-1.c
@@ -0,0 +1 @@
+int foo = 0;
diff --git a/ld/testsuite/ld-elf/pr28158-2.S b/ld/testsuite/ld-elf/pr28158-2.S
new file mode 100644
index 0000000..4e703b2
--- /dev/null
+++ b/ld/testsuite/ld-elf/pr28158-2.S
@@ -0,0 +1,16 @@
+ .text
+ .section .text.startup,"ax",@progbits
+ .p2align 4
+ .globl main
+ .type main, @function
+main:
+ .cfi_startproc
+#ifdef __x86_64__
+ movl foo(%rip), %eax
+#else
+ movl foo, %eax
+#endif
+ ret
+ .cfi_endproc
+ .size main, .-main
+ .section .note.GNU-stack,"",@progbits
diff --git a/ld/testsuite/ld-elf/pr28158.nd b/ld/testsuite/ld-elf/pr28158.nd
new file mode 100644
index 0000000..3b1a9bc
--- /dev/null
+++ b/ld/testsuite/ld-elf/pr28158.nd
@@ -0,0 +1,3 @@
+#...
+[0-9a-z]+ B foo@VERS_2.0
+#pass
diff --git a/ld/testsuite/ld-elf/pr28158.rd b/ld/testsuite/ld-elf/pr28158.rd
new file mode 100644
index 0000000..7488410
--- /dev/null
+++ b/ld/testsuite/ld-elf/pr28158.rd
@@ -0,0 +1,7 @@
+#ld: -shared -version-script pr27128.t
+#readelf: --dyn-syms --wide
+#target: x86_64-*-linux* i?86-*-linux-gnu
+
+#...
+ +[0-9]+: +[0-9a-f]+ +[0-9]+ +OBJECT +GLOBAL +DEFAULT +[1-9]+ foo@VERS_2.0 \(2\)
+#pass
diff --git a/ld/testsuite/ld-elf/pr28158.t b/ld/testsuite/ld-elf/pr28158.t
new file mode 100644
index 0000000..2b82842
--- /dev/null
+++ b/ld/testsuite/ld-elf/pr28158.t
@@ -0,0 +1,6 @@
+VERS_2.0 {
+global:
+ foo;
+local:
+ *;
+};
diff --git a/ld/testsuite/ld-elfvers/vers19.dsym b/ld/testsuite/ld-elfvers/vers19.dsym
index a77f949..798466f 100644
--- a/ld/testsuite/ld-elfvers/vers19.dsym
+++ b/ld/testsuite/ld-elfvers/vers19.dsym
@@ -1 +1 @@
-[0-9a-f]+ +DF \*UND\* [0-9a-f]+ +VERS_2\.0 +(0x[0-9a-f]+ )?_?show_foo
+[0-9a-f]+ +DF \*UND\* [0-9a-f]+ +\(VERS_2\.0\) +(0x[0-9a-f]+ )?_?show_foo
diff --git a/ld/testsuite/ld-elfvers/vers2.dsym b/ld/testsuite/ld-elfvers/vers2.dsym
index 30ba91b..f820fdc 100644
--- a/ld/testsuite/ld-elfvers/vers2.dsym
+++ b/ld/testsuite/ld-elfvers/vers2.dsym
@@ -1,3 +1,3 @@
-[0-9a-f]+ +DF \*UND\* [0-9a-f]+ +VERS_2\.0 +(0x[0-9a-f]+ )?_?show_foo
+[0-9a-f]+ +DF \*UND\* [0-9a-f]+ +\(VERS_2\.0\) +(0x[0-9a-f]+ )?_?show_foo
0+ g +DO \*ABS\* 0+ +VERS_XXX_1\.1 VERS_XXX_1\.1
[0-9a-f]+ g +DF (\.text|\.opd|\*ABS\*) [0-9a-f]+ +VERS_XXX_1\.1 (0x[0-9a-f]+ )?_?show_xyzzy
diff --git a/ld/testsuite/ld-elfvers/vers22.dsym b/ld/testsuite/ld-elfvers/vers22.dsym
index db2aeec..65a1833 100644
--- a/ld/testsuite/ld-elfvers/vers22.dsym
+++ b/ld/testsuite/ld-elfvers/vers22.dsym
@@ -1 +1 @@
-[0-9a-f]+ +DF \*UND\* [0-9a-f]+ +VERS\.0 +(0x[0-9a-f]+ )?_?bar
+[0-9a-f]+ +DF \*UND\* [0-9a-f]+ +\(VERS\.0\) +(0x[0-9a-f]+ )?_?bar
diff --git a/ld/testsuite/ld-elfvers/vers23.dsym b/ld/testsuite/ld-elfvers/vers23.dsym
index dfd6a33..d6c93b4 100644
--- a/ld/testsuite/ld-elfvers/vers23.dsym
+++ b/ld/testsuite/ld-elfvers/vers23.dsym
@@ -1 +1 @@
-[0-9a-f]+ +DF \*UND\* [0-9a-f]+ +VERS\.0 +(0x[0-9a-f]+ )?_?foo
+[0-9a-f]+ +DF \*UND\* [0-9a-f]+ +\(VERS\.0\) +(0x[0-9a-f]+ )?_?foo
diff --git a/ld/testsuite/ld-elfvers/vers23d.dsym b/ld/testsuite/ld-elfvers/vers23d.dsym
index ab5fbd8..12f8c59 100644
--- a/ld/testsuite/ld-elfvers/vers23d.dsym
+++ b/ld/testsuite/ld-elfvers/vers23d.dsym
@@ -1,2 +1,2 @@
-[0-9a-f]* DF \*UND\* [0-9a-f]* VERS.0 (0x[0-9a-f][0-9a-f] )?_?bar
-[0-9a-f]* DF \*UND\* [0-9a-f]* VERS.0 (0x[0-9a-f][0-9a-f] )?_?foo
+[0-9a-f]+ +DF \*UND\* [0-9a-f]+ +\(VERS\.0\) +(0x[0-9a-f]+ )?_?bar
+[0-9a-f]+ +DF \*UND\* [0-9a-f]+ +\(VERS\.0\) +(0x[0-9a-f]+ )?_?foo
diff --git a/ld/testsuite/ld-elfvers/vers27d4.dsym b/ld/testsuite/ld-elfvers/vers27d4.dsym
index dfd6a33..d6c93b4 100644
--- a/ld/testsuite/ld-elfvers/vers27d4.dsym
+++ b/ld/testsuite/ld-elfvers/vers27d4.dsym
@@ -1 +1 @@
-[0-9a-f]+ +DF \*UND\* [0-9a-f]+ +VERS\.0 +(0x[0-9a-f]+ )?_?foo
+[0-9a-f]+ +DF \*UND\* [0-9a-f]+ +\(VERS\.0\) +(0x[0-9a-f]+ )?_?foo
diff --git a/ld/testsuite/ld-elfvers/vers28c.dsym b/ld/testsuite/ld-elfvers/vers28c.dsym
index 7ad5678..a575eff 100644
--- a/ld/testsuite/ld-elfvers/vers28c.dsym
+++ b/ld/testsuite/ld-elfvers/vers28c.dsym
@@ -1 +1 @@
-[0-9a-f]+[ ]+DF[ ]+\*UND\*[ ]+[0-9a-f]+[ ]+VERS\.0[ ]+(0x[0-9a-f]+ )?_?foo
+[0-9a-f]+[ ]+DF[ ]+\*UND\*[ ]+[0-9a-f]+[ ]+\(VERS\.0\)[ ]+(0x[0-9a-f]+ )?_?foo
diff --git a/ld/testsuite/ld-elfvers/vers3.dsym b/ld/testsuite/ld-elfvers/vers3.dsym
index a77f949..798466f 100644
--- a/ld/testsuite/ld-elfvers/vers3.dsym
+++ b/ld/testsuite/ld-elfvers/vers3.dsym
@@ -1 +1 @@
-[0-9a-f]+ +DF \*UND\* [0-9a-f]+ +VERS_2\.0 +(0x[0-9a-f]+ )?_?show_foo
+[0-9a-f]+ +DF \*UND\* [0-9a-f]+ +\(VERS_2\.0\) +(0x[0-9a-f]+ )?_?show_foo
diff --git a/ld/testsuite/ld-elfvers/vers6.dsym b/ld/testsuite/ld-elfvers/vers6.dsym
index a5a8053..6d07312 100644
--- a/ld/testsuite/ld-elfvers/vers6.dsym
+++ b/ld/testsuite/ld-elfvers/vers6.dsym
@@ -1,4 +1,4 @@
[0-9a-f]+ +DF \*UND\* [0-9a-f]+ +Base +(0x[0-9a-f]+ )?_?show_foo
-[0-9a-f]+ +DF \*UND\* [0-9a-f]+ +VERS_2.0 +(0x[0-9a-f]+ )?_?show_foo
-[0-9a-f]+ +DF \*UND\* [0-9a-f]+ +VERS_1.2 +(0x[0-9a-f]+ )?_?show_foo
-[0-9a-f]+ +DF \*UND\* [0-9a-f]+ +VERS_1.1 +(0x[0-9a-f]+ )?_?show_foo
+[0-9a-f]+ +DF \*UND\* [0-9a-f]+ +\(VERS_2.0\) +(0x[0-9a-f]+ )?_?show_foo
+[0-9a-f]+ +DF \*UND\* [0-9a-f]+ +\(VERS_1.2\) +(0x[0-9a-f]+ )?_?show_foo
+[0-9a-f]+ +DF \*UND\* [0-9a-f]+ +\(VERS_1.1\) +(0x[0-9a-f]+ )?_?show_foo