Don't warn about redefinitions from a --just-symbols object.
authorIan Lance Taylor <iant@google.com>
Thu, 28 Feb 2008 22:39:29 +0000 (22:39 +0000)
committerIan Lance Taylor <iant@google.com>
Thu, 28 Feb 2008 22:39:29 +0000 (22:39 +0000)
gold/resolve.cc

index 185327b4e789a92e2da302f70ac3bd83d8570288..c244ad42a94ab11195f7944e63e9e22c685bc62c 100644 (file)
@@ -318,6 +318,14 @@ Symbol_table::should_override(const Symbol* to, unsigned int frombits,
     {
     case DEF * 16 + DEF:
       // Two definitions of the same symbol.
+
+      // If either symbol is defined by an object included using
+      // --just-symbols, then don't warn.  This is for compatibility
+      // with the GNU linker.  FIXME: This is a hack.
+      if ((to->source() == Symbol::FROM_OBJECT && to->object()->just_symbols())
+          || object->just_symbols())
+        return false;
+
       // FIXME: Do a better job of reporting locations.
       gold_error(_("%s: multiple definition of %s"),
                 object != NULL ? object->name().c_str() : _("command line"),