[lld] [WIP][lld] Add lld warning for checking discarded sections via COMDAT (PR #74151)

Fangrui Song via llvm-commits llvm-commits at lists.llvm.org
Fri Dec 1 21:23:49 PST 2023


MaskRay wrote:

I haven't looked at the patch in detail. Some thoughts:

* This patch adds quite a bit code.
* Whether this feature would make parallel symbol resolution more difficult. Eventually we should parallelize COMDAT group elimination (extend https://discourse.llvm.org/t/parallel-input-file-parsing/60164 to COMDAT, like what mold does).
* Whether this feature is useful once we implement ODR violation checker in linker and compiler-rt (https://maskray.me/blog/2022-11-13-odr-violation-detection#future-direction)

(It is valid to have two translation units, where a.o has C++ deleting and base object destructors (D0/D2) in their own COMDAT groups, while b.o has D0/D2 in the D5 COMDAT group (constructor/destructor alias). So, we cannot say that a COMDAT discarded section only uses one COMDAT section signature. However, this approach this patch utilizes, should work.)


https://github.com/llvm/llvm-project/pull/74151


More information about the llvm-commits mailing list