aboutsummaryrefslogtreecommitdiff
path: root/gcc/config/alpha/osf.h
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/config/alpha/osf.h')
-rw-r--r--gcc/config/alpha/osf.h17
1 files changed, 17 insertions, 0 deletions
diff --git a/gcc/config/alpha/osf.h b/gcc/config/alpha/osf.h
index 0af169cc74b..1e8e505d978 100644
--- a/gcc/config/alpha/osf.h
+++ b/gcc/config/alpha/osf.h
@@ -108,3 +108,20 @@ Boston, MA 02111-1307, USA. */
#ifndef CROSS_COMPILE
#define HAVE_STAMP_H 1
#endif
+
+/* Attempt to turn on access permissions for the stack. */
+
+#define TRANSFER_FROM_TRAMPOLINE \
+void \
+__enable_execute_stack (addr) \
+ void *addr; \
+{ \
+ long size = getpagesize (); \
+ long mask = ~(size-1); \
+ char *page = (char *) (((long) addr) & mask); \
+ char *end = (char *) ((((long) (addr + TRAMPOLINE_SIZE)) & mask) + size); \
+ \
+ /* 7 is PROT_READ | PROT_WRITE | PROT_EXEC */ \
+ if (mprotect (page, end - page, 7) < 0) \
+ perror ("mprotect of trampoline code"); \
+}