[COFF] Handle comdat sections without leader symbols
authorMartin Storsjo <martin@martin.st>
Thu, 26 Jul 2018 20:14:50 +0000 (20:14 +0000)
committerMartin Storsjo <martin@martin.st>
Thu, 26 Jul 2018 20:14:50 +0000 (20:14 +0000)
commit6c8cbf6db0839e525db4969377fa8109b6a6fcc9
treee15a55c1ccf94f3033e8d8039345f768e3c05c00
parent390bce43220111640bfe94733282ae7db4708f82
[COFF] Handle comdat sections without leader symbols

Discard them unless they have been associated by other means (yet
uimplemented).

According to MS link.exe, such sections are illegal, but MinGW setups
use them in their take on associative comdats.

This avoids leaving references to the bogus SectionChunk* PendingComdat,
which cannot be dereferenced.

This fixes PR38183.

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

llvm-svn: 338064
lld/COFF/InputFiles.cpp
lld/test/COFF/pending-comdat.s [new file with mode: 0644]