Date: Tue, 31 Dec 1996 17:10:27 +0200 (IST) From: Eli Zaretskii To: Ray Duncan cc: djgpp AT delorie DOT com, Robert Hoehne , DJ Delorie Subject: Re: go32 stub In-Reply-To: <5a8j9n$ip2@news1.voicenet.com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII On Mon, 30 Dec 1996, Ray Duncan wrote: > When I strip an executable that has the 10/26/96 version of the stub. > I get an 08/26/96 version of the stub for that executable (See below for > the details). > It seems to me that strip has an 08/26/96 stub contained in it that it uses > when it strips an executable. Yes, `strip' (and all the rest of Binutils) were originally compiled with an older stub built into them, and I guess they weren't recompiled when the stub was changed in the last stages of beta-testing. > 1) Does this create a problem It might, although only in rare cases. But I suggest to not use `strip' at all on .exe programs, since it currently writes the stripped program with the default stub info (like minstack and the rest; use `stubedit' to see all the fields), so if you stubedit a program and then strip it, your edited stub is gone! So my advice is to strip the COFF file and then stubify it, like so: gcc -g -o prog prog.c <... rest of modules here ...> strip prog stubify prog (note "gcc -o prog", not "gcc -o prog.exe"), or, if you only have a .exe, like so: exe2coff prog.exe strip prog stubify prog There is another way to use `strip' on .exe programs and get the latest stub (see below) but IMHO it is too cumbersome and error-prone to be a general solution for most of the users. > 2) Why does it do this? Because GNU Binutils need to know about the structure of DJGPP stubified exe-style programs in order to create them, read the info (sections etc.) from them, transform them to other supported binary formats, etc. The current implementation is to put the stub inside the GNU BFD (binary file description) library which is used by Binutils and GDB. As an alternative, you can set the environment variable STUB to point to the pathname of the stub that you want to be used instead. A modified version of `strip' which can read the stub from the program being stripped (and thus copy the original stub intact) should be available when Robert Hoehne (who ported Binutils 2.7 to DJGPP) has time to do that.