This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Re: Fw: Does ld removes uncalled functions from final exe ?
- From: "Valery Pykhtin" <pykhtin at prosoft dot ural dot ru>
- To: <binutils at sources dot redhat dot com>
- Date: Mon, 6 Sep 2004 16:46:43 +0600
- Subject: Re: Fw: Does ld removes uncalled functions from final exe ?
Hi Nick,
sorry, but this is not help to me :(. The info says that not all platforms
have such optimizations.
My platform is Pentium 4, Red Hat Linux 9.0
gcc version 3.2.2 20030222 (Red Hat Linux 3.2.2-5)
GNU ld version 2.13.90.0.18 20030206
Best regards,
Valery
> The linker does not do this by default. To achieve the affect you want
> compile your code with the -ffunction-sections switch specified and then
> link with the -gc-sections switch. eg like this:
> gcc -ffunction-sections -c test.c testfx.c
> gcc -Wl,-gc-sections test.o testfx.o