gold patch committed: Don't crash overriding with versioned alias

Ian Lance Taylor iant@google.com
Sat Jul 2 05:32:00 GMT 2011


One of the issues in PR 12525 is about a weak alias S1 to a symbol S2,
where both S1 and S2 are versioned symbols, and the versions are
different.  Instead of handling this correctly, gold was crashing.  This
patch fixes the problem and includes a test case.  The change to
dynobj.cc fixes a case where gold was crashing in an erroneous case; I
noticed this while trying to track down the real problem.  Committed to
mainline.

Ian


2011-07-01  Ian Lance Taylor  <iant@google.com>

	PR gold/12525
	PR gold/12952
	* resolve.cc (Symbol::override_base_with_special): Don't override
	the version if the overriding symbol has a different name.
	* dynobj.cc (Versions::add_def): Add dynpool parameter.  Change
	all callers.  If we give an error about an undefined version,
	define the base version if necessary.
	* dynobj.h (class Versions): Update declaration.
	* testsuite/weak_alias_test_5.cc: New file.
	* testsuite/weak_alias_test.script: New file.
	* testsuite/weak_alias_test_main.cc: Check that versioned_symbol
	and versioned_alias have the right value, and call t2.
	* testsuite/Makefile.am (weak_alias_test_DEPENDENCIES): Add
	weak_alias_test_5.so.
	(weak_alias_test_LDADD): Likewise.
	(weak_alias_test_5_pic.o, weak_alias_test_5.so): New targets.
	* testsuite/Makefile.in: Rebuild.


-------------- next part --------------
A non-text attachment was scrubbed...
Name: foo.patch
Type: text/x-diff
Size: 7957 bytes
Desc: patch
URL: <https://sourceware.org/pipermail/binutils/attachments/20110702/318acbec/attachment.bin>


More information about the Binutils mailing list