www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1996/09/23/10:40:13

Message-ID: <32475B30.5E66@spy.isp.nsc.ru>
Date: Mon, 23 Sep 1996 20:53:20 -0700
From: Ryzhenkov Ilya <ilya AT spy DOT isp DOT nsc DOT ru>
Organization: ISPh SB RAS
MIME-Version: 1.0
To: DJGPP Mailing List <djgpp AT delorie DOT com>
Subject: Structure package problems

I was creating an application to dump object (.o) file structure
 (similar to objdump) mainly to understand coff format. I've included
 coff.h and just used open,read,lseek in binary mode to read data in the
 structures of coff.h types (SYMENT,FILHDR etc). Things was completely
 messed up! (It was mainly in SYMENT struct)
 Yes, I've read the FAQ and added the following lines :

#pragma pack(1)
#include <coff.h>
#pragma pack()

 All becomes fine. No bugs, no data messing. But ....

 Is it so necessary to force user to overcome that very things ? Can
 #pragma statements can be placed in the coff.h (and similar files) ?
 How BFD was compiled ? Was -fpack-struct was used or it was smth other ?

 Or maybe I'm missing something important ? Some idea ? 
 Is it a bug ? (FAQ says that compiler incorrectly process tails of structs
 even if __attribute__((packed)) is used, but in <coff.h> for example that
 attribute was used for a few fields).

							Sincerely yours, Ilya

 P.S. IMHO, DJ have to put COFF-related materials on to his www page. ;)
-----------------------------------------------------------------------------
mailto://ilya AT spy DOT isp DOT nsc DOT ru                            http://spy.isp.nsc.ru
on IRC (EFNet) as "Orangy" usually on #mirc #novosibirsk or somewhere else ;)

- Raw text -


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