From Cary Coutant: Ignore hidden symbols in a dynamic object.
authorIan Lance Taylor <iant@google.com>
Fri, 1 Feb 2008 00:42:24 +0000 (00:42 +0000)
committerIan Lance Taylor <iant@google.com>
Fri, 1 Feb 2008 00:42:24 +0000 (00:42 +0000)
gold/symtab.cc

index c26cc2271c75c883e29fdac47f13cc4e265dc03f..78bfec5a61259d841163044b5fb7be2f8ce27fa8 100644 (file)
@@ -749,8 +749,11 @@ Symbol_table::add_from_dynobj(
     {
       elfcpp::Sym<size, big_endian> sym(p);
 
-      // Ignore symbols with local binding.
-      if (sym.get_st_bind() == elfcpp::STB_LOCAL)
+      // Ignore symbols with local binding or that have
+      // internal or hidden visibility.
+      if (sym.get_st_bind() == elfcpp::STB_LOCAL
+          || sym.get_st_visibility() == elfcpp::STV_INTERNAL
+          || sym.get_st_visibility() == elfcpp::STV_HIDDEN)
        continue;
 
       unsigned int st_name = sym.get_st_name();