[PATCH] D34956: [ELF] - Store pointer to PT_LOAD instead of pointer to first section (FirstInPtLoad) in OutputSection

Rui Ueyama via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Sep 5 17:55:35 PDT 2017


ruiu added inline comments.


================
Comment at: ELF/LinkerScript.cpp:728
 
+static OutputSection *getFirstSection(PhdrEntry *Load) {
+  for (OutputSection *Sec : OutputSections)
----------------
I'd name this `findSection` as it finds a given argument from a list. "get" prefix doesn't feel perfectly match to what this function does.


================
Comment at: ELF/OutputSections.h:71
+  // section in PT_LOAD.
+  PhdrEntry *Load = nullptr;
 
----------------
grimar wrote:
> ruiu wrote:
> > `Load` is not a good name, no? `Phdr` is better.
> `Phdr` stands for "program header", there are lot of them, isn't it too generic name ?
> We want to store pointer to loadable segment section resides in, so may be `LoadPhdr` or `PtLoad` 
> is better ?
I think I prefer PtLoad over LoadPhdr.


https://reviews.llvm.org/D34956





More information about the llvm-commits mailing list