Re: linux-user/elfload.c: Seeing a segfault in qemu with a binary with no data section

2020-11-02 Thread Stephen Long
Ahh whoops, I see the actual intended change was to replace "eppnt->p_filesz != 0" with "vaddr_len != 0", which isn't on master. Thanks, Stephen

Re: linux-user/elfload.c: Seeing a segfault in qemu with a binary with no data section

2020-11-02 Thread Stephen Long
I think that a variant of that patch made it into master: /* * Some segments may be completely empty without any backing file * segment, in that case just let zero_bss allocate an empty buffer * for it. */ if (eppnt->p_fil

Re: linux-user/elfload.c: Seeing a segfault in qemu with a binary with no data section

2020-11-02 Thread Philippe Mathieu-Daudé
On 11/2/20 7:30 PM, Stephen Long wrote: > Hi, we are seeing a segfault in qemu in the following code snippet in > zero_bss(): > > if (host_start < host_map_start) { > memset((void *)host_start, 0, host_map_start - host_start); > } > > The elf doesn't have a data section, so host_start isn't ma

linux-user/elfload.c: Seeing a segfault in qemu with a binary with no data section

2020-11-02 Thread Stephen Long
Hi, we are seeing a segfault in qemu in the following code snippet in zero_bss(): if (host_start < host_map_start) { memset((void *)host_start, 0, host_map_start - host_start); } The elf doesn't have a data section, so host_start isn't mapped. I'm not sure whether this is a qemu issue or the