Petr Salinger, le Thu 05 Jan 2006 09:22:29 +0100, a écrit : > > > > will add a very little extra cost to single thread-specific variable > > > > accesses, but it shouldn't be noticeable at all. > > > > > > Well, to be correct, switch -mno-tls-direct-seg-refs > > > add extra cost to ALL thread-specific variables accesses. > > > > No, only to isolated ones. The compiler can cache gs:0 (and it will do > > it anyway when -mno-tls-direct-seg-refs is not provided. > > This is still more then single variable ... > > Anyway, look at configure flags for basic libc in debian/sysdeps/i386.mk: > > libc_extra_config_options = $(extra_config_options) --with-tls > --without-__thread > > It doesn't use TLS internally, there is no .tbss ot .tdata segment in libc.so.
There is: $ objdump -T libc-2.3.5.so | grep -e "\(tbss\|tdata\)" 001315e0 l d .tdata 00000000 .tdata 001315e8 l d .tbss 00000000 .tbss 00000008 g D .tbss 00000004 GLIBC_PRIVATE errno 0000001c g D .tbss 00000004 GLIBC_PRIVATE h_errno 00000004 g D .tdata 00000004 GLIBC_PRIVATE __resp Please also look at how syscall() sets errno: 0x000cd863 <syscall+67>: mov %edx,%gs:(%ecx) Regards, Samuel