define and use internal macros for hidden visibility, weak refs
[musl] / src / thread / __tls_get_addr.c
1 #include <stddef.h>
2 #include "pthread_impl.h"
3 #include "libc.h"
4
5 hidden void *__tls_get_new(tls_mod_off_t *);
6
7 void *__tls_get_addr(tls_mod_off_t *v)
8 {
9         pthread_t self = __pthread_self();
10         if (v[0]<=(size_t)self->dtv[0])
11                 return (char *)self->dtv[v[0]]+v[1]+DTP_OFFSET;
12         return __tls_get_new(v);
13 }
14
15 weak_alias(__tls_get_addr, __tls_get_new);