Any symbol which is in both a regular object and a dynamic object
authorIan Lance Taylor <iant@google.com>
Wed, 29 Aug 2007 05:48:24 +0000 (05:48 +0000)
committerIan Lance Taylor <iant@google.com>
Wed, 29 Aug 2007 05:48:24 +0000 (05:48 +0000)
requires an entry in the dynamic symbol table.

gold/resolve.cc
gold/symtab.h

index f80e08f92e43264d622edb30c2f6ca697f34a217..d02159824af1d660afc25810d145f33f779957e8 100644 (file)
@@ -189,15 +189,6 @@ Symbol_table::resolve(Sized_symbol<size>* to,
       break;
     }
 
-  if ((tobits & (1 << 1)) != (frombits & (1 << 1)))
-    {
-      // This symbol is seen in both a dynamic object and a regular
-      // object.  That means that we need the symbol to go into the
-      // dynamic symbol table, so that the dynamic linker can use the
-      // regular symbol to override or define the dynamic symbol.
-      to->set_needs_dynsym_entry();
-    }
-
   // FIXME: Warn if either but not both of TO and SYM are STT_TLS.
 
   // We use a giant switch table for symbol resolution.  This code is
index 15d1f788eb076dbb873040f5a98f8adce6a4120e..816afb3884a8380053882a8c53fbed1124cff834 100644 (file)
@@ -178,7 +178,10 @@ class Symbol
   // table.
   bool
   needs_dynsym_entry() const
-  { return this->needs_dynsym_entry_; }
+  {
+    return (this->needs_dynsym_entry_
+            || (this->in_reg() && this->in_dyn()));
+  }
 
   // Mark this symbol as needing an entry in the dynamic symbol table.
   void