From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 16158 invoked by alias); 26 Mar 2014 00:41:56 -0000 Mailing-List: contact binutils-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: binutils-owner@sourceware.org Received: (qmail 16143 invoked by uid 89); 26 Mar 2014 00:41:56 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.5 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.2 X-HELO: mail-oa0-f51.google.com Received: from mail-oa0-f51.google.com (HELO mail-oa0-f51.google.com) (209.85.219.51) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-SHA encrypted) ESMTPS; Wed, 26 Mar 2014 00:41:54 +0000 Received: by mail-oa0-f51.google.com with SMTP id i4so1612783oah.38 for ; Tue, 25 Mar 2014 17:41:52 -0700 (PDT) MIME-Version: 1.0 X-Received: by 10.182.24.8 with SMTP id q8mr34853830obf.38.1395794512368; Tue, 25 Mar 2014 17:41:52 -0700 (PDT) Received: by 10.76.151.198 with HTTP; Tue, 25 Mar 2014 17:41:52 -0700 (PDT) In-Reply-To: <20140325235256.GK18201@bubble.grove.modra.org> References: <20140325203952.GA11925@intel.com> <20140325223910.GJ18201@bubble.grove.modra.org> <20140325235256.GK18201@bubble.grove.modra.org> Date: Wed, 26 Mar 2014 00:41:00 -0000 Message-ID: Subject: Re: [PATCH] PR ld/16746: Don't issue a warning for reference in LTO IR From: "H.J. Lu" To: Binutils Content-Type: text/plain; charset=ISO-8859-1 X-IsSubscribed: yes X-SW-Source: 2014-03/txt/msg00265.txt.bz2 On Tue, Mar 25, 2014 at 4:52 PM, Alan Modra wrote: > On Tue, Mar 25, 2014 at 03:50:05PM -0700, H.J. Lu wrote: >> On Tue, Mar 25, 2014 at 3:39 PM, Alan Modra wrote: >> > On Tue, Mar 25, 2014 at 01:39:52PM -0700, H.J. Lu wrote: >> >> case WARNC: >> >> - /* Issue a warning and cycle. */ >> >> - if (h->u.i.warning != NULL) >> >> + /* Issue a warning and cycle. Don't issue a warning for >> >> + reference in LTO IR which may be removed by LTO later. */ >> >> + if (h->u.i.warning != NULL >> >> + && (abfd->flags & BFD_PLUGIN) == 0) >> > >> > So here you're handling references in LTO IR for warning symbols >> > defined in real object files or other LTO IR files.. >> >> Yes. >> >> >> case WARN: >> >> + /* Don't issue a warning for reference in LTO IR which may be >> >> + removed by LTO later. Make a warning symbol instead. */ >> >> + if ((hash_entry_bfd (h)->flags & BFD_PLUGIN) != 0) >> >> + goto mwarn; >> >> + >> > >> > And here you have the case where the new symbol is a warning symbol, >> > in either LTO IR or real object files, but the reference was in an LTO >> > IR file. >> >> Yes. >> >> > What about the CWARN case, where you already have a definition that >> > may have been referenced, and the new symbol is a warning symbol? >> > You'll need to test h->non_ir_ref I think. >> >> It is: >> >> https://sourceware.org/bugzilla/show_bug.cgi?id=12760 > > That's a different issue, isn't it? I'm talking about the sequence > 1a) symbol referenced, > 2a) symbol defined, > 3a) warning symbol defined. > or > 1b) symbol defined, > 2b) symbol referenced, > 3b) warning symbol defined. > > If (1a) or (2b) is an IR reference then we don't want to warn. The symbol is referenced and used even if it has been inlined. Testing h->non_ir_ref isn't sufficient. We also want to know if it is used in LTO. -- H.J.