]> xenbits.xensource.com Git - qemu-xen.git/commit
linux-user: Fixes for zero_bss
authorRichard Henderson <richard.henderson@linaro.org>
Wed, 30 Aug 2023 20:33:54 +0000 (13:33 -0700)
committerRichard Henderson <richard.henderson@linaro.org>
Wed, 18 Oct 2023 22:32:16 +0000 (15:32 -0700)
commite6e66b03287331abc6f184456dbc6d25505590ec
tree39bcf5f9f0af8f4e3a3f1eab514d1ecd30b2d5f3
parentec6f9f135d5e5596ab0258da2ddd048f1fd8c359
linux-user: Fixes for zero_bss

The previous change, 2d385be6152, assumed !PAGE_VALID meant that
the page would be unmapped by the elf image.  However, since we
reserved the entire image space via mmap, PAGE_VALID will always
be set.  Instead, assume PROT_NONE for the same condition.

Furthermore, assume bss is only ever present for writable segments,
and that there is no page overlap between PT_LOAD segments.
Instead of an assert, return false to indicate failure.

Cc: qemu-stable@nongnu.org
Resolves: https://gitlab.com/qemu-project/qemu/-/issues/1854
Fixes: 2d385be6152 ("linux-user: Do not adjust zero_bss for host page size")
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
linux-user/elfload.c