1 #if defined(__loongarch_lp64) && defined(__linux__)
3 #include "sanitizer_common/sanitizer_asm.h"
5 ASM_HIDDEN(COMMON_INTERCEPTOR_SPILL_AREA)
6 ASM_HIDDEN(_ZN14__interception10real_vforkE)
9 .globl ASM_WRAPPER_NAME(vfork)
10 ASM_TYPE_FUNCTION(ASM_WRAPPER_NAME(vfork))
11 ASM_WRAPPER_NAME(vfork):
12 // Save ra in the off-stack spill area.
13 // allocate space on stack
17 bl COMMON_INTERCEPTOR_SPILL_AREA
18 // restore previous values from stack
25 // Call real vfork. This may return twice. User code that runs between the first and the second return
26 // may clobber the stack frame of the interceptor; that's why it does not have a frame.
27 la.local $a0, _ZN14__interception10real_vforkE
33 // store $a0 by adjusted stack
35 // jump to exit label if $a0 is 0
38 // $a0 != 0 => parent process. Clear stack shadow.
41 bl %plt(COMMON_INTERCEPTOR_HANDLE_VFORK)
45 bl COMMON_INTERCEPTOR_SPILL_AREA
47 // load value by stack
54 ASM_INTERCEPTOR_TRAMPOLINE(vfork)
55 ASM_TRAMPOLINE_ALIAS(vfork, vfork)