On ELF, an SHT_INIT_ARRAY outside a section group is a GC root. The current
codegen abuses SHT_INIT_ARRAY in a section group to mean a GC root.
On PE/COFF, the dynamic initialization for __declspec(selectany) in a comdat
can be garbage collected by -opt:ref.
Call addUsedGlobal for the two cases to fix the abuse/bug.
My first thought is that the selectany attribute should control the GVA_Linkage in the AST, but it looks like that doesn't happen right now. This is just refactoring the condition below.