cvs commit: src/sys/sys tls.h src/lib/libc/gen tls.c
dillon 2005/03/27 19:33:20 PST
DragonFly src repository
Modified files:
sys/sys tls.h
lib/libc/gen tls.c
lib/libthread_xu/arch/amd64/amd64 pthread_md.c
lib/libthread_xu/arch/i386/i386 pthread_md.c
libexec/rtld-elf rtld.c rtld.h rtld_tls.h
libexec/rtld-elf/i386 reloc.c
Log:
Cleanup and retool portions of the TLS support and make sure that
non-threaded binaries remain compatible with older kernels.
* Removes the tcb alignment argument. Instead an alignment #define is
placed in sys/tls.h
* Gets rid of the Variant I code (we can add it in later, it just gets
in the way).
* Retools the Variant II code to support %gs:OFFSET (negative offset)
AND %gs:0 relative accesses, supporting both -mtls-direct-seg-refs and
-mno-tls-direct-seg-refs.
* Changes the Elf_Addr array for the TCB into a real structure in
sys/tls.h
* Retains the DTV methodology.
* Retains the TCB methodology, but note that the area 'after' the tcb
is now available for future use (at least with Variant I removed).
Frankly I'm not sure we would ever want to support having the
'data' area after the TCB instead of before the TCB, at least not
for i386.
* Do not try to call sys_set_tls_area() if there is no TLS storage.
i.e. so non-threaded binaries remain compatible with old kernels.
The TLS is only initialized if (a) There is thread local storage, aka
gcc3's __thread keyword, or (b) The program is linked against a threading
library. The threading library makes the appropriate calls to set up the
TLS.
Revision Changes Path
1.5 +14 -0 src/sys/sys/tls.h
1.4 +47 -132 src/lib/libc/gen/tls.c
1.2 +15 -6 src/lib/libthread_xu/arch/amd64/amd64/pthread_md.c
1.5 +17 -7 src/lib/libthread_xu/arch/i386/i386/pthread_md.c
1.19 +74 -156 src/libexec/rtld-elf/rtld.c
1.8 +3 -5 src/libexec/rtld-elf/rtld.h
1.2 +3 -2 src/libexec/rtld-elf/rtld_tls.h
1.5 +35 -23 src/libexec/rtld-elf/i386/reloc.c
http://www.dragonflybsd.org/cvsweb/src/sys/sys/tls.h.diff?r1=1.4&r2=1.5&f=u
http://www.dragonflybsd.org/cvsweb/src/lib/libc/gen/tls.c.diff?r1=1.3&r2=1.4&f=u
http://www.dragonflybsd.org/cvsweb/src/lib/libthread_xu/arch/amd64/amd64/pthread_md.c.diff?r1=1.1&r2=1.2&f=u
http://www.dragonflybsd.org/cvsweb/src/lib/libthread_xu/arch/i386/i386/pthread_md.c.diff?r1=1.4&r2=1.5&f=u
http://www.dragonflybsd.org/cvsweb/src/libexec/rtld-elf/rtld.c.diff?r1=1.18&r2=1.19&f=u
http://www.dragonflybsd.org/cvsweb/src/libexec/rtld-elf/rtld.h.diff?r1=1.7&r2=1.8&f=u
http://www.dragonflybsd.org/cvsweb/src/libexec/rtld-elf/rtld_tls.h.diff?r1=1.1&r2=1.2&f=u
http://www.dragonflybsd.org/cvsweb/src/libexec/rtld-elf/i386/reloc.c.diff?r1=1.4&r2=1.5&f=u