summaryrefslogtreecommitdiff
path: root/lld/ELF/MarkLive.cpp
diff options
context:
space:
mode:
authorGeorge Rimar <grimar@accesssoftek.com>2017-10-27 11:32:22 +0000
committerGeorge Rimar <grimar@accesssoftek.com>2017-10-27 11:32:22 +0000
commita6b249d12e883966c20ea2c387283c46178bd6a2 (patch)
tree4972eb11d618fb8ee3dbe3d920780aa3e137eae6 /lld/ELF/MarkLive.cpp
parent56c5086e23763af71184d5ea09b7789461bae472 (diff)
[ELF] - Simplify reporting of garbage collected sections.
This moves reporting of garbage collected sections right after we do GC. That simplifies things. Differential revision: https://reviews.llvm.org/D39058
Diffstat (limited to 'lld/ELF/MarkLive.cpp')
-rw-r--r--lld/ELF/MarkLive.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/lld/ELF/MarkLive.cpp b/lld/ELF/MarkLive.cpp
index 05fe3a494c7..f85896ce593 100644
--- a/lld/ELF/MarkLive.cpp
+++ b/lld/ELF/MarkLive.cpp
@@ -289,6 +289,13 @@ template <class ELFT> void elf::markLive() {
// Follow the graph to mark all live sections.
doGcSections<ELFT>();
+
+ // Report garbage-collected sections.
+ if (Config->PrintGcSections)
+ for (InputSectionBase *Sec : InputSections)
+ if (!Sec->Live)
+ message("removing unused section from '" + Sec->Name + "' in file '" +
+ Sec->File->getName() + "'");
}
template void elf::markLive<ELF32LE>();