aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/init.c
diff options
context:
space:
mode:
authorArnaud Charlet <charlet@gcc.gnu.org>2013-04-11 14:36:44 +0200
committerArnaud Charlet <charlet@gcc.gnu.org>2013-04-11 14:36:44 +0200
commite6425869abeaf52c2c23e924140baa6c28dc9118 (patch)
tree94590b0d8e08551f870e7b7e60b3aa605b8e144b /gcc/ada/init.c
parentfe96ecb94ac3a81499d804d428d275284e676027 (diff)
downloadgcc-e6425869abeaf52c2c23e924140baa6c28dc9118.zip
gcc-e6425869abeaf52c2c23e924140baa6c28dc9118.tar.gz
gcc-e6425869abeaf52c2c23e924140baa6c28dc9118.tar.bz2
[multiple changes]
2013-04-11 Ed Schonberg <schonberg@adacore.com> * sem_util.ads, sem_util.adb (Get_Incomplete_View_Of_Ancestor): New function to implement the notion introduced in RM 7.3.1 (5.2/3): in a child unit, a derived type is within the derivation class of an ancestor declared in a parent unit, even if there is an intermediate derivation that does not see the full view of that ancestor. * sem_res.adb (Valid_Conversion): if all else fails, examine if an incomplete view of an ancestor makes a numeric conversion legal. 2013-04-11 Ed Schonberg <schonberg@adacore.com> * sem_ch6.adb: in Ada2012 operators can only have in parameters. 2013-04-11 Vincent Celier <celier@adacore.com> * makeutl.adb (Create_Binder_Mapping_File): Do not put into the mapping file ALI files of sources that have been replaced. 2013-04-11 Vincent Celier <celier@adacore.com> * projects.texi: Add subsection Duplicate Sources in Projects. 2013-04-11 Vincent Celier <celier@adacore.com> * gnat_ugn.texi: Add documentation for gnatmake switch -droot_dir/** 2013-04-11 Arnaud Charlet <charlet@adacore.com> * init.c (__gnat_install_handler): Only set up an alternate stack when installing a signal handler for SIGSEGV. 2013-04-11 Thomas Quinot <quinot@adacore.com> * g-socket.adb (Connect_Socket, timeout version): Call underlying connect operation directly, not through the 2-argument Connect_Socket thick binding, in order to avoid raising a junk exception for the EINPROGRESS return. From-SVN: r197775
Diffstat (limited to 'gcc/ada/init.c')
-rw-r--r--gcc/ada/init.c28
1 files changed, 16 insertions, 12 deletions
diff --git a/gcc/ada/init.c b/gcc/ada/init.c
index f5c3a81..ef9087c 100644
--- a/gcc/ada/init.c
+++ b/gcc/ada/init.c
@@ -6,7 +6,7 @@
* *
* C Implementation File *
* *
- * Copyright (C) 1992-2012, Free Software Foundation, Inc. *
+ * Copyright (C) 1992-2013, Free Software Foundation, Inc. *
* *
* GNAT is free software; you can redistribute it and/or modify it under *
* terms of the GNU General Public License as published by the Free Soft- *
@@ -603,14 +603,6 @@ __gnat_install_handler (void)
handled properly, avoiding a SEGV generation from stack usage by the
handler itself. */
-#if defined (i386) || defined (__x86_64__) || defined (__powerpc__)
- stack_t stack;
- stack.ss_sp = __gnat_alternate_stack;
- stack.ss_size = sizeof (__gnat_alternate_stack);
- stack.ss_flags = 0;
- sigaltstack (&stack, NULL);
-#endif
-
act.sa_sigaction = __gnat_error_handler;
act.sa_flags = SA_NODEFER | SA_RESTART | SA_SIGINFO;
sigemptyset (&act.sa_mask);
@@ -624,11 +616,23 @@ __gnat_install_handler (void)
sigaction (SIGILL, &act, NULL);
if (__gnat_get_interrupt_state (SIGBUS) != 's')
sigaction (SIGBUS, &act, NULL);
+ if (__gnat_get_interrupt_state (SIGSEGV) != 's')
+ {
#if defined (i386) || defined (__x86_64__) || defined (__powerpc__)
- act.sa_flags |= SA_ONSTACK;
+ /* 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. */
+ stack_t stack;
+
+ stack.ss_sp = __gnat_alternate_stack;
+ stack.ss_size = sizeof (__gnat_alternate_stack);
+ stack.ss_flags = 0;
+ sigaltstack (&stack, NULL);
+
+ act.sa_flags |= SA_ONSTACK;
#endif
- if (__gnat_get_interrupt_state (SIGSEGV) != 's')
- sigaction (SIGSEGV, &act, NULL);
+ sigaction (SIGSEGV, &act, NULL);
+ }
__gnat_handler_installed = 1;
}