]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
Enhance tst-xmmymm.sh to detect zmm register usage in ld.so (BZ #16194)
authorSiddhesh Poyarekar <siddhesh@redhat.com>
Fri, 12 Sep 2014 07:01:05 +0000 (12:31 +0530)
committerSiddhesh Poyarekar <siddhesh@redhat.com>
Fri, 12 Sep 2014 07:01:05 +0000 (12:31 +0530)
2d63a517e4084ec80403cd9f278690fa8b676cc4 added support to save and
restore zmm register in the dynamic linker, but did not enhance
test-xmmymm.sh to detect accidental usage of these registers.  The
patch below adds that check.

The script has also been renamed to tst-ld-sse-use.sh.  To see the
minimal changes, run `git show -M`.

[BZ #16194]
* sysdeps/x86/tst-xmmymm.sh: Rename file to...
* sysdeps/x86/tst-ld-sse-use.sh: ... this.  Check for zmm
register usage.
* sysdeps/x86/Makefile: Adjust.

ChangeLog
sysdeps/x86/Makefile
sysdeps/x86/tst-ld-sse-use.sh [moved from sysdeps/x86/tst-xmmymm.sh with 90% similarity]

index d528cab31e04b42eefaec14dc7b91412cf5b9f01..7a3346af66f19bb5955f7bcbd5c3de6d1efda74c 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2014-09-12  Siddhesh Poyarekar  <siddhesh@redhat.com>
+
+       [BZ #16194]
+       * sysdeps/x86/tst-xmmymm.sh: Rename file to...
+       * sysdeps/x86/tst-ld-sse-use.sh: ... this.  Check for zmm
+       register usage.
+       * sysdeps/x86/Makefile: Adjust.
+
 2014-09-11  Kostya Serebryany  <konstantin.s.serebryany@gmail.com>
            Roland McGrath  <roland@hack.frob.com>
 
index a96c8bd0b262ab864f9c8198f9ad5b5e4b413128..087bbdeca04accd0e7016ad1669b2d87be84a7c4 100644 (file)
@@ -2,8 +2,8 @@ ifeq ($(subdir),elf)
 CFLAGS-.os += $(if $(filter $(@F),$(patsubst %,%.os,$(all-rtld-routines))),\
                   -mno-sse -mno-mmx)
 
-tests-special += $(objpfx)tst-xmmymm.out
-$(objpfx)tst-xmmymm.out: ../sysdeps/x86/tst-xmmymm.sh $(objpfx)ld.so
+tests-special += $(objpfx)tst-ld-sse-use.out
+$(objpfx)tst-ld-sse-use.out: ../sysdeps/x86/tst-ld-sse-use.sh $(objpfx)ld.so
        @echo "Checking ld.so for SSE register use.  This will take a few seconds..."
        $(SHELL) $< $(objpfx) '$(NM)' '$(OBJDUMP)' '$(READELF)' > $@; \
        $(evaluate-test)
similarity index 90%
rename from sysdeps/x86/tst-xmmymm.sh
rename to sysdeps/x86/tst-ld-sse-use.sh
index 69ddb587d42d72d2123d8f69997c7b4af599b6b5..c707ca9cc9730e9dcd81352a956767ca8f5dfc61 100755 (executable)
@@ -1,5 +1,5 @@
 #! /bin/bash
-# Make sure no code in ld.so uses xmm/ymm registers on x86-64.
+# Make sure no code in ld.so uses xmm/ymm/zmm registers on x86-64.
 # Copyright (C) 2009-2014 Free Software Foundation, Inc.
 # This file is part of the GNU C Library.
 
@@ -24,7 +24,7 @@ NM="$2"
 OBJDUMP="$3"
 READELF="$4"
 
-tmp=$(mktemp ${objpfx}tst-xmmymm.XXXXXX)
+tmp=$(mktemp ${objpfx}tst-ld-sse-use.XXXXXX)
 trap 'rm -f "$tmp"' 1 2 3 15
 
 # List of object files we have to test
@@ -80,12 +80,12 @@ echo "object files needed: $tocheck"
 cp /dev/null "$tmp"
 for f in $tocheck; do
   $OBJDUMP -d "$objpfx"../*/"$f" |
-  awk 'BEGIN { last="" } /^[[:xdigit:]]* <[_[:alnum:]]*>:$/ { fct=substr($2, 2, length($2)-3) } /,%[xy]mm[[:digit:]]*$/ { if (last != fct) { print fct; last=fct} }' |
+  awk 'BEGIN { last="" } /^[[:xdigit:]]* <[_[:alnum:]]*>:$/ { fct=substr($2, 2, length($2)-3) } /,%[xyz]mm[[:digit:]]*$/ { if (last != fct) { print fct; last=fct} }' |
   while read fct; do
     if test "$fct" = "_dl_runtime_profile" -o "$fct" = "_dl_x86_64_restore_sse"; then
       continue;
     fi
-    echo "function $fct in $f modifies xmm/ymm" >> "$tmp"
+    echo "function $fct in $f modifies xmm/ymm/zmm" >> "$tmp"
     result=1
   done
 done