From: Richard Henderson <richard.henderson@linaro.org>
To: "Peter Maydell" <peter.maydell@linaro.org>,
"QEMU Developers" <qemu-devel@nongnu.org>,
"Laurent Vivier" <lvivier@redhat.com>,
"Alex Bennée" <alex.bennee@linaro.org>
Subject: Re: simple aarch64 binary can cause linux-user QEMU to segv in zero_bss()
Date: Tue, 24 Nov 2020 09:18:12 -0800 [thread overview]
Message-ID: <8e6cbc1f-82a5-1cd7-cdf3-59ab45c6d189@linaro.org> (raw)
In-Reply-To: <CAFEAcA_=RGziK6H4Pip+heE3JfjTYaZgrTgkwM=tNTwsqvuLfg@mail.gmail.com>
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-steplong@quicinc.com/
r~
next prev parent reply other threads:[~2020-11-24 17:22 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-11-23 19:52 simple aarch64 binary can cause linux-user QEMU to segv in zero_bss() Peter Maydell
2020-11-24 17:18 ` Richard Henderson [this message]
2020-11-24 17:31 ` Peter Maydell
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=8e6cbc1f-82a5-1cd7-cdf3-59ab45c6d189@linaro.org \
--to=richard.henderson@linaro.org \
--cc=alex.bennee@linaro.org \
--cc=lvivier@redhat.com \
--cc=peter.maydell@linaro.org \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).