www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp-workers/1997/06/17/06:04:27

Date: Tue, 17 Jun 1997 12:00:06 +0200 (METDST)
From: Robert Hoehne <robert DOT hoehne AT mathematik DOT tu-chemnitz DOT de>
To: DJ Delorie <dj AT delorie DOT com>
Cc: DJGPP workers <djgpp-workers AT delorie DOT com>
Subject: Re: Latest stub for binutils
In-Reply-To: <199706161215.IAA28174@delorie.com>
Message-Id: <Pine.HPP.3.95q.970617113806.22944A-100000@newton.mathematik.tu-chemnitz.de>
Mime-Version: 1.0

On Mon, 16 Jun 1997, DJ Delorie wrote:

> Because one of these days, the stub will grow to 2.5K.

What do you mean with this? After applying all the patches
to stub.asm which I have seen the last time it is still
2048 bytes (Or have I missed some patches).

Or do you mean, that you are working (or someone else) on
a patch which will grow the stub to 2.5K?

But my opionion in general is, not to grow the stub. If
we relly need some few bytes more we can reduce the size
of the exe header in the stub (I mean here to remove some
duplicated compile time information) and patching djasm
to emit the smallest needed exe header. Currently it
is hardcoded in it to use a 512 byte header, but that's
not needed at all. I have made already a patch at home
which does this with a small limitation, because the
.align directive needs to know the size of the exe header
which can be solved by dynamically resizing the exe header
when seeing a .copyright or .id directive but this needs
the limitation that these directives have to be at the
beginning of the assembler file.

Already for the current stub we can get at least 64 bytes
from the exe header and when removing some id's even more.


Some arithmetic exercises:

The copyright information in the header is about 240 bytes.
The minimal exe header size is 24 bytes. Now one string
indicating the compile time of the string of about 70 bytes
makes all together 334 bytes. Rounding up to 16 bytes boundary
and having some few bytes left will give us a exe header size of
320 bytes which gives us 192 bytes more for the real
stub from the exe header and the currently unused 66 bytes
at the end will give us finally 258 bytes !!!

BTW: If someone didn't know. The exe header must not be
512 byte aligned, it have to be 16 byte aligned.


Robert

- Raw text -


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