[PATCH] D24363: [ELF] Fix DT_NEEDED value

Rui Ueyama via llvm-commits llvm-commits at lists.llvm.org
Thu Sep 8 13:34:09 PDT 2016


ruiu added inline comments.

================
Comment at: ELF/OutputSections.cpp:689-690
@@ -687,3 +688,4 @@
     if (F->isNeeded())
-      Add({DT_NEEDED, Out<ELFT>::DynStrTab->addString(F->getSoName())});
+      Add({DT_NEEDED, Out<ELFT>::DynStrTab->addString(
+                          sys::path::filename(F->getSoName()))});
   if (!Config->SoName.empty())
----------------
Currently, the default soname (used if DT_SONAME is absent) if an absolute path of a library, which I think wrong. Look at SharedFile<ELFT>::parseSoName. You want to fix SoName default value in that function instead of fixing it here.


https://reviews.llvm.org/D24363





More information about the llvm-commits mailing list