aboutsummaryrefslogtreecommitdiff
path: root/gold/symtab.cc
diff options
context:
space:
mode:
authorIan Lance Taylor <ian@airs.com>2008-03-27 06:11:57 +0000
committerIan Lance Taylor <ian@airs.com>2008-03-27 06:11:57 +0000
commit5871526fc2745a477d3dcd5807934ce410568ffa (patch)
treeb35de04252f4cb7921faf74885fb7b1da3b6d9ec /gold/symtab.cc
parent42972f502e79cd88a7f011ead7b75dab5222b7c9 (diff)
downloadgdb-5871526fc2745a477d3dcd5807934ce410568ffa.zip
gdb-5871526fc2745a477d3dcd5807934ce410568ffa.tar.gz
gdb-5871526fc2745a477d3dcd5807934ce410568ffa.tar.bz2
* symtab.cc (Symbol_table::add_from_relobj): Don't set the version
of an undefined symbol from a version script. * testsuite/Makefile.am (ver_test_5.so): New target. (ver_test_5.o): New target. (check_SCRIPTS): Add ver_test_5.sh. (check_DATA): Add ver_test_5.syms. (ver_test_5.syms): New target. * testsuite/ver_test_5.cc: New file. * testsuite/ver_test_5.script: New file. * testsuite/ver_test_5.sh: New file. * Makefile.in, testsuite/Makefile.in: Rebuild.
Diffstat (limited to 'gold/symtab.cc')
-rw-r--r--gold/symtab.cc6
1 files changed, 5 insertions, 1 deletions
diff --git a/gold/symtab.cc b/gold/symtab.cc
index 5ad5ae8..c7170a3 100644
--- a/gold/symtab.cc
+++ b/gold/symtab.cc
@@ -719,7 +719,11 @@ Symbol_table::add_from_relobj(
++ver;
}
}
- else if (!version_script_.empty())
+ // We don't want to assign a version to an undefined symbol,
+ // even if it is listed in the version script. FIXME: What
+ // about a common symbol?
+ else if (!version_script_.empty()
+ && psym->get_st_shndx() != elfcpp::SHN_UNDEF)
{
// The symbol name did not have a version, but
// the version script may assign a version anyway.