[lld] [LLD][COFF] Add support for ARM64EC import call thunks. (PR #107931)

Jacek Caban via llvm-commits llvm-commits at lists.llvm.org
Mon Sep 9 15:46:46 PDT 2024


cjacek wrote:

Depends on #107929.

In its current form, this may cause a relocation error if the offset
to `__icall_helper_arm64ec` is too large. MSVC handles this by generating
range extension thunks in such cases. However, implementing this with the 
current LLD architecture is tricky. My plan is to inline the range extension 
thunks instead, which is both simpler and slightly more performant. See
https://github.com/cjacek/llvm-project/commit/93104988b8105a9f48dd9a994feb84a4ed44c850 for a draft.

The `loadconfig-arm64ec.s` change is not strictly necessary with the current 
implementation, but it is required when testing with MSVC. For some reason, 
the MSVC linker requires the `__os_arm64x_dispatch_icall` symbol to be provided 
by the CRT. Normally, it would be pulled in with the `__icall_helper_arm64ec` 
implementation, but it is still required even when using the `__icall_helper_arm64ec` 
stub, as in the tests for this PR.


https://github.com/llvm/llvm-project/pull/107931


More information about the llvm-commits mailing list