summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorMark Wielaard <[email protected]>2011-05-17 12:20:01 +0200
committerMark Wielaard <[email protected]>2011-05-19 10:38:43 +0200
commit7a125b9306c4743eaee062bdab301f890e3c6309 (patch)
tree9ee0b3ea5281b1c851d7ff9e131e6455c7ad08b8 /tests
parent0312424b6f374dac5c72b86791745d80b38049fb (diff)
strip: Handle SHT_GROUP sections better.
Diffstat (limited to 'tests')
-rw-r--r--tests/ChangeLog8
-rw-r--r--tests/Makefile.am6
-rwxr-xr-xtests/run-strip-groups.sh63
-rw-r--r--tests/testfile58.bz2bin0 -> 1680 bytes
4 files changed, 74 insertions, 3 deletions
diff --git a/tests/ChangeLog b/tests/ChangeLog
index 674fe969..2599b0ca 100644
--- a/tests/ChangeLog
+++ b/tests/ChangeLog
@@ -1,3 +1,11 @@
+2011-05-18 Mark Wielaard <[email protected]>
+
+ * run-strip-groups.sh: New test.
+ * testfile58.bz2: New test file.
+ * Makefile.am (EXTRA_DIST): Add testfile58.bz2.
+ (TESTS): Add run-strip-groups.sh.
+ (EXTRA_DIST): Likewise.
+
2011-03-28 Marek Polacek <[email protected]>
* alldts.c: New file.
diff --git a/tests/Makefile.am b/tests/Makefile.am
index 35f55e3c..16a47e2e 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -70,7 +70,7 @@ TESTS = run-arextract.sh run-arsymtest.sh newfile test-nlist \
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-test8.sh \
- run-unstrip-test.sh run-unstrip-test2.sh \
+ run-strip-groups.sh run-unstrip-test.sh run-unstrip-test2.sh \
run-ecp-test.sh run-ecp-test2.sh run-alldts.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 \
@@ -110,7 +110,7 @@ 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-strip-test8.sh \
+ run-strip-test7.sh run-strip-test8.sh run-strip-groups.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 \
@@ -158,7 +158,7 @@ EXTRA_DIST = run-arextract.sh run-arsymtest.sh \
testfile55-32.bz2 testfile55-32.debug.bz2 \
testfile55-32.prelink.bz2 testfile55-64.bz2 \
testfile55-64.debug.bz2 testfile55-64.prelink.bz2 \
- testfile56.bz2 testfile57.bz2
+ testfile56.bz2 testfile57.bz2 testfile58.bz2
installed_TESTS_ENVIRONMENT = libdir=$(DESTDIR)$(libdir) \
bindir=$(DESTDIR)$(bindir) \
diff --git a/tests/run-strip-groups.sh b/tests/run-strip-groups.sh
new file mode 100755
index 00000000..3434a61e
--- /dev/null
+++ b/tests/run-strip-groups.sh
@@ -0,0 +1,63 @@
+#! /bin/sh
+# Copyright (C) 2011 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
+# <http://www.openinventionnetwork.com>.
+#
+# g++ -gdwarf-4 -c testfile58.cxx
+# class ct
+# {
+# private:
+# int i;
+#
+# public:
+# void foo ()
+# {
+# i = 1;
+# }
+#
+# int bar ()
+# {
+# return i;
+# }
+# };
+#
+# int baz ()
+# {
+# class ct c;
+# c.foo ();
+# return c.bar ();
+# }
+
+. $srcdir/test-subr.sh
+
+infile=testfile58
+outfile=$infile.stripped
+dbgfile=$infile.debug
+
+testfiles $infile
+tempfiles $outfile $dbgfile
+
+testrun ../src/strip -o $outfile -f $dbgfile $infile
+testrun ../src/elflint -q $infile
+testrun ../src/elflint -q $outfile
+testrun ../src/elflint -q -d $dbgfile
diff --git a/tests/testfile58.bz2 b/tests/testfile58.bz2
new file mode 100644
index 00000000..839efd92
--- /dev/null
+++ b/tests/testfile58.bz2
Binary files differ