🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: alt.msdos.programmer
Article #1189

Re: Borland C/C++ 4.02 Executable size [possible repost]

#1189
From: Norman Bullen
Date: Sun, 11 Feb 1996 16:02
45 lines
2914 bytes
Kelvin Klijnsma wrote:
> 
> [This message is a repost. My news server seems to have been down on
> 8-2-1996. I'm sorry if you've already read my previous message. Please
> repost any reply you may have sent to my previous message. Thanks!]
> 
> Hi,
> 
> I really like Borland C++ 4.02 but one thing that's very annoying
> (IMHO) is the minimum size of an executable. At the moment I only do
> some DOS programming, but even the most simple utility will at least
> take about 30K. I know that the compiler links in some startup code
> and some necessary libs, but my question is: is there any way of
> reducing the size of the executable. For instance, in Borland Pascal
> you have smart linking and a simple utility need not be larger than
> say 5K.
> Please note that I'm used to program in TASM, i.e. I'm used to being
> in control of what exactly is linked into the program (I guess that's
> really why the minimum size of 30K bothers me :-).
> 
> In short:
> 
>  - How do I reduce the size of compiled C programs for DOS.
>    (And yes, I am aware of executable compressors).
>  - I would like a solution that works for all memory models.
>    (Except tiny model: this model does indeed allow me to
>    produce smaller executables, but I prefer small model).
> 
> I appreciate all solutions, suggestions and pointers!
> 
>      ________________________________________________
>     |_                                              _|
>    (__)              Kelvin Klijnsma               (__)
>    (___)          K.Klijnsma@net.HCC.nl           (___)
>    (__)   http://www.inter.nl.net/hcc/K.Klijnsma   (__)
>     |________________________________________________|

Are you looking at the size of the program file on disk or the amount of 
memory required to load it? If you have debugging options turned on Borland 
C/C++ will add symbol tables to the program file for use with TDEBUG. It is 
not unusual for these to be larger than the actual program code. To get rid 
of the symbol tables either recompile with the debugging options turned off 
or use the utility TDSTRIP to remove them from your program file. Your tiny 
model programs are much smaller because the linker cannot put symbol tables 
in a .COM program file.
Technical Details
Message-ID: <311E132E.4430@ix.netcom.com>
Path: arc1-ca.pugleaf.net!ix.netcom.com!netnews
References: <4ffk0c$6h4@altrade.nijmegen.inter.nl.net>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!ix.netcom.com!netnews
From: Norman Bullen <nbullen@ix.netcom.com>
Newsgroups: alt.msdos.programmer,comp.os.msdos.programmer,comp.lang.c
Subject: Re: Borland C/C++ 4.02 Executable size [possible repost]
Date: Sun, 11 Feb 1996 08:02:54 -0800
Organization: Black Cat Associates
Message-ID: <311E132E.4430@ix.netcom.com>
References: <4ffk0c$6h4@altrade.nijmegen.inter.nl.net>
NNTP-Posting-Host: ple-ca9-21.ix.netcom.com
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-NETCOM-Date: Sun Feb 11  8:10:00 AM PST 1996
X-Mailer: Mozilla 2.0 (Win16; I)
To: K.Klijnsma@net.HCC.nl