From ac4904440b4733f461bcd2c45915f502b0345f80 Mon Sep 17 00:00:00 2001 From: Alexandre Oliva Date: Mon, 24 Jan 2000 00:47:38 +0000 Subject: [PATCH] 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 --- gcc/ChangeLog | 5 ++++ gcc/config/sparc/sol2-sld-64.h | 43 ---------------------------------- gcc/config/sparc/sol2.h | 43 ++++++++++++++++++++++++++++++++++ 3 files changed, 48 insertions(+), 43 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index b00f9af055e..ee7112c914c 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2000-01-23 Alexandre Oliva + + * config/sparc/sol2-sld-64.h (TRANSFER_FROM_TRAMPOLINE): Moved... + * config/sparc/sol2.h: ... here. + 2000-01-24 Michael Hayes * 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 28a0a5e6818..275a89f536e 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 0aecee2e198..3c52b635315 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"); \ + } \ +} -- 2.30.2