aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/init.c
diff options
context:
space:
mode:
authorH.J. Lu <hongjiu.lu@intel.com>2012-03-03 17:04:49 +0000
committerH.J. Lu <hjl@gcc.gnu.org>2012-03-03 09:04:49 -0800
commit8b1106fbc36341b04477ee593ea0de92ecd16964 (patch)
tree85b4d2e3bed245e2ce2b3cfbce99eccec9880473 /gcc/ada/init.c
parent0e193637243a877226db68773c0735f88e4d9aab (diff)
downloadgcc-8b1106fbc36341b04477ee593ea0de92ecd16964.zip
gcc-8b1106fbc36341b04477ee593ea0de92ecd16964.tar.gz
gcc-8b1106fbc36341b04477ee593ea0de92ecd16964.tar.bz2
Add Linux/x32 support to Ada
2012-03-03 H.J. Lu <hongjiu.lu@intel.com> * init.c (__gnat_adjust_context_for_raise): Also check "orq $0x0,(%esp)" for x32. * link.c (__gnat_default_libgcc_subdir): set to libx32 for x32. * gcc-interface/Makefile.in (arch): Set to x32 if MULTISUBDIR is /x32. Support x32. From-SVN: r184859
Diffstat (limited to 'gcc/ada/init.c')
-rw-r--r--gcc/ada/init.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/gcc/ada/init.c b/gcc/ada/init.c
index 18280c2..80a02b1 100644
--- a/gcc/ada/init.c
+++ b/gcc/ada/init.c
@@ -615,9 +615,13 @@ __gnat_adjust_context_for_raise (int signo ATTRIBUTE_UNUSED, void *ucontext)
if (signo == SIGSEGV && pc && *pc == 0x00240c83)
mcontext->gregs[REG_ESP] += 4096 + 4 * sizeof (unsigned long);
#elif defined (__x86_64__)
- unsigned long *pc = (unsigned long *)mcontext->gregs[REG_RIP];
- /* The pattern is "orq $0x0,(%rsp)" for a probe in 64-bit mode. */
- if (signo == SIGSEGV && pc && (*pc & 0xffffffffff) == 0x00240c8348)
+ unsigned long long *pc = (unsigned long long *)mcontext->gregs[REG_RIP];
+ if (signo == SIGSEGV && pc
+ /* The pattern is "orq $0x0,(%rsp)" for a probe in 64-bit mode. */
+ && ((*pc & 0xffffffffffLL) == 0x00240c8348LL
+ /* The pattern may also be "orl $0x0,(%esp)" for a probe in
+ x32 mode. */
+ || (*pc & 0xffffffffLL) == 0x00240c83LL))
mcontext->gregs[REG_RSP] += 4096 + 4 * sizeof (unsigned long);
#elif defined (__ia64__)
/* ??? The IA-64 unwinder doesn't compensate for signals. */