summary refs log tree commit diff
path: root/sysdeps/powerpc/stackinfo.h
diff options
context:
space:
mode:
authorRyan S. Arnold <rsa@us.ibm.com>2010-12-19 22:49:01 -0500
committerUlrich Drepper <drepper@gmail.com>2010-12-19 22:49:01 -0500
commit30950a5fd2346c43ba4fc59c16f122cfb59f9629 (patch)
tree400aceac60bdb17ec66caf2850d173ad8554e135 /sysdeps/powerpc/stackinfo.h
parentdb753e2cfb2051ebf20dc089f87c5b1297cc2cff (diff)
downloadglibc-30950a5fd2346c43ba4fc59c16f122cfb59f9629.tar.gz
glibc-30950a5fd2346c43ba4fc59c16f122cfb59f9629.tar.xz
glibc-30950a5fd2346c43ba4fc59c16f122cfb59f9629.zip
Make PowerPC64 default to nonexecutable stack
Diffstat (limited to 'sysdeps/powerpc/stackinfo.h')
-rw-r--r--sysdeps/powerpc/stackinfo.h13
1 files changed, 12 insertions, 1 deletions
diff --git a/sysdeps/powerpc/stackinfo.h b/sysdeps/powerpc/stackinfo.h
index 839758a4e3..aac86a48a2 100644
--- a/sysdeps/powerpc/stackinfo.h
+++ b/sysdeps/powerpc/stackinfo.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1999 Free Software Foundation, Inc.
+/* Copyright (C) 1999, 2010 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
@@ -22,7 +22,18 @@
 #ifndef _STACKINFO_H
 #define _STACKINFO_H	1
 
+#include <elf.h>
+
 /* On PPC the stack grows down.  */
 #define _STACK_GROWS_DOWN	1
 
+#if __WORDSIZE == 64
+/* PPC64 doesn't need an executable stack and doesn't need PT_GNU_STACK
+ * to make the stack nonexecutable.  */
+# define DEFAULT_STACK_PERMS (PF_R|PF_W)
+#else
+/* PF_X can be overridden if PT_GNU_STACK is present but is presumed absent.  */
+# define DEFAULT_STACK_PERMS (PF_R|PF_W|PF_X)
+#endif
+
 #endif	/* stackinfo.h */