summaryrefslogtreecommitdiffstats
path: root/libexec
diff options
context:
space:
mode:
authornwhitehorn <nwhitehorn@FreeBSD.org>2013-02-08 17:44:44 +0000
committernwhitehorn <nwhitehorn@FreeBSD.org>2013-02-08 17:44:44 +0000
commitc07bb76c815a46c63cee793a7854e7af28791eda (patch)
treec67502e9dba797a7cf688c57bfcbe0e834594f1f /libexec
parentdfffe11d71ac60fa90737e21a2b32754c602f2b9 (diff)
downloadFreeBSD-src-c07bb76c815a46c63cee793a7854e7af28791eda.zip
FreeBSD-src-c07bb76c815a46c63cee793a7854e7af28791eda.tar.gz
Avoid use of register variables, which some compilers (e.g. clang)
don't like. It makes the code a little clearer as well. MFC after: 1 week
Diffstat (limited to 'libexec')
-rw-r--r--libexec/rtld-elf/powerpc64/reloc.c14
1 files changed, 5 insertions, 9 deletions
diff --git a/libexec/rtld-elf/powerpc64/reloc.c b/libexec/rtld-elf/powerpc64/reloc.c
index b13500f..fb5325f 100644
--- a/libexec/rtld-elf/powerpc64/reloc.c
+++ b/libexec/rtld-elf/powerpc64/reloc.c
@@ -486,8 +486,7 @@ init_pltgot(Obj_Entry *obj)
void
allocate_initial_tls(Obj_Entry *list)
{
- register Elf_Addr **tp __asm__("r13");
- Elf_Addr **_tp;
+ Elf_Addr **tp;
/*
* Fix the size of the static TLS block by using the maximum
@@ -497,22 +496,19 @@ allocate_initial_tls(Obj_Entry *list)
tls_static_space = tls_last_offset + tls_last_size + RTLD_STATIC_TLS_EXTRA;
- _tp = (Elf_Addr **) ((char *)allocate_tls(list, NULL, TLS_TCB_SIZE, 16)
+ tp = (Elf_Addr **) ((char *)allocate_tls(list, NULL, TLS_TCB_SIZE, 16)
+ TLS_TP_OFFSET + TLS_TCB_SIZE);
- /*
- * XXX gcc seems to ignore 'tp = _tp;'
- */
-
- __asm __volatile("mr %0,%1" : "=r"(tp) : "r"(_tp));
+ __asm __volatile("mr 13,%0" :: "r"(tp));
}
void*
__tls_get_addr(tls_index* ti)
{
- register Elf_Addr **tp __asm__("r13");
+ Elf_Addr **tp;
char *p;
+ __asm __volatile("mr %0,13" : "=r"(tp));
p = tls_get_addr_common((Elf_Addr**)((Elf_Addr)tp - TLS_TP_OFFSET
- TLS_TCB_SIZE), ti->ti_module, ti->ti_offset);
OpenPOWER on IntegriCloud