Variables with common linkage will be emitted as a common-type csect in XCOFF. Per the assembly reference:
"Several modules can share the same common block. If any of those modules have an external Control Section (csect) with the same name and the csect with the same name has a storage mapping class other than BS or UC, then the common block is initialized and becomes that other Control Section.”
Initialization via a non-csect (i.e label-ed data) is an undefined behaviour on AIX platform, and results in a linker warning.
Therefore, we want to turn on -data-sections by default on AIX. User could still use -fdata-sections=false if they understand the potential risks.
Suggestion (see proposed edit).
Not sure if the suggested name is better. Just noting that is particular line doesn't fit the pattern for when there is a codegen::get* function.