From: Andrew Crabtree Message-Id: <199705290205.AA042421501@typhoon.rose.hp.com> Subject: Re: Size of executable too large. To: claude AT tiac DOT net (Claude Sassine) Date: Wed, 28 May 1997 19:05:00 PDT Cc: djgpp AT delorie DOT com In-Reply-To: <338CF04B.EFB@tiac.net>; from "Claude Sassine" at May 28, 97 7:56 pm Precedence: bulk > "If your program doesn't need parts of the startup code, it can be made > smaller by defining certain functions with empty bodies. These ^^^^^^^^^^ > functions are `__crt0_glob_function', `__crt0_load_environment_file', > and `__crt0_setup_arguments.'..." > > I am not sure what is meant by empty bodies, supposedly: > > #define __crt0_glob_function The key part here is functions. These functions are defined in the libc sources and included in either crt0.o or libc.a (not sure). The linker will bring in dj's full versions of these functions (which do wildcard expansion and such) if they do not find any other present. You need to define them yourself like __crt0_glob_function() {} Check the prototypes needed here, I'm just guessing. > Even if this is true, judging from the > size hello.c file in comparison to the size of its executable, the > compiler still generates an enormous output. I wonder what steps to > take Judging by the size of the final executable takes into accound anything pulled in from libgcc and libc (as well as others potentially), as well as the real mode stub. If you want to look at the size of a particular piece of code compile with -c and look at the size of the .o file produced. Take into account that DJGPP has a lot of overhead, but this becomes less significant as your code size grows. There is also an exe compressor that works fairly well (so ive heard) Andrew