[lld] [lld-macho] Support archives without index (PR #132942)

Nico Weber via llvm-commits llvm-commits at lists.llvm.org
Tue Apr 8 07:32:02 PDT 2025


================
@@ -2156,9 +2156,34 @@ ArchiveFile::ArchiveFile(std::unique_ptr<object::Archive> &&f, bool forceHidden)
 void ArchiveFile::addLazySymbols() {
   // Avoid calling getMemoryBufferRef() on zero-symbol archive
   // since that crashes.
-  if (file->isEmpty() || file->getNumberOfSymbols() == 0)
+  if (file->isEmpty())
     return;
 
+  if (file->getNumberOfSymbols() == 0) {
----------------
nico wrote:

`if (!file->hasSymbolTable())`?

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


More information about the llvm-commits mailing list