fix debugger tracking of shared libraries on mips with PIE main program
[musl] / src / thread / x86_64 / syscall_cp.s
index 8b25048..4f10171 100644 (file)
@@ -1,13 +1,20 @@
 .text
+.global __cp_begin
+.hidden __cp_begin
+.global __cp_end
+.hidden __cp_end
+.global __cp_cancel
+.hidden __cp_cancel
+.hidden __cancel
 .global __syscall_cp_asm
-.type   __syscall_cp_asm,%function
+.hidden __syscall_cp_asm
+.type   __syscall_cp_asm,@function
 __syscall_cp_asm:
-       lea 1f(%rip),%rax
-       mov %rax,8(%rdi)
-       mov %rsp,(%rdi)
-       mov 16(%rdi),%eax
+
+__cp_begin:
+       mov (%rdi),%eax
        test %eax,%eax
-       jnz 2f
+       jnz __cp_cancel
        mov %rdi,%r11
        mov %rsi,%rax
        mov %rdx,%rdi
@@ -17,9 +24,8 @@ __syscall_cp_asm:
        mov 8(%rsp),%r8
        mov 16(%rsp),%r9
        mov %r11,8(%rsp)
-1:     syscall
-       xor %ecx,%ecx
-       mov 8(%rsp),%edi
-       mov %rcx,(%rdi)
+       syscall
+__cp_end:
        ret
-2:     call __cancel
+__cp_cancel:
+       jmp __cancel