[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
Mon Aug 28 10:31:11 PDT 2017
ruiu added inline comments.
================
Comment at: ELF/OutputSections.h:71
+ // section in PT_LOAD.
+ PhdrEntry *Load = nullptr;
----------------
`Load` is not a good name, no? `Phdr` is better.
================
Comment at: ELF/Writer.cpp:1584-1587
+ OutputSection *First = Cmd->Load ? Cmd->Load->First : nullptr;
// If the section is not in a PT_LOAD, we just have to align it.
if (!First)
return alignTo(Off, Cmd->Alignment);
----------------
Is it possible that Cmd->Load exists but Cmd->Load->First is null? If not, simplify this to:
if (!Cmd->Load)
return alignTo(Off, Cmd->Alignment):
https://reviews.llvm.org/D34956
More information about the llvm-commits
mailing list