Optimizing constructors/destructors for embedded systems

Kövesdi György kgy@deverto.hu
Tue Jun 26 13:43:00 GMT 2007


> 2) If they are not virtual, unused variants of the destructor should go
> away by means of function-level linking (on gcc by compiling with
> -ffunction-sections and linking with --gc-sections).
I tried it, but applying the option --gc-sections results in an empty 
executable file. Am I missed something? Without it everyting works in the 
known way.
BTW I wanted to try what happens if those functions are virtual and the 
mentioned options are used. I know that using virtual functions have its 
cost, but I don't know its couple to the operator delete(). Of course I will 
avoid using them as far as it is possible, but I want to know their behavior.

Regards
Gyorgy Kovesdi



More information about the Gcc-help mailing list