www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1996/07/04/03:48:29

Date: Thu, 4 Jul 1996 10:43:55 +0200 (IST)
From: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
To: deuce <norbertj AT panix DOT com>
Cc: djgpp AT delorie DOT com
Subject: Re: EXE size
In-Reply-To: <4re14h$k40@panix2.panix.com>
Message-Id: <Pine.SUN.3.91.960704104148.23994A-100000@is>
Mime-Version: 1.0

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 -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019