www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1996/08/16/04:00:54

Xref: news2.mv.net comp.os.msdos.djgpp:7349
From: malcolm AT manawatu DOT gen DOT nz (Malcolm Taylor)
Newsgroups: comp.os.msdos.djgpp
Subject: Re: DJGPP's .exe's are TOO large
Date: Thu, 15 Aug 1996 21:27:05 GMT
Organization: Grafik Software
Lines: 44
Message-ID: <4v08s6$ob9@news.manawatu.gen.nz>
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> <3210B921 DOT 5CCE AT stud DOT warande DOT ruu DOT nl>
Reply-To: malcolm AT manawatu DOT gen DOT nz
NNTP-Posting-Host: malcolm.manawatu.gen.nz
Mime-Version: 1.0
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

Elliott Oti <e DOT oti AT stud DOT warande DOT ruu DOT nl> wrote:
>Alexander Lehmann wrote:
>> : Another little trick is to strip your Coff files.  Gcc adds some

The easiest way to do this is:
	gcc -s -o name.exe
Which will strip it before it gets stubbed.

>But really, the size problem isn't too bad. There's a bare minimum
>of around 50k for the extender code, 

The overhead code is only around 20K if I remember right if you
remember to define a few empty functions (see the FAQ section
referenced earlier in this thread).
Also never go past DJP. This has extremely good compression ratios for
an exe packer, and can get your exe quite small.

>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. 

Actually PMODE adds 15K to your exe file. I have actually myself
packed this executable as well gaining another 5K. Note though that
packing the PMODE stub means the program cannot be spawned by other v2
apps anymore (I don't know why though :).

>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.

If you're still looking for space after that you can always get the
library sources and modify the functions that you use to remove some
of the 'unecessary stuff' like error handling :-). I used mkdir in my
prog and had 8K extra linked in just for the error handling and access
functions it used. For my prog I didn't need this, so I lost the 8K
again just by recompiling the function.

As a testamony I have written a fully functional archiver that is only
50K long. This is shorter than most of the others I have seen, and
they don't even use protected-mode! 

Malcolm

- Raw text -


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