From 2113106124ff094741fc3a0edacf118739ce766d Mon Sep 17 00:00:00 2001 From: Ian Lance Taylor Date: Sat, 2 Jul 2011 05:30:00 +0000 Subject: 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. --- gold/resolve.cc | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'gold/resolve.cc') diff --git a/gold/resolve.cc b/gold/resolve.cc index 71d5109..8850a3d 100644 --- a/gold/resolve.cc +++ b/gold/resolve.cc @@ -887,7 +887,8 @@ Symbol_table::should_override_with_special(const Symbol* to, Defined defined) void Symbol::override_base_with_special(const Symbol* from) { - gold_assert(this->name_ == from->name_ || this->has_alias()); + bool same_name = this->name_ == from->name_; + gold_assert(same_name || this->has_alias()); this->source_ = from->source_; switch (from->source_) @@ -909,7 +910,8 @@ Symbol::override_base_with_special(const Symbol* from) break; } - this->override_version(from->version_); + if (same_name) + this->override_version(from->version_); this->type_ = from->type_; this->binding_ = from->binding_; this->override_visibility(from->visibility_); -- cgit v1.1