[PATCH] D78342: [lld] Add archive file support to Mach-O backend

Shoaib Meenai via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu May 7 15:14:34 PDT 2020


smeenai added inline comments.


================
Comment at: lld/MachO/SymbolTable.cpp:59
     replaceSymbol<Undefined>(s, name);
   return s;
 }
----------------
smeenai wrote:
> We need to add a check here where if the existing symbol `isa<LazySymbol>`, we fetch that archive member. A consequence is that we need to store a pointer to the `ArchiveFile` in the `LazySymbol`.
> 
> We should add a test for this case, where the archive file appears on the link line before the object file, and its members should still be fetched.
LLD ELF moved its symbol resolution logic from SymbolTable to Symbol last year, so it's hard to find the direct analogue for this, but https://github.com/llvm/llvm-project/blob/edf0391491e3a2076779c5da2c0dfc1829585d64/lld/ELF/Symbols.cpp#L253 is the equivalent logic there. https://github.com/llvm/llvm-project/blob/edf0391491e3a2076779c5da2c0dfc1829585d64/lld/COFF/SymbolTable.cpp#L485 is the equivalent logic in the SymbolTable in COFF.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D78342/new/

https://reviews.llvm.org/D78342





More information about the llvm-commits mailing list