delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2004/11/05/13:03:03

X-Authentication-Warning: delorie.com: mail set sender to djgpp-bounces using -f
Date: Fri, 05 Nov 2004 19:56:59 +0200
From: "Eli Zaretskii" <eliz AT gnu DOT org>
Sender: halo1 AT zahav DOT net DOT il
To: djgpp AT delorie DOT com
Message-ID: <01c4c360$Blat.v2.2.2$fe8321e0@zahav.net.il>
X-Mailer: emacs 21.3.50 (via feedmail 8 I) and Blat ver 2.2.2
In-reply-to: <418b6a02@news.upm.es> (message from Manuel Collado on Fri, 05
Nov 2004 12:54:37 +0100)
Subject: Re: Reducing size of executables in binary distributions
References: <418b6a02 AT news DOT upm DOT es>
Reply-To: djgpp AT delorie DOT com
Errors-To: nobody AT delorie DOT com
X-Mailing-List: djgpp AT delorie DOT com
X-Unsubscribes-To: listserv AT delorie DOT com

> Date: Fri, 05 Nov 2004 12:54:37 +0100
> From: Manuel Collado <m DOT collado AT aaron DOT ls DOT fi DOT upm DOT es>
> 
> Is there a recommended practice for reducing the size of executables in 
> binary distributions of utilities compiled with DJGPP?
> 
> I'm aware of 'strip', but it does a small size reduction, and seems not 
> to be generally applied in DJGPP binary packages. There is also UPX, but 
> i've never used it. And yes, I've read the FAQ, but what I'm asking here 
> is not what can be done, but what the DJGPP porters usually do.

The *b.zip distributions should come with stripped binaries.  Your
testing indicates that it is indeed so, at least for the Gawk
distributions (see below).

> I've checked 'gawk' by rebuilding myself from sources. The sizes in 
> bytes, for version 3.1.1, are:
> 
> 294.912  gawk.exe from gwk311b.zip
> 324.608  gawk.exe compiled from gwk311s.zip
> 
> Applying 'strip' gives 292.864 and 322.560 bytes, respectively.

That's because the binary that is built by the default Make command is
stripped (the linker is invoked with the -s switch).  To build a
non-stripped version, say "make debug" (or some such, I don't remember
exactly).

> Perhaps the difference in sizes is due to different compiler/library 
> versions.

No, the difference is only 2KB and is due to different ways the binary
was stripped and/or different Binutils version (`strip' is part of
Binutils).  The 2K difference is due to alignment considerations (it's
a long story).

I usually strip a binary like this:

   exe2coff gawk.exe
   strip gawk
   stubify gawk

- Raw text -


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