Mail Archives: djgpp/2004/11/05/13:03:03
> 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 -