Check Live instead of the section type.

By the time we get here all live sections should have been combined
into InputSections.

llvm-svn: 304243
diff --git a/lld/ELF/LinkerScript.cpp b/lld/ELF/LinkerScript.cpp
index 2628977..5ebb9f3 100644
--- a/lld/ELF/LinkerScript.cpp
+++ b/lld/ELF/LinkerScript.cpp
@@ -291,12 +291,14 @@
     size_t SizeBefore = Ret.size();
 
     for (InputSectionBase *Sec : InputSections) {
-      if (!isa<InputSection>(Sec))
-        continue;
-
       if (Sec->Assigned)
         continue;
 
+      if (!Sec->Live) {
+        reportDiscarded(Sec);
+        continue;
+      }
+
       // For -emit-relocs we have to ignore entries like
       //   .rela.dyn : { *(.rela.data) }
       // which are common because they are in the default bfd script.