- ELF supports nodeduplicate.
- ELF calls the concept "section group". GRP_COMDAT emulates the PE COMDAT deduplication feature.
- "COMDAT group" is an ELF term. Avoid it for PE/COFF.
- WebAssembly supports comdat but only supports the any selection kind. https://bugs.llvm.org/show_bug.cgi?id=50531
- A comdat must be included or omitted as a unit. Both the compiler and the linker must obey this rule.
- A global object can be a member of at most one comdat.
- COFF requires a non-local linkage for non-nodeduplicate selection kinds.
Details
- Reviewers
rnk sbc100 tejohnson - Commits
- rGd5401315cd29: [LangRef] Clarify comdat
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
llvm/docs/LangRef.rst | ||
---|---|---|
953 | I'll move WebAssembly to a separate list item. |
llvm/docs/LangRef.rst | ||
---|---|---|
944–945 | This wording is confusing: the term "noduplicates" seems to be in conflict with the idea that no deduplication is performed (which could result in there being duplicates in the output). Is that intentional? Does it mean that the compiler must ensure that there are no duplicates (which would allow the linker to skip deduplication)? If so, I think ti would be good to clarify. |
llvm/docs/LangRef.rst | ||
---|---|---|
944–945 | I agree that noduplicates is confusing. The word says the opposite to that the implementation actually does... I will send a patch to renaming it... |
Drop llvm.global_ctors change
ELF probably should use SHF_LINK_ORDER instead to avoid the ldc compiler's confusion
This wording is confusing: the term "noduplicates" seems to be in conflict with the idea that no deduplication is performed (which could result in there being duplicates in the output). Is that intentional? Does it mean that the compiler must ensure that there are no duplicates (which would allow the linker to skip deduplication)? If so, I think ti would be good to clarify.