This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] sparc: Move sigreturn stub to assembly


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]