From 7d3f85133a697062752d73b295cb7c563f2759cc Mon Sep 17 00:00:00 2001 From: Marcel Moolenaar Date: Wed, 30 Aug 2006 00:39:07 +0000 Subject: [PATCH] Prevent dead code elimination for the TP assignmient by using inline assembly. --- lib/libc/ia64/gen/_set_tp.c | 3 +-- libexec/rtld-elf/ia64/reloc.c | 5 +++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/libc/ia64/gen/_set_tp.c b/lib/libc/ia64/gen/_set_tp.c index 2419e10209ec..901e90166918 100644 --- a/lib/libc/ia64/gen/_set_tp.c +++ b/lib/libc/ia64/gen/_set_tp.c @@ -29,7 +29,6 @@ void _set_tp(void *tpval) { - register void* tp __asm__("r13"); - tp = tpval; + __asm __volatile("mov r13 = %0" :: "r"(tpval)); } diff --git a/libexec/rtld-elf/ia64/reloc.c b/libexec/rtld-elf/ia64/reloc.c index 45f9ef54f590..a07aeb83ec91 100644 --- a/libexec/rtld-elf/ia64/reloc.c +++ b/libexec/rtld-elf/ia64/reloc.c @@ -594,7 +594,7 @@ init_pltgot(Obj_Entry *obj) void allocate_initial_tls(Obj_Entry *list) { - register Elf_Addr** tp __asm__("r13"); + void *tpval; /* * Fix the size of the static TLS block by using the maximum @@ -603,7 +603,8 @@ allocate_initial_tls(Obj_Entry *list) */ tls_static_space = tls_last_offset + tls_last_size + RTLD_STATIC_TLS_EXTRA; - tp = allocate_tls(list, 0, 16, 16); + tpval = allocate_tls(list, 0, 16, 16); + __asm __volatile("mov r13 = %0" :: "r"(tpval)); } void *__tls_get_addr(unsigned long module, unsigned long offset)