https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88061
--- Comment #8 from Milan Svoboda <milan.svoboda at centrum dot cz> --- Well, additional workaround is to use -fdata-sections. Then the workaround with the linker script works also for the templated static functions and for functions (templated, static) in anonymous namespace (which is another occurrence of this bug).