[lld] [llvm] [LLD][COFF] Add support for ARM64EC entry thunks. (PR #88132)

Martin Storsjö via llvm-commits llvm-commits at lists.llvm.org
Mon Jun 17 02:48:52 PDT 2024


================
@@ -410,6 +410,10 @@ void SectionChunk::writeTo(uint8_t *buf) const {
 
     applyRelocation(buf + rel.VirtualAddress, rel);
   }
+
+  // Write the offset to EC entry thunk preceding section contents.
+  if (Defined *entryThunk = getEntryThunk())
+    write32le(buf - sizeof(uint32_t), entryThunk->getRVA() - rva + 1);
----------------
mstorsjo wrote:

The `+1` feels quite odd here. I don't doubt that it's right, but it feels quite surprising to see an odd number when it comes to arm64 function offsets (which all should be multiples of 4). Is there something more you can write here to explain it?

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


More information about the llvm-commits mailing list