summaryrefslogtreecommitdiffstats
path: root/lld/ELF/LinkerScript.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lld/ELF/LinkerScript.cpp')
-rw-r--r--lld/ELF/LinkerScript.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/lld/ELF/LinkerScript.cpp b/lld/ELF/LinkerScript.cpp
index a2f611a1d49..661f693537d 100644
--- a/lld/ELF/LinkerScript.cpp
+++ b/lld/ELF/LinkerScript.cpp
@@ -213,11 +213,11 @@ template <class ELFT> void LinkerScript<ELFT>::filter() {
if (Cmd->Constraint == ConstraintKind::NoConstraint)
continue;
+ bool RO = (Cmd->Constraint == ConstraintKind::ReadOnly);
+ bool RW = (Cmd->Constraint == ConstraintKind::ReadWrite);
+
removeElementsIf(*OutputSections, [&](OutputSectionBase<ELFT> *S) {
bool Writable = (S->getFlags() & SHF_WRITE);
- bool RO = (Cmd->Constraint == ConstraintKind::ReadOnly);
- bool RW = (Cmd->Constraint == ConstraintKind::ReadWrite);
-
return S->getName() == Cmd->Name &&
((RO && Writable) || (RW && !Writable));
});
OpenPOWER on IntegriCloud