[PATCH] libio: Properly link in libio functions in static binaries

Florian Weimer fweimer@redhat.com
Mon Aug 25 13:08:55 GMT 2025


* 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
references like these once we improve support for static linking.

Developers should run --strip-unneeded on the output file, not the input
files, or use --strip-debug on libc.a.  Running --strip-unneeded on
libc.a seems unnecessary.

Thanks,
Florian



More information about the Libc-alpha mailing list