[PATCH] elf: Strip unreferenced weak undefined symbols

Alan Modra amodra@gmail.com
Fri Apr 19 00:38:11 GMT 2024


On Thu, Apr 18, 2024 at 05:28:56AM -0700, H.J. Lu wrote:
> Linker will resolve an undefined symbol only if it is referenced by
> relocation.  Unreferenced weak undefined symbols serve no purpose.
> Weak undefined symbols appear in the dynamic symbol table only when they
> are referenced by dynamic relocation.  Mark symbols with relocation and
> strip undefined weak symbols if they don't have relocation and aren't
> in the dynamic symbol table.

OK, seems reasonable.

-- 
Alan Modra
Australia Development Lab, IBM


More information about the Binutils mailing list