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

Jacek Caban via llvm-commits llvm-commits at lists.llvm.org
Tue Sep 10 14:22:06 PDT 2024


================
@@ -1093,4 +1093,21 @@ void CHPERedirectionChunk::writeTo(uint8_t *buf) const {
   }
 }
 
+ImportThunkChunkARM64EC::ImportThunkChunkARM64EC(ImportFile *file)
+    : ImportThunkChunk(file->ctx, file->impSym), file(file) {}
+
+void ImportThunkChunkARM64EC::writeTo(uint8_t *buf) const {
+  memcpy(buf, importThunkARM64EC, sizeof(importThunkARM64EC));
+  applyArm64Addr(buf, file->impSym->getRVA(), rva, 12);
+  applyArm64Ldr(buf + 4, file->impSym->getRVA() & 0xfff);
+
+  uint32_t exitThunkRVA = exitThunk ? exitThunk->getRVA() : 0;
----------------
cjacek wrote:

I will add a comment, thanks!

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


More information about the llvm-commits mailing list