From 521c47d2a216fc64098c024fc5ed53532b485f32 Mon Sep 17 00:00:00 2001 From: Roland McGrath Date: Fri, 11 Apr 2008 07:01:58 +0000 Subject: 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. --- tests/ChangeLog | 13 +++++++++++++ tests/Makefile.am | 7 ++++--- tests/run-strip-test.sh | 9 +++++++-- tests/run-strip-test8.sh | 5 +++++ tests/testfile16.bz2 | Bin 8424 -> 8413 bytes tests/testfile16.debug.bz2 | Bin 23520 -> 24257 bytes tests/testfile47.bz2 | Bin 0 -> 793 bytes tests/testfile48.bz2 | Bin 0 -> 408 bytes tests/testfile48.debug.bz2 | Bin 0 -> 758 bytes 9 files changed, 29 insertions(+), 5 deletions(-) create mode 100755 tests/run-strip-test8.sh create mode 100644 tests/testfile47.bz2 create mode 100644 tests/testfile48.bz2 create mode 100644 tests/testfile48.debug.bz2 (limited to 'tests') diff --git a/tests/ChangeLog b/tests/ChangeLog index d9d74692..c9bba45c 100644 --- a/tests/ChangeLog +++ b/tests/ChangeLog @@ -1,3 +1,16 @@ +2008-04-10 Roland McGrath + + * testfile48.bz2, testfile48.bz2.debug: New data files. + * Makefile.am (EXTRA_DIST): Add them. + * run-strip-test8.sh: Use them. + + * testfile16.bz2, testfile16.debug.bz2: Replace data files. + + * run-strip-test.sh: Fail if stripped output has ".debug_*" sections. + * run-strip-test8.sh: New file. + * testfile47.bz2: New data file. + * Makefile.am (TESTS, EXTRA_DIST): Add them. + 2008-03-31 Roland McGrath * run-early-offscn.sh: New file. diff --git a/tests/Makefile.am b/tests/Makefile.am index f0b20e9d..361c6581 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -71,7 +71,7 @@ TESTS = run-arextract.sh run-arsymtest.sh newfile test-nlist \ run-show-abbrev.sh run-line2addr.sh hash \ newscn run-strip-test.sh run-strip-test2.sh \ run-strip-test3.sh run-strip-test4.sh run-strip-test5.sh \ - run-strip-test6.sh run-strip-test7.sh \ + run-strip-test6.sh run-strip-test7.sh run-strip-test8.sh \ run-unstrip-test.sh run-unstrip-test2.sh \ run-ecp-test.sh run-ecp-test2.sh \ run-elflint-test.sh run-elflint-self.sh run-ranlib-test.sh \ @@ -110,7 +110,8 @@ EXTRA_DIST = run-arextract.sh run-arsymtest.sh \ testfile13.bz2 run-strip-test3.sh run-allfcts.sh \ run-line2addr.sh run-elflint-test.sh testfile14.bz2 \ run-strip-test4.sh run-strip-test5.sh run-strip-test6.sh \ - run-strip-test7.sh run-unstrip-test.sh run-unstrip-test2.sh \ + run-strip-test7.sh run-strip-test8.sh \ + run-unstrip-test.sh run-unstrip-test2.sh \ run-elflint-self.sh run-ranlib-test.sh run-ranlib-test2.sh \ run-ranlib-test3.sh run-ranlib-test4.sh \ run-addrscopes.sh run-strings-test.sh run-funcscopes.sh \ @@ -138,7 +139,7 @@ EXTRA_DIST = run-arextract.sh run-arsymtest.sh \ testfile41.bz2 testfile42.bz2 testfile43.bz2 \ testfile44.S.bz2 testfile44.expect.bz2 run-disasm-x86.sh \ testfile45.S.bz2 testfile45.expect.bz2 run-disasm-x86-64.sh \ - testfile46.bz2 + testfile46.bz2 testfile47.bz2 testfile48.bz2 testfile48.debug.bz2 installed_TESTS_ENVIRONMENT = libdir=$(DESTDIR)$(libdir) \ bindir=$(DESTDIR)$(bindir) \ diff --git a/tests/run-strip-test.sh b/tests/run-strip-test.sh index 480101eb..e056f890 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 , 1999. # @@ -30,7 +30,8 @@ original=${original:-testfile11} 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/unstrip -o testfile.unstrip testfile.temp testfile.debug.temp 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 diff --git a/tests/run-strip-test8.sh b/tests/run-strip-test8.sh new file mode 100755 index 00000000..fb9fa087 --- /dev/null +++ b/tests/run-strip-test8.sh @@ -0,0 +1,5 @@ +original=testfile47 +stripped=testfile48 +debugfile=testfile48.debug + +. $srcdir/run-strip-test.sh diff --git a/tests/testfile16.bz2 b/tests/testfile16.bz2 index 909e2253..4d7160c0 100644 Binary files a/tests/testfile16.bz2 and b/tests/testfile16.bz2 differ diff --git a/tests/testfile16.debug.bz2 b/tests/testfile16.debug.bz2 index 48d651fb..f02a9723 100644 Binary files a/tests/testfile16.debug.bz2 and b/tests/testfile16.debug.bz2 differ diff --git a/tests/testfile47.bz2 b/tests/testfile47.bz2 new file mode 100644 index 00000000..334bd6c4 Binary files /dev/null and b/tests/testfile47.bz2 differ diff --git a/tests/testfile48.bz2 b/tests/testfile48.bz2 new file mode 100644 index 00000000..da0d9dab Binary files /dev/null and b/tests/testfile48.bz2 differ diff --git a/tests/testfile48.debug.bz2 b/tests/testfile48.debug.bz2 new file mode 100644 index 00000000..7b84c4ca Binary files /dev/null and b/tests/testfile48.debug.bz2 differ -- cgit v1.2.3