diff options
author | Cary Coutant <ccoutant@google.com> | 2011-10-18 00:25:53 +0000 |
---|---|---|
committer | Cary Coutant <ccoutant@google.com> | 2011-10-18 00:25:53 +0000 |
commit | f7c5b166f66958163526aa5688d8a7e3d0686694 (patch) | |
tree | 486d1a59c99520b4b72fb6d2913b3499c438d993 /gold/plugin.cc | |
parent | sim: move from common.m4 to SIM_AC_COMMON (diff) | |
download | binutils-gdb-f7c5b166f66958163526aa5688d8a7e3d0686694.tar.gz binutils-gdb-f7c5b166f66958163526aa5688d8a7e3d0686694.tar.bz2 binutils-gdb-f7c5b166f66958163526aa5688d8a7e3d0686694.zip |
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.cc | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/gold/plugin.cc b/gold/plugin.cc index ebda0aff152..637613c897a 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; |