X-Authentication-Warning: delorie.com: mail set sender to djgpp-bounces using -f Date: Mon, 08 Nov 2004 12:52:26 +0100 From: Manuel Collado User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.4) Gecko/20030624 Netscape/7.1 (ax) X-Accept-Language: en-us, en MIME-Version: 1.0 Newsgroups: comp.os.msdos.djgpp Subject: Re: Reducing size of executables in binary distributions References: <418b6a02 AT news DOT upm DOT es> <01c4c360$Blat.v2.2.2$fe8321e0 AT zahav DOT net DOT il> In-Reply-To: <01c4c360$Blat.v2.2.2$fe8321e0@zahav.net.il> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit NNTP-Posting-Host: 138.100.10.20 Message-ID: <418f5e01@news.upm.es> X-Trace: 8 Nov 2004 12:52:33 +0100, 138.100.10.20 Lines: 64 To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Reply-To: djgpp AT delorie DOT com Eli Zaretskii wrote: >>Date: Fri, 05 Nov 2004 12:54:37 +0100 >>From: Manuel Collado >> >>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). That's exactly what I wanted to know. > >>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). "make djgpp-debug". It gives me a 637,780 bytes gawk.exe file. > >>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 was speaking about the difference between the executable in the *s.zip file and the executable rebuilt from sources: 324,608 - 294,912 = 29,696 > > I usually strip a binary like this: > > exe2coff gawk.exe > strip gawk > stubify gawk Thanks for the hint. Now I understand why 'strip *.exe' sometimes further reduces the size of the already stripped executable by 2KB, but not always. Thanks, again. -- To reply by e-mail, please remove the extra dot in the given address: m.collado -> mcollado