[klibc] sparc: Set sa_restorer for signals and disable executable stack
authorBen Hutchings <ben@decadent.org.uk>
Thu, 30 Apr 2020 12:56:47 +0000 (13:56 +0100)
committerBen Hutchings <benh@debian.org>
Fri, 30 Apr 2021 01:05:23 +0000 (02:05 +0100)
commit303ae3fe422adcf24986430f047162cd7f366b1a
tree567816bb1988ae259fb86be2c96b41efc443dae9
parent921cc68bf1ee9d0344df57fffb6ac187c5a38afb
[klibc] sparc: Set sa_restorer for signals and disable executable stack

Origin: https://git.kernel.org/pub/scm/libs/klibc/klibc.git/commit/?id=05350b72cace18417c1ba00c4796a5e19ebb908b

sparc allows specifiying a signal restorer in the usual way.  We
should do this to avoid needing an executable stack.

* Define a __sigreturn() routine that calls rt_sigreturn
* Force the SA_RESTORER flag on for all signal handlers, and set
  __sigreturn as the restorer if none is already set
* Force the SA_SIGINFO flag on for all signal handlers, so that we can
  always return from them with rt_sigreturn
* Set KLIBCEXECSTACK=n

Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
Gbp-Pq: Name 0005-klibc-sparc-Set-sa_restorer-for-signals-and-disable-.patch
usr/include/arch/sparc/klibc/archconfig.h
usr/klibc/SYSCALLS.def
usr/klibc/arch/sparc/MCONFIG