[lld] [LLD][COFF] Swap the meaning of symtab and hybridSymtab in hybrid images (PR #135093)

Martin Storsjö via llvm-commits llvm-commits at lists.llvm.org
Fri Apr 11 04:11:49 PDT 2025


================
@@ -41,16 +41,16 @@ class COFFLinkerContext : public CommonLinkerContext {
 
   // Returns the appropriate symbol table for the specified machine type.
   SymbolTable &getSymtab(llvm::COFF::MachineTypes machine) {
-    if (hybridSymtab && (machine == ARM64EC || machine == AMD64))
+    if (hybridSymtab && machine == ARM64)
       return *hybridSymtab;
     return symtab;
   }
 
   // Invoke the specified callback for each symbol table.
   void forEachSymtab(std::function<void(SymbolTable &symtab)> f) {
-    f(symtab);
     if (hybridSymtab)
       f(*hybridSymtab);
+    f(symtab);
----------------
mstorsjo wrote:

I see that we maintain the strict order that we first deal with the native one, then the arm64ec one. I guess this makes a difference for e.g. the order within sections? (Perhaps this case would need a comment?)

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


More information about the llvm-commits mailing list