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