src/
	* strip.c (handle_elf): Don't keep sections that kept symbol tables
	refer to.  Instead, just be sure to preserve the original symbol
	table in the debug file so those symbols go with their sections and
	can be elided from the stripped version of the symbol table.


tests/
	* testfile48.bz2, testfile48.bz2.debug: New data files.
	* Makefile.am (EXTRA_DIST): Add them.
	* run-strip-test8.sh: Use them.
diff --git a/tests/run-strip-test.sh b/tests/run-strip-test.sh
index 480101e..e056f89 100755
--- a/tests/run-strip-test.sh
+++ b/tests/run-strip-test.sh
@@ -1,5 +1,5 @@
 #! /bin/sh
-# Copyright (C) 1999, 2000, 2002, 2003, 2005, 2007 Red Hat, Inc.
+# Copyright (C) 1999, 2000, 2002, 2003, 2005, 2007, 2008 Red Hat, Inc.
 # This file is part of Red Hat elfutils.
 # Written by Ulrich Drepper <drepper@redhat.com>, 1999.
 #
@@ -30,7 +30,8 @@
 stripped=${stripped:-testfile7}
 debugout=${debugfile:+-f testfile.debug.temp -F $debugfile}
 
-testfiles $original $stripped $debugfile
+testfiles $original
+test x$stripped = xtestfile.temp || testfiles $stripped $debugfile
 
 tempfiles testfile.temp testfile.debug.temp testfile.unstrip
 
@@ -56,4 +57,8 @@
 testrun ../src/elfcmp --hash-inexact $original testfile.unstrip
 }
 
+tempfiles testfile.sections
+testrun ../src/readelf -S testfile.temp > testfile.sections || status=$?
+fgrep ' .debug_' testfile.sections && status=1
+
 exit $status