https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102772
--- Comment #22 from ro at CeBiTec dot Uni-Bielefeld.DE <ro at CeBiTec dot Uni-Bielefeld.DE> --- > --- Comment #20 from Jakub Jelinek <jakub at gcc dot gnu.org> --- > Note, for ntpoff the listed instructions are: > movl %gs:0,%eax > leal x@ntpoff(%eax),%eax > rather than addl. But certainly this one was never meant to be taken > pedantically as that instruction sequence only, it is completely intentional > that the %gs:0 load can be far away (used by multiple TLS LE or IE accesses), > and > even tls.pdf mentions some other instructions: > movl %gs:0,%eax > movl x@ntpoff(%eax),%eax > and > movl %gs:x@ntpoff,%eax > are all mentioned. In the Solaris Linkers and Libraries Guide I'd mentioned, those forms are all listed. However, this wouldn't be the first case where the registers in the spec were taken literally on Solaris: see i386.cc (legitimize_tls_address) <TLS_MODEL_INITIAL_EXEC> and i386.md (tls_initial_exec_64_sun) where Solaris only accepts %rax.