summaryrefslogtreecommitdiffstats
path: root/lld/ELF/LinkerScript.cpp
diff options
context:
space:
mode:
authorRafael Espindola <rafael.espindola@gmail.com>2017-02-17 17:35:07 +0000
committerRafael Espindola <rafael.espindola@gmail.com>2017-02-17 17:35:07 +0000
commitecbfd871f9aad6c13aa5af56465b2cf00fa18ba7 (patch)
tree723c792de662eace2fb9ccab9ac61e5701e1e926 /lld/ELF/LinkerScript.cpp
parente91e9dd7bb95bd34fa871300be807b5870170dc6 (diff)
downloadbcm5719-llvm-ecbfd871f9aad6c13aa5af56465b2cf00fa18ba7.tar.gz
bcm5719-llvm-ecbfd871f9aad6c13aa5af56465b2cf00fa18ba7.zip
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
Diffstat (limited to 'lld/ELF/LinkerScript.cpp')
-rw-r--r--lld/ELF/LinkerScript.cpp3
1 files changed, 2 insertions, 1 deletions
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 <class ELFT>
void LinkerScript<ELFT>::discard(ArrayRef<InputSectionBase<ELFT> *> V) {
for (InputSectionBase<ELFT> *S : V) {
S->Live = false;
- reportDiscarded(S);
+ if (S == In<ELFT>::ShStrTab)
+ error("discarding .shstrtab section is not allowed");
InputSection<ELFT> *IS = dyn_cast<InputSection<ELFT>>(S);
if (!IS || IS->DependentSections.empty())
OpenPOWER on IntegriCloud