This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH] sparc: Move sigreturn stub to assembly
- From: Zack Weinberg <zackw at panix dot com>
- To: Adhemerval Zanella <adhemerval dot zanella at linaro dot org>
- Cc: GNU C Library <libc-alpha at sourceware dot org>
- Date: Thu, 5 Mar 2020 16:34:31 -0500
- Subject: Re: [PATCH] sparc: Move sigreturn stub to assembly
- References: <20200305192203.30217-1-adhemerval.zanella@linaro.org>
On Thu, Mar 5, 2020 at 2:22 PM Adhemerval Zanella
<adhemerval.zanella@linaro.org> wrote:
>
> As indicated by kernel developers [1], the sigreturn stub can not change
> the register window or the stack pointer since the kernel has setup the
> restore frame at a precise location relative to the stack pointer when
> the stub is invoked.
>
> I tried to play with some compiler flags and even with _Noreturn and
> __builtin_unreachable after the asm does not help (and Sparc does not
> support naked functions).
>
> To avoid similar issues, as the stack-protector support also have
> stumbled, this patch moves the implementation of the sigreturn stubs to
> assembly.
Could you add a comment explaining this to each of the new .S files?
"This function must not change the register window or the stack
pointer" would be enough, I think. Maybe include the URL for [1].
zw