aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorAlexandre Oliva <oliva@lsd.ic.unicamp.br>2000-01-24 00:47:38 +0000
committerAlexandre Oliva <oliva@gcc.gnu.org>2000-01-24 00:47:38 +0000
commitac4904440b4733f461bcd2c45915f502b0345f80 (patch)
tree7bf70b75ba24de1d0a8f4f413428bc28d295339d /gcc
parentd6181b1bdcbc6df86c0a589b7ed9905ee634aa3e (diff)
downloadgcc-ac4904440b4733f461bcd2c45915f502b0345f80.zip
gcc-ac4904440b4733f461bcd2c45915f502b0345f80.tar.gz
gcc-ac4904440b4733f461bcd2c45915f502b0345f80.tar.bz2
sol2-sld-64.h (TRANSFER_FROM_TRAMPOLINE): Moved...
* config/sparc/sol2-sld-64.h (TRANSFER_FROM_TRAMPOLINE): Moved... * config/sparc/sol2.h: ... here. From-SVN: r31578
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog5
-rw-r--r--gcc/config/sparc/sol2-sld-64.h43
-rw-r--r--gcc/config/sparc/sol2.h43
3 files changed, 48 insertions, 43 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index b00f9af..ee7112c 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,8 @@
+2000-01-23 Alexandre Oliva <oliva@lsd.ic.unicamp.br>
+
+ * config/sparc/sol2-sld-64.h (TRANSFER_FROM_TRAMPOLINE): Moved...
+ * config/sparc/sol2.h: ... here.
+
2000-01-24 Michael Hayes <m.hayes@elec.canterbury.ac.nz>
* basic-block.h (struct loops): New field `levels'.
diff --git a/gcc/config/sparc/sol2-sld-64.h b/gcc/config/sparc/sol2-sld-64.h
index 28a0a5e..275a89f 100644
--- a/gcc/config/sparc/sol2-sld-64.h
+++ b/gcc/config/sparc/sol2-sld-64.h
@@ -305,49 +305,6 @@
#endif /* ! SPARC_BI_ARCH */
-/*
- * Attempt to turn on access permissions for the stack.
- *
- * This code must be defined when compiling gcc but not when compiling
- * libgcc2.a, unless we're generating code for 64 bits SPARC
- *
- * _SC_STACK_PROT is only defined for post 2.6, but we want this code
- * to run always. 2.6 can change the stack protection but has no way to
- * query it.
- *
- */
-
-#define TRANSFER_FROM_TRAMPOLINE \
-static int need_enable_exec_stack; \
- \
-static void check_enabling(void) __attribute__ ((constructor)); \
-static void check_enabling(void) \
-{ \
- extern long sysconf(int); \
- \
- int prot = (int) sysconf(515 /*_SC_STACK_PROT */); \
- if (prot != 7) \
- need_enable_exec_stack = 1; \
-} \
- \
-void \
-__enable_execute_stack (addr) \
- void *addr; \
-{ \
- if (!need_enable_exec_stack) \
- return; \
- else { \
- 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"); \
- } \
-}
-
/* A C statement (sans semicolon) to output an element in the table of
global constructors. */
#undef ASM_OUTPUT_CONSTRUCTOR
diff --git a/gcc/config/sparc/sol2.h b/gcc/config/sparc/sol2.h
index 0aecee2..3c52b63 100644
--- a/gcc/config/sparc/sol2.h
+++ b/gcc/config/sparc/sol2.h
@@ -235,3 +235,46 @@ Boston, MA 02111-1307, USA. */
: /* no outputs */ \
: "r" (ms_flags), "r" (ms_saveret));
#endif /* sparc32 */
+
+/*
+ * Attempt to turn on access permissions for the stack.
+ *
+ * This code must be defined when compiling gcc but not when compiling
+ * libgcc2.a, unless we're generating code for 64 bits SPARC
+ *
+ * _SC_STACK_PROT is only defined for post 2.6, but we want this code
+ * to run always. 2.6 can change the stack protection but has no way to
+ * query it.
+ *
+ */
+
+#define TRANSFER_FROM_TRAMPOLINE \
+static int need_enable_exec_stack; \
+ \
+static void check_enabling(void) __attribute__ ((constructor)); \
+static void check_enabling(void) \
+{ \
+ extern long sysconf(int); \
+ \
+ int prot = (int) sysconf(515 /*_SC_STACK_PROT */); \
+ if (prot != 7) \
+ need_enable_exec_stack = 1; \
+} \
+ \
+void \
+__enable_execute_stack (addr) \
+ void *addr; \
+{ \
+ if (!need_enable_exec_stack) \
+ return; \
+ else { \
+ 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"); \
+ } \
+}