www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1999/06/08/08:12:55

Date: Tue, 8 Jun 1999 11:59:13 +0300 (IDT)
From: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
X-Sender: eliz AT is
To: Brian Palmer <brianp AT sginet DOT com>
cc: djgpp AT delorie DOT com
Subject: Re: ld & flat binaries
In-Reply-To: <375C62B6.95561B1F@sginet.com>
Message-ID: <Pine.SUN.3.91.990608115851.4197W-100000@is>
MIME-Version: 1.0
Reply-To: djgpp AT delorie DOT com
X-Mailing-List: djgpp AT delorie DOT com
X-Unsubscribes-To: listserv AT delorie DOT com

On Mon, 7 Jun 1999, Brian Palmer wrote:

> I am trying to make a flat binary with no stub or anything like that
> using DJGPP.

If you don't name a target that has a .exe suffix, GCC won't prepend a
stub to it.  Even if it does, EXE2COFF will remove it and leave you
with a raw COFF executable.

As for ``anything like that'', I don't know what else do you need to
avoid in the ``flat binary''.  Please elaborate.  In general, DJGPP
programs have some DPMI-specific stuff in the startup code as well,
and if you don't want that, you will have to rewrite the crt0 code.

> Also is there a way that I can put on my own stub?

Latest versions of Binutils have an environment variable that you can
point to your stub, and then that stub will be used.

But I think you have a much more complex problem on your hands than
just replacing the stub, if you want a boot loader, because at boot
time none of the DPMI stuff works yet, and the startup code (not only
the stub) depends on DPMI calls to set up the program for execution.

- Raw text -


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