X-Authentication-Warning: delorie.com: mailnull set sender to djgpp-bounces using -f Date: Mon, 15 Apr 2002 11:29:55 -0400 Message-Id: <200204151529.g3FFTt805813@envy.delorie.com> X-Authentication-Warning: envy.delorie.com: dj set sender to dj AT delorie DOT com using -f From: DJ Delorie To: djgpp AT delorie DOT com In-reply-to: (gohyongkwang@hotmail.com) Subject: Re: Creating small-sized EXE References: Reply-To: djgpp AT delorie DOT com Errors-To: nobody AT delorie DOT com X-Mailing-List: djgpp AT delorie DOT com X-Unsubscribes-To: listserv AT delorie DOT com Precedence: bulk The FAQ has an entry on "Why are DJGPP .exe files so large?" Based on that, I get these file sizes with gcc 3.0.4: #include main() { printf("Hello World\n"); return 0; } > gcc hello.c 111,384 hello.exe > strip hello.exe 51,606 > gcc -O2 hello.c 97,241 > strip hello.exe 43,926 The C library info files have an entire category for "startup functions" that tell you how to reduce the size of your code: #include __crt0_glob_function() { return 0; } __crt0_load_environment_file() {} __ctrO_setup_arguments() {} main() { printf("Hello World\n"); return 0; } > gcc hello.c 95,089 > strip hello.exe 43,414 > gcc -O2 hello.c 80,946 > strip hello.exe 35,734