libc: implement __tls_get_addr() for static binaries
Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D29623
This commit is contained in:
parent
06d8a116bd
commit
ca46b5698e
@ -103,25 +103,32 @@ static size_t libc_tls_init_align;
|
||||
static void *libc_tls_init;
|
||||
#endif
|
||||
|
||||
void *
|
||||
__libc_tls_get_addr(void *vti)
|
||||
{
|
||||
Elf_Addr **dtvp, *dtv;
|
||||
tls_index *ti;
|
||||
|
||||
dtvp = _get_tp();
|
||||
dtv = *dtvp;
|
||||
ti = vti;
|
||||
return ((char *)(dtv[ti->ti_module + 1] + ti->ti_offset) +
|
||||
TLS_DTV_OFFSET);
|
||||
}
|
||||
|
||||
#ifdef __i386__
|
||||
|
||||
/* GNU ABI */
|
||||
|
||||
__attribute__((__regparm__(1)))
|
||||
void *
|
||||
___libc_tls_get_addr(void *ti __unused)
|
||||
___libc_tls_get_addr(void *vti)
|
||||
{
|
||||
return (0);
|
||||
return (__libc_tls_get_addr(vti));
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
void *
|
||||
__libc_tls_get_addr(void *ti __unused)
|
||||
{
|
||||
return (0);
|
||||
}
|
||||
|
||||
#ifndef PIC
|
||||
|
||||
static void *
|
||||
|
Loading…
x
Reference in New Issue
Block a user