* symtab.cc (Symbol_table::add_from_dynobj): Only look for weak

aliases for symbols defined in the same object.
	* testsuite/Makefile.am (check_PROGRAMS): Add weak_alias_test.
	(weak_alias_test_SOURCES): New variable.
	(weak_alias_test_DEPENDENCIES): New variable.
	(weak_alias_test_LDFLAGS): New variable.
	(weak_alias_test_LDADD): New variable.
	(weak_alias_test_1_pic.o, weak_alias_test_1.so): New targets.
	(weak_alias_test_2_pic.o, weak_alias_test_2.so): New targets.
	(weak_alias_test_3.o): New target.
	(weak_alias_test_4_pic.o, weak_alias_test_4.so): New targets.
	* testsuite/weak_alias_test_main.cc: New file.
	* testsuite/weak_alias_test_1.cc: New file.
	* testsuite/weak_alias_test_2.cc: New file.
	* testsuite/weak_alias_test_3.cc: New file.
This commit is contained in:
Ian Lance Taylor
2008-04-09 22:45:08 +00:00
parent de051565df
commit 99a37bfda0
9 changed files with 340 additions and 4 deletions

View File

@ -1006,8 +1006,12 @@ Symbol_table::add_from_dynobj(
}
}
// Note that it is possible that RES was overridden by an
// earlier object, in which case it can be aliased here.
if (sym.get_st_shndx() != elfcpp::SHN_UNDEF
&& sym.get_st_type() == elfcpp::STT_OBJECT)
&& sym.get_st_type() == elfcpp::STT_OBJECT
&& res->source() == Symbol::FROM_OBJECT
&& res->object() == dynobj)
object_symbols.push_back(res);
}