Commit 518f32221af7 "linux-user: Fix qemu-arm to run static armhf binaries" added brk value adjustment to interpreter brk value after loading the interpreter. Unfortunately this broke aarch64, ppc64el and s390x emulation, - the error which we had on armhf now happens on at least these 3 architectures. For the time being, limit the adjustment to aarch32 case only (where the prob originally observed), to be analyzed in more details later.
This is a quick band-aid, not a real fix. Signed-off-by: Michael Tokarev <m...@tls.msk.ru> --- linux-user/elfload.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/linux-user/elfload.c b/linux-user/elfload.c index 88c6861d7d..08e09b6863 100644 --- a/linux-user/elfload.c +++ b/linux-user/elfload.c @@ -3617,15 +3617,18 @@ int load_elf_binary(struct linux_binprm *bprm, struct image_info *info) } if (elf_interpreter) { load_elf_interp(elf_interpreter, &interp_info, bprm->buf); +#if defined(TARGET_ARM) && !defined(TARGET_AARCH64) +/* FIXME: this breaks aarch64, ppc64el, s390x, hence the #if for now */ /* * adjust brk address if the interpreter was loaded above the main * executable, e.g. happens with static binaries on armhf */ if (interp_info.brk > info->brk) { info->brk = interp_info.brk; } +#endif /* If the program interpreter is one of these two, then assume an iBCS2 image. Otherwise assume a native linux image. */ -- 2.39.2