SelectionKind
public enum SelectionKind
A Comdat.SelectionKind
describes the behavior of the linker when
linking COMDAT sections.
-
The linker may choose any COMDAT section with a matching key.
This selection kind is the most relaxed - any section with the same key but not necessarily identical size or contents can be chosen. Precisely which section is chosen is implementation-defined.
This selection kind is the default for all newly-inserted sections.
Declaration
Swift
case any
-
The linker may choose any identically-keyed COMDAT section and requires all other referenced data to match its selection’s referenced data.
This selection kind requires that the data in each COMDAT section be identical in length and content. Inclusion of multiple non-identical COMDAT sections with the same key is an error.
For global objects in LLVM, identical contents is defined to mean that their initializers point to the same global
IRValue
.Declaration
Swift
case exactMatch
-
The linker chooses the identically-keyed COMDAT section with the largest size, ignoring content.
Declaration
Swift
case largest
-
The COMDAT section with this key is unique.
This selection requires that no other COMDAT section have the same key as this section, making the choice of selection unambiguous. Inclusion of any other COMDAT section with the same key is an error.
Declaration
Swift
case noDuplicates
-
The linker may choose any identically-keyed COMDAT section and requires all other sections to have the same size as its selection.
Declaration
Swift
case sameSize