[ELF/GC] Don't crash while processing Discarded sections.
authorDavide Italiano <davide@freebsd.org>
Thu, 22 Sep 2016 21:08:51 +0000 (21:08 +0000)
committerDavide Italiano <davide@freebsd.org>
Thu, 22 Sep 2016 21:08:51 +0000 (21:08 +0000)
commit49ab2517f5d7e29b3e01bb73076077c9ce035b20
tree61b1ccf7cf0b539e927dbde7b122d1379f8cfb2f
parent7176862809a97d189ff5c82711f4d7afffb4dbe8
[ELF/GC] Don't crash while processing Discarded sections.

The ELF spec doesn't allow relocations to point directly to
a deduplicated COMDAT section but this unfortunately happens in
practice. Bail out early instead of crashing.

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

llvm-svn: 282197
lld/ELF/MarkLive.cpp
lld/test/ELF/comdat.s