about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog9
-rw-r--r--sysdeps/x86/Makefile2
-rwxr-xr-xsysdeps/x86/tst-xmmymm.sh13
3 files changed, 18 insertions, 6 deletions
diff --git a/ChangeLog b/ChangeLog
index cac1a7ede8..3f7334dc6c 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2012-11-07  Joseph Myers  <joseph@codesourcery.com>
+
+	* sysdeps/x86/Makefile ($(objpfx)tst-xmmymm.out): Pass $(NM),
+	$(OBJDUMP) and $(READELF) to tst-xmmymm.sh.
+	* sysdeps/x86/tst-xmmymm.sh (NM): New variable.  Use it instead of
+	hardcoded "nm".
+	(OBJDUMP): New variable.  Use it instead of hardcoded "objdump".
+	(READELF): New variable.  Use it instead of hardcoded "readelf".
+
 2012-11-07  H.J. Lu  <hongjiu.lu@intel.com>
 
 	* sysdeps/x86_64/Makefile ($(objpfx)tst-xmmymm.out): Moved to ...
diff --git a/sysdeps/x86/Makefile b/sysdeps/x86/Makefile
index 086054ff09..3e87a77069 100644
--- a/sysdeps/x86/Makefile
+++ b/sysdeps/x86/Makefile
@@ -5,5 +5,5 @@ CFLAGS-.os += $(if $(filter $(@F),$(patsubst %,%.os,$(all-rtld-routines))),\
 tests: $(objpfx)tst-xmmymm.out
 $(objpfx)tst-xmmymm.out: ../sysdeps/x86/tst-xmmymm.sh $(objpfx)ld.so
 	@echo "Checking ld.so for SSE register use.  This will take a few seconds..."
-	$(SHELL) $< $(objpfx) > $@
+	$(SHELL) $< $(objpfx) '$(NM)' '$(OBJDUMP)' '$(READELF)' > $@
 endif
diff --git a/sysdeps/x86/tst-xmmymm.sh b/sysdeps/x86/tst-xmmymm.sh
index 64efc6e021..613a6a8d59 100755
--- a/sysdeps/x86/tst-xmmymm.sh
+++ b/sysdeps/x86/tst-xmmymm.sh
@@ -20,18 +20,21 @@
 set -e
 
 objpfx="$1"
+NM="$2"
+OBJDUMP="$3"
+READELF="$4"
 
 tmp=$(mktemp ${objpfx}tst-xmmymm.XXXXXX)
 trap 'rm -f "$tmp"' 1 2 3 15
 
 # List of object files we have to test
-rtldobjs=$(readelf -W -wi ${objpfx}dl-allobjs.os |
+rtldobjs=$($READELF -W -wi ${objpfx}dl-allobjs.os |
     awk '/^ </ { if ($5 == "(DW_TAG_compile_unit)") c=1; else c=0 } $2 == "DW_AT_name" { if (c == 1) print $NF }' |
     sed 's,\(.*/\|\)\([_[:alnum:]-]*[.]\).$,\2os,')
 rtldobjs="$rtldobjs $(ar t ${objpfx}rtld-libc.a)"
 
 # OBJECT symbols can be ignored.
-readelf -sW ${objpfx}dl-allobjs.os ${objpfx}rtld-libc.a |
+$READELF -sW ${objpfx}dl-allobjs.os ${objpfx}rtld-libc.a |
 egrep " OBJECT  *GLOBAL " |
 awk '{if ($7 != "ABS") print $8 }' |
 sort -u > "$tmp"
@@ -46,7 +49,7 @@ while test -n "$objs"; do
   objs=""
 
   for f in $this; do
-    undef=$(nm -u "$objpfx"../*/"$f" | awk '{print $2}')
+    undef=$($NM -u "$objpfx"../*/"$f" | awk '{print $2}')
     if test -n "$undef"; then
       for s in $undef; do
 	for obj in ${objects[*]} "_GLOBAL_OFFSET_TABLE_"; do
@@ -56,7 +59,7 @@ while test -n "$objs"; do
 	done
         for o in $rtldobjs; do
 	  ro=$(echo "$objpfx"../*/"$o")
-	  if nm -g --defined-only "$ro" | egrep -qs " $s\$"; then
+	  if $NM -g --defined-only "$ro" | egrep -qs " $s\$"; then
 	    if ! (echo "$tocheck $objs" | fgrep -qs "$o"); then
 	      echo "$o needed for $s"
 	      objs="$objs $o"
@@ -76,7 +79,7 @@ echo "object files needed: $tocheck"
 
 cp /dev/null "$tmp"
 for f in $tocheck; do
-  objdump -d "$objpfx"../*/"$f" |
+  $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} }' |
   while read fct; do
     if test "$fct" = "_dl_runtime_profile" -o "$fct" = "_dl_x86_64_restore_sse"; then