Enum Linkage
Linkage specification for functions and globals
public enum Linkage
Fields
Append = 7Special purpose, applies only to global arrays
AvailableExternally = 1Available Externally
Globals with “available_externally” linkage are never emitted into the object file corresponding to the LLVM module. From the linker’s perspective, an available_externally global is equivalent to an external declaration. They exist to allow in-lining and other optimizations to take place given knowledge of the definition of the global, which is known to be somewhere outside the module. Globals with available_externally linkage are allowed to be discarded at will, and allow in-lining and other optimizations. This linkage type is only allowed on definitions, not declarations.
Common = 14Tentative definitions
DllExport = 11Global to be Exported from a DLL
DllImport = 10Global to be imported from a DLL
External = 0Externally visible Global
ExternalWeak = 12External weak linkage
The semantics of this linkage follow the ELF object file model: the symbol is weak until linked, if not linked, the symbol becomes null instead of being an undefined reference.
Internal = 8Rename collision when linking (i.e static function)
LinkOnceAny = 2Keep a single copy when linking
LinkOnceODR = 3Like LinkOnceAny but can only be replaced by equivalent (One Definition Rule)
LinkerPrivate = 15Like Private but the linker remove this symbol
LinkerPrivateWeak = 16Weak form of LinkerPrivate
Private = 9Link as Internal but omit from the generated symbol table
Weak = 5Keep one copy when linking (weak)
WeakODR = 6Like Weak but only replaced by something equivalent (e.g. One Definition Rule)