Fix compilation of server.cc on hpux.
[official-gcc.git] / libsanitizer / sanitizer_common / sanitizer_common_interceptors_vfork_x86_64.inc.S
blob8fd18ea67ffd2b6e912980c667c80f3df0222338
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         _CET_ENDBR
10         // Store return address in the spill area and tear down the stack frame.
11         push    %rcx
12         call    COMMON_INTERCEPTOR_SPILL_AREA
13         pop     %rcx
14         pop     %rdi
15         mov     %rdi, (%rax)
17         call    *_ZN14__interception10real_vforkE(%rip)
19         // Restore return address from the spill area.
20         push    %rcx
21         push    %rax
22         call    COMMON_INTERCEPTOR_SPILL_AREA
23         mov     (%rax), %rdx
24         mov     %rdx, 8(%rsp)
25         mov     (%rsp), %rax
27         // Call handle_vfork in the parent process (%rax != 0).
28         test    %rax, %rax
29         je      .L_exit
31         lea     16(%rsp), %rdi
32         call    COMMON_INTERCEPTOR_HANDLE_VFORK@PLT
34 .L_exit:
35         pop     %rax
36         ret
37 ASM_SIZE(vfork)
39 .weak vfork
40 .set vfork, ASM_WRAPPER_NAME(vfork)
42 #endif