Mail Archives: djgpp/2001/08/03/11:19:54
> 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 -