[PATCH] D25495: [ThinLTO] Avoid archive member collisions

Peter Collingbourne via llvm-commits llvm-commits at lists.llvm.org
Wed Oct 12 12:26:48 PDT 2016


pcc added a comment.

In https://reviews.llvm.org/D25495#568493, @ruiu wrote:

> I'm wondering if InputFile::getName() should return a unique name, such as "some/path/foobar.a:123:x.o" where 123 is an offset in the archive.


That might be something we could do in `lld::elf::getFilename()`. It could be confusing in the normal case, so maybe we could do it only if the archive contains duplicate names?



================
Comment at: ELF/InputFiles.cpp:491
                          Ret.getBuffer());
-
-  return Ret;
+  return {Ret, C.getChildOffset()};
 }
----------------
If this is a thin archive, I don't think `getChildOffset` will give us the right value (looking at the implementation, it appears that it will return a garbage value for thin archive members). Maybe return 0 if thin?


https://reviews.llvm.org/D25495





More information about the llvm-commits mailing list