[PATCH] ld: Skip the LTO archive member only for the earlier DSO

H.J. Lu hjl.tools@gmail.com
Wed Apr 9 14:32:26 GMT 2025


On Wed, Apr 9, 2025 at 6:01 AM Michael Matz <matz@suse.de> wrote:
>
> Hey,
>
> On Wed, 9 Apr 2025, Michael Matz wrote:
>
> > > commit 2707d55e539ef323dd14a1293e762bf3d9739ee7
> > > Author: Michael Matz <matz@suse.de>
> > > Date:   Mon Mar 31 15:57:08 2025 +0200
> > >
> > > skipped the LTO archive member even when the earlier item is also an
> > > archive.  Instead, skip the LTO archive member only if the earlier item
> > > is a shared library.
> >
> > Thanks!  Does it also solve the inline testcase I cobbled up in
> >   https://sourceware.org/bugzilla/show_bug.cgi?id=32846#c6
> > (that wasn't working even without my patch but is related to the
> > shared vs. static symbols).
>
> FWIW: It doesn't, it remains resolving to the abort in libc.so, not to
> either the one in the cmdline shared lib (which would also be wrong) nor
> to the one from static.a, which would be the correct one.
>
> Obviously it's still better to have this patch now, as it fixes a
> regression in the wild, but I wonder if adding more and more conditions
> for each testcase we come along is the right approach to deal with this.
> Can you describe what first_hash is _really_ supposed to be and how it
> interacts with the linkers symbol table vs. the two LTO symbol lookup
> phases?
>

first_hash has the first definition for dynamic symbol or archive symbol
lookup.


-- 
H.J.


More information about the Binutils mailing list