From 9aa8ef7fbb5ada14b7c4585d6c1361aa5eab6f88 Mon Sep 17 00:00:00 2001 From: Roland McGrath Date: Fri, 18 May 2007 08:59:43 +0000 Subject: src/ 2007-05-18 Roland McGrath * unstrip.c (copy_elided_sections): Match up non-NOBITS sections with stripped file, so as not to duplicate a section copied in both. * strip.c (handle_elf): Keep SHT_NOTE section copies in the debug file. tests/ 2007-05-18 Roland McGrath * run-strip-test4.sh (stripped, debugfile): Use new reference files. * testfile37.bz2: New data file. * testfile37.debug.bz2: New data file. * run-unstrip-test2.sh: New file. * Makefile.am (TESTS, EXTRA_DIST): Add them. --- tests/ChangeLog | 25 +++++++++++++++++++++++ tests/Makefile.am | 12 +++++++---- tests/run-dwfl-bug-offline-rel.sh | 36 +++++++++++++++++++++++++++++++++ tests/run-strip-test.sh | 12 ++++++----- tests/run-strip-test4.sh | 4 ++-- tests/run-strip-test6.sh | 4 ++-- tests/run-unstrip-test.sh | 41 ++++++++++++++++++++++++++++++++++++++ tests/run-unstrip-test2.sh | 5 +++++ tests/testfile35.bz2 | Bin 0 -> 1643 bytes tests/testfile35.debug.bz2 | Bin 0 -> 9106 bytes tests/testfile36.bz2 | Bin 0 -> 714 bytes tests/testfile36.debug.bz2 | Bin 0 -> 24909 bytes tests/testfile37.bz2 | Bin 0 -> 3140 bytes tests/testfile37.debug.bz2 | Bin 0 -> 28522 bytes 14 files changed, 126 insertions(+), 13 deletions(-) create mode 100755 tests/run-dwfl-bug-offline-rel.sh create mode 100755 tests/run-unstrip-test.sh create mode 100755 tests/run-unstrip-test2.sh create mode 100644 tests/testfile35.bz2 create mode 100644 tests/testfile35.debug.bz2 create mode 100644 tests/testfile36.bz2 create mode 100644 tests/testfile36.debug.bz2 create mode 100644 tests/testfile37.bz2 create mode 100644 tests/testfile37.debug.bz2 (limited to 'tests') diff --git a/tests/ChangeLog b/tests/ChangeLog index 89fbab7c..3424c1e2 100644 --- a/tests/ChangeLog +++ b/tests/ChangeLog @@ -1,3 +1,28 @@ +2007-05-18 Roland McGrath + + * run-strip-test4.sh (stripped, debugfile): Use new reference files. + * testfile37.bz2: New data file. + * testfile37.debug.bz2: New data file. + * run-unstrip-test2.sh: New file. + * Makefile.am (TESTS, EXTRA_DIST): Add them. + +2007-05-10 Roland McGrath + + * run-dwfl-bug-offline-rel.sh: New file. + * testfile36.bz2: New data file. + * testfile36.debug.bz2: New data file. + * Makefile.am (TESTS, EXTRA_DIST): Add them. + +2007-04-28 Roland McGrath + + * run-strip-test6.sh (stripped, debugfile): Use new reference files. + * testfile35.bz2: New data file. + * testfile35.debug.bz2: New data file. + * run-unstrip-test.sh: New file. + * Makefile.am (TESTS, EXTRA_DIST): Add them. + + * run-strip-test.sh: Do all elflint and cmp runs even when some fail. + 2007-04-26 Roland McGrath * run-elflint-self.sh: Run all tests even if one fails. diff --git a/tests/Makefile.am b/tests/Makefile.am index 0715fff8..f485acd1 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -71,13 +71,15 @@ 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-ecp-test.sh run-ecp-test2.sh \ + run-strip-test6.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 \ run-ranlib-test2.sh run-ranlib-test3.sh run-ranlib-test4.sh \ run-addrscopes.sh run-strings-test.sh run-funcscopes.sh \ run-find-prologues.sh run-allregs.sh run-readelf-test1.sh \ run-native-test.sh run-bug1-test.sh \ - dwfl-bug-addr-overflow run-addrname-test.sh dwfl-bug-fd-leak + dwfl-bug-addr-overflow run-addrname-test.sh dwfl-bug-fd-leak \ + run-dwfl-bug-offline-rel.sh # run-show-ciefde.sh if !STANDALONE @@ -102,11 +104,12 @@ 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-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 \ run-find-prologues.sh run-allregs.sh run-native-test.sh \ - run-addrname-test.sh \ + run-addrname-test.sh run-dwfl-bug-offline-rel.sh \ testfile15.bz2 testfile15.debug.bz2 \ testfile16.bz2 testfile16.debug.bz2 \ testfile17.bz2 testfile17.debug.bz2 \ @@ -119,7 +122,8 @@ EXTRA_DIST = run-arextract.sh run-arsymtest.sh \ run-bug1-test.sh testfile28.bz2 testfile28.rdwr.bz2 \ testfile29.bz2 testfile29.rdwr.bz2 \ testfile30.bz2 testfile31.bz2 testfile32.bz2 testfile33.bz2 \ - testfile34.bz2 + testfile34.bz2 testfile35.bz2 testfile35.debug.bz2 + testfile36.bz2 testfile36.debug.bz2 installed_TESTS_ENVIRONMENT = libdir=$(DESTDIR)$(libdir) \ bindir=$(DESTDIR)$(bindir) \ diff --git a/tests/run-dwfl-bug-offline-rel.sh b/tests/run-dwfl-bug-offline-rel.sh new file mode 100755 index 00000000..40e90bec --- /dev/null +++ b/tests/run-dwfl-bug-offline-rel.sh @@ -0,0 +1,36 @@ +#! /bin/sh +# Copyright (C) 2007 Red Hat, Inc. +# This file is part of Red Hat elfutils. +# +# Red Hat elfutils is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by the +# Free Software Foundation; version 2 of the License. +# +# Red Hat elfutils is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# General Public License for more details. +# +# You should have received a copy of the GNU General Public License along +# with Red Hat elfutils; if not, write to the Free Software Foundation, +# Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301 USA. +# +# Red Hat elfutils is an included package of the Open Invention Network. +# An included package of the Open Invention Network is a package for which +# Open Invention Network licensees cross-license their patents. No patent +# license is granted, either expressly or impliedly, by designation as an +# included package. Should you wish to participate in the Open Invention +# Network licensing program, please visit www.openinventionnetwork.com +# . + +. $srcdir/test-subr.sh + +testfiles testfile36 testfile36.debug + +testrun_compare ./dwflmodtest -e testfile36 <<\EOF +module: 00000000..00002308 testfile36 (null) +module: 00000000 (nil) 0 (Callback returned failure) +module: 00000000..00002308 testfile36 testfile36.debug +EOF + +exit 0 diff --git a/tests/run-strip-test.sh b/tests/run-strip-test.sh index 9a82d53d..480101eb 100755 --- a/tests/run-strip-test.sh +++ b/tests/run-strip-test.sh @@ -36,16 +36,18 @@ tempfiles testfile.temp testfile.debug.temp testfile.unstrip testrun ../src/strip -o testfile.temp $debugout $original -cmp $stripped testfile.temp +status=0 + +cmp $stripped testfile.temp || status=$? # Check elflint and the expected result. -testrun ../src/elflint -q testfile.temp +testrun ../src/elflint -q testfile.temp || status=$? test -z "$debugfile" || { -cmp $debugfile testfile.debug.temp +cmp $debugfile testfile.debug.temp || status=$? # Check elflint and the expected result. -testrun ../src/elflint -q -d testfile.debug.temp +testrun ../src/elflint -q -d testfile.debug.temp || status=$? # Now test unstrip recombining those files. testrun ../src/unstrip -o testfile.unstrip testfile.temp testfile.debug.temp @@ -54,4 +56,4 @@ testrun ../src/unstrip -o testfile.unstrip testfile.temp testfile.debug.temp testrun ../src/elfcmp --hash-inexact $original testfile.unstrip } -exit 0 +exit $status diff --git a/tests/run-strip-test4.sh b/tests/run-strip-test4.sh index 8e9be228..64924a92 100755 --- a/tests/run-strip-test4.sh +++ b/tests/run-strip-test4.sh @@ -1,5 +1,5 @@ original=testfile11 -stripped=testfile15 -debugfile=testfile15.debug +stripped=testfile37 +debugfile=testfile37.debug . $srcdir/run-strip-test.sh diff --git a/tests/run-strip-test6.sh b/tests/run-strip-test6.sh index 8ee5f02c..c59bf5e4 100755 --- a/tests/run-strip-test6.sh +++ b/tests/run-strip-test6.sh @@ -1,5 +1,5 @@ original=testfile12 -stripped=testfile17 -debugfile=testfile17.debug +stripped=testfile35 +debugfile=testfile35.debug . $srcdir/run-strip-test.sh diff --git a/tests/run-unstrip-test.sh b/tests/run-unstrip-test.sh new file mode 100755 index 00000000..67029051 --- /dev/null +++ b/tests/run-unstrip-test.sh @@ -0,0 +1,41 @@ +#! /bin/sh +# Copyright (C) 2007 Red Hat, Inc. +# This file is part of Red Hat elfutils. +# +# Red Hat elfutils is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by the +# Free Software Foundation; version 2 of the License. +# +# Red Hat elfutils is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# General Public License for more details. +# +# You should have received a copy of the GNU General Public License along +# with Red Hat elfutils; if not, write to the Free Software Foundation, +# Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301 USA. +# +# Red Hat elfutils is an included package of the Open Invention Network. +# An included package of the Open Invention Network is a package for which +# Open Invention Network licensees cross-license their patents. No patent +# license is granted, either expressly or impliedly, by designation as an +# included package. Should you wish to participate in the Open Invention +# Network licensing program, please visit www.openinventionnetwork.com +# . + +. $srcdir/test-subr.sh + +original=${original:-testfile12} +stripped=${stripped:-testfile17} +debugfile=${debugfile:-${stripped}.debug} + +testfiles $original $stripped $debugfile + +# These are old reference output from run-test-strip6.sh, when +# strip left the .debug file with unchanged sh_size in +# stripped sections that shrank in the stripped file. strip +# no longer does that, but unstrip must still handle it. + +testrun ../src/unstrip -o testfile.unstrip $stripped $debugfile + +testrun ../src/elfcmp --hash-inexact $original testfile.unstrip diff --git a/tests/run-unstrip-test2.sh b/tests/run-unstrip-test2.sh new file mode 100755 index 00000000..44074c19 --- /dev/null +++ b/tests/run-unstrip-test2.sh @@ -0,0 +1,5 @@ +original=testfile11 +stripped=testfile15 +debugfile=testfile15.debug + +. $srcdir/run-unstrip-test.sh diff --git a/tests/testfile35.bz2 b/tests/testfile35.bz2 new file mode 100644 index 00000000..b5913015 Binary files /dev/null and b/tests/testfile35.bz2 differ diff --git a/tests/testfile35.debug.bz2 b/tests/testfile35.debug.bz2 new file mode 100644 index 00000000..f1918627 Binary files /dev/null and b/tests/testfile35.debug.bz2 differ diff --git a/tests/testfile36.bz2 b/tests/testfile36.bz2 new file mode 100644 index 00000000..e912a197 Binary files /dev/null and b/tests/testfile36.bz2 differ diff --git a/tests/testfile36.debug.bz2 b/tests/testfile36.debug.bz2 new file mode 100644 index 00000000..76aca42e Binary files /dev/null and b/tests/testfile36.debug.bz2 differ diff --git a/tests/testfile37.bz2 b/tests/testfile37.bz2 new file mode 100644 index 00000000..254ce324 Binary files /dev/null and b/tests/testfile37.bz2 differ diff --git a/tests/testfile37.debug.bz2 b/tests/testfile37.debug.bz2 new file mode 100644 index 00000000..74e46a87 Binary files /dev/null and b/tests/testfile37.debug.bz2 differ -- cgit v1.2.3