COFF: Fix bug that not all symbols were written to symtab if /opt:noref.

Only live symbols are written to the symbol table. Because isLive()
returned false if dead-stripping was disabled entirely, only
non-COMDAT sections were written to the symbol table. This patch fixes
the issue.

llvm-svn: 247856
diff --git a/lld/COFF/Chunks.cpp b/lld/COFF/Chunks.cpp
index 6a9c214..7168a03 100644
--- a/lld/COFF/Chunks.cpp
+++ b/lld/COFF/Chunks.cpp
@@ -38,6 +38,9 @@
   unsigned Shift = (Header->Characteristics >> 20) & 0xF;
   if (Shift > 0)
     Align = uint32_t(1) << (Shift - 1);
+
+  // Only COMDAT sections are subject of dead-stripping.
+  Live = !isCOMDAT();
 }
 
 static void add16(uint8_t *P, int16_t V) { write16le(P, read16le(P) + V); }