public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
From: "H.J. Lu" <hjl.tools@gmail.com>
To: Binutils <binutils@sourceware.org>
Subject: Re: [PATCH] PR ld/16746: Don't issue a warning for reference in LTO IR
Date: Wed, 26 Mar 2014 00:41:00 -0000	[thread overview]
Message-ID: <CAMe9rOoob7BN0GsCFmftwzdg01-nD4HGM6XS91Dn8KS1z5Z_yQ@mail.gmail.com> (raw)
In-Reply-To: <20140325235256.GK18201@bubble.grove.modra.org>

On Tue, Mar 25, 2014 at 4:52 PM, Alan Modra <amodra@gmail.com> 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 <amodra@gmail.com> 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.

  reply	other threads:[~2014-03-26  0:41 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-03-25 20:40 H.J. Lu
2014-03-25 22:39 ` Alan Modra
2014-03-25 22:50   ` H.J. Lu
2014-03-25 23:53     ` Alan Modra
2014-03-26  0:41       ` H.J. Lu [this message]
2014-03-26 19:29         ` H.J. Lu
2014-08-07  0:42 Merge WARN and CWARN cases in _bfd_generic_link_add_one_symbol Alan Modra
2014-08-07  0:55 ` [PATCH] PR ld/16746: Don't issue a warning for reference in LTO IR Alan Modra
2014-08-11 22:21   ` Hans-Peter Nilsson
2014-08-12  1:12     ` Alan Modra

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAMe9rOoob7BN0GsCFmftwzdg01-nD4HGM6XS91Dn8KS1z5Z_yQ@mail.gmail.com \
    --to=hjl.tools@gmail.com \
    --cc=binutils@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).