@@ -107,43 +107,14 @@ void scanTLSRanges(void[]* rng, scope void delegate(void* pbeg, void* pend) noth
107
107
* the corresponding address in the TLS dynamic per-thread data.
108
108
*/
109
109
110
- version ( X86 )
110
+ extern ( C ) void * __tls_get_addr( void * p ) nothrow @nogc
111
111
{
112
- // NB: the compiler mangles this function as '___tls_get_addr'
113
- // even though it is extern(D)
114
- extern (D ) void * ___tls_get_addr( void * p ) nothrow @nogc
115
- {
116
- debug (PRINTF ) printf(" ___tls_get_addr input - %p\n " , p);
117
- immutable offset = cast (size_t )(p - cast (void * )&_tlsstart);
118
- auto tls = getTLSBlockAlloc();
119
- assert (offset < tls.length);
120
- return tls.ptr + offset;
121
- }
122
- }
123
- else version (ARM )
124
- {
125
- extern (C ) void * __tls_get_addr( void ** p ) nothrow @nogc
126
- {
127
- debug (PRINTF ) printf(" __tls_get_addr input - %p\n " , * p);
128
- immutable offset = cast (size_t )(* p - cast (void * )&_tlsstart);
129
- auto tls = getTLSBlockAlloc();
130
- assert (offset < tls.length);
131
- return tls.ptr + offset;
132
- }
133
- }
134
- else version (AArch64 )
135
- {
136
- extern (C ) void * __tls_get_addr( void * p ) nothrow @nogc
137
- {
138
- debug (PRINTF ) printf(" __tls_get_addr input - %p\n " , p);
139
- immutable offset = cast (size_t )(p - cast (void * )&_tlsstart);
140
- auto tls = getTLSBlockAlloc();
141
- assert (offset < tls.length);
142
- return tls.ptr + offset;
143
- }
112
+ debug (PRINTF ) printf(" __tls_get_addr input - %p\n " , p);
113
+ immutable offset = cast (size_t )(p - cast (void * )&_tlsstart);
114
+ auto tls = getTLSBlockAlloc();
115
+ assert (offset < tls.length);
116
+ return tls.ptr + offset;
144
117
}
145
- else
146
- static assert ( false , " Android architecture not supported." );
147
118
148
119
private :
149
120
0 commit comments