diff options
Diffstat (limited to 'src/ldso/dynlink.c')
-rw-r--r-- | src/ldso/dynlink.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/ldso/dynlink.c b/src/ldso/dynlink.c index 4e0b9f4e..774ab849 100644 --- a/src/ldso/dynlink.c +++ b/src/ldso/dynlink.c @@ -654,6 +654,16 @@ void *__copy_tls(unsigned char *mem, size_t cnt) return mem; } +void *__tls_get_addr(size_t *p) +{ + pthread_t self = __pthread_self(); + if ((size_t)self->dtv[0] < p[0]) { + // FIXME: obtain new DTV and TLS from the DSO + a_crash(); + } + return (char *)self->dtv[p[0]] + p[1]; +} + void *__dynlink(int argc, char **argv) { size_t aux[AUX_CNT] = {0}; |