From 36cee502f345b8b64a08c57c1ac3237cb5c7d5e3 Mon Sep 17 00:00:00 2001 From: Tristan Gingold Date: Tue, 20 May 2008 14:47:13 +0200 Subject: [PATCH] init.c: Enable stack probing on ppc-linux. 2008-05-20 Tristan Gingold * init.c: Enable stack probing on ppc-linux. * tracebak.c: Add symbolic traceback for ppc-linux. * system-linux-ppc.ads: Enable stack probing on ppc-linux. From-SVN: r135630 --- gcc/ada/init.c | 6 +++++- gcc/ada/system-linux-ppc.ads | 4 ++-- gcc/ada/tracebak.c | 8 ++++---- 3 files changed, 11 insertions(+), 7 deletions(-) diff --git a/gcc/ada/init.c b/gcc/ada/init.c index 5dd78155688..24a6437f26b 100644 --- a/gcc/ada/init.c +++ b/gcc/ada/init.c @@ -568,7 +568,7 @@ __gnat_install_handler (void) /*********************/ #elif defined (linux) && (defined (i386) || defined (__x86_64__) \ - || defined (__ia64__)) + || defined (__ia64__) || defined (__powerpc__)) #include @@ -624,7 +624,9 @@ static void __gnat_error_handler (int, siginfo_t *siginfo, void *ucontext); void __gnat_adjust_context_for_raise (int signo ATTRIBUTE_UNUSED, void *ucontext) { +#ifndef __powerpc__ mcontext_t *mcontext = &((ucontext_t *) ucontext)->uc_mcontext; +#endif /* On the i386 and x86-64 architectures, stack checking is performed by means of probes with moving stack pointer, that is to say the probed @@ -657,6 +659,8 @@ __gnat_adjust_context_for_raise (int signo ATTRIBUTE_UNUSED, void *ucontext) mcontext->gregs[REG_RIP]++; #elif defined (__ia64__) mcontext->sc_ip++; +#elif defined (__powerpc__) + ((ucontext_t *) ucontext)->uc_mcontext.regs->nip++; #endif } diff --git a/gcc/ada/system-linux-ppc.ads b/gcc/ada/system-linux-ppc.ads index 599bdcc9dc3..08c08a36068 100644 --- a/gcc/ada/system-linux-ppc.ads +++ b/gcc/ada/system-linux-ppc.ads @@ -7,7 +7,7 @@ -- S p e c -- -- (GNU-Linux/PPC Version) -- -- -- --- Copyright (C) 1992-2007, Free Software Foundation, Inc. -- +-- Copyright (C) 1992-2008, Free Software Foundation, Inc. -- -- -- -- This specification is derived from the Ada Reference Manual for use with -- -- GNAT. The copyright notice above, and the license provisions that follow -- @@ -139,7 +139,7 @@ private Preallocated_Stacks : constant Boolean := False; Signed_Zeros : constant Boolean := True; Stack_Check_Default : constant Boolean := False; - Stack_Check_Probes : constant Boolean := False; + Stack_Check_Probes : constant Boolean := True; Stack_Check_Limits : constant Boolean := False; Support_64_Bit_Divides : constant Boolean := True; Support_Aggregates : constant Boolean := True; diff --git a/gcc/ada/tracebak.c b/gcc/ada/tracebak.c index 65c1828badd..8a69057ed77 100644 --- a/gcc/ada/tracebak.c +++ b/gcc/ada/tracebak.c @@ -6,8 +6,7 @@ * * * C Implementation File * * * - * Copyright (C) 2000-2007, AdaCore * - * Copyright (C) 2008, Free Software Foundation, Inc. * + * Copyright (C) 2000-2008, AdaCore * * * * 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- * @@ -230,9 +229,10 @@ struct layout #define BASE_SKIP 1 -/*---------------------------- PPC VxWorks------------------------------*/ +/*-------------------- PPC ELF (GNU/Linux & VxWorks) ---------------------*/ -#elif defined (_ARCH_PPC) && defined (__vxworks) +#elif (defined (_ARCH_PPC) && defined (__vxworks)) || \ + (defined (linux) && defined (__powerpc__)) #define USE_GENERIC_UNWINDER -- 2.30.2