Unstrippable garbage in executables
GCC for 32-bit and 64-bit Windows with a real installer & updater
Brought to you by:
tdragon
TDM-GCC 5.1.0-2 includes garbage in the target executable. Created files are too big even despite compiling with debug disabled. Garbage can't even be removed with the strip command. The garbage is bigger when the executable is compiled from several source modules instead of one monolithic file. It seems the garbage is concentrated in the .rdata section. A small part of the garbage is the repetition of the compiler name and several versions over and over again. Other part of the garbage seems to be some kind of symbol table which can't be stripped (contains names of C functions like malloc, strlen, etc...).
Anonymous
The build ID can be suppressed with -fno-ident, or just run
strip -S --strip-unneeded --remove-section=.note.gnu.gold-version --remove-section=.comment --remove-section=.note --remove-section=.note.gnu.build-id --remove-section=.note.ABI-tag
on the resulting binary. The symbol table is needed to load in these functions, as they are provided by the runtime distributables in Windows.