]> sourceware.org Git - glibc.git/commitdiff
BZ#18383: Conditionalize test-xfail-tst-tlsalign{,-static} on ARM assembler bug.
authorRoland McGrath <roland@hack.frob.com>
Wed, 8 Jul 2015 22:00:43 +0000 (15:00 -0700)
committerRoland McGrath <roland@hack.frob.com>
Wed, 8 Jul 2015 22:00:43 +0000 (15:00 -0700)
ChangeLog
NEWS
elf/Makefile
sysdeps/arm/configure
sysdeps/arm/configure.ac

index 90d5fa016a8f7302e5edf1907cf91423fd7403fa..71ec1f3c2ec0fd83e14109a1fda8ecba972ce926 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,12 @@
 2015-07-08  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.
+
        * Makerules (do-install-so): Use $(LN_S) rather than explicit 'ln -s'.
        * elf/Makefile ($(objpfx)$(rtld-installed-name)): Use $(make-link)
        rather than explicit 'ln -s'.
diff --git a/NEWS b/NEWS
index ae0b753cde3cac856037ae4a74b2195e47ff9085..40472a415a50f0865bb85e82531a55f6b9c9dc5d 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -21,13 +21,13 @@ Version 2.22
   18049, 18068, 18080, 18093, 18100, 18104, 18110, 18111, 18116, 18125,
   18128, 18138, 18185, 18196, 18197, 18206, 18210, 18211, 18217, 18219,
   18220, 18221, 18234, 18244, 18245, 18247, 18287, 18319, 18324, 18333,
-  18346, 18371, 18397, 18409, 18410, 18412, 18418, 18422, 18434, 18435,
-  18444, 18468, 18469, 18470, 18479, 18483, 18495, 18496, 18497, 18498,
-  18502, 18507, 18508, 18512, 18513, 18519, 18520, 18522, 18527, 18528,
-  18529, 18530, 18532, 18533, 18534, 18536, 18539, 18540, 18542, 18544,
-  18545, 18546, 18547, 18549, 18553, 18557, 18558, 18569, 18583, 18585,
-  18586, 18592, 18593, 18594, 18602, 18612, 18613, 18619, 18633, 18641.
-  18643.
+  18346, 18371, 18383, 18397, 18409, 18410, 18412, 18418, 18422, 18434,
+  18435, 18444, 18468, 18469, 18470, 18479, 18483, 18495, 18496, 18497,
+  18498, 18502, 18507, 18508, 18512, 18513, 18519, 18520, 18522, 18527,
+  18528, 18529, 18530, 18532, 18533, 18534, 18536, 18539, 18540, 18542,
+  18544, 18545, 18546, 18547, 18549, 18553, 18557, 18558, 18569, 18583,
+  18585, 18586, 18592, 18593, 18594, 18602, 18612, 18613, 18619, 18633,
+  18641, 18643.
 
 * Cache information can be queried via sysconf() function on s390 e.g. with
   _SC_LEVEL1_ICACHE_SIZE as argument.
index e439527fb94118abfb6f5ab405fbecc7b4560970..535421f250f213be2048a65bc7ab8ef2abed2b98 100644 (file)
@@ -525,10 +525,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
 
index 52f2185c2979c161547a81d620c64abaaba90aad..158116b5a74c75b0915d82cfbe3207f047dbbad5 100644 (file)
@@ -260,6 +260,55 @@ if test $libc_cv_arm_pcrel_movw = yes; then
 
 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).
+{ $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.
index 168f2e7c80169c3204157ff3ee41cff88f1d5fa0..859c92a0024743455588056362c3aa8d373dbad6 100644 (file)
@@ -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.
This page took 0.124767 seconds and 5 git commands to generate.