Xref: news2.mv.net comp.os.msdos.djgpp:7222 From: Elliott Oti 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> <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 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit 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