aboutsummaryrefslogtreecommitdiff
path: root/ld
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2020-11-30 19:19:00 +1030
committerAlan Modra <amodra@gmail.com>2020-12-01 11:26:35 +1030
commit5160d0f323d47031cb73c39a4dbd31d8976b4c8e (patch)
tree59710941879e3598ddc359511388a9a5384ef271 /ld
parent3ca6a4e547924828ec1428eda78217b30fae809c (diff)
downloadgdb-5160d0f323d47031cb73c39a4dbd31d8976b4c8e.zip
gdb-5160d0f323d47031cb73c39a4dbd31d8976b4c8e.tar.gz
gdb-5160d0f323d47031cb73c39a4dbd31d8976b4c8e.tar.bz2
PR26979, Visibility of undefined foo@v1 should constrain foo@@v1
Also, undefined foo should constrain the visibility of foo@@v1 just as it does for a later plain foo definition. bfd/ PR 26979 * elf-bfd.h (elf_backend_merge_symbol_attribute): Update prototype. * elf32-m68hc1x.h (elf32_m68hc11_merge_symbol_attribute): Likewise. * elfxx-mips.h (_bfd_mips_elf_merge_symbol_attribute): Likewise. * elfxx-x86.h (_bfd_x86_elf_merge_symbol_attribute): Likewise. * elf32-m68hc1x.c (elf32_m68hc11_merge_symbol_attribute): Replace isym parameter with st_other. Adjust code. * elf64-alpha.c (elf64_alpha_merge_symbol_attribute): Likewise. * elf64-ppc.c (ppc64_elf_merge_symbol_attribute): Likewise. * elfnn-aarch64.c (elfNN_aarch64_merge_symbol_attribute): Likewise. * elfxx-mips.c (_bfd_mips_elf_merge_symbol_attribute): Likewise. * elfxx-x86.c (_bfd_x86_elf_merge_symbol_attribute): Likewise. * elflink.c (elf_merge_st_other): Likewise. (_bfd_elf_merge_symbol, elf_link_add_object_symbols): Adjust to suit. (_bfd_elf_copy_link_hash_symbol_type): Likewise. (_bfd_elf_add_default_symbol): Merge st_other from undecorated symbol and @VER symbol to @@VER symbol. ld/ * testsuite/ld-elf/pr26979a.s, * testsuite/ld-elf/pr26979b.s, * testsuite/ld-elf/pr26979c.s, * testsuite/ld-elf/pr26979.ver, * testsuite/ld-elf/pr26979a.d, * testsuite/ld-elf/pr26979b.d: New tests.
Diffstat (limited to 'ld')
-rw-r--r--ld/ChangeLog9
-rw-r--r--ld/testsuite/ld-elf/pr26979.ver1
-rw-r--r--ld/testsuite/ld-elf/pr26979a.d12
-rw-r--r--ld/testsuite/ld-elf/pr26979a.s3
-rw-r--r--ld/testsuite/ld-elf/pr26979b.d12
-rw-r--r--ld/testsuite/ld-elf/pr26979b.s4
-rw-r--r--ld/testsuite/ld-elf/pr26979c.s3
7 files changed, 44 insertions, 0 deletions
diff --git a/ld/ChangeLog b/ld/ChangeLog
index 9dbb473..7e09a2f 100644
--- a/ld/ChangeLog
+++ b/ld/ChangeLog
@@ -1,3 +1,12 @@
+2020-12-01 Alan Modra <amodra@gmail.com>
+
+ * testsuite/ld-elf/pr26979a.s,
+ * testsuite/ld-elf/pr26979b.s,
+ * testsuite/ld-elf/pr26979c.s,
+ * testsuite/ld-elf/pr26979.ver,
+ * testsuite/ld-elf/pr26979a.d,
+ * testsuite/ld-elf/pr26979b.d: New tests.
+
2020-11-29 H.J. Lu <hongjiu.lu@intel.com>
PR ld/26936
diff --git a/ld/testsuite/ld-elf/pr26979.ver b/ld/testsuite/ld-elf/pr26979.ver
new file mode 100644
index 0000000..46ddd30
--- /dev/null
+++ b/ld/testsuite/ld-elf/pr26979.ver
@@ -0,0 +1 @@
+v1 {};
diff --git a/ld/testsuite/ld-elf/pr26979a.d b/ld/testsuite/ld-elf/pr26979a.d
new file mode 100644
index 0000000..1b42598
--- /dev/null
+++ b/ld/testsuite/ld-elf/pr26979a.d
@@ -0,0 +1,12 @@
+#source: pr26979a.s
+#source: pr26979c.s
+#target: [check_shared_lib_support]
+#as:
+#ld: -shared --version-script=pr26979.ver
+#readelf: -sW
+
+#...
+.* GLOBAL PROTECTED .*foo@@v1
+#...
+.* GLOBAL PROTECTED .*foo@@v1
+#pass
diff --git a/ld/testsuite/ld-elf/pr26979a.s b/ld/testsuite/ld-elf/pr26979a.s
new file mode 100644
index 0000000..c70c756
--- /dev/null
+++ b/ld/testsuite/ld-elf/pr26979a.s
@@ -0,0 +1,3 @@
+ .protected foo
+ .data
+ .dc.a foo
diff --git a/ld/testsuite/ld-elf/pr26979b.d b/ld/testsuite/ld-elf/pr26979b.d
new file mode 100644
index 0000000..0697368
--- /dev/null
+++ b/ld/testsuite/ld-elf/pr26979b.d
@@ -0,0 +1,12 @@
+#source: pr26979b.s
+#source: pr26979c.s
+#target: [check_shared_lib_support]
+#as:
+#ld: -shared --version-script=pr26979.ver
+#readelf: -sW
+
+#...
+.* GLOBAL PROTECTED .*foo@@v1
+#...
+.* GLOBAL PROTECTED .*foo@@v1
+#pass
diff --git a/ld/testsuite/ld-elf/pr26979b.s b/ld/testsuite/ld-elf/pr26979b.s
new file mode 100644
index 0000000..e078857
--- /dev/null
+++ b/ld/testsuite/ld-elf/pr26979b.s
@@ -0,0 +1,4 @@
+ .protected foo_v1
+ .symver foo_v1, foo@v1
+ .data
+ .dc.a foo_v1
diff --git a/ld/testsuite/ld-elf/pr26979c.s b/ld/testsuite/ld-elf/pr26979c.s
new file mode 100644
index 0000000..f74dc1c
--- /dev/null
+++ b/ld/testsuite/ld-elf/pr26979c.s
@@ -0,0 +1,3 @@
+ .globl foo
+ .symver foo, foo@@@v1
+foo: