Rename HasSections -> HasSectionsComand.
HasSections is true if there is at least one SECTIONS linker
script command, and it is not directly related to whether we have
section objects or not. So I think the new name is better.
llvm-svn: 315405
diff --git a/lld/ELF/LinkerScript.cpp b/lld/ELF/LinkerScript.cpp
index 1831c16..29a11e3 100644
--- a/lld/ELF/LinkerScript.cpp
+++ b/lld/ELF/LinkerScript.cpp
@@ -763,7 +763,7 @@
uint64_t HeaderSize = getHeaderSize();
// When linker script with SECTIONS is being used, don't output headers
// unless there's a space for them.
- uint64_t Base = HasSections ? alignDown(Min, Config->MaxPageSize) : 0;
+ uint64_t Base = HasSectionsCommand ? alignDown(Min, Config->MaxPageSize) : 0;
if (HeaderSize <= Min - Base || Script->hasPhdrsCommands()) {
Min = alignDown(Min - HeaderSize, Config->MaxPageSize);
Out::ElfHeader->Addr = Min;
diff --git a/lld/ELF/LinkerScript.h b/lld/ELF/LinkerScript.h
index 145cb31..5cf8665 100644
--- a/lld/ELF/LinkerScript.h
+++ b/lld/ELF/LinkerScript.h
@@ -251,7 +251,7 @@
// PHDRS command list.
std::vector<PhdrsCommand> PhdrsCommands;
- bool HasSections = false;
+ bool HasSectionsCommand = false;
// List of section patterns specified with KEEP commands. They will
// be kept even if they are unused and --gc-sections is specified.
diff --git a/lld/ELF/ScriptParser.cpp b/lld/ELF/ScriptParser.cpp
index 944e29f..1c2e9d3 100644
--- a/lld/ELF/ScriptParser.cpp
+++ b/lld/ELF/ScriptParser.cpp
@@ -434,7 +434,7 @@
}
void ScriptParser::readSections() {
- Script->HasSections = true;
+ Script->HasSectionsCommand = true;
// -no-rosegment is used to avoid placing read only non-executable sections in
// their own segment. We do the same if SECTIONS command is present in linker
diff --git a/lld/ELF/Writer.cpp b/lld/ELF/Writer.cpp
index cdc2c0e..283d064 100644
--- a/lld/ELF/Writer.cpp
+++ b/lld/ELF/Writer.cpp
@@ -161,7 +161,7 @@
addReservedSymbols();
// Create output sections.
- if (Script->HasSections) {
+ if (Script->HasSectionsCommand) {
// If linker script contains SECTIONS commands, let it create sections.
Script->processCommands(Factory);
@@ -813,7 +813,7 @@
addOptionalRegular<ELFT>(Name, Out::ElfHeader, 0, STV_HIDDEN);
// If linker script do layout we do not need to create any standart symbols.
- if (Script->HasSections)
+ if (Script->HasSectionsCommand)
return;
auto Add = [](StringRef S, int64_t Pos) {
@@ -1055,7 +1055,7 @@
if (auto *Sec = dyn_cast<OutputSection>(Base))
Sec->SortRank = getSectionRank(Sec);
- if (!Script->HasSections) {
+ if (!Script->HasSectionsCommand) {
// We know that all the OutputSections are contiguous in
// this case.
auto E = Script->Commands.end();
@@ -1355,7 +1355,7 @@
InX::Dynamic},
[](SyntheticSection *SS) { SS->finalizeContents(); });
- if (!Script->HasSections && !Config->Relocatable)
+ if (!Script->HasSectionsCommand && !Config->Relocatable)
fixSectionAlignments();
// Some architectures use small displacements for jump instructions.
@@ -1681,7 +1681,7 @@
for (OutputSection *Sec : OutputSections) {
Off = setOffset(Sec, Off);
- if (Script->HasSections)
+ if (Script->HasSectionsCommand)
continue;
// If this is a last section of the last executable segment and that
// segment is the last loadable segment, align the offset of the
@@ -1860,7 +1860,7 @@
// We'll leave other pages in segments as-is because the rest will be
// overwritten by output sections.
template <class ELFT> void Writer<ELFT>::writeTrapInstr() {
- if (Script->HasSections)
+ if (Script->HasSectionsCommand)
return;
// Fill the last page.