diff options
author | Michael Bohan <mbohan@codeaurora.org> | 2011-11-17 13:06:42 +0530 |
---|---|---|
committer | Ricardo Cerqueira <cyanogenmod@cerqueira.org> | 2012-07-10 20:30:58 +0100 |
commit | 467dcf56ba73e66ce4e73c055fa042de5c11633a (patch) | |
tree | d8cc45c2e7dcd428bafae95564fb622d11b5e89b /libc/private | |
parent | f225ebe43d596173f19e8d686f74b9a5fb1ff090 (diff) | |
download | bionic-467dcf56ba73e66ce4e73c055fa042de5c11633a.zip bionic-467dcf56ba73e66ce4e73c055fa042de5c11633a.tar.gz bionic-467dcf56ba73e66ce4e73c055fa042de5c11633a.tar.bz2 |
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: I282697b0ab97cb62affd018494076e6ffa4d392a
Diffstat (limited to 'libc/private')
-rw-r--r-- | libc/private/bionic_tls.h | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/libc/private/bionic_tls.h b/libc/private/bionic_tls.h index 9a5146f..f3a4ca0 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); |