Changeset View
Changeset View
Standalone View
Standalone View
libexec/rtld-elf/arm/reloc.c
Show First 20 Lines • Show All 485 Lines • ▼ Show 20 Lines | |||||
ifunc_init(Elf_Auxinfo aux_info[__min_size(AT_COUNT)] __unused) | ifunc_init(Elf_Auxinfo aux_info[__min_size(AT_COUNT)] __unused) | ||||
{ | { | ||||
} | } | ||||
void | void | ||||
allocate_initial_tls(Obj_Entry *objs) | allocate_initial_tls(Obj_Entry *objs) | ||||
{ | { | ||||
#ifdef 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 | ||||
* offset allocated so far and adding a bit for dynamic modules to | * offset allocated so far and adding a bit for dynamic modules to | ||||
* use. | * use. | ||||
*/ | */ | ||||
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); | |||||
#else | |||||
sysarch(ARM_SET_TP, allocate_tls(objs, NULL, TLS_TCB_SIZE, 8)); | 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) | ||||
{ | { | ||||
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); | |||||
#else | |||||
void *_tp; | void *_tp; | ||||
__asm __volatile("mrc p15, 0, %0, c13, c0, 3" \ | __asm __volatile("mrc p15, 0, %0, c13, c0, 3" \ | ||||
: "=r" (_tp)); | : "=r" (_tp)); | ||||
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); | ||||
#endif | |||||
return (p); | return (p); | ||||
} | } |