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

Jacek Caban via llvm-commits llvm-commits at lists.llvm.org
Fri Apr 11 06:47:01 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);
----------------
cjacek wrote:

Yes, things should generally work if we change the order, but it would result in a different ordering of some chunks, which would be visible. I’ll add a comment, thanks for the review!

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


More information about the llvm-commits mailing list