On Sun, Nov 05, 2017 at 04:17:50PM -0800, Philip Guenther wrote: > BTW, in the .s file in your original message you had this line: > .type foo, @object > > Since foo is in an SHF_TLS section, it has to be of type STT_TLS.
You're right. But... > Indeed, binutils is silently overriding what you wrote. Yes, see: http://www.cygwin.com/ml/binutils/2002-11/msg00409.html That assembly was actually generated by GCC. Clang generates the same. The reason is that not all assemblers understand @tls_object. For example, Sun as(1) wants @tls_obj instead. So GCC relies on the fact that it will be fixed later. See: https://gcc.gnu.org/ml/gcc-patches/2015-07/msg00284.html Anyway, that was just a simple example to demonstrate the problem. I don't expect that code to outlive the e-mail. (At least, I hope not...) -- Charles