I removed ld.so.cache to experiment, and indeed a trivial "hello
world"
program in C works:
#include <stdio.h>
int main(){
printf("hello\n");
return 0;
}
(surprisingly, after regenerating ld.so.cache, it keeps working. To make
things simpler, I don't have any ld.so.cache for the rest of this message)
However, the C++ version fails (and almost all C++ programs fail
similarly):
#include <iostream>
int main(){
std::cout << "hello\n";
return 0;
}
$ qemu-ppc-static cxx
Invalid data memory access: 0xfffffff4
NIP 0ff65648 LR 0ff65620 CTR 0ff65610 XER 00000000
MSR 00006040 HID0 00000000 HF 00006000 idx 0
TB 00000000 00000000
GPR00 000000000ff66164 00000000f6fff450 00000000f67cf4a0 00000000f6fff478
GPR04 0000000010010b58 0000000000000006 00000000fefefeff 000000007f7f7f7f
GPR08 0000000000008080 0000000000000000 0000000000000000 00000000f6fff3f0
GPR12 0000000022000082 0000000010018b58 0000000000000000 0000000000000000
GPR16 0000000000000000 0000000000000000 0000000000000000 0000000000000000
GPR20 0000000000000000 0000000000000000 0000000000000000 0000000000000000
GPR24 0000000000000000 0000000010000910 0000000000000006 00000000f6fff478
GPR28 00000000f67fe018 0000000010000910 000000000ffef904 00000000f6fff478
CR 42000080 [ G E - - - - L - ] RES ffffffff
FPR00 3f847ae140000000 0000000000000000 0000000000000000 0000000000000000
FPR04 0000000000000000 0000000000000000 0000000000000000 0000000000000000
FPR08 0000000000000000 0000000000000000 0000000000000000 0000000000000000
FPR12 0000000000000000 3ff0000000000000 0000000000000000 0000000000000000
FPR16 0000000000000000 0000000000000000 0000000000000000 0000000000000000
FPR20 0000000000000000 0000000000000000 0000000000000000 0000000000000000
FPR24 0000000000000000 0000000000000000 0000000000000000 0000000000000000
FPR28 0000000000000000 0000000000000000 0000000000000000 0000000000000000
FPSCR 00000000
qemu: uncaught target signal 11 (Segmentation fault) - core dumped
Unrelated, but I tried generating a static binary to test, and noticed
that the binfmt for qemu didn't recognize that binary. `file` identifies
it as:
ELF 32-bit MSB executable, PowerPC or cisco 4500, version 1 (GNU/Linux)
instead of:
ELF 32-bit MSB executable, PowerPC or cisco 4500, version 1 (SYSV)
I had to manually call qemu-ppc-static (and it failed like the dynamic
version). Should this format be added to binfmt, or did I mess up getting
such a binary?
--
Marc Glisse
--
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org