From f7c5b166f66958163526aa5688d8a7e3d0686694 Mon Sep 17 00:00:00 2001 From: Cary Coutant Date: Tue, 18 Oct 2011 00:25:53 +0000 Subject: 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. --- gold/plugin.cc | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'gold/plugin.cc') 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; -- cgit v1.1