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

Rui Ueyama via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jan 10 23:37:43 PST 2018


ruiu added inline comments.


================
Comment at: ELF/SyntheticSections.cpp:1841
     : SyntheticSection(SHF_ALLOC | SHF_EXECINSTR, SHT_PROGBITS, 16, ".plt"),
-      HeaderSize(S) {
+      HeaderSize(S), IsIplt(IsIplt) {
   // The PLT needs to be writable on SPARC as the dynamic linker will
----------------
Remove HeaderSize member because it is always Target->PltHeaderSize


================
Comment at: ELF/Writer.cpp:372-374
+  InX::Plt = make<PltSection>(Target->PltHeaderSize, false /*IsIplt*/);
   Add(InX::Plt);
+  InX::Iplt = make<PltSection>(0, true /*IsIplt*/);
----------------
Passing (PltHeaderSize, false) or (0, true) is strange. You should just pass true or false and infer the header size inside the class.


https://reviews.llvm.org/D41613





More information about the llvm-commits mailing list