diff options
author | Richard Henderson <rth@redhat.com> | 2014-04-22 09:51:14 -0700 |
---|---|---|
committer | Richard Henderson <rth@gcc.gnu.org> | 2014-04-22 09:51:14 -0700 |
commit | 19a0be3d6b537bc6c9566608cd657bcb96c2dec7 (patch) | |
tree | 2c0bb9bc1cc2d95d356116b6b038ada6f5053e4b /gcc | |
parent | 793c625fb803247ea5b759c11dbeb3d6882cd74a (diff) | |
download | gcc-19a0be3d6b537bc6c9566608cd657bcb96c2dec7.zip gcc-19a0be3d6b537bc6c9566608cd657bcb96c2dec7.tar.gz gcc-19a0be3d6b537bc6c9566608cd657bcb96c2dec7.tar.bz2 |
Enable __gnat_alternate_stack for most linux
* init.c [__linux__] (HAVE_GNAT_ALTERNATE_STACK): New define.
(__gnat_alternate_stack): Enable for all linux except ia64.
From-SVN: r209653
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ada/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/ada/init.c | 13 |
2 files changed, 14 insertions, 4 deletions
diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog index 96bc09b..0d3c792 100644 --- a/gcc/ada/ChangeLog +++ b/gcc/ada/ChangeLog @@ -1,3 +1,8 @@ +2014-04-22 Richard Henderson <rth@redhat.com> + + * init.c [__linux__] (HAVE_GNAT_ALTERNATE_STACK): New define. + (__gnat_alternate_stack): Enable for all linux except ia64. + 2014-04-22 Eric Botcazou <ebotcazou@adacore.com> * fe.h (Compiler_Abort): Replace Fat_Pointer with String_Pointer. diff --git a/gcc/ada/init.c b/gcc/ada/init.c index c3824ab..48319d6 100644 --- a/gcc/ada/init.c +++ b/gcc/ada/init.c @@ -556,9 +556,14 @@ __gnat_error_handler (int sig, siginfo_t *si ATTRIBUTE_UNUSED, void *ucontext) Raise_From_Signal_Handler (exception, msg); } -#if defined (i386) || defined (__x86_64__) || defined (__powerpc__) -/* This must be in keeping with System.OS_Interface.Alternate_Stack_Size. */ -char __gnat_alternate_stack[16 * 1024]; /* 2 * SIGSTKSZ */ +#ifndef __ia64__ +#define HAVE_GNAT_ALTERNATE_STACK 1 +/* This must be in keeping with System.OS_Interface.Alternate_Stack_Size. + It must be larger than MINSIGSTKSZ and hopefully near 2 * SIGSTKSZ. */ +# if 16 * 1024 < MINSIGSTKSZ +# error "__gnat_alternate_stack too small" +# endif +char __gnat_alternate_stack[16 * 1024]; #endif #ifdef __XENO__ @@ -612,7 +617,7 @@ __gnat_install_handler (void) sigaction (SIGBUS, &act, NULL); if (__gnat_get_interrupt_state (SIGSEGV) != 's') { -#if defined (i386) || defined (__x86_64__) || defined (__powerpc__) +#ifdef HAVE_GNAT_ALTERNATE_STACK /* Setup an alternate stack region for the handler execution so that stack overflows can be handled properly, avoiding a SEGV generation from stack usage by the handler itself. */ |