diff mbox

PATCH [x32]: Support x32 __NR_rt_sigreturn

Message ID 20110803041320.GA30003@intel.com
State New
Headers show

Commit Message

H.J. Lu Aug. 3, 2011, 4:13 a.m. UTC
Hi,

X32 uses 0x40000206 for system call number __NR_rt_sigreturn and long
long is needed for 64bit integer.  OK for trunk?

Thanks.


H.J.
---
2011-08-02  H.J. Lu  <hongjiu.lu@intel.com>

	* config/i386/linux-unwind.h (RT_SIGRETURN_SYSCALL): New.
	(x86_64_fallback_frame_state): Use RT_SIGRETURN_SYSCALL and
	long long to check rt_sigreturn syscall.

Comments

Ian Lance Taylor Aug. 3, 2011, 4:38 a.m. UTC | #1
"H.J. Lu" <hongjiu.lu@intel.com> writes:

> 2011-08-02  H.J. Lu  <hongjiu.lu@intel.com>
>
> 	* config/i386/linux-unwind.h (RT_SIGRETURN_SYSCALL): New.
> 	(x86_64_fallback_frame_state): Use RT_SIGRETURN_SYSCALL and
> 	long long to check rt_sigreturn syscall.

This is OK.

Thanks.

Ian
diff mbox

Patch

diff --git a/libgcc/config/i386/linux-unwind.h b/libgcc/config/i386/linux-unwind.h
index de44823..f17a46c 100644
--- a/libgcc/config/i386/linux-unwind.h
+++ b/libgcc/config/i386/linux-unwind.h
@@ -44,9 +44,14 @@  x86_64_fallback_frame_state (struct _Unwind_Context *context,
   struct sigcontext *sc;
   long new_cfa;
 
-  /* movq __NR_rt_sigreturn, %rax ; syscall  */
+  /* movq $__NR_rt_sigreturn, %rax ; syscall.  */
+#ifdef __LP64__
+#define RT_SIGRETURN_SYSCALL	0x050f0000000fc0c7ULL
+#else
+#define RT_SIGRETURN_SYSCALL	0x050f40002006c0c7ULL
+#endif
   if (*(unsigned char *)(pc+0) == 0x48
-      && *(unsigned long *)(pc+1) == 0x050f0000000fc0c7)
+      && *(unsigned long long *)(pc+1) == RT_SIGRETURN_SYSCALL)
     {
       struct ucontext *uc_ = context->cfa;
       /* The void * cast is necessary to avoid an aliasing warning.