Mail Archives: djgpp/1996/07/04/03:48:29
On 3 Jul 1996, deuce wrote:
> hello world compiles to about 50K .exe. I wonder why so much...there is
> only a printf function. Is there any way to get it smaller?
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.' By defining empty substitutes for all three of
these, you can make the "Hello" program be about 18KB on disk.
You can make your program image still smaller by compressing it with `DJP'
which is a DJGPP-specific executable compressor, available as
ftp://ftp.simtel.net/pub/simtelnet/gnu/djgpp/v2misc/mlefp103.zip. It is
fast and has no memory overhead.
- Raw text -