Giant executables.. what am I doing wrong?

Michiel Buddingh'
Mon Oct 14 16:49:00 GMT 2002

I'm currently trying to write a program for a linux system with limited
memory, and as such I'd like gcc to generate small, statically linked 

However, if I compile even a simple program like:

int main() { write(2,"Hello world.\n", 13); return 0; }

with the --static option, then strip it with "--strip-all" I get a 
program worth 332 kB(!).

Needless to say, this is not exactly what I want.

I have tried both gcc 2.95 and gcc 3.2, but the results differ only by
a few bytes.

Am I missing something really obvious here?
		-- Michiel

More information about the Gcc-help mailing list