www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/02/26/08:16:49

Date: Wed, 26 Feb 1997 14:56:44 +0200 (IST)
From: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
To: Aubrey Millard <aubrey AT golden DOT net>
cc: djgpp AT delorie DOT com
Subject: Re: Size of .exe Why so BIG???
In-Reply-To: <33136158.7725@golden.net>
Message-ID: <Pine.SUN.3.91.970226144742.10395D-100000@is>
MIME-Version: 1.0

On Tue, 25 Feb 1997, Aubrey Millard wrote:

> Try running "strip". Just type  strip foo.exe  or whatever your program

I would like to point out that the current version of `strip' has a known 
bug/misfeature when you run it on a .exe file: it replaces the stub 
prepended to the program by its own stub hard-coded inside `strip'.  
Thus, if the original program was stub-edited to change, e.g. the size of 
the transfer buffer or the maximum stack size, you lose those changes 
when you strip the .exe.  Also, the stub embedded inside `strip' is an
old, pre-v2.01 stub; in particular, it exhibits the bug with the empty 
PATH, and its diagnostics in case of load errors is less extensive.

Work-around?  Run strip on raw COFF file, then prepend the stub to it:

	gcc -o foo foo.c bar.c ...
	strip foo
	stubify foo
or
	gcc -s -o foo foo.c bar.c ...
	stubify foo

If you already have foo.exe, convert to COFF first:

	exe2coff foo.exe
	strip foo
	stubify foo
	del foo

- Raw text -


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