[PATCH] sparc: Move sigreturn stub to assembly

Adhemerval Zanella adhemerval.zanella@linaro.org
Fri Mar 6 16:19:00 GMT 2020



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.



More information about the Libc-alpha mailing list