Hi Richard,
Thanks for putting this all together!
I'll test asap.
I haven't checked yet, but Akihiko did send a revised v2 patch
series, while my v6 series included his older v1 patches.
We should consider his latest series...
One other thing below....
On 8/3/23 03:53, Richard Henderson wrote:
From: Helge Deller <[email protected]>
While we attempt to load a ET_DYN executable far away from
TASK_UNMAPPED_BASE, we are not completely in control of the
address space layout. If the interpreter lands close to
the executable, leaving insufficient heap space, move brk.
Signed-off-by: Helge Deller <[email protected]>
[rth: Re-order after ELF_ET_DYN_BASE patch so that we do not
"temporarily break" tsan, and also to minimize the changes required.
Remove image_info.reserve_brk as unused.]
Signed-off-by: Richard Henderson <[email protected]>
---
linux-user/qemu.h | 1 -
linux-user/elfload.c | 51 +++++++++++++-------------------------------
2 files changed, 15 insertions(+), 37 deletions(-)
...
@@ -3229,7 +3208,8 @@ static void load_elf_image(const char *image_name, int
image_fd,
info->end_code = 0;
info->start_data = -1;
info->end_data = 0;
- info->brk = 0;
+ /* Usual start for brk is after all sections of the main executable. */
+ info->brk = TARGET_PAGE_ALIGN(hiaddr);
This is from my original patch, and is probably wrong.
I think this needs to be:
info->brk = HOST_PAGE_ALIGN(hiaddr);
The brk page needs to be aligned to the host page size variable (which
is always >= target page size).
The page will be mapped +rw (on host), so may need the distance to code/shared
libs below it, and for that distance target-alignment may not be sufficient.
I think this fixes the problem which joel faced with armel static binary
on ppc64le.
Helge