public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
From: "H.J. Lu" <hjl.tools@gmail.com>
To: Alan Modra <amodra@gmail.com>
Cc: Binutils <binutils@sourceware.org>
Subject: Re: [PATCH] LTO: Ignore undefined symbols without relocation
Date: Thu, 30 Jul 2020 04:51:35 -0700	[thread overview]
Message-ID: <CAMe9rOq=J-0Ms=usypC-rAZQtmB4bjgo0bv8CDV4ooaOdAeFsg@mail.gmail.com> (raw)
In-Reply-To: <20200730093214.GT9601@bubble.grove.modra.org>

On Thu, Jul 30, 2020 at 2:32 AM Alan Modra <amodra@gmail.com> wrote:
>
> On Wed, Jul 29, 2020 at 03:22:58PM -0700, H.J. Lu via Binutils wrote:
> > Normally an undefined symbol is treated as a reference.  Linker will
> > try to satisfy the reference.  This feature is used to bring a symbol
> > definition into output without explicit relocation.  If there is no
> > definition nor relocation, linker will remove undefined symbol from
> > symbol table in output (PR ld/4317).  But GCC 10 LTO may generate
> > separate debug info files which contain undefined symbols without
> > relocations:
>
> Surely this is just a gcc bug?  We search libraries again after
> loading the LTO output, so one would expect that undefined symbols
> satisfied by an archive (or as-needed shared library) would lead to
> extra files being linked.
>
> I'd like to better understand just how this problem occurs though.  As
> it is, I suspect there might be something else going on here, for
> example, ranlib being run without a plugin when building the archives.

A testcase is on pr96385 branch at:

https://gitlab.com/x86-gcc/gcc-bugs

-- 
H.J.

  parent reply	other threads:[~2020-07-30 11:52 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-29 22:22 H.J. Lu
2020-07-30  9:32 ` Alan Modra
2020-07-30 10:39   ` [PATCH] elf: Add sym_cache to elf_link_hash_table H.J. Lu
2020-07-30 11:51   ` H.J. Lu [this message]
2020-07-31  8:12     ` [PATCH] LTO: Ignore undefined symbols without relocation Alan Modra
2020-07-31  9:51       ` Nick Clifton
2020-07-31 10:07       ` Nick Clifton
2020-07-31 11:02         ` Alan Modra
2020-07-31 11:43           ` H.J. Lu
2020-07-31 15:47             ` V2 " H.J. Lu
2020-08-03  7:26               ` 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='CAMe9rOq=J-0Ms=usypC-rAZQtmB4bjgo0bv8CDV4ooaOdAeFsg@mail.gmail.com' \
    --to=hjl.tools@gmail.com \
    --cc=amodra@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).