Issue 113974
Summary lld-link LTO doesn't support comdat selection kinds
Labels lld:COFF
Assignees
Reporter rnk
    [This code in LLD COFF](https://github.com/llvm/llvm-project/blob/474234a09655e57b7a4270150f0926db77e864b4/lld/COFF/InputFiles.cpp#L1200) doesn't ever look at the LLVM IR comdat selection kind, so it doesn't implement selection kinds other than "any". It simply boils comdats down to a boolean, rather than a selection kind.

This means that mixing RTTI code with no-RTTI code can crash at runtime because the static linker forgot to implement `IMAGE_COMDAT_SELECT_LARGEST` or the `largest` comdat selection kind ([LangRef](https://llvm.org/docs/LangRef.html#comdats:~:text=the%20same%20data.-,largest,-The%20linker%20will)).

A Chrome-related user exercised these conditions and reported those symptoms, and I'm reasonably convinced I've spotted the bug by looking at the source code. The source does say "// FIXME: Check nodeduplicate" after all. =S

_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to