When GCC produces a jump table as part of a comdat function, the jump table itself is produced as plain non-comdat rdata section. When linked with ld.bfd, all of those rdata sections are kept, with relocations unchanged in the sections that refer to discarded comdat sections.
This has been observed with GCC 5.x and 7.x.
I know this change is extremely ugly, but I don't really know what else to do about it...
I know I earlier said support for linking GCC produced object files with LLD was a non-goal. After getting support for GNU import libraries and GNU ld compatible CTOR_LIST, using LLD as an actual drop-in replacement for GNU ld in existing setups with GCC actually is totally viable though.
With these three patches, I'm able to link clang.exe with LLD, out of object files compiled with GCC.