From 16d2ea4c821502948d193a152c8b151f5497a0d3 Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Sun, 26 Jul 2009 16:10:00 -0700 Subject: Make sure no code in ld.so uses xmm/ymm registers on x86-64. This patch introduces a test to make sure no function modifies the xmm/ymm registers. With the exception of the auditing functions. The test is probably too pessimistic. All code linked into ld.so is checked. Perhaps at some point the callgraph starting from _dl_fixup and _dl_profile_fixup is checked and we can start using faster SSE-using functions in parts of ld.so. --- sysdeps/x86_64/tst-xmmymm.sh | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100755 sysdeps/x86_64/tst-xmmymm.sh (limited to 'sysdeps/x86_64/tst-xmmymm.sh') diff --git a/sysdeps/x86_64/tst-xmmymm.sh b/sysdeps/x86_64/tst-xmmymm.sh new file mode 100755 index 0000000000..0735276e6d --- /dev/null +++ b/sysdeps/x86_64/tst-xmmymm.sh @@ -0,0 +1,17 @@ +#! /bin/sh +objpfx="$1" + +tmp=$(mktemp ${objpfx}tst-xmmymm.XXXXXX) +trap 'rm -f "$tmp"' 1 2 3 15 + +objdump -d "${objpfx}ld.so" | +awk 'BEGIN { last="" } /^[[:xdigit:]]* <[_[:alnum:]]*>:$/ { fct=substr($2, 2, length($2)-3) } /,%[xy]mm[[:digit:]]*$/ { if (last != fct) { print fct; last=fct} }' | +tee "$tmp" + +echo "Functions which incorrectly modify xmm/ymm registers:" +err=1 +egrep -vs '^_dl_runtime_profile$' "$tmp" || err=0 +if test $err -eq 0; then echo "None"; fi + +rm "$tmp" +exit $err -- cgit 1.4.1