[PATCH] D41613: [ELF] - Do not use HeaderSize for conditions in PltSection.

Rui Ueyama via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jan 11 13:01:25 PST 2018


ruiu accepted this revision.
ruiu added a comment.

LGTM with these changes.



================
Comment at: ELF/SyntheticSections.cpp:1875
     Target->writePltHeader(Buf);
-  size_t Off = HeaderSize;
   // The IPlt is immediately after the Plt, account for this in RelOff
----------------
OK this change isn't pretty. Pleasse keep HeaderSize and remove getHeaderSize.


================
Comment at: ELF/SyntheticSections.h:509
   std::vector<std::pair<const Symbol *, unsigned>> Entries;
-  // Iplt always has HeaderSize of 0, the Plt HeaderSize is always non-zero
-  size_t HeaderSize;
+  // True if section is Iplt.
+  bool IsIplt;
----------------
That `IsIplt` is true if it is Iplt is obvious, no? If you change this to something like "true if IPLT. false if the regular PLT", that would be nontrivial. But I doubt we need it though.


https://reviews.llvm.org/D41613





More information about the llvm-commits mailing list