https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91628
--- Comment #14 from Carlos O'Donell <carlos at redhat dot com> --- My preference for would be a distinct *.S file as Florian suggests, it's the most robust solution. The only other alternative I would consider is a new __builtin_get_tls_offset() that does what you want, and then use the builtin. It complicates backporting but solves the problem for all runtimes that want access to a __tls_get_addr() equivalent for the architecture.