PATCH COMMITTED: Fix gold bug accidentally unhiding version

Ian Lance Taylor iant@google.com
Sat Mar 29 07:22:00 GMT 2008


While investigating a g++ testsuite failure, I discovered that gold
was incorrectly emitting some symbols with a visible version which
should have been hidden.  This turned out to happen when there was an
object which defined versions for a symbol using .symver, and the
versions also appeared in a version script, and there was a later
object in the link which defined the symbol again, this time without a
version.  The second definition had to be weak, to avoid a multiple
definition error.  In this case the second definition picked up a
version from the version script, and then incorrectly wound up making
that version be globally visible even though the weak symbol was not
used.

This patch fixes the problem, and adds a test case for it.

Ian


2008-03-29  Ian Lance Taylor  <iant@google.com>

	* symtab.cc (Symbol_table::add_from_object): If we don't use the
	new symbol when resolving, don't call set_is_default.
	* testsuite/ver_test_7.cc: New file.
	* testsuite/ver_test_7.sh: New file.
	* testsuite/Makefile.am (ver_test_7.so): New target.
	(ver_test_7.o): New target.
	(check_SCRIPTS): Add ver_test_7.sh.
	(check_DATA): Add ver_test_7.syms.
	(ver_test_7.syms): New target.


-------------- next part --------------
A non-text attachment was scrubbed...
Name: foo.patch
Type: text/x-patch
Size: 4677 bytes
Desc: Fix bug accidentally unhiding version
URL: <https://sourceware.org/pipermail/binutils/attachments/20080329/352a0e67/attachment.bin>


More information about the Binutils mailing list