This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Use configured $(NM), $(OBJDUMP), $(READELF) in tst-xmmymm.sh


The tst-xmmymm.sh test uses plain "nm", "objdump" and "readelf"; for
better cross-testing support it should use the configured $(NM),
$(OBJDUMP) and $(READELF).

This patch makes it do so.  Tested x86_64.

(Not noticed before this test was moved since I haven't actually done
cross builds to x86/x86_64 target from another architecture, which is
the case where the hardcoding of native tool names would cause
problems.)

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".

diff --git a/sysdeps/x86/Makefile b/sysdeps/x86/Makefile
index 086054f..3e87a77 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 64efc6e..613a6a8 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

-- 
Joseph S. Myers
joseph@codesourcery.com


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]