[PATCH] D108689: [Linker] Support weak symbols in nodeduplicate COMDAT group

Fangrui Song via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Aug 26 13:31:10 PDT 2021


MaskRay added a comment.

The description should call out that with current IR, a generic `comdat nodeduplicate` for regular LTO is not representable.

In the linker, sections and symbols are separate concepts. A dropped weak symbol does not force the drop of the defining input section (though can be collected by GC).
While in the IR, when a weak linkage symbol is dropped, its associate section content is dropped as well.
profc and profd must be parallel, so we need to be careful.
For their regular LTO behavior, a `comdat any` happens to work because we don't really the need other members in the comdat whose leader is weak.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D108689/new/

https://reviews.llvm.org/D108689



More information about the llvm-commits mailing list