delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/03/26/06:59:26

Message-ID: <351A42B3.756912F2@cs.joensuu.fi>
Date: Thu, 26 Mar 1998 13:57:39 +0200
From: Eugene Ageenko <ageson AT cs DOT joensuu DOT fi>
MIME-Version: 1.0
To: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>, djgpp AT delorie DOT com
Subject: Re: Strip and Coff2exe. File size increasing!
References: <Pine DOT SUN DOT 3 DOT 91 DOT 980326110402 DOT 29215L-100000 AT is>

Eli Zaretskii wrote:
> 
> On Tue, 24 Mar 1998, Eugene Ageenko wrote:
> 
> > if one compile the program using gcc w/o any special options it
> > produce the either coff (eg. test.) and executable files (test.exe).
> >
> > Now if we apply "strip" to test.exe directly or we apply "strip" to
> > coff file and convert it to exe using "coff2exe" tool we get
> > different results.
> >
> > No wonder, but interesting that if we apply "strip" again to
> > executable, that was produced from "strip'ed" coff file, we get
> > executable that will increased in size.  !?!
> 
> Such problems were known bugs in very old versions of DJGPP.  So
> please post the necessary details when reporting such problems.  In
> this case, the following is required:
> 
>      1) The versions of your GCC and Binutils;

Hey Man!, its me again, I have the LATEST binary distribution og GCC and related tools,
just taken 2 days ago from SimTel. Look there for versions.

gcc 2.8.0  from gcc280b.zip

bnu281b.zip


>      2) Size and time stamps of coff2exe, stubify, ld and strip;

the same, everything from the same package

stbify.exe 112277 06/10/96
strip.exe  326144 15/01/98
ld.exe     317440 31/12/96
coff2exe.bat what you want from .bat file, it runs stubify

>      3) DIR listings of the program after every one of the above
>         methods to strip it.
> 

You get it here, fe have the same examples as in previous my messages:
test.c, module.c, module.h.

=========================

(my command started with $)

$gcc test.c module.c -o test
$dir

TEST                82 869  26.03.98  13:39 test
TEST     EXE        84 917  26.03.98  13:39 test.exe

$strip test.exe
$dir

TEST                82 869  26.03.98  13:39 test
TEST     EXE        38 552  26.03.98  13:40 test.exe

# now let's use different tactic

$strip test
$coff2exe test

TEST                34 456  26.03.98  13:41 test
TEST     EXE        36 504  26.03.98  13:41 test.exe

# A-ha! 36504
# But ....

$strip test.exe
$dir

TEST     EXE        38 552  26.03.98  13:41 test.exe

# 38552 again

=================

Now the question - Is this RIGHT, that file size increaes?

Logic says NO.

> Btw, what happens if you add -s to the link command line?

In case of that it is 36504, bacuse the coff file is stripped not the .exe

but if we now run

$strip test.exe

it will increased to 38552 again.


So, the QUESTION is following:

Is it right that file size of stripped executable is larger that file size of
executable produced from stripped coff file?

And also: why file size increases when we try to strip executable produced
from already stripped coff file??? 


Regards: Eugene Ageenko

- Raw text -


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