diff options
author | hjl <hjl@138bc75d-0d04-0410-961f-82ee72b054a4> | 2012-03-03 17:04:49 +0000 |
---|---|---|
committer | hjl <hjl@138bc75d-0d04-0410-961f-82ee72b054a4> | 2012-03-03 17:04:49 +0000 |
commit | 70d595c8e41c9a7fdf5049c5a48c3b50304c8cbe (patch) | |
tree | 85b4d2e3bed245e2ce2b3cfbce99eccec9880473 /gcc/ada/init.c | |
parent | 8e6180019e60d0127a41c7d1de855a1977155a81 (diff) | |
download | gcc-70d595c8e41c9a7fdf5049c5a48c3b50304c8cbe.tar.gz |
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.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@184859 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/ada/init.c')
-rw-r--r-- | gcc/ada/init.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/gcc/ada/init.c b/gcc/ada/init.c index 18280c28ca9..80a02b1734f 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. */ |