On 11/23/20 11:52 AM, Peter Maydell wrote:
> Somebody reported this on stackoverflow. Before I spend too
> much time thinking about how this ought to work, does anybody
> have the elfload.c intended operation in their head still?
> Bug description and analysis of what goes wrong below:
> 
> https://stackoverflow.com/questions/64956322/alignment-requirements-for-arm64-elf-executables-run-in-qemu-assembled-by-gas
> 
> Given this trivial asm:
> 
> ===begin program.s===
> // GNU Assembler, ARM64 Linux
> 
> .bss
> 
> .lcomm ARRAY, 16
> 
> .text
> 
> .global _start
> 
> _start:
>     mov x8, 93 // exit sys num
>     mov x0, 0 // success
>     svc 0
> ===endit===

...

> Should we try to get the SEGV handler working earlier in initialization
> (it's pretty hairy machinery so that could be tricky) or should
> elfload.c be mprotect()ing things appropriately itself?

elfload should be handling this.

I believe this should be fixed by

https://patchew.org/QEMU/20201118165206.2826-1-stepl...@quicinc.com/


r~

Reply via email to