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: Adhemerval Zanella <adhemerval dot zanella at linaro dot org>
- To: Zack Weinberg <zackw at panix dot com>
- Cc: GNU C Library <libc-alpha at sourceware dot org>
- Date: Fri, 6 Mar 2020 13:19:48 -0300
- Subject: Re: [PATCH] sparc: Move sigreturn stub to assembly
- References: <20200305192203.30217-1-adhemerval.zanella@linaro.org> <CAKCAbMgFF6z=7fHR_j7jgsx9d=aJad7AXFetYni901hKFM1yoQ@mail.gmail.com>
On 05/03/2020 18:34, Zack Weinberg wrote:
> 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
>
Ack, I pushed with your suggestion plus the URL link.