[14/14] sparc: do not stack-protect the sigreturn handler.

Message ID 1456270777-9083-15-git-send-email-nix@esperi.org.uk
State New, archived
Headers

Commit Message

Nix Feb. 23, 2016, 11:39 p.m. UTC
  From: Nick Alcock <nick.alcock@oracle.com>

This is called from the kernel and must not have a canary.

v2: New.
---
 sysdeps/unix/sysv/linux/sparc/sparc32/Makefile | 7 +++++++
 sysdeps/unix/sysv/linux/sparc/sparc64/Makefile | 7 +++++++
 2 files changed, 14 insertions(+)
  

Patch

diff --git a/sysdeps/unix/sysv/linux/sparc/sparc32/Makefile b/sysdeps/unix/sysv/linux/sparc/sparc32/Makefile
index 21c7dc1..60fb6f6 100644
--- a/sysdeps/unix/sysv/linux/sparc/sparc32/Makefile
+++ b/sysdeps/unix/sysv/linux/sparc/sparc32/Makefile
@@ -26,3 +26,10 @@  ifeq ($(subdir),math)
 # Provide these routines here as well.
 libm-routines += multc3 divtc3
 endif   # math
+
+ifneq (,$(filter signal nptl,$(subdir)))
+ifeq ($(have-ssp),yes)
+# We must not stack-protect the sigreturn handler.
+CFLAGS-sigaction.c += -fno-stack-protector
+endif  # have-ssp
+endif  # signal
diff --git a/sysdeps/unix/sysv/linux/sparc/sparc64/Makefile b/sysdeps/unix/sysv/linux/sparc/sparc64/Makefile
index 7ea433f..dada022 100644
--- a/sysdeps/unix/sysv/linux/sparc/sparc64/Makefile
+++ b/sysdeps/unix/sysv/linux/sparc/sparc64/Makefile
@@ -12,3 +12,10 @@  ifeq ($(subdir),nptl)
 CFLAGS-pause.c += -fexceptions
 CFLAGS-sigsuspend.c += -fexceptions
 endif
+
+ifneq (,$(filter signal nptl,$(subdir)))
+ifeq ($(have-ssp),yes)
+# We must not stack-protect the sigreturn handler.
+CFLAGS-sigaction.c += -fno-stack-protector
+endif  # have-ssp
+endif  # signal