mirror of
https://git.FreeBSD.org/src.git
synced 2025-02-03 17:11:32 +00:00
Merging of projects/armv6, part 2
Handle TLS for ARMv6 and ARMv7
This commit is contained in:
parent
cf1a573f04
commit
c9e95645f6
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=239269
@ -433,7 +433,9 @@ reloc_jmpslot(Elf_Addr *where, Elf_Addr target, const Obj_Entry *defobj,
|
|||||||
void
|
void
|
||||||
allocate_initial_tls(Obj_Entry *objs)
|
allocate_initial_tls(Obj_Entry *objs)
|
||||||
{
|
{
|
||||||
|
#ifdef ARM_TP_ADDRESS
|
||||||
void **_tp = (void **)ARM_TP_ADDRESS;
|
void **_tp = (void **)ARM_TP_ADDRESS;
|
||||||
|
#endif
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Fix the size of the static TLS block by using the maximum
|
* Fix the size of the static TLS block by using the maximum
|
||||||
@ -443,16 +445,27 @@ allocate_initial_tls(Obj_Entry *objs)
|
|||||||
|
|
||||||
tls_static_space = tls_last_offset + tls_last_size + RTLD_STATIC_TLS_EXTRA;
|
tls_static_space = tls_last_offset + tls_last_size + RTLD_STATIC_TLS_EXTRA;
|
||||||
|
|
||||||
|
#ifdef ARM_TP_ADDRESS
|
||||||
(*_tp) = (void *) allocate_tls(objs, NULL, TLS_TCB_SIZE, 8);
|
(*_tp) = (void *) allocate_tls(objs, NULL, TLS_TCB_SIZE, 8);
|
||||||
|
#else
|
||||||
|
sysarch(ARM_SET_TP, allocate_tls(objs, NULL, TLS_TCB_SIZE, 8));
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
void *
|
void *
|
||||||
__tls_get_addr(tls_index* ti)
|
__tls_get_addr(tls_index* ti)
|
||||||
{
|
{
|
||||||
void **_tp = (void **)ARM_TP_ADDRESS;
|
|
||||||
char *p;
|
char *p;
|
||||||
|
#ifdef ARM_TP_ADDRESS
|
||||||
|
void **_tp = (void **)ARM_TP_ADDRESS;
|
||||||
|
|
||||||
p = tls_get_addr_common((Elf_Addr **)(*_tp), ti->ti_module, ti->ti_offset);
|
p = tls_get_addr_common((Elf_Addr **)(*_tp), ti->ti_module, ti->ti_offset);
|
||||||
|
#else
|
||||||
|
void *_tp;
|
||||||
|
__asm __volatile("mrc p15, 0, %0, c13, c0, 3" \
|
||||||
|
: "=r" (_tp));
|
||||||
|
p = tls_get_addr_common((Elf_Addr **)(_tp), ti->ti_module, ti->ti_offset);
|
||||||
|
#endif
|
||||||
|
|
||||||
return (p);
|
return (p);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user