1 #if defined(__aarch64__) && defined(__linux__)
3 #include "sanitizer_common/sanitizer_asm.h"
4 #include "builtins/assembly.h"
6 ASM_HIDDEN(COMMON_INTERCEPTOR_SPILL_AREA)
8 .comm _ZN14__interception10real_vforkE,8,8
9 .globl ASM_WRAPPER_NAME(vfork)
10 ASM_TYPE_FUNCTION(ASM_WRAPPER_NAME(vfork))
11 ASM_WRAPPER_NAME(vfork):
12 // Save x30 in the off-stack spill area.
14 stp xzr, x30, [sp, #-16]!
15 bl COMMON_INTERCEPTOR_SPILL_AREA
16 ldp xzr, x30, [sp], 16
19 // Call real vfork. This may return twice. User code that runs between the first and the second return
20 // may clobber the stack frame of the interceptor; that's why it does not have a frame.
21 adrp x0, _ZN14__interception10real_vforkE
22 ldr x0, [x0, :lo12:_ZN14__interception10real_vforkE]
25 stp x0, xzr, [sp, #-16]!
29 // x0 != 0 => parent process. Clear stack shadow.
31 bl COMMON_INTERCEPTOR_HANDLE_VFORK
35 bl COMMON_INTERCEPTOR_SPILL_AREA
44 .set vfork, ASM_WRAPPER_NAME(vfork)