|
From: <sv...@va...> - 2011-09-26 17:55:33
|
Author: sewardj
Date: 2011-09-26 18:50:46 +0100 (Mon, 26 Sep 2011)
New Revision: 12049
Log:
run_a_thread_NORETURN: add trashed-register annotations for the magic
bits of assembly which finally cause the thread to exit. How this
ever worked before, on any platform, beats me. The lack was causing
some Android builds to segfault at thread exit. Only the s390 version
was correct.
Modified:
trunk/coregrind/m_syswrap/syswrap-linux.c
Modified: trunk/coregrind/m_syswrap/syswrap-linux.c
===================================================================
--- trunk/coregrind/m_syswrap/syswrap-linux.c 2011-09-26 16:46:04 UTC (rev 12048)
+++ trunk/coregrind/m_syswrap/syswrap-linux.c 2011-09-26 17:50:46 UTC (rev 12049)
@@ -205,7 +205,9 @@
"movl %3, %%ebx\n" /* set %ebx = tst->os_state.exitcode */
"int $0x80\n" /* exit(tst->os_state.exitcode) */
: "=m" (tst->status)
- : "n" (VgTs_Empty), "n" (__NR_exit), "m" (tst->os_state.exitcode));
+ : "n" (VgTs_Empty), "n" (__NR_exit), "m" (tst->os_state.exitcode)
+ : "eax", "ebx"
+ );
#elif defined(VGP_amd64_linux)
asm volatile (
"movl %1, %0\n" /* set tst->status = VgTs_Empty */
@@ -213,7 +215,9 @@
"movq %3, %%rdi\n" /* set %rdi = tst->os_state.exitcode */
"syscall\n" /* exit(tst->os_state.exitcode) */
: "=m" (tst->status)
- : "n" (VgTs_Empty), "n" (__NR_exit), "m" (tst->os_state.exitcode));
+ : "n" (VgTs_Empty), "n" (__NR_exit), "m" (tst->os_state.exitcode)
+ : "rax", "rdi"
+ );
#elif defined(VGP_ppc32_linux) || defined(VGP_ppc64_linux)
{ UInt vgts_empty = (UInt)VgTs_Empty;
asm volatile (
@@ -222,7 +226,9 @@
"lwz 3,%3\n\t" /* set r3 = tst->os_state.exitcode */
"sc\n\t" /* exit(tst->os_state.exitcode) */
: "=m" (tst->status)
- : "r" (vgts_empty), "n" (__NR_exit), "m" (tst->os_state.exitcode));
+ : "r" (vgts_empty), "n" (__NR_exit), "m" (tst->os_state.exitcode)
+ : "r0", "r3"
+ );
}
#elif defined(VGP_arm_linux)
asm volatile (
@@ -231,7 +237,9 @@
"ldr r0, %3\n" /* set %r0 = tst->os_state.exitcode */
"svc 0x00000000\n" /* exit(tst->os_state.exitcode) */
: "=m" (tst->status)
- : "r" (VgTs_Empty), "n" (__NR_exit), "m" (tst->os_state.exitcode));
+ : "r" (VgTs_Empty), "n" (__NR_exit), "m" (tst->os_state.exitcode)
+ : "r0", "r7"
+ );
#elif defined(VGP_s390x_linux)
asm volatile (
"st %1, %0\n" /* set tst->status = VgTs_Empty */
@@ -239,7 +247,8 @@
"svc %2\n" /* exit(tst->os_state.exitcode) */
: "=m" (tst->status)
: "d" (VgTs_Empty), "n" (__NR_exit), "m" (tst->os_state.exitcode)
- : "2");
+ : "2"
+ );
#else
# error Unknown platform
#endif
|