I’ve compiled a C file that does absolutely nothing (just a main that returns… not even a “Hello, world” gets printed), and I’ve compiled it with various compilers (MinGW GCC, Visual C++, Windows DDK, etc.). All of them link with the C runtime, which is standard.
But what I don’t get is: When I open up the file in a hex editor (or a disassembler), why do I see that almost half of the 16 KB is just huge sections of either 0x00 bytes or 0xCC bytes? It seems rather ridiculous to me… is there any way to prevent these from occurring? And why are they there in the first place?
Thank you!
As it turns out, I should’ve been able to guess this beforehand… the answer was the debug symbols and code; those were taking up most of the space. Not compiling with /DEBUG and /PDB (which I always do by default) reduced the 13 K down to 3 K.