aboutsummaryrefslogtreecommitdiff
path: root/gold/dynobj.cc
diff options
context:
space:
mode:
authorIan Lance Taylor <ian@airs.com>2011-07-02 05:30:00 +0000
committerIan Lance Taylor <ian@airs.com>2011-07-02 05:30:00 +0000
commit2113106124ff094741fc3a0edacf118739ce766d (patch)
treefccdcee567edc60e4efddc45993f1d8c8eca416c /gold/dynobj.cc
parent9e3dc3160bdf3e40e72ae1a174aaf44f7553a269 (diff)
downloadfsf-binutils-gdb-2113106124ff094741fc3a0edacf118739ce766d.zip
fsf-binutils-gdb-2113106124ff094741fc3a0edacf118739ce766d.tar.gz
fsf-binutils-gdb-2113106124ff094741fc3a0edacf118739ce766d.tar.bz2
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.
Diffstat (limited to 'gold/dynobj.cc')
-rw-r--r--gold/dynobj.cc14
1 files changed, 9 insertions, 5 deletions
diff --git a/gold/dynobj.cc b/gold/dynobj.cc
index 8ddb3f7..4404a35 100644
--- a/gold/dynobj.cc
+++ b/gold/dynobj.cc
@@ -1,6 +1,6 @@
// dynobj.cc -- dynamic object support for gold
-// Copyright 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
+// Copyright 2006, 2007, 2008, 2009, 2010, 2011 Free Software Foundation, Inc.
// Written by Ian Lance Taylor <iant@google.com>.
// This file is part of gold.
@@ -1483,7 +1483,7 @@ Versions::record_version(const Symbol_table* symtab,
if (!sym->is_from_dynobj() && !sym->is_copied_from_dynobj())
{
if (parameters->options().shared())
- this->add_def(sym, version, version_key);
+ this->add_def(dynpool, sym, version, version_key);
}
else
{
@@ -1496,7 +1496,7 @@ Versions::record_version(const Symbol_table* symtab,
// We've found a symbol SYM defined in version VERSION.
void
-Versions::add_def(const Symbol* sym, const char* version,
+Versions::add_def(Stringpool* dynpool, const Symbol* sym, const char* version,
Stringpool::Key version_key)
{
Key k(version_key, 0);
@@ -1520,8 +1520,12 @@ Versions::add_def(const Symbol* sym, const char* version,
// find a definition of a symbol with a version which is not
// in the version script.
if (parameters->options().shared())
- gold_error(_("symbol %s has undefined version %s"),
- sym->demangled_name().c_str(), version);
+ {
+ gold_error(_("symbol %s has undefined version %s"),
+ sym->demangled_name().c_str(), version);
+ if (this->needs_base_version_)
+ this->define_base_version(dynpool);
+ }
else
// We only insert a base version for shared library.
gold_assert(!this->needs_base_version_);