Clear link register in __bionic_clone.
Since __bionic_clone uses tail-call to invoke __bionic_clone_entry,
at runtime the unwinder will reach the stack of the clone() function,
which belongs to the parent thread, if the link register is not cleared.
BUG: 14270816
Change-Id: Ia3711c87f8b619debe73748c28b9fb8691ea698e
diff --git a/libc/arch-arm64/bionic/__bionic_clone.S b/libc/arch-arm64/bionic/__bionic_clone.S
index c49782c..d3c0374 100644
--- a/libc/arch-arm64/bionic/__bionic_clone.S
+++ b/libc/arch-arm64/bionic/__bionic_clone.S
@@ -61,9 +61,9 @@
.L_bc_child:
# We're in the child now. Set the end of the frame record chain...
- .cfi_undefined x29
- .cfi_undefined x30
mov x29, xzr
+ # Setting x30 to 0 will make the unwinder stop at __bionic_clone_entry
+ mov x30, xzr
# ...and call __bionic_clone_entry with the 'fn' and 'arg' we stored on the child stack.
ldp x0, x1, [sp, #-16]
b __bionic_clone_entry