diff options
author | Fangrui Song <maskray@google.com> | 2019-09-24 11:48:46 +0000 |
---|---|---|
committer | Fangrui Song <maskray@google.com> | 2019-09-24 11:48:46 +0000 |
commit | e447d5afd37228125bca280ad96c1a191b0b4169 (patch) | |
tree | fcc1f5833bb586e91f5f355163b4cefc7519a512 /lld/ELF/LinkerScript.cpp | |
parent | e47bbd28f8e9dfea4e019e27e9d371c144c3302e (diff) | |
download | bcm5719-llvm-e447d5afd37228125bca280ad96c1a191b0b4169.tar.gz bcm5719-llvm-e447d5afd37228125bca280ad96c1a191b0b4169.zip |
[ELF] Delete SectionBase::assigned
D67504 removed uses of `assigned` from OutputSection::addSection, which
makes `assigned` purely used in processSectionCommands() and its
callees. By replacing its references with `parent`, we can remove
`assigned`.
Reviewed By: grimar
Differential Revision: https://reviews.llvm.org/D67531
llvm-svn: 372735
Diffstat (limited to 'lld/ELF/LinkerScript.cpp')
-rw-r--r-- | lld/ELF/LinkerScript.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/lld/ELF/LinkerScript.cpp b/lld/ELF/LinkerScript.cpp index 48f6c38cce6..74fae363fe4 100644 --- a/lld/ELF/LinkerScript.cpp +++ b/lld/ELF/LinkerScript.cpp @@ -414,7 +414,7 @@ LinkerScript::computeInputSections(const InputSectionDescription *cmd) { size_t sizeBefore = ret.size(); for (InputSectionBase *sec : inputSections) { - if (!sec->isLive() || sec->assigned) + if (!sec->isLive() || sec->parent) continue; // For -emit-relocs we have to ignore entries like @@ -433,7 +433,6 @@ LinkerScript::computeInputSections(const InputSectionDescription *cmd) { continue; ret.push_back(sec); - sec->assigned = true; } sortInputSections( @@ -455,6 +454,7 @@ void LinkerScript::discard(InputSectionBase *s) { mainPart->hashTab = nullptr; s->markDead(); + s->parent = nullptr; for (InputSection *ds : s->dependentSections) discard(ds); } @@ -466,6 +466,8 @@ LinkerScript::createInputSectionList(OutputSection &outCmd) { for (BaseCommand *base : outCmd.sectionCommands) { if (auto *cmd = dyn_cast<InputSectionDescription>(base)) { cmd->sectionBases = computeInputSections(cmd); + for (InputSectionBase *s : cmd->sectionBases) + s->parent = &outCmd; ret.insert(ret.end(), cmd->sectionBases.begin(), cmd->sectionBases.end()); } } @@ -497,7 +499,7 @@ void LinkerScript::processSectionCommands() { // way to "make it as if it wasn't present" is to make it empty. if (!matchConstraints(v, sec->constraint)) { for (InputSectionBase *s : v) - s->assigned = false; + s->parent = nullptr; sec->sectionCommands.clear(); continue; } @@ -512,8 +514,6 @@ void LinkerScript::processSectionCommands() { } sec->sectionIndex = i++; - for (InputSectionBase *s : v) - s->parent = sec; } } } |