diff --git a/.gitattributes b/.gitattributes
index 970ce8d8a476dcccdc75991af35ffb058d603caf..04d099ff29ce9bbed9e47d63a323983f8b442c15 100644
--- a/.gitattributes
+++ b/.gitattributes
@@ -1158,6 +1158,7 @@ tools/selective_cfi/scfi_instr.hpp -text
 tools/selective_cfi/tests/dude.c -text
 tools/selective_cfi/tests/fib.c -text
 tools/selective_cfi/tests/foo.c -text
+tools/selective_cfi/tests/libc_driver.c -text
 tools/selective_cfi/tests/libdude.c -text
 tools/selective_cfi/tests/libfib.c -text
 tools/selective_cfi/tests/libfib2.c -text
@@ -1166,6 +1167,7 @@ tools/selective_cfi/tests/pow.c -text
 tools/selective_cfi/tests/test_dude.sh -text
 tools/selective_cfi/tests/test_fib.sh -text
 tools/selective_cfi/tests/test_foo.sh -text
+tools/selective_cfi/tests/test_libc.sh -text
 tools/selective_cfi/tests/test_pow.sh -text
 tools/selective_cfi/zest_cfi_runtime/SConscript -text
 tools/selective_cfi/zest_cfi_runtime/SConscript32 -text
diff --git a/tools/selective_cfi/tests/libc_driver.c b/tools/selective_cfi/tests/libc_driver.c
new file mode 100644
index 0000000000000000000000000000000000000000..38ebfd5146a6ff1f95ce8472622ff82bf8530d06
--- /dev/null
+++ b/tools/selective_cfi/tests/libc_driver.c
@@ -0,0 +1,6 @@
+#include <stdio.h>
+
+main()
+{
+	printf("hello world\n");
+}
diff --git a/tools/selective_cfi/tests/test_foo.sh b/tools/selective_cfi/tests/test_foo.sh
index e92f3eb45608fd273ebd487f036853aa9e07a89a..dfa8706c1ff17fe72775cdb3dde6547ca1831bbb 100755
--- a/tools/selective_cfi/tests/test_foo.sh
+++ b/tools/selective_cfi/tests/test_foo.sh
@@ -72,7 +72,7 @@ main()
 	test foo.exe libfoo.so.cfi		# shared lib only
 	test foo.exe.cfi libfoo.so.cfi		# both protected
 	report
-	clean
+#	clean
 }
 
 passes=0 
diff --git a/tools/selective_cfi/tests/test_libc.sh b/tools/selective_cfi/tests/test_libc.sh
new file mode 100755
index 0000000000000000000000000000000000000000..6217f8c8e032d43be87d9f7d063281bf0667028a
--- /dev/null
+++ b/tools/selective_cfi/tests/test_libc.sh
@@ -0,0 +1,84 @@
+#!/bin/bash 
+
+do_cfi()
+{
+	$PS $1 $2 --backend zipr --step move_globals=on --step selective_cfi=on --step-option selective_cfi:--multimodule --step-option move_globals:--cfi  --step-option fix_calls:--fix-all --step-option zipr:"--add-sections false"
+	if [ ! $? -eq 0 ]; then
+		echo "do_cfi(): failed to protect"
+	fi
+}
+
+do_coloring_cfi()
+{
+	$PS $1 $2 --backend zipr --step move_globals=on --step selective_cfi=on --step-option selective_cfi:--multimodule --step-option move_globals:--cfi  --step-option fix_calls:--fix-all --step-option selective_cfi:--color  --step-option zipr:"--add-sections false"
+	if [ ! $? -eq 0 ]; then
+		echo "do_coloring_cfi(): failed to protect"
+	fi
+}
+
+
+get_correct()
+{
+	cp libfoo.so.orig libfoo.so
+	./foo.exe > correct
+}
+
+test()
+{
+	
+	cp $2 libfoo.so  
+	./$1 > out 
+
+	cmp out correct
+	if [ $? = 1 ]; then
+		fails=$(expr $fails + 1 )
+		echo test failed
+	else
+		passes=$(expr $passes + 1 )
+		echo test passed.
+	fi
+}
+
+
+build()
+{
+	gcc -o libc_driver.exe libc_driver.c -w 
+
+	libcpath=$(ldd libc_driver.exe|grep libc.so.6|sed "s/.*=>//"|sed "s/(.*//")
+	echo libc=$libcpath
+	cp $libcpath libc.so.6.orig
+}
+
+
+protect()
+{
+	do_cfi libc.so.6.orig libc-2.19.so.cfi
+}
+
+clean()
+{
+	rm out
+	rm correct
+	rm -Rf foo.exe peasoup_exe* libfoo.so libfoo.so.orig libfoo.so.cfi foo.cfi foo.exe.cfi
+}
+
+report ()
+{
+	total=$(expr $passes + $fails)
+	echo "Passes:  $passes / $total"
+	echo "Fails :  $fails / $total"
+}
+
+main()
+{
+	build
+	protect
+#	get_correct
+#	report
+#	clean
+}
+
+passes=0 
+fails=0
+
+main $*