This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: Can LD give warnings about the non-static functions defined but never used explicitly?
- From: Alan Modra <amodra at bigpond dot net dot au>
- To: Pan ruochen <panruochen at gmail dot com>
- Cc: binutils at sourceware dot org
- Date: Mon, 24 Nov 2008 18:26:01 +1030
- Subject: Re: Can LD give warnings about the non-static functions defined but never used explicitly?
- References: <af0faace0811232319n6e6789e5t6cc39ff5be836ed4@mail.gmail.com>
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