Revert "Put r7 back into clobber registers in sys_clone() for thumb2."
This reverts commit 1549d20f6d3e7d66bb4e687c0ab9da42c2bff2ac.
The code doesn't build with the newest gcc in the Android NDK else.
Change-Id: Id9a64e3d9645c119ae0f0be9c8f73a33a42e1a99
Reviewed-on: https://chromium-review.googlesource.com/463646
Reviewed-by: Mark Seaborn <mseaborn@chromium.org>
diff --git a/linux_syscall_support.h b/linux_syscall_support.h
index 126d7b7..80a3e56 100644
--- a/linux_syscall_support.h
+++ b/linux_syscall_support.h
@@ -2606,6 +2606,9 @@
__asm__ __volatile__(/* Push "arg" and "fn" onto the stack that will be
* used by the child.
*/
+#ifdef __thumb2__
+ "push {r7}\n"
+#endif
"str %4,[%2,#-4]!\n"
"str %1,[%2,#-4]!\n"
@@ -2651,11 +2654,18 @@
"mov r7, %9\n"
"swi 0x0\n"
"1:\n"
+#ifdef __thumb2__
+ "pop {r7}"
+#endif
: "=r" (__res)
: "r"(fn), "r"(__stack), "r"(__flags), "r"(arg),
"r"(__ptid), "r"(__tls), "r"(__ctid),
"i"(__NR_clone), "i"(__NR_exit)
+#ifdef __thumb2__
+ : "cc", "lr", "memory");
+#else
: "cc", "r7", "lr", "memory");
+#endif
}
LSS_RETURN(int, __res);
}