Reland r319090, "COFF: Do not create SectionChunks for discarded comdat sections...
authorPeter Collingbourne <peter@pcc.me.uk>
Tue, 28 Nov 2017 01:30:07 +0000 (01:30 +0000)
committerPeter Collingbourne <peter@pcc.me.uk>
Tue, 28 Nov 2017 01:30:07 +0000 (01:30 +0000)
commit1621c20ffccd14ec2a2e0fe6510eacd035701d70
tree04d490e4ff994ac321576159ca615cf89495b8b3
parentb108dbcc91d1008b9ee9d945298f53434c9a0cb9
Reland r319090, "COFF: Do not create SectionChunks for discarded comdat sections." with a fix for debug sections.

If /debug was not specified, readSection will return a null
pointer for debug sections. If the debug section is associative with
another section, we need to make sure that the section returned from
readSection is not a null pointer before adding it as an associative
section.

Differential Revision: https://reviews.llvm.org/D40533

llvm-svn: 319133
lld/COFF/Chunks.cpp
lld/COFF/Chunks.h
lld/COFF/InputFiles.cpp
lld/COFF/InputFiles.h
lld/COFF/MarkLive.cpp
lld/COFF/SymbolTable.cpp
lld/COFF/SymbolTable.h
lld/COFF/Symbols.h
lld/test/COFF/pdb-comdat.test
lld/test/COFF/reloc-discarded.s
llvm/include/llvm/Object/COFF.h