Le 20/03/2022 à 06:22, WANG Xuerui a écrit :
The MIPS n32 ABI is basically n64 with the address space (i.e. pointer
width) shrinked to 32 bits. Meanwhile the current code treats it as
o32-like based on TARGET_ABI_BITS, which causes problems with n32
syscalls utilizing 64-bit offsets, like pread64, affecting most (if not
all) recently built n32 binaries.

This partially solves issue #909 ("qemu-mipsn32(el) user mode emulator
fails to execute any recently built n32 binaries"); with this change
applied, the built qemu-mipsn32el is able to progress beyond the
pread64, and finish _dl_start_user for the "getting ld.so load libc.so"
case. The program later dies with SIGBUS, though, due to _dl_start_user
not maintaining stack alignment after removing ld.so itself from argv,
and qemu-user starting to enforce alignment recently, but that is
orthogonal to the issue here; the more common case of chrooting is
working, verified with my own-built Gentoo n32 sysroot. (Depending on
the exact ISA used, one may have to explicitly specify QEMU_CPU, which
is the case for my chroot.)

Buglink: https://gitlab.com/qemu-project/qemu/-/issues/909
Signed-off-by: WANG Xuerui <xe...@gentoo.org>
Cc: Laurent Vivier <laur...@vivier.eu>
Cc: Philippe Mathieu-Daudé <f4...@amsat.org>
Cc: Jiaxun Yang <jiaxun.y...@flygoat.com>
Cc: Andreas K. Hüttel <dilfri...@gentoo.org>
---

P.S. This patch is done with my Gentoo hat on, so I'm not using my
usual xen0n.name address. I'd like to add a mailmap entry for correct
shortlog display though, but it seems there's no category for "merely
preference" mappings yet. What should I do in this case?

  linux-user/user-internals.h | 6 +++---
  1 file changed, 3 insertions(+), 3 deletions(-)



Applied to my linux-user-for-7.0 branch.

Thanks,
Laurent


Reply via email to