diff options
author | Cary Coutant <ccoutant@google.com> | 2009-08-12 18:30:39 +0000 |
---|---|---|
committer | Cary Coutant <ccoutant@google.com> | 2009-08-12 18:30:39 +0000 |
commit | 645afe0c5b028b013231f5890f66376e4dfc811d (patch) | |
tree | e07a17f8369fa623c2b137dc6ffcde513d9097e1 /gold/resolve.cc | |
parent | c1742541e6541c035b26f17b463f48ac71575653 (diff) | |
download | gdb-645afe0c5b028b013231f5890f66376e4dfc811d.zip gdb-645afe0c5b028b013231f5890f66376e4dfc811d.tar.gz gdb-645afe0c5b028b013231f5890f66376e4dfc811d.tar.bz2 |
PR 10471
* resolve.cc (Symbol_table::resolve): Check for references from
dynamic objects to hidden and internal symbols.
* testsuite/Makefile.am (hidden_test.sh): New test.
* testsuite/Makefile.in: Regenerate.
* testsuite/hidden_test.sh: New script.
* testsuite/hidden_test_1.c: New test source.
* testsuite/hidden_test_main.c: New test source.
Diffstat (limited to 'gold/resolve.cc')
-rw-r--r-- | gold/resolve.cc | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/gold/resolve.cc b/gold/resolve.cc index 9da963f..7299c55 100644 --- a/gold/resolve.cc +++ b/gold/resolve.cc @@ -257,6 +257,20 @@ Symbol_table::resolve(Sized_symbol<size>* to, // Record that we've seen this symbol in a regular object. to->set_in_reg(); } + else if (to->visibility() == elfcpp::STV_HIDDEN + || to->visibility() == elfcpp::STV_INTERNAL) + { + // A dynamic object cannot reference a hidden or internal symbol + // defined in another object. + gold_warning(_("%s symbol '%s' in %s is referenced by DSO %s"), + (to->visibility() == elfcpp::STV_HIDDEN + ? "hidden" + : "internal"), + to->demangled_name().c_str(), + to->object()->name().c_str(), + object->name().c_str()); + return; + } else { // Record that we've seen this symbol in a dynamic object. |