summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Bohan <mbohan@codeaurora.org>2011-04-21 15:48:09 -0700
committerMichael Bohan <mbohan@codeaurora.org>2011-04-21 16:07:44 -0700
commit00e42a09a8f205f22f260ffeb84a7e7daff26fc1 (patch)
tree6138dc39e1ebdc4a6fec550150b5494a4ca5bb59
parent3208f096b4f2e41974309ecd75877c542d7019bb (diff)
downloadbionic-00e42a09a8f205f22f260ffeb84a7e7daff26fc1.zip
bionic-00e42a09a8f205f22f260ffeb84a7e7daff26fc1.tar.gz
bionic-00e42a09a8f205f22f260ffeb84a7e7daff26fc1.tar.bz2
TLS: Call kernel helper in additional situationsM8960AAAAANLYA1002M76XXUSNEKNLYA1010
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
-rw-r--r--libc/private/bionic_tls.h4
1 files changed, 3 insertions, 1 deletions
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);