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

Petr Hosek via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Aug 27 00:29:20 PDT 2021


phosek marked an inline comment as done.
phosek added a subscriber: mcgrathr.
phosek added a comment.

In D108689#2968019 <https://reviews.llvm.org/D108689#2968019>, @MaskRay wrote:

> 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.

@mcgrathr suggested using a COMDAT group anytime the instrumented function is weak, I can implement that solution instead if that's fine with you.


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