This is the mail archive of the
binutils-cvs@sourceware.org
mailing list for the binutils project.
[binutils-gdb/binutils-2_28-branch] Solaris2/LD: Fix anonymous version script acceptance bug
- From: Maciej W.Rozycki <macro at sourceware dot org>
- To: bfd-cvs at sourceware dot org
- Date: 24 Jan 2017 14:09:02 -0000
- Subject: [binutils-gdb/binutils-2_28-branch] Solaris2/LD: Fix anonymous version script acceptance bug
https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=8cf12fd327278b6e5edd90f162dc257656603f30
commit 8cf12fd327278b6e5edd90f162dc257656603f30
Author: Maciej W. Rozycki <macro@imgtec.com>
Date: Mon Jan 23 11:37:19 2017 +0000
Solaris2/LD: Fix anonymous version script acceptance bug
Correct a bug in Solaris 2 linker emulation code triggered by a test
introduced with commit 81ff47b3a546 ("PR ld/20828: Fix linker script
symbols wrongly forced local with section GC") and only create implicit
version nodes if versioning is actually introduced with a version script
(or VERSION command) rather than only global vs local symbol visibility
selected, fixing an:
ld: anonymous version tag cannot be combined with other version tags
linker error produced whenever a version script (or VERSION command) is
used that does not assign symbol versions, such as:
{ global: foo; bar; local: *; };
and consequently removing a:
FAIL: PR ld/20828 dynamic symbols with section GC (version script)
test suite failure with the `x86_64-solaris2' target.
ld/
* emultempl/solaris2.em (elf_solaris2_before_allocation): Do not
add implicit version nodes if an anonymous version tag is being
used.
(cherry picked from commit 1a792e1c00e07a1e644145a9f71446cf2e75e9ab)
Diff:
---
ld/ChangeLog | 6 ++++++
ld/emultempl/solaris2.em | 3 ++-
2 files changed, 8 insertions(+), 1 deletion(-)
diff --git a/ld/ChangeLog b/ld/ChangeLog
index 4fb1f38..6323524 100644
--- a/ld/ChangeLog
+++ b/ld/ChangeLog
@@ -1,3 +1,9 @@
+2017-01-24 Maciej W. Rozycki <macro@imgtec.com>
+
+ * emultempl/solaris2.em (elf_solaris2_before_allocation): Do not
+ add implicit version nodes if an anonymous version tag is being
+ used.
+
2017-01-23 Maciej W. Rozycki <macro@imgtec.com>
PR ld/20828
diff --git a/ld/emultempl/solaris2.em b/ld/emultempl/solaris2.em
index 9845047..c5f2f31 100644
--- a/ld/emultempl/solaris2.em
+++ b/ld/emultempl/solaris2.em
@@ -76,7 +76,8 @@ elf_solaris2_before_allocation (void)
/* Only do this if emitting a shared object and versioning is in place. */
if (bfd_link_dll (&link_info)
- && (link_info.version_info != NULL
+ && ((link_info.version_info != NULL
+ && link_info.version_info->name[0] != '\0')
|| link_info.create_default_symver))
{
struct bfd_elf_version_expr *globals = NULL, *locals = NULL;