[PATCH] D18743: [ELF] - Do not handle ELF and program header as dummy sections

Rui Ueyama via llvm-commits llvm-commits at lists.llvm.org
Mon Apr 4 13:24:28 PDT 2016


ruiu added inline comments.

================
Comment at: ELF/Writer.cpp:103
@@ -105,10 +102,3 @@
   std::vector<std::unique_ptr<OutputSectionBase<ELFT>>> OwningSections;
-
-  // We create a section for the ELF header and one for the program headers.
-  ArrayRef<OutputSectionBase<ELFT> *> getSections() const {
-    return makeArrayRef(OutputSections).slice(dummySectionsNum());
-  }
-  unsigned getNumSections() const {
-    return OutputSections.size() + 1 - dummySectionsNum();
-  }
+  unsigned getNumSections() const { return OutputSections.size() + 1; }
 
----------------
It's a bit weird to count the first null entry of the section table as a section. You can just remove this function, no?


http://reviews.llvm.org/D18743





More information about the llvm-commits mailing list