[PATCH] D46727: Use object address instead of offset in an archive file.

Rui Ueyama via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu May 10 14:37:12 PDT 2018


ruiu created this revision.
ruiu added a reviewer: pcc.
Herald added subscribers: arichardson, emaste.
Herald added a reviewer: espindola.

This patch is more like a question than a real change I want to submit,
but can we just use object address to make each file in an archive has
a unique identifier? If this is OK, we don't need to pass OffsetInArchive
to the ctor.


https://reviews.llvm.org/D46727

Files:
  lld/ELF/InputFiles.cpp


Index: lld/ELF/InputFiles.cpp
===================================================================
--- lld/ELF/InputFiles.cpp
+++ lld/ELF/InputFiles.cpp
@@ -1035,7 +1035,7 @@
   MemoryBufferRef MBRef(
       MB.getBuffer(),
       Saver.save(ArchiveName + MB.getBufferIdentifier() +
-                 (ArchiveName.empty() ? "" : utostr(OffsetInArchive))));
+                 (ArchiveName.empty() ? "" : utostr(reinterpret_cast<uint64_t>(MB.getBufferStart())))));
   Obj = CHECK(lto::InputFile::create(MBRef), this);
 
   Triple T(Obj->getTargetTriple());


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D46727.146228.patch
Type: text/x-patch
Size: 554 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180510/8b453635/attachment.bin>


More information about the llvm-commits mailing list