2011-03-04 Michael Snyder <msnyder@msnyder-server.eng.vmware.com>
[deliverable/binutils-gdb.git] / gold / resolve.cc
index 29d9d79c7a46c682215896c7b4d315e855e43edb..a9a89fa65d68dfee86dffafebd212abdbd30f9a3 100644 (file)
@@ -195,7 +195,7 @@ symbol_to_bits(elfcpp::STB binding, bool is_dynamic,
     default:
       // Any target which wants to handle STB_LOOS, etc., needs to
       // define a resolve method.
-      gold_error(_("unsupported symbol binding"));
+      gold_error(_("unsupported symbol binding %d"), static_cast<int>(binding));
       bits = global_flag;
     }
 
@@ -630,14 +630,21 @@ Symbol_table::should_override(const Symbol* to, unsigned int frombits,
     case UNDEF * 16 + WEAK_UNDEF:
     case WEAK_UNDEF * 16 + WEAK_UNDEF:
     case DYN_UNDEF * 16 + WEAK_UNDEF:
-    case DYN_WEAK_UNDEF * 16 + WEAK_UNDEF:
     case COMMON * 16 + WEAK_UNDEF:
     case WEAK_COMMON * 16 + WEAK_UNDEF:
     case DYN_COMMON * 16 + WEAK_UNDEF:
     case DYN_WEAK_COMMON * 16 + WEAK_UNDEF:
-      // A new weak undefined reference tells us nothing.
+      // A new weak undefined reference tells us nothing unless the
+      // exisiting symbol is a dynamic weak reference.
       return false;
 
+    case DYN_WEAK_UNDEF * 16 + WEAK_UNDEF:
+      // A new weak reference overrides an existing dynamic weak reference.
+      // This is necessary because a dynamic weak reference remembers
+      // the old binding, which may not be weak.  If we keeps the existing
+      // dynamic weak reference, the weakness may be dropped in the output.
+      return true;
+
     case DYN_DEF * 16 + WEAK_UNDEF:
     case DYN_WEAK_DEF * 16 + WEAK_UNDEF:
       // For a dynamic def, we need to remember which kind of undef we see.
This page took 0.022648 seconds and 4 git commands to generate.