From 9d3b06987a9f8e6c40bf90f502f57d1c2b6b10ed Mon Sep 17 00:00:00 2001 From: Ian Lance Taylor Date: Thu, 16 Jun 2011 17:55:48 +0000 Subject: [PATCH] * symtab.cc (Warnings::issue_warning): Don't warn if relocation occurs in same object. --- gold/ChangeLog | 5 +++++ gold/symtab.cc | 6 ++++++ 2 files changed, 11 insertions(+) diff --git a/gold/ChangeLog b/gold/ChangeLog index f0ca5e5218c..e628e4948b1 100644 --- a/gold/ChangeLog +++ b/gold/ChangeLog @@ -1,3 +1,8 @@ +2011-06-16 Ian Lance Taylor + + * symtab.cc (Warnings::issue_warning): Don't warn if relocation + occurs in same object. + 2011-06-14 Alan Modra * po/POTFILES.in: Regenerate. diff --git a/gold/symtab.cc b/gold/symtab.cc index 92f83af852b..5d8c163504c 100644 --- a/gold/symtab.cc +++ b/gold/symtab.cc @@ -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, -- 2.30.2