Can LD give warnings about the non-static functions defined but never used explicitly?

Alan Modra amodra@bigpond.net.au
Mon Nov 24 07:56:00 GMT 2008


On Mon, Nov 24, 2008 at 03:19:32PM +0800, Pan ruochen wrote:
> Can LD give warnings about the non-static functions defined but never
> used explicitly? I want to optimize the code size by removing those
> unused functions.

No, but if you compile with -ffunction-sections -fdata-sections and
link with -gc-sections, ld will trim off the unused functions for you.

-- 
Alan Modra
Australia Development Lab, IBM



More information about the Binutils mailing list