Alexandre Julliard : ntdll: Use a custom signal restorer for Android.

Alexandre Julliard julliard at wine.codeweavers.com
Thu Jul 17 14:05:50 CDT 2014


Module: wine
Branch: master
Commit: 1b1ea639cd66c8c3ea690afc5a346651364d36b1
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=1b1ea639cd66c8c3ea690afc5a346651364d36b1

Author: Alexandre Julliard <julliard at winehq.org>
Date:   Thu Jul 17 14:51:12 2014 +0200

ntdll: Use a custom signal restorer for Android.

Bionic doesn't provide one, even when vdso has been unmapped by the
preloader.

---

 dlls/ntdll/signal_i386.c | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/dlls/ntdll/signal_i386.c b/dlls/ntdll/signal_i386.c
index 5f8b8fd..7b4bc72 100644
--- a/dlls/ntdll/signal_i386.c
+++ b/dlls/ntdll/signal_i386.c
@@ -135,6 +135,12 @@ typedef struct ucontext
 #define FPU_sig(context)     ((FLOATING_SAVE_AREA*)((context)->uc_mcontext.fpstate))
 #define FPUX_sig(context)    (FPU_sig(context) && !((context)->uc_mcontext.fpstate->status >> 16) ? (XMM_SAVE_AREA32 *)(FPU_sig(context) + 1) : NULL)
 
+/* custom signal restorer since we may have unmapped the one in vdso, and bionic doesn't check for that */
+void rt_sigreturn(void);
+__ASM_GLOBAL_FUNC( rt_sigreturn,
+                   "movl $173,%eax\n\t"  /* NR_rt_sigreturn */
+                   "int $0x80" );
+
 #elif defined (__linux__)
 
 typedef ucontext_t SIGCONTEXT;
@@ -2327,7 +2333,10 @@ void signal_init_process(void)
 #ifdef SA_ONSTACK
     sig_act.sa_flags |= SA_ONSTACK;
 #endif
-
+#ifdef __ANDROID__
+    sig_act.sa_flags |= SA_RESTORER;
+    sig_act.sa_restorer = rt_sigreturn;
+#endif
     sig_act.sa_sigaction = int_handler;
     if (sigaction( SIGINT, &sig_act, NULL ) == -1) goto error;
     sig_act.sa_sigaction = fpe_handler;




More information about the wine-cvs mailing list