PR 10471
[deliverable/binutils-gdb.git] / gold / resolve.cc
index 9da963f0abb9de1cbc10de57d302d41f6d980bfd..7299c5589a27bf15f16842fe25847f2bf75eaad8 100644 (file)
@@ -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.
This page took 0.024573 seconds and 4 git commands to generate.