aboutsummaryrefslogtreecommitdiff
path: root/gold/symtab.cc
diff options
context:
space:
mode:
authorIan Lance Taylor <ian@airs.com>2008-03-27 18:19:09 +0000
committerIan Lance Taylor <ian@airs.com>2008-03-27 18:19:09 +0000
commit18e6b24e63c9965e417f009c21e1945e735ef0d0 (patch)
treedc505be1409e16d15451b6a44eeeb17d7bafd323 /gold/symtab.cc
parent38de72b9a0ea41e8436c0dfc546017a20108386d (diff)
downloadgdb-18e6b24e63c9965e417f009c21e1945e735ef0d0.zip
gdb-18e6b24e63c9965e417f009c21e1945e735ef0d0.tar.gz
gdb-18e6b24e63c9965e417f009c21e1945e735ef0d0.tar.bz2
* symtab.cc (Symbol_table::add_from_object): Handle saw_undefined_
and commons_ correctly when NAME/VERSION does not override NAME/NULL. * testsuite/ver_test_6.c: New file. * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_6 (ver_test_6_SOURCES, ver_test_6_DEPENDENCIES): New variables. (ver_test_6_LDFLAGS, ver_test_6_LDADD): New variables.
Diffstat (limited to 'gold/symtab.cc')
-rw-r--r--gold/symtab.cc10
1 files changed, 7 insertions, 3 deletions
diff --git a/gold/symtab.cc b/gold/symtab.cc
index c7170a3..a2ae22f 100644
--- a/gold/symtab.cc
+++ b/gold/symtab.cc
@@ -584,19 +584,23 @@ Symbol_table::add_from_object(Object* object,
// This is the first time we have seen NAME/VERSION.
gold_assert(ins.first->second == NULL);
- was_undefined = false;
- was_common = false;
-
if (def && !insdef.second)
{
// We already have an entry for NAME/NULL. If we override
// it, then change it to NAME/VERSION.
ret = this->get_sized_symbol<size>(insdef.first->second);
+
+ was_undefined = ret->is_undefined();
+ was_common = ret->is_common();
+
this->resolve(ret, sym, orig_sym, object, version);
ins.first->second = ret;
}
else
{
+ was_undefined = false;
+ was_common = false;
+
Sized_target<size, big_endian>* target =
object->sized_target<size, big_endian>();
if (!target->has_make_symbol())