Index: coregrind/valgrind.in =================================================================== RCS file: /cvsroot/valgrind/valgrind/coregrind/valgrind.in,v retrieving revision 1.28 diff -p -u -r1.28 valgrind.in --- coregrind/valgrind.in 1 Jun 2003 19:06:03 -0000 1.28 +++ coregrind/valgrind.in 17 Jun 2003 15:53:15 -0000 @@ -127,9 +127,16 @@ export LD_PRELOAD #export LD_DEBUG # If no command given, act like -h was given so vg_main.c prints out -# the usage string. And pass to 'exec' tha name of any program -- it doesn't +# the usage string. And pass to 'exec' the name of any program -- it doesn't # matter which -- because it won't be run anyway (we use 'true'). if [ $# != 0 ] ; then + which_prog="`which $1`" + case `ldd "$which_prog"` in + *"not a dynamic executable"*) + echo "\`$which_prog' is statically linked" + echo "Valgrind only works on dynamically linked executables" + exit 1 ;; + esac exec "$@" else VG_ARGS="$VG_ARGS -h"