www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2001/08/03/11:19:54

Date: Fri, 3 Aug 2001 11:19:09 -0400
Message-Id: <200108031519.LAA30756@delorie.com>
X-Authentication-Warning: delorie.com: eliz set sender to eliz AT delorie DOT com using -f
From: Eli Zaretskii <eliz AT delorie DOT com>
To: "Michael Farnham" <mcfarnham DOT notme AT prodigy DOT net>
CC: djgpp AT delorie DOT com
In-reply-to: <Ucya7.1286$CE6.360924388@newssvr15.news.prodigy.com>
(mcfarnham DOT notme AT prodigy DOT net)
Subject: Re: Files created by gcc/g77
References: <3B6906F5 DOT 98FAB93A AT sandia DOT gov> <7458-Fri03Aug2001112601+0300-eliz AT is DOT elta DOT co DOT il> <Ucya7.1286$CE6 DOT 360924388 AT newssvr15 DOT news DOT prodigy DOT com>
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

> From: "Michael Farnham" <mcfarnham DOT notme AT prodigy DOT net>
> Newsgroups: comp.os.msdos.djgpp
> Date: Fri, 03 Aug 2001 14:05:40 GMT
> 
> "Eli Zaretskii" <eliz AT is DOT elta DOT co DOT il> wrote in message news:7458-
> > In the meantime, if you want to get rid of the garbage, I
> > suggest to create programs like this:
> >
> >    gcc -o foo foo.c
> >    stubify foo
> 
> Eli
> 
> This is the second time I have seen the suggestion that we
> should run stubify to remove garbage from our executables.
> My experiments seem to show that running stubify after
> the compile and link processes does not make any difference.

Running stubify doesn't matter if the input file already has a stub.
But in the above procedure, `foo' doesn't have a stub, because I said
"-o foo", not "-o foo.exe".

> The only references to stubify I could find in the
> documentation were in the FAQ. These references seem to
> imply that stubify is automatically run during the
> compilation process.

This depends on the version of Binutils you have installed and on the
particulars of the command line you use to link the program.  Some
combinations indeed run stubify on the raw COFF image.

However, please note that if the file produced by the linker already
has a stub, running stubify on it is a no-op.

> I also created a simple C program and compiled it using
> the command line "gcc foo.c -o foo.exe". After the compile
> and link process completed I created a copy of foo.exe
> named foo1.exe. I ran stubify on foo.exe and then did a
> file compare on foo.exe and foo1.exe and there were no
> differences. What am I missing?

Please see the commands I posted: they didn't say "-o foo.exe", they
said "-o foo".  The former produces a stubbed executable, because the
linker knows about the stub.

- Raw text -


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