[PATCH] D31836: [lld] Keep full library path in DT_NEEDED

Rui Ueyama via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Apr 10 11:07:22 PDT 2017


ruiu added inline comments.


================
Comment at: ELF/Driver.cpp:156
 // Newly created memory buffers are owned by this driver.
-void LinkerDriver::addFile(StringRef Path) {
+void LinkerDriver::addFile(StringRef Path, bool SharedFoundFromSearchPaths) {
   using namespace sys::fs;
----------------
This variable name seems too long and too abstract. I prefer something like `WithLOption`.


================
Comment at: ELF/Driver.cpp:187
     Files.push_back(createSharedFile(MBRef));
+    Files.back()->SharedFoundFromSearchPaths = SharedFoundFromSearchPaths;
     return;
----------------
The logic to choose the default SO name is buried inside InputFiles.cpp which I don't think very easy to read. I'd probably process it right here for clarity.

  if (WithLOption)
    Files.back()->DefaultSoName = sys::path::filename(Path);
  else
    Files.back()->DefaultSoName = Path;



================
Comment at: ELF/Driver.h:30
   void main(ArrayRef<const char *> Args, bool CanExitEarly);
-  void addFile(StringRef Path);
+  void addFile(StringRef Path, bool SharedFoundFromSearchPaths = false);
   void addLibrary(StringRef Name);
----------------
Please avoid using default arguments to make things explicit.


Repository:
  rL LLVM

https://reviews.llvm.org/D31836





More information about the llvm-commits mailing list