crt: Implement the indirect call helper ARM64EC adjustor thunk Calls to this are synthesized by the linker where it is used for calling into import libraries, this is referred to as an 'Adjustor Thunk' in ARM64EC documentation. Signed-off-by: Jacek Caban <jacek@codeweavers.com>
diff --git a/mingw-w64-crt/crt/chpe.S b/mingw-w64-crt/crt/chpe.S index 8311da1..20d9622 100644 --- a/mingw-w64-crt/crt/chpe.S +++ b/mingw-w64-crt/crt/chpe.S
@@ -83,3 +83,26 @@ .rva __os_arm64x_helper6 .rva __os_arm64x_helper7 .rva __os_arm64x_helper8 + +/* + * Calls to this are synthesized by the linker when calling into import libraries, + * this is referred to as an 'Adjustor Thunk' in ARM64EC documentation. +*/ + .text + .balign 16 +EXPORT_SYM(__icall_helper_arm64ec) + .seh_proc "__icall_helper_arm64ec" + stp fp, lr, [sp, #-16]! + .seh_save_fplr_x 16 + mov fp, sp + .seh_set_fp + .seh_endprologue + adrp x16, __os_arm64x_check_icall + ldr x16, [x16, #:lo12:__os_arm64x_check_icall] + blr x16 + .seh_startepilogue + ldp fp, lr, [sp], #16 + .seh_save_fplr_x 16 + .seh_endepilogue + br x11 + .seh_endproc