summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lld/ELF/LinkerScript.cpp7
1 files changed, 1 insertions, 6 deletions
diff --git a/lld/ELF/LinkerScript.cpp b/lld/ELF/LinkerScript.cpp
index 52a46e66320..d94970e4847 100644
--- a/lld/ELF/LinkerScript.cpp
+++ b/lld/ELF/LinkerScript.cpp
@@ -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
OpenPOWER on IntegriCloud