about summary refs log tree commit diff
path: root/arch
diff options
context:
space:
mode:
authorRich Felker <dalias@aerifal.cx>2018-10-01 18:37:02 -0400
committerRich Felker <dalias@aerifal.cx>2018-10-01 18:37:02 -0400
commit0beb9dfbecad38af9759b1e83eeb007e28b70abb (patch)
tree75c42c8b544a480ba0a7664ebe83d88de654cd60 /arch
parent4d0a82170a25464c39522d7190b9fe302045ddb2 (diff)
downloadmusl-0beb9dfbecad38af9759b1e83eeb007e28b70abb.tar.gz
musl-0beb9dfbecad38af9759b1e83eeb007e28b70abb.tar.xz
musl-0beb9dfbecad38af9759b1e83eeb007e28b70abb.zip
add TLSDESC support for 32-bit arm
unlike other asm where the baseline ISA is used, these functions are
hot paths and use ISA-level specializations.

call-clobbered vfp registers are saved before calling __tls_get_new,
since there is no guarantee it won't use them. while setjmp/longjmp
have to use hwcap to decide whether to the fpu is in use, since
application code could be using vfp registers even if libc was
compiled as pure softfloat, __tls_get_new is part of libc and can be
assumed not to have access to vfp registers if tlsdesc.S does not.
thus it suffices just to check the predefined preprocessor macros. the
check for __ARM_PCS_VFP is redundant; !__SOFTFP__ must always be true
if the target ISA level includes fpu instructions/registers.
Diffstat (limited to 'arch')
-rw-r--r--arch/arm/reloc.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/arch/arm/reloc.h b/arch/arm/reloc.h
index 4b00bf64..2c2e7f58 100644
--- a/arch/arm/reloc.h
+++ b/arch/arm/reloc.h
@@ -26,7 +26,9 @@
 #define REL_DTPMOD      R_ARM_TLS_DTPMOD32
 #define REL_DTPOFF      R_ARM_TLS_DTPOFF32
 #define REL_TPOFF       R_ARM_TLS_TPOFF32
-//#define REL_TLSDESC     R_ARM_TLS_DESC
+#define REL_TLSDESC     R_ARM_TLS_DESC
+
+#define TLSDESC_BACKWARDS
 
 #define CRTJMP(pc,sp) __asm__ __volatile__( \
 	"mov sp,%1 ; bx %0" : : "r"(pc), "r"(sp) : "memory" )