[PATCH] D55852: [elfabi] Add support for reading DT_NEEDED from binaries

Rui Ueyama via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Dec 18 17:11:14 PST 2018


ruiu added inline comments.


================
Comment at: llvm/test/tools/llvm-elfabi/binary-read-neededlibs.test:35
+    Address:         0x3000
+#                     \0 l i b f o o . s o\0 l i b b a r . s o\0 s o m e l i b . s o\0 f o o\0
+    Content:         "006c6962666f6f2e736f006c69626261722e736f00736f6d656c69622e736f00666f6f00"
----------------
nit: remove extraneous space characters?


================
Comment at: llvm/tools/llvm-elfabi/ELFObjHandler.cpp:130
+      const char *SoNamePtr = DynStr.data() + LibNameOffset;
+      TargetStub.NeededLibs.push_back(SoNamePtr);
+      NeededLibCount++;
----------------
Is `NeededLibs` empty on function entry? If so, you can return `TargetStub.NeededLibs.count()` and remove `NeededLibCount` variable.


Repository:
  rL LLVM

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D55852/new/

https://reviews.llvm.org/D55852





More information about the llvm-commits mailing list