This is the mail archive of the binutils@sources.redhat.com mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]