Skip to content

Commit 192c54e

Browse files
Empty symbol tables exist
1 parent 4336163 commit 192c54e

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

lld/MachO/InputFiles.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2159,7 +2159,8 @@ ArchiveFile::ArchiveFile(std::unique_ptr<object::Archive> &&f, bool forceHidden)
21592159
void ArchiveFile::addLazySymbols() {
21602160
// Avoid calling getMemoryBufferRef() on zero-symbol archive
21612161
// since that crashes.
2162-
if (file->isEmpty())
2162+
if (file->isEmpty() ||
2163+
(file->hasSymbolTable() && file->getNumberOfSymbols() == 0))
21632164
return;
21642165

21652166
if (!file->hasSymbolTable()) {

0 commit comments

Comments
 (0)