[lld] [LLD][COFF] Add support for ARM64X same-address thunks (PR #151255)

Martin Storsjö via llvm-commits llvm-commits at lists.llvm.org
Wed Jul 30 05:03:25 PDT 2025


================
@@ -2310,6 +2313,18 @@ void Writer::createECChunks() {
       ctx.symtab.findUnderscore("__arm64x_redirection_metadata");
   replaceSymbol<DefinedSynthetic>(entryPointsSym, entryPointsSym->getName(),
                                   entryPoints);
+
+  for (auto thunk : ctx.symtab.sameAddressThunks) {
+    wowthkSec->insertChunkAtStart(thunk);
----------------
mstorsjo wrote:

Does this mean that for each thunk, we insert it at the start, i.e. adding them in reverse order? That seems both a bit odd and inefficient. Wouldn't `wowthkSec` be empty here and we could just append to it?

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


More information about the llvm-commits mailing list