[PATCH] ld: Skip the LTO archive member only for the earlier DSO
H.J. Lu
hjl.tools@gmail.com
Wed Apr 9 19:32:56 GMT 2025
On Wed, Apr 9, 2025 at 9:36 AM Michael Matz <matz@suse.de> wrote:
>
> Hello,
>
> On Wed, 9 Apr 2025, H.J. Lu wrote:
>
> > > > 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.
>
> Well, yes, that's how it's currently filled. But why, and how does that
> interact with the linker symbol table, or rather: how have you designed it
> to interact? I will also say that the above isn't the full truth, it
> contains the first definition for archive symbols _only_ when at the point
> of seeing it no reference to it existed yet.
>
The design goal is to support shared libraries and archives with LTO.
--
H.J.
More information about the Binutils
mailing list