[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:49 PDT 2024


================
@@ -152,6 +152,38 @@ void ObjFile::parseLazy() {
   }
 }
 
+struct ECMapEntry {
+  ulittle32_t src;
+  ulittle32_t dst;
+  ulittle32_t type;
+};
+
+void ObjFile::initializeECThunks() {
+  for (SectionChunk *chunk : hybmpChunks) {
+    if (chunk->getContents().size() % sizeof(ECMapEntry)) {
+      error("Invalid .hybmp chunk size " + Twine(chunk->getContents().size()));
+      return;
----------------
mstorsjo wrote:

Would it make sense to just continue to the next chunk, instead of flat out returning, if one chunk has an unexpected size? (OTOH, it's probably not worth continuing doing lots of work as the link will fail anyway, but one general design principle in lld, is that we try not to abort directly on the first error, but print as many relevant errors to the user as possible in one go.)

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


More information about the llvm-commits mailing list