fix inconsistent visibility for internal __tls_get_new function
[oweals/musl.git] / src / thread / __tls_get_addr.c
1 #include <stddef.h>
2 #include "pthread_impl.h"
3
4 void *__tls_get_addr(size_t *v)
5 {
6         pthread_t self = __pthread_self();
7 #ifdef SHARED
8         __attribute__((__visibility__("hidden")))
9         void *__tls_get_new(size_t *);
10         if (v[0]<=(size_t)self->dtv[0])
11                 return (char *)self->dtv[v[0]]+v[1];
12         return __tls_get_new(v);
13 #else
14         return (char *)self->dtv[1]+v[1];
15 #endif
16 }