summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoland McGrath <roland@hack.frob.com>2015-06-26 09:28:09 -0700
committerRoland McGrath <roland@hack.frob.com>2015-06-26 09:28:09 -0700
commit52af4b2e8b10bba2f6292616645ba1826480ef8e (patch)
treed14d79f0423e12bc4fb01103648c2a3f2e391952
parenta2057c984e4314c3740f04cf54e36c824e4c8f32 (diff)
downloadglibc-roland/arm.tar.gz
Conditionalize test-xfail-tst-tlsalign{,-static} on ARM assembler bug.roland/arm
-rw-r--r--ChangeLog9
-rw-r--r--elf/Makefile4
-rw-r--r--sysdeps/arm/configure46
-rw-r--r--sysdeps/arm/configure.ac37
4 files changed, 92 insertions, 4 deletions
diff --git a/ChangeLog b/ChangeLog
index b502c78f89..b4ff9cd842 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2015-06-26 Roland McGrath <roland@hack.frob.com>
+
+ [BZ #18383]
+ * sysdeps/arm/configure.ac (libc_cv_arm_tpoff_addend): New check.
+ Emit test-xfail-tst-tlsalign{,-static}=yes if it fails.
+ * sysdeps/arm/configure: Regenerated.
+ * elf/Makefile (test-xfail-tst-tlsalign): Variable removed.
+ (test-xfail-tst-tlsalign-static): Variable removed.
+
2015-06-26 Matthew Fortune <matthew.fortune@imgtec.com>
* elf/elf.h (DT_MIPS_RLD_MAP_REL): New macro.
diff --git a/elf/Makefile b/elf/Makefile
index f21276c006..7fda05610a 100644
--- a/elf/Makefile
+++ b/elf/Makefile
@@ -524,10 +524,6 @@ $(objpfx)tst-initorder: $(objpfx)tst-initordera4.so $(objpfx)tst-initordera1.so
$(objpfx)tst-null-argv: $(objpfx)tst-null-argv-lib.so
$(objpfx)tst-tlsalign: $(objpfx)tst-tlsalign-lib.so
-# BZ#18383: broken on at least ARM (both).
-test-xfail-tst-tlsalign = yes
-test-xfail-tst-tlsalign-static = yes
-
$(objpfx)tst-tlsalign-extern: $(objpfx)tst-tlsalign-vars.o
$(objpfx)tst-tlsalign-extern-static: $(objpfx)tst-tlsalign-vars.o
diff --git a/sysdeps/arm/configure b/sysdeps/arm/configure
index 52f2185c29..f789f616af 100644
--- a/sysdeps/arm/configure
+++ b/sysdeps/arm/configure
@@ -260,6 +260,52 @@ if test $libc_cv_arm_pcrel_movw = yes; then
fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether TPOFF relocs with addends are assembled correctly" >&5
+$as_echo_n "checking whether TPOFF relocs with addends are assembled correctly... " >&6; }
+if ${libc_cv_arm_tpoff_addend+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+
+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>&5 2>&5 &&
+LC_ALL=C $READELF -x.text conftest.o > conftest.x 2>&5 &&
+{
+ cat conftest.x 1>&5
+ $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>&5 && libc_cv_arm_tpoff_addend=yes
+}
+rm -f conftest*
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $libc_cv_arm_tpoff_addend" >&5
+$as_echo "$libc_cv_arm_tpoff_addend" >&6; }
+if test $libc_cv_arm_tpoff_addend = no; then
+ config_vars="$config_vars
+test-xfail-tst-tlsalign = yes"
+ config_vars="$config_vars
+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.
diff --git a/sysdeps/arm/configure.ac b/sysdeps/arm/configure.ac
index 168f2e7c80..d7b6a7a266 100644
--- a/sysdeps/arm/configure.ac
+++ b/sysdeps/arm/configure.ac
@@ -79,6 +79,43 @@ if test $libc_cv_arm_pcrel_movw = yes; then
AC_DEFINE([ARM_PCREL_MOVW_OK])
fi
+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.