diff options
author | kmacy <kmacy@FreeBSD.org> | 2006-10-08 02:50:34 +0000 |
---|---|---|
committer | kmacy <kmacy@FreeBSD.org> | 2006-10-08 02:50:34 +0000 |
commit | 3785d22822bc425cde879bea3c1758e71a30892a (patch) | |
tree | 6ad8c75d0dc911debb2ae132787ef8e5be588a57 /lib/libc/gen/tls.c | |
parent | e36fa6ead363211fd86ded1eefa0869c344737ba (diff) | |
download | FreeBSD-src-3785d22822bc425cde879bea3c1758e71a30892a.zip FreeBSD-src-3785d22822bc425cde879bea3c1758e71a30892a.tar.gz |
Fix TLS on sparc64 for statically and dynamically linked binaries
Approved by: rwatson (mentor)
Reviewed by: jmg and marcel
Diffstat (limited to 'lib/libc/gen/tls.c')
-rw-r--r-- | lib/libc/gen/tls.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/lib/libc/gen/tls.c b/lib/libc/gen/tls.c index 76e1950..5bc4b87 100644 --- a/lib/libc/gen/tls.c +++ b/lib/libc/gen/tls.c @@ -58,6 +58,15 @@ void _rtld_free_tls(void *tls, size_t tcbsize, size_t tcbalign); void *__libc_allocate_tls(void *oldtls, size_t tcbsize, size_t tcbalign); void __libc_free_tls(void *tls, size_t tcbsize, size_t tcbalign); +#if defined(__ia64__) || defined(__amd64__) +#define TLS_TCB_ALIGN 16 +#elif defined(__powerpc__) || defined(__i386__) || defined(__arm__) || \ + defined(__sparc64__) +#define TLS_TCB_ALIGN sizeof(void *) +#else +#error TLS_TCB_ALIGN undefined for target architecture +#endif + #if defined(__ia64__) || defined(__powerpc__) #define TLS_VARIANT_I #endif @@ -299,7 +308,7 @@ _init_tls() } } - tls = _rtld_allocate_tls(NULL, TLS_TCB_SIZE, 1); + tls = _rtld_allocate_tls(NULL, TLS_TCB_SIZE, TLS_TCB_ALIGN); _set_tp(tls); #endif |