Mail Archives: djgpp/1997/08/04/19:39:50

From: James MacDonald <trill AT netbook DOT demon DOT co DOT uk>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: what's the size of the DJGPP stub + .EXE header?
Date: Mon, 4 Aug 1997 12:47:13 +0100
Organization: Trills and Technologies
Distribution: world
Message-ID: <>
References: <33E4A623 DOT 3A94FC62 AT execulink DOT com>
MIME-Version: 1.0
Lines: 18
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

In article <33E4A623 DOT 3A94FC62 AT execulink DOT com>, Jeff Weeks
<pweeks AT execulink DOT com> scribbled :
>I need to know the size of the DJGPP stub plus the .EXE header.  In most
>compilers, to get a flat binary file, you simply strip the first 512
>bytes (which would be the .EXE header) from the resultant executable.
>In DJGPP you can't do this though because of the stub (correct?), so I
>need to know the size of the stub, so that I can strip it from the
>executable to get a flat binary file.

DJGPP produces COFF files, which are executable on some Unices. Then it
adds a stub to load the COFF file and execute it in DOS.

The size of the stub, in bytes, is 2048 for DJGPP 2.00 (assemble
src/stub/stub.asm and DIR) - strip it and you have a flat binary.

Look at stubify.c and exe2coff.c, especially the latter.

- Raw text -

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