* symtab.cc (Symbol_table::do_define_as_constant): Don't force a

version symbol to be local.
	* testsuite/ver_test_4.sh: New file.
	* testsuite/Makefile.am (check_SCRIPTS): Add ver_test_4.sh.
	(check_DATA): Add ver_test_4.syms.
	(ver_test_4.syms): New target.
	* testsuite/Makefile.in: Rebuild.
This commit is contained in:
Ian Lance Taylor
2008-03-29 08:39:26 +00:00
parent ab794b6bda
commit 686c8caf41
5 changed files with 68 additions and 2 deletions

View File

@@ -1406,8 +1406,13 @@ Symbol_table::do_define_as_constant(
if (oldsym == NULL)
{
if (binding == elfcpp::STB_LOCAL
|| this->version_script_.symbol_is_local(name))
// Version symbols are absolute symbols with name == version.
// We don't want to force them to be local.
if ((version == NULL
|| name != version
|| value != 0)
&& (binding == elfcpp::STB_LOCAL
|| this->version_script_.symbol_is_local(name)))
this->force_local(sym);
return sym;
}