Enum Linkage
Linkage specification for functions and globals
public enum Linkage
Fields
Append = 7
Special purpose, applies only to global arrays
AvailableExternally = 1
Available 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 = 14
Tentative definitions
DllExport = 11
Global to be Exported from a DLL
DllImport = 10
Global to be imported from a DLL
External = 0
Externally visible Global
ExternalWeak = 12
External 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 = 8
Rename collision when linking (i.e static function)
LinkOnceAny = 2
Keep a single copy when linking
LinkOnceODR = 3
Like LinkOnceAny but can only be replaced by equivalent (One Definition Rule)
LinkerPrivate = 15
Like Private but the linker remove this symbol
LinkerPrivateWeak = 16
Weak form of LinkerPrivate
Private = 9
Link as Internal but omit from the generated symbol table
Weak = 5
Keep one copy when linking (weak)
WeakODR = 6
Like Weak but only replaced by something equivalent (e.g. One Definition Rule)