about summary refs log tree commit diff
path: root/sysdeps/arm/configure.ac
diff options
context:
space:
mode:
Diffstat (limited to 'sysdeps/arm/configure.ac')
-rw-r--r--sysdeps/arm/configure.ac40
1 files changed, 40 insertions, 0 deletions
diff --git a/sysdeps/arm/configure.ac b/sysdeps/arm/configure.ac
index 168f2e7c80..859c92a002 100644
--- a/sysdeps/arm/configure.ac
+++ b/sysdeps/arm/configure.ac
@@ -79,6 +79,46 @@ if test $libc_cv_arm_pcrel_movw = yes; then
   AC_DEFINE([ARM_PCREL_MOVW_OK])
 fi
 
+# This was buggy in assemblers from GNU binutils versions before 2.25.1
+# (it's known to be broken in 2.24 and 2.25; see
+# https://sourceware.org/bugzilla/show_bug.cgi?id=18383).
+AC_CACHE_CHECK([whether TPOFF relocs with addends are assembled correctly],
+	       libc_cv_arm_tpoff_addend, [
+cat > conftest.s <<\EOF
+	.syntax unified
+	.arm
+	.arch armv7-a
+
+	.text
+foo:
+	.word tbase(tpoff)+4
+
+	.section .tdata,"awT",%progbits
+	.word -4
+tbase:	.word 0
+	.word 4
+EOF
+libc_cv_arm_tpoff_addend=no
+${CC-cc} -c $CFLAGS $CPPFLAGS \
+	 -o conftest.o conftest.s 1>&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD &&
+LC_ALL=C $READELF -x.text conftest.o > conftest.x 2>&AS_MESSAGE_LOG_FD &&
+{
+  cat conftest.x 1>&AS_MESSAGE_LOG_FD
+  $AWK 'BEGIN { result = 2 }
+$1 ~ /0x0+/ && $2 ~ /[[0-9a-f]]+/ {
+# Check for little-endian or big-endian encoding of 4 in the in-place addend.
+  result = ($2 == "04000000" || $2 == "00000004") ? 0 : 1
+}
+END { exit(result) }
+' conftest.x 2>&AS_MESSAGE_LOG_FD && libc_cv_arm_tpoff_addend=yes
+}
+rm -f conftest*])
+if test $libc_cv_arm_tpoff_addend = no; then
+  LIBC_CONFIG_VAR([test-xfail-tst-tlsalign], [yes])
+  LIBC_CONFIG_VAR([test-xfail-tst-tlsalign-static], [yes])
+fi
+
+
 libc_cv_gcc_unwind_find_fde=no
 
 # Remove -fno-unwind-tables that was added in sysdeps/arm/preconfigure.ac.