!retain may be attached to a function/global variable definition.
Its section will be marked as a linker GC root.
On ELF platforms, we set the SHF_GNU_RETAIN flag.
We don't restrict the feature to ELFOSABI_GNU and ELFOSABI_FREEBSD for
now. See the rationale in D95749.
The integrated assembler has supported SHF_GNU_RETAIN since D95730.
GNU as>=2.36 supports section flag 'R'.
We don't need to worry about GNU ld support because older GNU ld just ignores
the unknown SHF_GNU_RETAIN.
On COFF platforms, we add /INCLUDE: linker options similar to how we currently
handle llvm.used (99f479abcf2c9b36daad04eb91cd0aafa659bb1d). Retaining local
linkage symbols is not representable due to the limitation.
Would it be possible to expand this sentence a bit? I'm not quite sure what you mean by "loosing linker GC precision".