Mail Archives: djgpp/1996/09/23/10:40:13
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 -