This is an attempt to fix PR48030.
The initialization function of dynamic TLS variables are currently placed into comdats (on ELF at least). The wrapper functions that are used to access these variables call the initializers via an alias, but in TUs where the variables are not used, no wrapper function (and no alias) is generated. At link time it is possible that an initializer function from a TU without a wrapper function is selected, while the wrapper is selected from a different TU. In that case, the alias is undefined.
A possible fix is to not place the initializer function into a comdat. This will lead to some duplication in the final executable, but this can be mitigated by the linker via --gc-sections or the like.
The fix is based on a suggestion by Andrew Ng.