aboutsummaryrefslogtreecommitdiff
path: root/gold/plugin.cc
diff options
context:
space:
mode:
authorCary Coutant <ccoutant@google.com>2011-10-18 00:25:53 +0000
committerCary Coutant <ccoutant@google.com>2011-10-18 00:25:53 +0000
commitf7c5b166f66958163526aa5688d8a7e3d0686694 (patch)
tree486d1a59c99520b4b72fb6d2913b3499c438d993 /gold/plugin.cc
parent6ffe910a7e62888428dfe53168a5383dd3daf689 (diff)
downloadgdb-f7c5b166f66958163526aa5688d8a7e3d0686694.zip
gdb-f7c5b166f66958163526aa5688d8a7e3d0686694.tar.gz
gdb-f7c5b166f66958163526aa5688d8a7e3d0686694.tar.bz2
PR gold/13245
* plugin.cc (is_visible_from_outside): Check for symbols referenced from dynamic objects. * resolve.cc (Symbol_table::resolve): Don't count references from dynamic objects as references from real ELF files. * testsuite/plugin_test_2.sh: Adjust expected result.
Diffstat (limited to 'gold/plugin.cc')
-rw-r--r--gold/plugin.cc6
1 files changed, 5 insertions, 1 deletions
diff --git a/gold/plugin.cc b/gold/plugin.cc
index ebda0af..637613c 100644
--- a/gold/plugin.cc
+++ b/gold/plugin.cc
@@ -818,7 +818,9 @@ Pluginobj::Pluginobj(const std::string& name, Input_file* input_file,
}
// Return TRUE if a defined symbol is referenced from outside the
-// universe of claimed objects.
+// universe of claimed objects. Only references from relocatable,
+// non-IR (unclaimed) objects count as a reference. References from
+// dynamic objects count only as "visible".
static inline bool
is_referenced_from_outside(Symbol* lsym)
@@ -838,6 +840,8 @@ is_referenced_from_outside(Symbol* lsym)
static inline bool
is_visible_from_outside(Symbol* lsym)
{
+ if (lsym->in_dyn())
+ return true;
if (parameters->options().export_dynamic() || parameters->options().shared())
return lsym->is_externally_visible();
return false;