Fw: Does ld removes uncalled functions from final exe ?
Valery Pykhtin
pykhtin@prosoft.ural.ru
Mon Sep 6 10:46:00 GMT 2004
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
More information about the Binutils
mailing list