From ecbfd871f9aad6c13aa5af56465b2cf00fa18ba7 Mon Sep 17 00:00:00 2001 From: Rafael Espindola Date: Fri, 17 Feb 2017 17:35:07 +0000 Subject: Don't print DISCARD sections as gced. This is a small difference I noticed to gold and bfd. When given --print-gc-sections, we print sections a linkerscript marks DISCARD. The other linkers don't. llvm-svn: 295467 --- lld/ELF/LinkerScript.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'lld/ELF/LinkerScript.cpp') diff --git a/lld/ELF/LinkerScript.cpp b/lld/ELF/LinkerScript.cpp index 9f2ac61b463..ac5ac99b97b 100644 --- a/lld/ELF/LinkerScript.cpp +++ b/lld/ELF/LinkerScript.cpp @@ -296,7 +296,8 @@ template void LinkerScript::discard(ArrayRef *> V) { for (InputSectionBase *S : V) { S->Live = false; - reportDiscarded(S); + if (S == In::ShStrTab) + error("discarding .shstrtab section is not allowed"); InputSection *IS = dyn_cast>(S); if (!IS || IS->DependentSections.empty()) -- cgit v1.2.3