As mentioned in the subject, I'm trying to get qemu-i386 (from qemu-2.7.0) user space emulation working on an amd64 NetBSD (7.0). Unfortunately, even giving a try to a 32bit binary printing "hello world" gives a segfault. Hopefully, it's me who's doing something wrong. I just compiled a simple hello world both with static and dynamic linking like:
clang -static -O2 -m32 -o hello32 hello.c
for static and for dynamic linking like
clang -O2 -m32 -o hello32 hello.c
Then I launch qemu as:
qemu-i386 -L /usr/lib/i386 -bsd NetBSD hello32
and I get a segfault. If I check the core dump file with gdb, then it says:
Program terminated with signal SIGSEGV, segmentation fault.
#0 0x<address> in strchr() from /usr/lib/libc.so.12
The same happens if no options are passed at all. Could any of you tell me what am I doing wrong? Thanks for your help in advance!