delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2012/04/28/16:53:02

X-Authentication-Warning: delorie.com: mail set sender to djgpp-bounces using -f
X-Recipient: djgpp AT delorie DOT com
X-Authenticated: #27081556
X-Provags-ID: V01U2FsdGVkX1/NCZxTK17NBdkpaDsX8b0ZWYK2pnf1fnqpHeI9E1
4sdc6PTue080x6
From: Juan Manuel Guerrero <juan DOT guerrero AT gmx DOT de>
To: djgpp AT delorie DOT com
Subject: DJGPP stub length and the value of COFF file header pointers of executable files.
Date: Sat, 28 Apr 2012 22:47:47 +0200
User-Agent: KMail/1.9.10
MIME-Version: 1.0
Message-Id: <201204282247.47841.juan.guerrero@gmx.de>
X-Y-GMX-Trusted: 0

I have observed that the symbol table pointer (aka FILHDR.f_symptr) stored in
the COFF file header of an *executable* file seems not to account for the size
of the DJGPP specific stub.  This means that if I try to access the symbol table
or the string table following the symbol table I always read wrong data because
the pointer (or offset) I take from the file header is 0x0800 bytes to short.
Is this intentional or am I missing something?  Must all pointers be manually
adjusted by the user before they can be used to access different file sections
or tables?  (cygwin executables adjust these pointers to accont for their 0x0080
bytes long MSDOS specific header.) For pure object files (aka assembler output)
every thing is OK.  This is clear because here no stub is present so that the
file beginning is identical with the file header beginning from where all
offsets are computed.
I have verified this behaviour with different binutils versions, so this
behaviour is certainly not a bug introduced by my latest port.
Can some clarify this issue.

TIA
Juan M. Guerrero

PS: I am not lobbying to change the current behaviour,
I only want to understand it.  I took all information
about COFF and DJGPP from 
  <http://www.delorie.com/djgpp/doc/coff/>

- Raw text -


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