[PATCH] libio: Properly link in libio functions in static binaries
H.J. Lu
hjl.tools@gmail.com
Mon Aug 25 13:11:53 GMT 2025
On Mon, Aug 25, 2025 at 6:09 AM Florian Weimer <fweimer@redhat.com> wrote:
>
> * H. J. Lu:
>
> >> Hmm. The --strip-unneeded option says this:
> >>
> >> --strip-unneeded
> >> Remove all symbols that are not needed for relocation processing in
> >> addition to debugging symbols and sections stripped by
> >> --strip-debug.
> >>
> >> I think it's a user error to use this on libc.a. What's the benefit of
> >
> > Why can't --strip-unneeded be used on libc.a? If a symbol isn't used for
> > relocation processing, it is unused.
>
> It's only unused from the individual .o file that the strip command
> processes. It's not unused from a global perspective. We'll add more
An undefined entry in the symbol table without relocation is unneeded
for "relocation processing".
> references like these once we improve support for static linking.
>
> Developers should run --strip-unneeded on the output file, not the input
The key word is "relocation processing". Most of the outputs don't need
relocation processing.
> files, or use --strip-debug on libc.a. Running --strip-unneeded on
> libc.a seems unnecessary.
>
> Thanks,
> Florian
>
--
H.J.
More information about the Libc-alpha
mailing list