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, 4 insertions, 2 deletions
diff --git a/lld/ELF/LinkerScript.cpp b/lld/ELF/LinkerScript.cpp
index 2628977ac5f..5ebb9f3b3d8 100644
--- a/lld/ELF/LinkerScript.cpp
+++ b/lld/ELF/LinkerScript.cpp
@@ -291,11 +291,13 @@ LinkerScript::computeInputSections(const InputSectionDescription *Cmd) {
size_t SizeBefore = Ret.size();
for (InputSectionBase *Sec : InputSections) {
- if (!isa<InputSection>(Sec))
+ if (Sec->Assigned)
continue;
- if (Sec->Assigned)
+ if (!Sec->Live) {
+ reportDiscarded(Sec);
continue;
+ }
// For -emit-relocs we have to ignore entries like
// .rela.dyn : { *(.rela.data) }
OpenPOWER on IntegriCloud