www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1996/08/13/23:00:29

Xref: news2.mv.net comp.os.msdos.djgpp:7222
From: Elliott Oti <e DOT oti AT stud DOT warande DOT ruu DOT nl>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: DJGPP's .exe's are TOO large
Date: Tue, 13 Aug 1996 10:19:29 -0700
Organization: Academic Computer Centre Utrecht, (ACCU)
Lines: 31
Message-ID: <3210B921.5CCE@stud.warande.ruu.nl>
References: <4uk6qr$795 AT utdallas DOT edu> <Pine DOT NEB DOT 3 DOT 95 DOT 960812142450 DOT 16040A-100000 AT ananke DOT amu DOT edu DOT pl> <4upl1g$r23 AT wnnews1 DOT netlink DOT net DOT nz> <4uq176$1ndo AT rs18 DOT hrz DOT th-darmstadt DOT de>
NNTP-Posting-Host: warande1078.warande.ruu.nl
Mime-Version: 1.0
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

Alexander Lehmann wrote:
> 
> : Another little trick is to strip your Coff files.  Gcc adds some
> : rudimentary debug info even when compiling without the '-g' option.
> : If you compile to Coff - 'gcc -o foo ...' - rather than exe -
> : 'gcc -o foo.exe ...' - then you can strip the resulting binary and use
> : stubify to turn it into a much smaller exe.
> 
> Or you can strip the COFF binary and recreate a new .exe with coff2exe
> (or if you have only the .exe first exe2coff, strip and then
> coff2exe). This works even with executables that are acidentally
> distributed unstripped (jpeg386 did that at one point, I think).
> 
> bye, Alexander
> 

Some standard functions are much larger than others:
printf() smacks 30k extra. Use puts() instead if possible.
Compiling with -ffast-math , -fomit-frame-pointer reduces 
size too. (Of course, these switches carry their own attendant
dangers).
But really, the size problem isn't too bad. There's a bare minimum
of around 50k for the extender code, but the PMODE 2.5 assembly
extender by Tran (Thomas Pytel), the best freeware assembly extender 
around, also adds 30k extra to the .exe file. So much for the 
compactness of assembler. 
I think a lot of dead weight after that comes from certain standard
C functions like printf(), and the error-handling associated
with them. Trial and error should show which ones are the worst.

-Elliott

- Raw text -


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