[Ada] Code cleanups in System.Atomic_Counters
[official-gcc.git] / libsanitizer / sanitizer_common / sanitizer_common_interceptors_vfork_x86_64.inc.S
blob8147cdd0924730b39eca04e4c2b66a6d08787bc2
1 #if defined(__x86_64__) && defined(__linux__)
3 #include "sanitizer_common/sanitizer_asm.h"
5 .comm _ZN14__interception10real_vforkE,8,8
6 .globl ASM_WRAPPER_NAME(vfork)
7 ASM_TYPE_FUNCTION(ASM_WRAPPER_NAME(vfork))
8 ASM_WRAPPER_NAME(vfork):
9         // Store return address in the spill area and tear down the stack frame.
10         push    %rcx
11         call    COMMON_INTERCEPTOR_SPILL_AREA
12         pop     %rcx
13         pop     %rdi
14         mov     %rdi, (%rax)
16         call    *_ZN14__interception10real_vforkE(%rip)
18         // Restore return address from the spill area.
19         push    %rcx
20         push    %rax
21         call    COMMON_INTERCEPTOR_SPILL_AREA
22         mov     (%rax), %rdx
23         mov     %rdx, 8(%rsp)
24         mov     (%rsp), %rax
26         // Call handle_vfork in the parent process (%rax != 0).
27         test    %rax, %rax
28         je      .L_exit
30         lea     16(%rsp), %rdi
31         call    COMMON_INTERCEPTOR_HANDLE_VFORK@PLT
33 .L_exit:
34         pop     %rax
35         ret
36 ASM_SIZE(vfork)
38 .weak vfork
39 .set vfork, ASM_WRAPPER_NAME(vfork)
41 #endif