Stripping dead code
Par zogzog, mercredi 1 avril 2009 à 15:01 :: General :: #31 :: rss
Bloat is bad. Here is how to remove unused functions from your binaries:
- On MacOS: really easy, just use the
-dead_strip
linker option, that Steve Jobs in his infinite wisdom, has invented for us. The-dead_strip_dylibs
will also remove references to unused dynamic libraries. - On Linux: a bit more tricky. You have to compile the sources with the
-ffunction-sections -fdata-sections
, and then link with the --gc-sections flag. - On Windows, with msvc: you have to compile the sources with
/Gy
option ("enable function-level linking"), and then link with/OPT:ref /RELEASE
Commentaires
Aucun commentaire pour le moment.
Ajouter un commentaire
Les commentaires pour ce billet sont fermés.