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

This commit is contained in:
Joseph Myers 2012-11-08 00:01:46 +00:00
parent eb48db7e89
commit 0fbb0fbc2e
3 changed files with 18 additions and 6 deletions

View File

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

View File

@ -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

View File

@ -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