* symtab.cc (Warnings::issue_warning): Don't warn if relocation
authorIan Lance Taylor <ian@airs.com>
Thu, 16 Jun 2011 17:55:48 +0000 (17:55 +0000)
committerIan Lance Taylor <ian@airs.com>
Thu, 16 Jun 2011 17:55:48 +0000 (17:55 +0000)
occurs in same object.

gold/ChangeLog
gold/symtab.cc

index f0ca5e5218c8d76ed572c837ed03953c2b20fe8c..e628e4948b1378e03c877a03435edb9f998fad9c 100644 (file)
@@ -1,3 +1,8 @@
+2011-06-16  Ian Lance Taylor  <iant@google.com>
+
+       * symtab.cc (Warnings::issue_warning): Don't warn if relocation
+       occurs in same object.
+
 2011-06-14  Alan Modra  <amodra@gmail.com>
 
        * po/POTFILES.in: Regenerate.
index 92f83af852b56bdc3da38386b2ab2e3429abfd1a..5d8c163504c7e176dfc7bfbd0417c108dca60ba5 100644 (file)
@@ -3282,6 +3282,12 @@ Warnings::issue_warning(const Symbol* sym,
                        size_t relnum, off_t reloffset) const
 {
   gold_assert(sym->has_warning());
+
+  // We don't want to issue a warning for a relocation against the
+  // symbol in the same object file in which the symbol is defined.
+  if (sym->object() == relinfo->object)
+    return;
+
   Warning_table::const_iterator p = this->warnings_.find(sym->name());
   gold_assert(p != this->warnings_.end());
   gold_warning_at_location(relinfo, relnum, reloffset,