From 3785d22822bc425cde879bea3c1758e71a30892a Mon Sep 17 00:00:00 2001 From: kmacy Date: Sun, 8 Oct 2006 02:50:34 +0000 Subject: Fix TLS on sparc64 for statically and dynamically linked binaries Approved by: rwatson (mentor) Reviewed by: jmg and marcel --- libexec/rtld-elf/sparc64/reloc.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'libexec/rtld-elf') diff --git a/libexec/rtld-elf/sparc64/reloc.c b/libexec/rtld-elf/sparc64/reloc.c index dc0d830..225322e 100644 --- a/libexec/rtld-elf/sparc64/reloc.c +++ b/libexec/rtld-elf/sparc64/reloc.c @@ -723,7 +723,7 @@ install_plt(Elf_Word *pltgot, Elf_Addr proc) void allocate_initial_tls(Obj_Entry *objs) { - register Elf_Addr** tp __asm__("%g7"); + Elf_Addr* tpval; /* * Fix the size of the static TLS block by using the maximum @@ -731,7 +731,8 @@ allocate_initial_tls(Obj_Entry *objs) * use. */ tls_static_space = tls_last_offset + RTLD_STATIC_TLS_EXTRA; - tp = allocate_tls(objs, NULL, 3*sizeof(Elf_Addr), sizeof(Elf_Addr)); + tpval = allocate_tls(objs, NULL, 3*sizeof(Elf_Addr), sizeof(Elf_Addr)); + __asm __volatile("mov %0, %%g7" : : "r" (tpval)); } void *__tls_get_addr(tls_index *ti) -- cgit v1.1