[PATCH] D50204: [llvm-objdump] Label calls to the PLT

Paul Semel via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Aug 3 10:30:28 PDT 2018


paulsemel added inline comments.


================
Comment at: tools/llvm-objdump/llvm-objdump.cpp:1244
+          StringRef Str;
+          return !Section.getName(Str) && Str == ".plt";
+        });
----------------
pcc wrote:
> paulsemel wrote:
> > Not sure this is the correct way to get the PLT section. Here is how GNU readelf does : first, it searches in the dynamic entries, and then, if there is no dynamic tables, it tries to find by name.
> > 
> > There is a helper for getting dynamic entries in the libObject : `dynamicEntries()` in include/llvm/Object/ELF.h
> > 
> > Btw, I think it might be cool to have a helper that gets the PLT section in the libObject. And you might want to use it also in https://reviews.llvm.org/D50203.
> Is there a DT tag for the PLT? At least I can't seem to see one in either an x86_64 or aarch64 binary, which makes sense to me because from the loader's perspective the PLT is just another block of code.
Exact there is only one for the got I think.. this still look weird to search for the section name (even though 99% of the time the PLT will be called ".plt"


Repository:
  rL LLVM

https://reviews.llvm.org/D50204





More information about the llvm-commits mailing list