diff options
author | Eric Botcazou <ebotcazou@act-europe.fr> | 2004-07-17 23:09:14 +0200 |
---|---|---|
committer | Eric Botcazou <ebotcazou@gcc.gnu.org> | 2004-07-17 21:09:14 +0000 |
commit | e7a742ec9624db7b29d824a7b9899b73554322e3 (patch) | |
tree | adb37612658bd4d95ab4862b248c91a39335be16 /gcc/config | |
parent | 6e34d3a39f0ce48e95a2853df4be8d01eb745850 (diff) | |
download | gcc-e7a742ec9624db7b29d824a7b9899b73554322e3.zip gcc-e7a742ec9624db7b29d824a7b9899b73554322e3.tar.gz gcc-e7a742ec9624db7b29d824a7b9899b73554322e3.tar.bz2 |
libgcc2.c (__enable_execute_stack): New symbol.
* libgcc2.c (__enable_execute_stack): New symbol.
* libgcc-std.ver (GCC_3.4.2): New version. Inherit from GCC_3.4
and declare __enable_execute_stack.
* mklibgcc.in (lib2funcs): Add _enable_execute_stack.
* config/netbsd.h (NETBSD_ENABLE_EXECUTE_STACK): ANSIfy.
* config/sol2.h (TRANSFER_FROM_TRAMPOLINE): Rename into
ENABLE_EXECUTE_STACK.
* config/alpha/alpha.c (alpha_initialize_trampoline): Conditionalize
on ENABLE_EXECUTE_STACK instead of TRANSFER_FROM_TRAMPOLINE.
* config/alpha/netbsd.h (TRANSFER_FROM_TRAMPOLINE): Rename into
ENABLE_EXECUTE_STACK.
* config/alpha/osf.h (TRANSFER_FROM_TRAMPOLINE): Likewise.
* config/i386/i386.c (x86_initialize_trampoline): Conditionalize
on ENABLE_EXECUTE_STACK instead of TRANSFER_FROM_TRAMPOLINE.
* config/i386/netbsd-elf.h (TRANSFER_FROM_TRAMPOLINE): Rename into
ENABLE_EXECUTE_STACK.
* config/i386/netbsd.h (TRANSFER_FROM_TRAMPOLINE): Likewise.
* config/i386/netbsd64.h (TRANSFER_FROM_TRAMPOLINE): Likewise.
* config/sparc/freebsd.h (TRANSFER_FROM_TRAMPOLINE): Likewise.
* config/sparc/netbsd-elf.h (TRANSFER_FROM_TRAMPOLINE): Likewise.
* config/sparc/sparc.c (sparc_initialize_trampoline): Conditionalize
on ENABLE_EXECUTE_STACK instead of TRANSFER_FROM_TRAMPOLINE.
(sparc64_initialize_trampoline): Likewise.
* doc/tm.texi (trampolines): Add ENABLE_EXECUTE_STACK macro.
From-SVN: r84880
Diffstat (limited to 'gcc/config')
-rw-r--r-- | gcc/config/alpha/alpha.c | 2 | ||||
-rw-r--r-- | gcc/config/alpha/netbsd.h | 2 | ||||
-rw-r--r-- | gcc/config/alpha/osf.h | 2 | ||||
-rw-r--r-- | gcc/config/i386/i386.c | 2 | ||||
-rw-r--r-- | gcc/config/i386/netbsd-elf.h | 2 | ||||
-rw-r--r-- | gcc/config/i386/netbsd.h | 2 | ||||
-rw-r--r-- | gcc/config/i386/netbsd64.h | 2 | ||||
-rw-r--r-- | gcc/config/netbsd.h | 5 | ||||
-rw-r--r-- | gcc/config/sol2.h | 7 | ||||
-rw-r--r-- | gcc/config/sparc/freebsd.h | 2 | ||||
-rw-r--r-- | gcc/config/sparc/netbsd-elf.h | 2 | ||||
-rw-r--r-- | gcc/config/sparc/sparc.c | 4 |
12 files changed, 15 insertions, 19 deletions
diff --git a/gcc/config/alpha/alpha.c b/gcc/config/alpha/alpha.c index 102cbb1..646258b 100644 --- a/gcc/config/alpha/alpha.c +++ b/gcc/config/alpha/alpha.c @@ -5782,7 +5782,7 @@ alpha_initialize_trampoline (rtx tramp, rtx fnaddr, rtx cxt, emit_move_insn (gen_rtx_MEM (SImode, addr), temp1); } -#ifdef TRANSFER_FROM_TRAMPOLINE +#ifdef ENABLE_EXECUTE_STACK emit_library_call (init_one_libfunc ("__enable_execute_stack"), 0, VOIDmode, 1, tramp, Pmode); #endif diff --git a/gcc/config/alpha/netbsd.h b/gcc/config/alpha/netbsd.h index 1eede22..d4f833a 100644 --- a/gcc/config/alpha/netbsd.h +++ b/gcc/config/alpha/netbsd.h @@ -76,7 +76,7 @@ Boston, MA 02111-1307, USA. */ /* Attempt to enable execute permissions on the stack. */ -#define TRANSFER_FROM_TRAMPOLINE NETBSD_ENABLE_EXECUTE_STACK +#define ENABLE_EXECUTE_STACK NETBSD_ENABLE_EXECUTE_STACK #undef TARGET_VERSION diff --git a/gcc/config/alpha/osf.h b/gcc/config/alpha/osf.h index 04b7bf1..954a4ad 100644 --- a/gcc/config/alpha/osf.h +++ b/gcc/config/alpha/osf.h @@ -144,7 +144,7 @@ Boston, MA 02111-1307, USA. */ /* Attempt to turn on access permissions for the stack. */ -#define TRANSFER_FROM_TRAMPOLINE \ +#define ENABLE_EXECUTE_STACK \ void \ __enable_execute_stack (void *addr) \ { \ diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c index b8aa661..bcc9104 100644 --- a/gcc/config/i386/i386.c +++ b/gcc/config/i386/i386.c @@ -12659,7 +12659,7 @@ x86_initialize_trampoline (rtx tramp, rtx fnaddr, rtx cxt) abort (); } -#ifdef TRANSFER_FROM_TRAMPOLINE +#ifdef ENABLE_EXECUTE_STACK emit_library_call (gen_rtx_SYMBOL_REF (Pmode, "__enable_execute_stack"), LCT_NORMAL, VOIDmode, 1, tramp, Pmode); #endif diff --git a/gcc/config/i386/netbsd-elf.h b/gcc/config/i386/netbsd-elf.h index cfd8837..bd2e9de 100644 --- a/gcc/config/i386/netbsd-elf.h +++ b/gcc/config/i386/netbsd-elf.h @@ -120,6 +120,6 @@ Boston, MA 02111-1307, USA. */ #define DEFAULT_PCC_STRUCT_RETURN 1 /* Attempt to enable execute permissions on the stack. */ -#define TRANSFER_FROM_TRAMPOLINE NETBSD_ENABLE_EXECUTE_STACK +#define ENABLE_EXECUTE_STACK NETBSD_ENABLE_EXECUTE_STACK #define TARGET_VERSION fprintf (stderr, " (NetBSD/i386 ELF)"); diff --git a/gcc/config/i386/netbsd.h b/gcc/config/i386/netbsd.h index 45ae893..dd7eae1 100644 --- a/gcc/config/i386/netbsd.h +++ b/gcc/config/i386/netbsd.h @@ -69,4 +69,4 @@ #define GOT_SYMBOL_NAME "GLOBAL_OFFSET_TABLE_" /* Attempt to enable execute permissions on the stack. */ -#define TRANSFER_FROM_TRAMPOLINE NETBSD_ENABLE_EXECUTE_STACK +#define ENABLE_EXECUTE_STACK NETBSD_ENABLE_EXECUTE_STACK diff --git a/gcc/config/i386/netbsd64.h b/gcc/config/i386/netbsd64.h index 7ff09d5..66f31e0 100644 --- a/gcc/config/i386/netbsd64.h +++ b/gcc/config/i386/netbsd64.h @@ -68,6 +68,6 @@ Boston, MA 02111-1307, USA. */ } /* Attempt to enable execute permissions on the stack. */ -#define TRANSFER_FROM_TRAMPOLINE NETBSD_ENABLE_EXECUTE_STACK +#define ENABLE_EXECUTE_STACK NETBSD_ENABLE_EXECUTE_STACK #define TARGET_VERSION fprintf (stderr, " (NetBSD/x86_64 ELF)"); diff --git a/gcc/config/netbsd.h b/gcc/config/netbsd.h index 40adf1a..aad3cac 100644 --- a/gcc/config/netbsd.h +++ b/gcc/config/netbsd.h @@ -178,7 +178,7 @@ Boston, MA 02111-1307, USA. */ /* Attempt to turn on execute permission for the stack. This may be - used by TRANSFER_FROM_TRAMPOLINE of the target needs it (that is, + used by INITIALIZE_TRAMPOLINE of the target needs it (that is, if the target machine can change execute permissions on a page). There is no way to query the execute permission of the stack, so @@ -193,8 +193,7 @@ Boston, MA 02111-1307, USA. */ #define NETBSD_ENABLE_EXECUTE_STACK \ extern void __enable_execute_stack (void *); \ void \ -__enable_execute_stack (addr) \ - void *addr; \ +__enable_execute_stack (void *addr) \ { \ extern int mprotect (void *, size_t, int); \ extern int __sysctl (int *, unsigned int, void *, size_t *, \ diff --git a/gcc/config/sol2.h b/gcc/config/sol2.h index 1ff6308..aa567bc 100644 --- a/gcc/config/sol2.h +++ b/gcc/config/sol2.h @@ -162,9 +162,6 @@ Boston, MA 02111-1307, USA. */ /* * 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-bit 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. @@ -172,10 +169,10 @@ Boston, MA 02111-1307, USA. */ */ /* sys/mman.h is not present on some non-Solaris configurations - that use sol2.h, so TRANSFER_FROM_TRAMPOLINE must use a magic + that use sol2.h, so ENABLE_EXECUTE_STACK must use a magic number instead of the appropriate PROT_* flags. */ -#define TRANSFER_FROM_TRAMPOLINE \ +#define ENABLE_EXECUTE_STACK \ \ /* #define STACK_PROT_RWX (PROT_READ | PROT_WRITE | PROT_EXEC) */ \ \ diff --git a/gcc/config/sparc/freebsd.h b/gcc/config/sparc/freebsd.h index d8dfbf0..389c00d 100644 --- a/gcc/config/sparc/freebsd.h +++ b/gcc/config/sparc/freebsd.h @@ -96,7 +96,7 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ #undef SPARC_DEFAULT_CMODEL #define SPARC_DEFAULT_CMODEL CM_MEDLOW -#define TRANSFER_FROM_TRAMPOLINE \ +#define ENABLE_EXECUTE_STACK \ static int need_enable_exec_stack; \ static void check_enabling(void) __attribute__ ((constructor)); \ static void check_enabling(void) \ diff --git a/gcc/config/sparc/netbsd-elf.h b/gcc/config/sparc/netbsd-elf.h index 3cfd0fc..3c2f8a9 100644 --- a/gcc/config/sparc/netbsd-elf.h +++ b/gcc/config/sparc/netbsd-elf.h @@ -89,7 +89,7 @@ Boston, MA 02111-1307, USA. */ #undef STDC_0_IN_SYSTEM_HEADERS /* Attempt to enable execute permissions on the stack. */ -#define TRANSFER_FROM_TRAMPOLINE NETBSD_ENABLE_EXECUTE_STACK +#define ENABLE_EXECUTE_STACK NETBSD_ENABLE_EXECUTE_STACK #undef TARGET_VERSION #define TARGET_VERSION fprintf (stderr, " (%s)", TARGET_NAME); diff --git a/gcc/config/sparc/sparc.c b/gcc/config/sparc/sparc.c index 1dbd002..d378757 100644 --- a/gcc/config/sparc/sparc.c +++ b/gcc/config/sparc/sparc.c @@ -7575,7 +7575,7 @@ sparc_initialize_trampoline (rtx tramp, rtx fnaddr, rtx cxt) /* Call __enable_execute_stack after writing onto the stack to make sure the stack address is accessible. */ -#ifdef TRANSFER_FROM_TRAMPOLINE +#ifdef ENABLE_EXECUTE_STACK emit_library_call (gen_rtx_SYMBOL_REF (Pmode, "__enable_execute_stack"), LCT_NORMAL, VOIDmode, 1, tramp, Pmode); #endif @@ -7616,7 +7616,7 @@ sparc64_initialize_trampoline (rtx tramp, rtx fnaddr, rtx cxt) /* Call __enable_execute_stack after writing onto the stack to make sure the stack address is accessible. */ -#ifdef TRANSFER_FROM_TRAMPOLINE +#ifdef ENABLE_EXECUTE_STACK emit_library_call (gen_rtx_SYMBOL_REF (Pmode, "__enable_execute_stack"), LCT_NORMAL, VOIDmode, 1, tramp, Pmode); #endif |