gcc: decrease binary size, eliminate unused functions/code

In SuperTuxKart, we have ~80 unused functions and some of them are really big. As I’m not sure whether they’re needed or not, I’ve googled for special gcc options.

Some links so I don’t forget:

http://gcc.gnu.org/onlinedocs/gnat_ugn_unw/Compilation-options.html

http://gcc.gnu.org/onlinedocs/gcc/Optimize-Options.html#index-ffunction-sections-973

http://gcc.gnu.org/onlinedocs/gcc/Link-Options.html#index-Wl-1104

By default gcc won’t eliminate unused data/functions, but we can do it manually. As a result – decreasing ‘supertuxkart’ binary by 80kb. Not epic, especially when you know that binary is 11mb in size.

This entry was posted in Uncategorized and tagged , , . Bookmark the permalink.

Leave a comment