aboutsummaryrefslogtreecommitdiff
path: root/gold/resolve.cc
diff options
context:
space:
mode:
authorIan Lance Taylor <iant@google.com>2006-11-16 00:38:25 +0000
committerIan Lance Taylor <iant@google.com>2006-11-16 00:38:25 +0000
commitc06b7b0ba3f6aaa4a3f9586689ef8bfdbd17454e (patch)
tree732f3a1719d66e1fd993872ecd58ca282d2858f8 /gold/resolve.cc
parent7495b3afc0d28e2d64995f383e2436a35aa14e6d (diff)
downloadgdb-c06b7b0ba3f6aaa4a3f9586689ef8bfdbd17454e.zip
gdb-c06b7b0ba3f6aaa4a3f9586689ef8bfdbd17454e.tar.gz
gdb-c06b7b0ba3f6aaa4a3f9586689ef8bfdbd17454e.tar.bz2
Snapshot. Includes first cut at output relocation sections.
Diffstat (limited to 'gold/resolve.cc')
-rw-r--r--gold/resolve.cc12
1 files changed, 11 insertions, 1 deletions
diff --git a/gold/resolve.cc b/gold/resolve.cc
index 86645a4..2b6d65c 100644
--- a/gold/resolve.cc
+++ b/gold/resolve.cc
@@ -106,7 +106,8 @@ Symbol_table::resolve(Sized_symbol<size>* to,
abort();
}
- if (to->object() != NULL && to->object()->is_dynamic())
+ if (to->source() == Symbol::FROM_OBJECT
+ && to->object()->is_dynamic())
tobits |= (1 << 1);
switch (to->shnum())
@@ -174,6 +175,15 @@ Symbol_table::resolve(Sized_symbol<size>* to,
break;
}
+ if ((tobits & (1 << 1)) != (frombits & (1 << 1)))
+ {
+ // This symbol is seen in both a dynamic object and a regular
+ // object. That means that we need the symbol to go into the
+ // dynamic symbol table, so that the dynamic linker can use the
+ // regular symbol to override or define the dynamic symbol.
+ to->set_needs_dynsym_entry();
+ }
+
// FIXME: Warn if either but not both of TO and SYM are STT_TLS.
// We use a giant switch table for symbol resolution. This code is