]>
Commit | Line | Data |
---|---|---|
bb330e25 AF |
1 | # |
2 | # Based on commit e6c61494125126d2ba77e5d99f83887a2ed49783. | |
3 | # | |
4 | # 2011-04-10 Ulrich Drepper <drepper@gmail.com> | |
5 | # | |
6 | # [BZ #12650] | |
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. | |
15 | # | |
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 | |
19 | @@ -33,9 +33,6 @@ | |
20 | to allow dynamic loading of modules defining IE-model TLS data. */ | |
21 | #define TLS_STATIC_SURPLUS 64 + DL_NNS * 100 | |
22 | ||
23 | -/* Value used for dtv entries for which the allocation is delayed. */ | |
24 | -#define TLS_DTV_UNALLOCATED ((void *) -1l) | |
25 | - | |
26 | ||
27 | /* Out-of-memory handler. */ | |
28 | #ifdef SHARED | |
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 | |
32 | @@ -26,6 +26,7 @@ | |
33 | #include <sys/mman.h> | |
34 | #include <sys/param.h> | |
35 | #include <dl-sysdep.h> | |
36 | +#include <dl-tls.h> | |
37 | #include <tls.h> | |
38 | #include <list.h> | |
39 | #include <lowlevellock.h> | |
40 | @@ -242,6 +243,10 @@ | |
41 | ||
42 | /* Clear the DTV. */ | |
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)); | |
49 | ||
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 | |
54 | @@ -58,3 +58,6 @@ | |
55 | ||
56 | # endif | |
57 | #endif | |
58 | + | |
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 | |
64 | @@ -28,3 +28,6 @@ | |
65 | #define DONT_USE_TLS_INDEX 1 | |
66 | ||
67 | extern void *__tls_get_addr (size_t m, size_t offset); | |
68 | + | |
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 | |
74 | @@ -47,3 +47,6 @@ | |
75 | # define GET_ADDR_OFFSET (ti->ti_offset + TLS_DTV_OFFSET) | |
76 | # define __TLS_GET_ADDR(__ti) (__tls_get_addr (__ti) - TLS_DTV_OFFSET) | |
77 | #endif | |
78 | + | |
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 | |
84 | @@ -72,6 +72,9 @@ | |
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 (); }) | |
90 | ||
91 | #endif | |
92 | + | |
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 | |
98 | @@ -27,3 +27,6 @@ | |
99 | ||
100 | ||
101 | extern void *__tls_get_addr (tls_index *ti); | |
102 | + | |
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 | |
108 | @@ -27,3 +27,6 @@ | |
109 | ||
110 | ||
111 | extern void *__tls_get_addr (tls_index *ti); | |
112 | + | |
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 | |
118 | @@ -27,3 +27,6 @@ | |
119 | ||
120 | ||
121 | extern void *__tls_get_addr (tls_index *ti); | |
122 | + | |
123 | +/* Value used for dtv entries for which the allocation is delayed. */ | |
124 | +#define TLS_DTV_UNALLOCATED ((void *) -1l) |