This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH 4/5] 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 any existing version information 
	has no name.
---
 No regressions in `x86_64-solaris2' testing, OK to apply and backport to 
2.28?

  Maciej

binutils-solaris2-ld-register-vers-node.diff
Index: binutils/ld/emultempl/solaris2.em
===================================================================
--- binutils.orig/ld/emultempl/solaris2.em	2017-01-16 19:12:50.000000000 +0000
+++ binutils/ld/emultempl/solaris2.em	2017-01-20 14:02:15.617924483 +0000
@@ -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;


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]