summaryrefslogtreecommitdiffstats
path: root/lld/ELF/Writer.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lld/ELF/Writer.cpp')
-rw-r--r--lld/ELF/Writer.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/lld/ELF/Writer.cpp b/lld/ELF/Writer.cpp
index 19ab2cb0393..060f21adf06 100644
--- a/lld/ELF/Writer.cpp
+++ b/lld/ELF/Writer.cpp
@@ -1383,9 +1383,9 @@ static void removeUnusedSyntheticSections() {
llvm::erase_if(ISD->Sections,
[=](InputSection *IS) { return IS == SS; });
- // If there are no other alive input sections left, we remove output
- // section from the output.
- if (getInputSections(OS).empty())
+ // If there are no other alive sections or commands left in the output
+ // section description, we remove it from the output.
+ if (getInputSections(OS).empty() && OS->isAllSectionDescription())
OS->Live = false;
}
}
OpenPOWER on IntegriCloud