Message-ID: <32475B30.5E66@spy.isp.nsc.ru> Date: Mon, 23 Sep 1996 20:53:20 -0700 From: Ryzhenkov Ilya Organization: ISPh SB RAS MIME-Version: 1.0 To: DJGPP Mailing List Subject: Structure package problems Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit 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 #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 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 ;)