2 # Based on commit e6c61494125126d2ba77e5d99f83887a2ed49783.
4 # 2011-04-10 Ulrich Drepper <drepper@gmail.com>
7 # * sysdeps/i386/dl-tls.h: Define TLS_DTV_UNALLOCATED.
8 # * sysdeps/ia64/dl-tls.h: Likewise.
9 # * sysdeps/powerpc/dl-tls.h: Likewise.
10 # * sysdeps/s390/dl-tls.h: Likewise.
11 # * sysdeps/sh/dl-tls.h: Likewise.
12 # * sysdeps/sparc/dl-tls.h: Likewise.
13 # * sysdeps/x86_64/dl-tls.h: Likewise.
14 # * elf/dl-tls.c: Don't define TLS_DTV_UNALLOCATED here.
16 diff -urN glibc-2.12-2-gc4ccff1/elf/dl-tls.c glibc-2.12-2-gc4ccff1.mod/elf/dl-tls.c
17 --- glibc-2.12-2-gc4ccff1/elf/dl-tls.c 2015-02-18 05:16:56.087096028 -0500
18 +++ glibc-2.12-2-gc4ccff1.mod/elf/dl-tls.c 2015-02-18 05:21:04.018424445 -0500
20 to allow dynamic loading of modules defining IE-model TLS data. */
21 #define TLS_STATIC_SURPLUS 64 + DL_NNS * 100
23 -/* Value used for dtv entries for which the allocation is delayed. */
24 -#define TLS_DTV_UNALLOCATED ((void *) -1l)
27 /* Out-of-memory handler. */
29 diff -urN glibc-2.12-2-gc4ccff1/nptl/allocatestack.c glibc-2.12-2-gc4ccff1.mod/nptl/allocatestack.c
30 --- glibc-2.12-2-gc4ccff1/nptl/allocatestack.c 2015-02-18 05:16:56.101095594 -0500
31 +++ glibc-2.12-2-gc4ccff1.mod/nptl/allocatestack.c 2015-02-18 05:21:04.019424414 -0500
34 #include <sys/param.h>
35 #include <dl-sysdep.h>
39 #include <lowlevellock.h>
43 dtv_t *dtv = GET_DTV (TLS_TPADJ (result));
44 + for (size_t cnt = 0; cnt < dtv[-1].counter; ++cnt)
45 + if (! dtv[1 + cnt].pointer.is_static
46 + && dtv[1 + cnt].pointer.val != TLS_DTV_UNALLOCATED)
47 + free (dtv[1 + cnt].pointer.val);
48 memset (dtv, '\0', (dtv[-1].counter + 1) * sizeof (dtv_t));
50 /* Re-initialize the TLS. */
51 diff -urN glibc-2.12-2-gc4ccff1/sysdeps/i386/dl-tls.h glibc-2.12-2-gc4ccff1.mod/sysdeps/i386/dl-tls.h
52 --- glibc-2.12-2-gc4ccff1/sysdeps/i386/dl-tls.h 2010-05-04 07:27:23.000000000 -0400
53 +++ glibc-2.12-2-gc4ccff1.mod/sysdeps/i386/dl-tls.h 2015-02-18 05:21:04.019424414 -0500
59 +/* Value used for dtv entries for which the allocation is delayed. */
60 +#define TLS_DTV_UNALLOCATED ((void *) -1l)
61 diff -urN glibc-2.12-2-gc4ccff1/sysdeps/ia64/dl-tls.h glibc-2.12-2-gc4ccff1.mod/sysdeps/ia64/dl-tls.h
62 --- glibc-2.12-2-gc4ccff1/sysdeps/ia64/dl-tls.h 2010-05-04 07:27:23.000000000 -0400
63 +++ glibc-2.12-2-gc4ccff1.mod/sysdeps/ia64/dl-tls.h 2015-02-18 05:21:04.019424414 -0500
65 #define DONT_USE_TLS_INDEX 1
67 extern void *__tls_get_addr (size_t m, size_t offset);
69 +/* Value used for dtv entries for which the allocation is delayed. */
70 +#define TLS_DTV_UNALLOCATED ((void *) -1l)
71 diff -urN glibc-2.12-2-gc4ccff1/sysdeps/powerpc/dl-tls.h glibc-2.12-2-gc4ccff1.mod/sysdeps/powerpc/dl-tls.h
72 --- glibc-2.12-2-gc4ccff1/sysdeps/powerpc/dl-tls.h 2010-05-04 07:27:23.000000000 -0400
73 +++ glibc-2.12-2-gc4ccff1.mod/sysdeps/powerpc/dl-tls.h 2015-02-18 05:21:04.019424414 -0500
75 # define GET_ADDR_OFFSET (ti->ti_offset + TLS_DTV_OFFSET)
76 # define __TLS_GET_ADDR(__ti) (__tls_get_addr (__ti) - TLS_DTV_OFFSET)
79 +/* Value used for dtv entries for which the allocation is delayed. */
80 +#define TLS_DTV_UNALLOCATED ((void *) -1l)
81 diff -urN glibc-2.12-2-gc4ccff1/sysdeps/s390/dl-tls.h glibc-2.12-2-gc4ccff1.mod/sysdeps/s390/dl-tls.h
82 --- glibc-2.12-2-gc4ccff1/sysdeps/s390/dl-tls.h 2010-05-04 07:27:23.000000000 -0400
83 +++ glibc-2.12-2-gc4ccff1.mod/sysdeps/s390/dl-tls.h 2015-02-18 05:21:04.019424414 -0500
85 # define __TLS_GET_ADDR(__ti) \
86 ({ extern char _GLOBAL_OFFSET_TABLE_[] attribute_hidden; \
87 (void *) __tls_get_offset ((char *) (__ti) - _GLOBAL_OFFSET_TABLE_) \
88 - + (unsigned long) __builtin_thread_pointer (); })
89 + + (unsigned long) __builtin_thread_pointer (); })
93 +/* Value used for dtv entries for which the allocation is delayed. */
94 +#define TLS_DTV_UNALLOCATED ((void *) -1l)
95 diff -urN glibc-2.12-2-gc4ccff1/sysdeps/sh/dl-tls.h glibc-2.12-2-gc4ccff1.mod/sysdeps/sh/dl-tls.h
96 --- glibc-2.12-2-gc4ccff1/sysdeps/sh/dl-tls.h 2010-05-04 07:27:23.000000000 -0400
97 +++ glibc-2.12-2-gc4ccff1.mod/sysdeps/sh/dl-tls.h 2015-02-18 05:21:04.019424414 -0500
101 extern void *__tls_get_addr (tls_index *ti);
103 +/* Value used for dtv entries for which the allocation is delayed. */
104 +#define TLS_DTV_UNALLOCATED ((void *) -1l)
105 diff -urN glibc-2.12-2-gc4ccff1/sysdeps/sparc/dl-tls.h glibc-2.12-2-gc4ccff1.mod/sysdeps/sparc/dl-tls.h
106 --- glibc-2.12-2-gc4ccff1/sysdeps/sparc/dl-tls.h 2010-05-04 07:27:23.000000000 -0400
107 +++ glibc-2.12-2-gc4ccff1.mod/sysdeps/sparc/dl-tls.h 2015-02-18 05:21:04.019424414 -0500
111 extern void *__tls_get_addr (tls_index *ti);
113 +/* Value used for dtv entries for which the allocation is delayed. */
114 +#define TLS_DTV_UNALLOCATED ((void *) -1l)
115 diff -urN glibc-2.12-2-gc4ccff1/sysdeps/x86_64/dl-tls.h glibc-2.12-2-gc4ccff1.mod/sysdeps/x86_64/dl-tls.h
116 --- glibc-2.12-2-gc4ccff1/sysdeps/x86_64/dl-tls.h 2010-05-04 07:27:23.000000000 -0400
117 +++ glibc-2.12-2-gc4ccff1.mod/sysdeps/x86_64/dl-tls.h 2015-02-18 05:21:04.019424414 -0500
121 extern void *__tls_get_addr (tls_index *ti);
123 +/* Value used for dtv entries for which the allocation is delayed. */
124 +#define TLS_DTV_UNALLOCATED ((void *) -1l)