aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/init.c
diff options
context:
space:
mode:
authorEric Botcazou <ebotcazou@adacore.com>2007-12-13 11:19:19 +0100
committerArnaud Charlet <charlet@gcc.gnu.org>2007-12-13 11:19:19 +0100
commit0312b364242bc5d1f96d00d7228ede4a26730e0c (patch)
tree3cf3e951f0c6130ad3c9ebea685be075a959511b /gcc/ada/init.c
parentdef46b5433513c720e7a17c62fa3e1837d905fca (diff)
downloadgcc-0312b364242bc5d1f96d00d7228ede4a26730e0c.zip
gcc-0312b364242bc5d1f96d00d7228ede4a26730e0c.tar.gz
gcc-0312b364242bc5d1f96d00d7228ede4a26730e0c.tar.bz2
system-linux-ia64.ads, [...] (Stack_Check_Limits): New target parameter.
2007-12-06 Eric Botcazou <ebotcazou@adacore.com> Bob Duff <duff@adacore.com> Tristan Gingold <gingold@adacore.com> * system-linux-ia64.ads, system-freebsd-x86.ads, system-lynxos-ppc.ads, system-lynxos-x86.ads, system-linux-x86_64.ads, system-tru64.ads, system-aix.ads, system-vxworks-sparcv9.ads, system-solaris-x86.ads, system-irix-o32.ads, system-irix-n32.ads, system-hpux.ads, system-vxworks-m68k.ads, system-linux-x86.ads, system-vxworks-mips.ads, system-solaris-sparc.ads, system-solaris-sparcv9.ads, system-vms.ads, system-mingw.ads, system-vms-zcx.ads, system-vxworks-ppc.ads, system-vxworks-arm.ads, system-darwin-x86.ads, system.ads, system-vms_64.ads, system-darwin-ppc.ads, system-vxworks-x86.ads, system-linux-ppc.ads, system-linux-hppa.ads, system-hpux-ia64.ads, system-vms-ia64.ads (Stack_Check_Limits): New target parameter. (Always_Compatible_Rep): New flag to control trampolines globally. (Dynamic_Trampolines_Used): New flag for implementing the No_Implicit_Dynamic_Code restriction more correctly (not yet used, and not yet set correctly for some targets). * s-taprop-vxworks.adb: Use stack limit method of stack checking. Simply indirectly call s-stchop when a task is created. * ali.ads: New flag added: Stack_Check_Switch_Set which is set when '-fstack-check' appears as an argument (entries A) in an ALI file. * fe.h (Stack_Check_Limits): Declare new target parameter. (Check_Implicit_Dynamic_Code_Allowed): New procedure. * init.c: Declare __gnat_set_stack_limit_hook for VxWorks kernel RTS. This variable is declared in C to be sure not subject to elaboration code. (__gnat_map_signal, VxWorks): In kernel mode, map SIGILL to Storage_Error. * targparm.ads, targparm.adb (Stack_Check_Limits): New parameter. (Always_Compatible_Rep, Dynamic_Trampolines_Used): New parameters. * s-stchop.ads: Add comments. * s-stchop-vxworks.adb: Package almost fully rewritten to use stack limit method of stack checking. * s-stchop-limit.ads: New file. From-SVN: r130814
Diffstat (limited to 'gcc/ada/init.c')
-rw-r--r--gcc/ada/init.c21
1 files changed, 17 insertions, 4 deletions
diff --git a/gcc/ada/init.c b/gcc/ada/init.c
index 00f986b..fdfd31a 100644
--- a/gcc/ada/init.c
+++ b/gcc/ada/init.c
@@ -1713,19 +1713,24 @@ __gnat_map_signal (int sig)
msg = "SIGBUS: possible stack overflow";
break;
#else
+#ifdef __RTP__
+ /* In RTP mode a SIGSEGV is most likely due to a stack overflow,
+ since stack checking uses the probing mechanism. */
case SIGILL:
exception = &constraint_error;
msg = "SIGILL";
break;
-/* In RTP mode a SIGSEGV is most likely due to a stack overflow. This is not
- the case in kernel mode where stack overflow detection uses a comparison
- method instead of memory probes. */
-#ifdef __RTP__
case SIGSEGV:
exception = &storage_error;
msg = "SIGSEGV: possible stack overflow";
break;
#else
+ /* In kernel mode a SIGILL is most likely due to a stack overflow,
+ since stack checking uses the stack limit mechanism. */
+ case SIGILL:
+ exception = &storage_error;
+ msg = "SIGILL: possible stack overflow";
+ break;
case SIGSEGV:
exception = &program_error;
msg = "SIGSEGV";
@@ -1826,6 +1831,14 @@ __gnat_init_float (void)
#endif
}
+/* This subprogram is called by System.Task_Primitives.Operations.Enter_Task
+ (if not null) when a new task is created. It is initialized by
+ System.Stack_Checking.Operations.Initialize_Stack_Limit.
+ The use of a hook avoids to drag stack checking subprograms if stack
+ checking is not used. */
+void (*__gnat_set_stack_limit_hook)(void) = (void (*)(void))0;
+
+
/******************/
/* NetBSD Section */
/******************/