[lld] [LLD][COFF] Make /wholearchive thin-archive member identifiers consistent (PR #145487)

Alexandre Ganea via llvm-commits llvm-commits at lists.llvm.org
Sun Jul 20 15:06:48 PDT 2025


================
@@ -275,7 +275,12 @@ void LinkerDriver::addBuffer(std::unique_ptr<MemoryBuffer> mb,
 
       int memberIndex = 0;
       for (MemoryBufferRef m : getArchiveMembers(ctx, archive))
-        addArchiveBuffer(m, "<whole-archive>", filename, memberIndex++);
+        if (!archive->isThin())
+          addArchiveBuffer(m, "<whole-archive>", filename, memberIndex++);
+        else
+          // Pass empty string as archive name so that the original filename is
+          // used as the buffer identifier.
----------------
aganea wrote:

If you could also add a short comment about why we're setting 0 for the offset, as you did in the description, it'd be great.

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


More information about the llvm-commits mailing list