[PATCH] D106228: [LTO] Add SelectionKind to IRSymtab and use it in ld.lld/LLVMgold

Fangrui Song via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jul 19 09:31:59 PDT 2021


MaskRay added a comment.

In D106228#2887624 <https://reviews.llvm.org/D106228#2887624>, @tejohnson wrote:

> I'm not sure I understand the comdat noduplicates selection kind. The lang ref says it means "The linker requires that only section with this COMDAT key exist.". Does that mean that we should never see more than one section with that COMDAT key, in which case it seems like we shouldn't have the case you describe (2 noduplicates comdat with the key "__profc_foo"), or does it mean something else?

"The linker requires that only section with this COMDAT key exist." The sentence looks unclear.

The semantics are: (1) Within a module, a section can be the member of at most one ELF section group or PE/COFF comdat. (2) if two groups in two modules have the same key, they are not deduplicated.

The failure scenario happened for a PGO+ThinLTO case, where two modules have `comdat noduplicates` of the same name. We should not perform deduplication.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D106228



More information about the llvm-commits mailing list