aboutsummaryrefslogtreecommitdiff
path: root/gold/symtab.cc
diff options
context:
space:
mode:
authorIan Lance Taylor <ian@airs.com>2008-04-09 22:45:08 +0000
committerIan Lance Taylor <ian@airs.com>2008-04-09 22:45:08 +0000
commit99a37bfda08542d871bd81bd83680ad547eb015e (patch)
tree434e31347ae3a1244cbe8a0b25460589905da421 /gold/symtab.cc
parentde051565dfd9173f9ca885ac8e294ae2c90e409c (diff)
downloadgdb-99a37bfda08542d871bd81bd83680ad547eb015e.zip
gdb-99a37bfda08542d871bd81bd83680ad547eb015e.tar.gz
gdb-99a37bfda08542d871bd81bd83680ad547eb015e.tar.bz2
* 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.
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 91a2b1e..6acdcc8 100644
--- a/gold/symtab.cc
+++ b/gold/symtab.cc
@@ -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);
}