summaryrefslogtreecommitdiffstats
path: root/libexec/rtld-elf
diff options
context:
space:
mode:
authorjhibbits <jhibbits@FreeBSD.org>2015-01-06 03:49:22 +0000
committerjhibbits <jhibbits@FreeBSD.org>2015-01-06 03:49:22 +0000
commit0c99d3fb5488d53a1b6c9afd134fb9f7066e373a (patch)
tree7c21271a1bf72c0ee39dacb363ec7ffc246bf08b /libexec/rtld-elf
parentab03e992585c9b77bf9147a3eab69b82317ec0c3 (diff)
downloadFreeBSD-src-0c99d3fb5488d53a1b6c9afd134fb9f7066e373a.zip
FreeBSD-src-0c99d3fb5488d53a1b6c9afd134fb9f7066e373a.tar.gz
Apply r246556 to powerpc:
Avoid use of register variables, which some compilers (e.g. clang) don't like. It makes the code a little clearer as well. This allows a clang 3.5 built powerpc world to run (tested in a jail). MFC after: 1 week
Diffstat (limited to 'libexec/rtld-elf')
-rw-r--r--libexec/rtld-elf/powerpc/reloc.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/libexec/rtld-elf/powerpc/reloc.c b/libexec/rtld-elf/powerpc/reloc.c
index 8e23daa..1fe9676 100644
--- a/libexec/rtld-elf/powerpc/reloc.c
+++ b/libexec/rtld-elf/powerpc/reloc.c
@@ -622,8 +622,7 @@ init_pltgot(Obj_Entry *obj)
void
allocate_initial_tls(Obj_Entry *list)
{
- register Elf_Addr **tp __asm__("r2");
- Elf_Addr **_tp;
+ Elf_Addr **tp;
/*
* Fix the size of the static TLS block by using the maximum
@@ -633,22 +632,23 @@ 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, 8)
+ tp = (Elf_Addr **) ((char *) allocate_tls(list, NULL, TLS_TCB_SIZE, 8)
+ 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 2,%0" :: "r"(tp));
}
void*
__tls_get_addr(tls_index* ti)
{
- register Elf_Addr **tp __asm__("r2");
+ register Elf_Addr **tp;
char *p;
+ __asm __volatile("mr %0,2" : "=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