Put r7 back into clobber registers in sys_clone() for thumb2.
This change reverts this previous change: https://chromium.googlesource.com/linux-syscall-support/+/77ebebeffe70f6c41493f239e0a1bc449cc6b009%5E!/
The compiler bug causing the workaround is no longer present in modern GCC,
and the workaround was busted if the compiler happened to assign r7
to the __res variable.
More discussion at https://bugzilla.mozilla.org/show_bug.cgi?id=1247399#c12
R=markus@chromium.org
BUG=https://bugs.chromium.org/p/linux-syscall-support/issues/detail?id=13
Patch contributed by Ted Mielczarek (ted.mielczarek@gmail.com).
Review URL: https://codereview.chromium.org/1903833002 .
diff --git a/linux_syscall_support.h b/linux_syscall_support.h
index 9dbd239..a5bcb9b 100644
--- a/linux_syscall_support.h
+++ b/linux_syscall_support.h
@@ -2603,9 +2603,6 @@
__asm__ __volatile__(/* if (fn == NULL || child_stack == NULL)
* return -EINVAL;
*/
-#ifdef __thumb2__
- "push {r7}\n"
-#endif
"cmp %2,#0\n"
"it ne\n"
"cmpne %3,#0\n"
@@ -2661,19 +2658,12 @@
"mov r7, %10\n"
"swi 0x0\n"
"1:\n"
-#ifdef __thumb2__
- "pop {r7}"
-#endif
: "=r" (__res)
: "i"(-EINVAL),
"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);
}