From 4c533566c2bb94162bcc1f66c5cf9db609e20803 Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Thu, 17 Jan 2008 20:20:00 +0000 Subject: * include/link.h (FORCED_DYNAMIC_TLS_OFFSET): Define. * elf/dl-close.c (_dl_close): Check for it. * elf/dl-reloc.c (CHECK_STATIC_TLS): Likewise. (_dl_allocate_static_tls): Likewise. * elf/dl-tls.c (_dl_allocate_tls_init): Likewise. (__tls_get_addr): Protect from race conditions in setting l_tls_offset to it. * elf/tst-tls16.c: New file. * elf/tst-tlsmod16a.c: New file. * elf/tst-tlsmod16b.c: New file. * elf/Makefile: Add rules to build and run tst-tls16. --- include/link.h | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'include') diff --git a/include/link.h b/include/link.h index 16980ef664..4b9978ad61 100644 --- a/include/link.h +++ b/include/link.h @@ -278,6 +278,15 @@ struct link_map size_t l_tls_firstbyte_offset; #ifndef NO_TLS_OFFSET # define NO_TLS_OFFSET 0 +#endif +#ifndef FORCED_DYNAMIC_TLS_OFFSET +# if NO_TLS_OFFSET == 0 +# define FORCED_DYNAMIC_TLS_OFFSET 1 +# elif NO_TLS_OFFSET == -1 +# define FORCED_DYNAMIC_TLS_OFFSET -2 +# else +# error "FORCED_DYNAMIC_TLS_OFFSET is not defined" +# endif #endif /* For objects present at startup time: offset in the static TLS block. */ ptrdiff_t l_tls_offset; -- cgit v1.2.3