diff --git a/lld/ELF/InputFiles.cpp b/lld/ELF/InputFiles.cpp --- a/lld/ELF/InputFiles.cpp +++ b/lld/ELF/InputFiles.cpp @@ -1715,6 +1715,11 @@ if (isBitcode(mb)) return make(mb, archiveName, offsetInArchive, /*lazy=*/false); + // If it is a fatLTO object file + Expected fatLTOData = IRObjectFile::findBitcodeInMemBuffer(mb); + if (!errorToBool(fatLTOData.takeError())) + return make(*fatLTOData, archiveName, offsetInArchive, /*lazy=*/false); + switch (getELFKind(mb, archiveName)) { case ELF32LEKind: return make>(mb, archiveName); diff --git a/llvm/lib/Object/ObjectFile.cpp b/llvm/lib/Object/ObjectFile.cpp --- a/llvm/lib/Object/ObjectFile.cpp +++ b/llvm/lib/Object/ObjectFile.cpp @@ -79,7 +79,7 @@ bool ObjectFile::isSectionBitcode(DataRefImpl Sec) const { Expected NameOrErr = getSectionName(Sec); if (NameOrErr) - return *NameOrErr == ".llvmbc"; + return *NameOrErr == ".llvmbc" || *NameOrErr == ".fatlto"; consumeError(NameOrErr.takeError()); return false; }