diff options
author | oliva <oliva@138bc75d-0d04-0410-961f-82ee72b054a4> | 2000-01-24 00:47:38 +0000 |
---|---|---|
committer | oliva <oliva@138bc75d-0d04-0410-961f-82ee72b054a4> | 2000-01-24 00:47:38 +0000 |
commit | 8be977998ce3bb8e1040fe5f9b3979ab713fec05 (patch) | |
tree | 7bf70b75ba24de1d0a8f4f413428bc28d295339d /gcc/config | |
parent | 8c567f7b45d1a993988dd2ef51bdc03f44c08ec1 (diff) | |
download | gcc-8be977998ce3bb8e1040fe5f9b3979ab713fec05.tar.gz |
* config/sparc/sol2-sld-64.h (TRANSFER_FROM_TRAMPOLINE): Moved...
* config/sparc/sol2.h: ... here.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@31578 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/config')
-rw-r--r-- | gcc/config/sparc/sol2-sld-64.h | 43 | ||||
-rw-r--r-- | gcc/config/sparc/sol2.h | 43 |
2 files changed, 43 insertions, 43 deletions
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"); \ + } \ +} |