Message-ID: <329B8876.2AA3@pobox.oleane.com> Date: Wed, 27 Nov 1996 01:16:54 +0100 From: Francois Charton Organization: CCMSA MIME-Version: 1.0 To: djgpp AT delorie DOT com Subject: a.out format and objcopy Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit As promised yesterday, here are the results of a few experiments with objcopy, and a.out format. I tested all of this on a *very* simple "Hello world" program, namely #include int main(void) { printf("Hello world\n"); return 0; } I compiled it using gcc -o hello.o -c hello.c at this stage I get a COFF format hello.o object when I link it (gcc -o hello.exe hello.o) everything runs allright Then I tried using objcopy, to change my hello.o COFF object into an a.out object (which, the manual says, DJGPP ld also understands). The command line was objcopy -O a.out-i386 hello.o hello2.o I then tried to link gcc -o hello2.exe hello2.o so far so good, except that the resulting program crashed on a SIGSEV fault. Then, I tried to translate hello2.o back to coff format, saying objcopy -O coff-go32 hello2.o hello3.o -> obj copy complained at this point about aoutx.h (a file in the BFD source) and then I tried to rebuild hello3.exe, it worked, but the resulting program also crashed. To me, this is a problem with the implementation of a.out in BFD... Or did I do something wrong using objcopy? Francois