[lld] r338699 - [LLD][ELF] - Simplify. NFC.

George Rimar via llvm-commits llvm-commits at lists.llvm.org
Thu Aug 2 03:59:28 PDT 2018


Author: grimar
Date: Thu Aug  2 03:59:28 2018
New Revision: 338699

URL: http://llvm.org/viewvc/llvm-project?rev=338699&view=rev
Log:
[LLD][ELF] - Simplify. NFC.

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

Modified:
    lld/trunk/ELF/LinkerScript.cpp

Modified: lld/trunk/ELF/LinkerScript.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/LinkerScript.cpp?rev=338699&r1=338698&r2=338699&view=diff
==============================================================================
--- lld/trunk/ELF/LinkerScript.cpp (original)
+++ lld/trunk/ELF/LinkerScript.cpp Thu Aug  2 03:59:28 2018
@@ -751,10 +751,6 @@ MemoryRegion *LinkerScript::findMemoryRe
   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(OutputS
   // 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




More information about the llvm-commits mailing list