[LLD][ELF] - Simplify. NFC.

isHeaderSection can be useful I believe,
but probably not right now and not
for this case.

llvm-svn: 338699
This commit is contained in:
George Rimar 2018-08-02 10:59:28 +00:00
parent 090d58b2b5
commit 6fe30771aa
1 changed files with 1 additions and 6 deletions

View File

@ -751,10 +751,6 @@ MemoryRegion *LinkerScript::findMemoryRegion(OutputSection *Sec) {
return nullptr;
}
static bool isHeaderSection(OutputSection *Sec) {
return Sec == Out::ElfHeader || Sec == Out::ProgramHeaders;
}
static OutputSection *findFirstSection(PhdrEntry *Load) {
for (OutputSection *Sec : OutputSections)
if (Sec->PtLoad == Load)
@ -790,8 +786,7 @@ void LinkerScript::assignOffsets(OutputSection *Sec) {
// This, however, should only be done by the first "non-header" section
// in the segment.
if (PhdrEntry *L = Ctx->OutSec->PtLoad)
if ((Sec == L->FirstSec) ||
(isHeaderSection(L->FirstSec) && (Sec == findFirstSection(L))))
if (Sec == findFirstSection(L))
L->LMAOffset = Ctx->LMAOffset;
// We can call this method multiple times during the creation of