[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Gas compilation, question about binary formats..
- To: misc_(_at_)_openbsd_(_dot_)_org
- Subject: Gas compilation, question about binary formats..
- From: SONKOLY Pal <phaul_(_at_)_inf_(_dot_)_elte_(_dot_)_hu>
- Date: Fri, 16 Apr 2004 14:09:58 +0200 (CEST)
Hi!
I have decided to compile the following assembly program, but
didn't succeed. My first question is WHY? What's wrong with the
followings? The second question is which binary form to use.
I mean
$ objdump -i
BFD header file version 2.11.2
elf32-i386
(header little endian, data little endian)
i386
a.out-i386-netbsd
(header little endian, data little endian)
i386
elf32-little
(header little endian, data little endian)
i386
elf32-big
(header big endian, data big endian)
i386
srec
(header endianness unknown, data endianness unknown)
i386
symbolsrec
(header endianness unknown, data endianness unknown)
i386
tekhex
(header endianness unknown, data endianness unknown)
i386
binary
(header endianness unknown, data endianness unknown)
i386
ihex
(header endianness unknown, data endianness unknown)
i386
netbsd-core
(header endianness unknown, data endianness unknown)
elf32-i386 a.out-i386-netbsd elf32-little elf32-big srec
i386 elf32-i386 a.out-i386-netbsd elf32-little elf32-big srec
symbolsrec tekhex binary ihex netbsd-core
i386 symbolsrec tekhex binary ihex -----------
but the only one that seemed to be openbsd binary is a.out-i386-netbsd.
Curiously the others (elf s) are linux binaries. I surely know
becouse
#sysctl -w kern.emul.linux=1
and they began working.
So what binary format is appropriate?
Here is a dump of my doings:
$ uname -a
OpenBSD phoenix.local 3.4 PHOENIX#7 i386
$ cat proba.S
.global _start
_start:
pushl $0x0
movl $0x1,%eax
int $0x80
ret
$ as -o proba.o proba.S
$ ld --oformat a.out-i386-netbsd -o proba -s proba.o
$ ./proba
Segmentation fault (core dumped)
Visit your host, monkey.org