Index: lld/trunk/COFF/Driver.cpp =================================================================== --- lld/trunk/COFF/Driver.cpp +++ lld/trunk/COFF/Driver.cpp @@ -310,9 +310,10 @@ auto mbOrErr = future->get(); if (mbOrErr.second) reportBufferError(errorCodeToError(mbOrErr.second), childName); + // Pass empty string as archive name so that the original filename is + // used as the buffer identifier. driver->addArchiveBuffer(takeBuffer(std::move(mbOrErr.first)), - toCOFFString(sym), parentName, - /*OffsetInArchive=*/0); + toCOFFString(sym), "", /*OffsetInArchive=*/0); }); } Index: lld/trunk/test/COFF/thinlto-index-only.ll =================================================================== --- lld/trunk/test/COFF/thinlto-index-only.ll +++ lld/trunk/test/COFF/thinlto-index-only.ll @@ -41,6 +41,17 @@ ; BACKEND2-NEXT: