forked from OSchip/llvm-project
[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:
parent
090d58b2b5
commit
6fe30771aa
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue