From 00e42a09a8f205f22f260ffeb84a7e7daff26fc1 Mon Sep 17 00:00:00 2001 From: Michael Bohan Date: Thu, 21 Apr 2011 15:48:09 -0700 Subject: TLS: Call kernel helper in additional situations ARMv6 has HW TLS support, and thus we should be using it rather than hacking the Linux Kernel to use the software mechanism. Unfortunately, ARMv6 targets without Thumb2 do not support the necessary TLS instructions in Thumb Mode. Converting the tls libc routines to ARM Mode will require an additional branch to switch modes. Therefore, let's simply use the Kernel's Helper Routine which already operates in ARM Mode. This changed behavior only applies if the HAVE_ARM_TLS_REGISTER option is defined. Otherwise, the existing paradigm is used. Change-Id: Iedf7036c0c2539cab0f82507bef810e1e0cbd4f6 --- libc/private/bionic_tls.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/libc/private/bionic_tls.h b/libc/private/bionic_tls.h index 008fd2f..3edee11 100644 --- a/libc/private/bionic_tls.h +++ b/libc/private/bionic_tls.h @@ -100,7 +100,9 @@ extern int __set_tls(void *ptr); * C library, because we don't know where the corresponding code * is going to run. */ -# ifdef LIBC_STATIC +# if defined(LIBC_STATIC) || \ + (defined(__ARM_ARCH_6__) && defined(HAVE_ARM_TLS_REGISTER) && \ + !defined(__ARM_ARCH_6T2__)) /* Use the kernel helper in static C library. */ typedef volatile void* (__kernel_get_tls_t)(void); -- cgit v1.1