rtld-elf: Use _get_tp in __tls_get_addr for aarch64 and riscv64.
Reviewed by: kib Sponsored by: The University of Cambridge, Google Inc. Differential Revision: https://reviews.freebsd.org/D33047
This commit is contained in:
parent
201d0ebee3
commit
b928e924f7
@ -534,11 +534,8 @@ allocate_initial_tls(Obj_Entry *objs)
|
|||||||
void *
|
void *
|
||||||
__tls_get_addr(tls_index* ti)
|
__tls_get_addr(tls_index* ti)
|
||||||
{
|
{
|
||||||
char *p;
|
Elf_Addr **dtvp;
|
||||||
void *_tp;
|
|
||||||
|
|
||||||
__asm __volatile("mrs %0, tpidr_el0" : "=r" (_tp));
|
dtvp = _get_tp();
|
||||||
p = tls_get_addr_common((Elf_Addr **)(_tp), ti->ti_module, ti->ti_offset);
|
return (tls_get_addr_common(dtvp, ti->ti_module, ti->ti_offset));
|
||||||
|
|
||||||
return (p);
|
|
||||||
}
|
}
|
||||||
|
@ -406,13 +406,11 @@ allocate_initial_tls(Obj_Entry *objs)
|
|||||||
void *
|
void *
|
||||||
__tls_get_addr(tls_index* ti)
|
__tls_get_addr(tls_index* ti)
|
||||||
{
|
{
|
||||||
char *_tp;
|
Elf_Addr **dtvp;
|
||||||
void *p;
|
void *p;
|
||||||
|
|
||||||
__asm __volatile("mv %0, tp" : "=r" (_tp));
|
dtvp = _get_tp();
|
||||||
|
p = tls_get_addr_common(dtvp, ti->ti_module, ti->ti_offset);
|
||||||
p = tls_get_addr_common((Elf_Addr**)((Elf_Addr)_tp - TLS_TP_OFFSET
|
|
||||||
- TLS_TCB_SIZE), ti->ti_module, ti->ti_offset);
|
|
||||||
|
|
||||||
return ((char*)p + TLS_DTV_OFFSET);
|
return ((char*)p + TLS_DTV_OFFSET);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user