diff --git a/libc/arch-arm/bionic/__bionic_clone.S b/libc/arch-arm/bionic/__bionic_clone.S index 2643ae00d..48f2f98a5 100644 --- a/libc/arch-arm/bionic/__bionic_clone.S +++ b/libc/arch-arm/bionic/__bionic_clone.S @@ -60,10 +60,10 @@ ENTRY(__bionic_clone) b __set_errno 1: # The child. - # Setting lr to 0 will make the unwinder stop at __bionic_clone_entry + # Setting lr to 0 will make the unwinder stop at __start_thread mov lr, #0 ldr r0, [sp, #-4] ldr r1, [sp, #-8] - b __bionic_clone_entry + b __start_thread END(__bionic_clone) .hidden __bionic_clone diff --git a/libc/arch-arm64/bionic/__bionic_clone.S b/libc/arch-arm64/bionic/__bionic_clone.S index d3c03742d..76fe24e43 100644 --- a/libc/arch-arm64/bionic/__bionic_clone.S +++ b/libc/arch-arm64/bionic/__bionic_clone.S @@ -62,10 +62,10 @@ ENTRY(__bionic_clone) .L_bc_child: # We're in the child now. Set the end of the frame record chain... mov x29, xzr - # Setting x30 to 0 will make the unwinder stop at __bionic_clone_entry + # Setting x30 to 0 will make the unwinder stop at __start_thread mov x30, xzr - # ...and call __bionic_clone_entry with the 'fn' and 'arg' we stored on the child stack. + # ...and call __start_thread with the 'fn' and 'arg' we stored on the child stack. ldp x0, x1, [sp, #-16] - b __bionic_clone_entry + b __start_thread END(__bionic_clone) .hidden __bionic_clone diff --git a/libc/arch-mips/bionic/__bionic_clone.S b/libc/arch-mips/bionic/__bionic_clone.S index 7b138ae43..4b4498d5e 100644 --- a/libc/arch-mips/bionic/__bionic_clone.S +++ b/libc/arch-mips/bionic/__bionic_clone.S @@ -60,8 +60,8 @@ ENTRY(__bionic_clone) lw a0,0(sp) # fn lw a1,4(sp) # arg - # void __bionic_clone_entry(int (*func)(void*), void *arg) - la t9,__bionic_clone_entry + # void __start_thread(int (*func)(void*), void *arg) + la t9,__start_thread j t9 .L__error_bc: diff --git a/libc/arch-mips64/bionic/__bionic_clone.S b/libc/arch-mips64/bionic/__bionic_clone.S index 868790630..4f053f99a 100644 --- a/libc/arch-mips64/bionic/__bionic_clone.S +++ b/libc/arch-mips64/bionic/__bionic_clone.S @@ -78,10 +78,10 @@ LEAF(__bionic_clone, FRAMESZ) # Clear return address in child so we don't unwind further. li ra,0 - # void __bionic_clone_entry(int (*func)(void*), void *arg) + # void __start_thread(int (*func)(void*), void *arg) PTR_L a0,FRAME_FN(sp) # fn PTR_L a1,FRAME_ARG(sp) # arg - LA t9,__bionic_clone_entry + LA t9,__start_thread RESTORE_GP64 /* * For O32 etc the child stack must have space for a0..a3 to be stored diff --git a/libc/arch-x86/bionic/__bionic_clone.S b/libc/arch-x86/bionic/__bionic_clone.S index 0c0feff83..917dc6883 100644 --- a/libc/arch-x86/bionic/__bionic_clone.S +++ b/libc/arch-x86/bionic/__bionic_clone.S @@ -39,7 +39,7 @@ ENTRY(__bionic_clone) .L_bc_child: # We don't want anyone to unwind past this point. .cfi_undefined %eip - call __bionic_clone_entry + call __start_thread hlt .L_bc_parent: diff --git a/libc/arch-x86_64/bionic/__bionic_clone.S b/libc/arch-x86_64/bionic/__bionic_clone.S index 173ab5ce9..e0ce5a6b8 100644 --- a/libc/arch-x86_64/bionic/__bionic_clone.S +++ b/libc/arch-x86_64/bionic/__bionic_clone.S @@ -62,12 +62,12 @@ ENTRY(__bionic_clone) .cfi_undefined %rip .cfi_undefined %rbp - # We're in the child now, so call __bionic_clone_entry + # We're in the child now, so call __start_thread # with the arguments from the child stack moved into # the appropriate registers. popq %rdi # fn popq %rsi # arg - call __bionic_clone_entry + call __start_thread hlt .L_bc_parent: diff --git a/libc/bionic/clone.cpp b/libc/bionic/clone.cpp index d38a422ea..001e245d7 100644 --- a/libc/bionic/clone.cpp +++ b/libc/bionic/clone.cpp @@ -35,7 +35,7 @@ extern "C" pid_t __bionic_clone(uint32_t flags, void* child_stack, int* parent_t extern "C" __noreturn void __exit(int status); // Called from the __bionic_clone assembler to call the thread function then exit. -extern "C" __LIBC_HIDDEN__ void __bionic_clone_entry(int (*fn)(void*), void* arg) { +extern "C" __LIBC_HIDDEN__ void __start_thread(int (*fn)(void*), void* arg) { int status = (*fn)(arg); __exit(status); }