From: Kevin Cernekee Date: Sun, 23 Oct 2016 17:25:56 +0000 (-0700) Subject: tests: unstrip: Add test for mismatched .strtab sections X-Git-Tag: elfutils-0.168~10 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=33ca0e1b9dfb47c6f9836c7fc19d04bd34337767;p=thirdparty%2Felfutils.git tests: unstrip: Add test for mismatched .strtab sections Current unstrip test cases either have no .symtab/.strtab in the stripped binary, or .strtab sections that are identical between the stripped and debuginfo binaries. Add a test case where .symtab/.strtab in the stripped binary contains a small subset of the full unstripped data. Signed-off-by: Kevin Cernekee --- diff --git a/tests/ChangeLog b/tests/ChangeLog index 31904e768..3d34778bd 100644 --- a/tests/ChangeLog +++ b/tests/ChangeLog @@ -1,4 +1,14 @@ -2015-10-11 Akihiko Odaki +2016-10-22 Kevin Cernekee + + * Makefile.am (TESTS): Add run-unstrip-test4.sh. + (EXTRA_DIST): Add run-unstrip-test4.sh, testfile-strtab.bz2, + testfile-strtab.stripped.bz2, testfile-strtab.debuginfo.bz2. + (run-unstrip-test4.sh): New file. + (testfile-strtab.bz2): New file. + (testfile-strtab.stripped.bz2): New file. + (testfile-strtab.debuginfo.bz2): New file. + +2016-10-11 Akihiko Odaki * arextract.c: Remove sys/param.h include, add system.h include. diff --git a/tests/Makefile.am b/tests/Makefile.am index e331cb556..d4659cdb1 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -81,8 +81,8 @@ TESTS = run-arextract.sh run-arsymtest.sh newfile test-nlist \ run-strip-test9.sh run-strip-test10.sh run-strip-test11.sh \ run-strip-groups.sh run-strip-reloc.sh run-strip-strmerge.sh \ run-strip-nobitsalign.sh \ - run-unstrip-test.sh run-unstrip-test2.sh \ - run-unstrip-test3.sh run-unstrip-M.sh run-elfstrmerge-test.sh \ + run-unstrip-test.sh run-unstrip-test2.sh run-unstrip-test3.sh \ + run-unstrip-test4.sh run-unstrip-M.sh run-elfstrmerge-test.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 \ @@ -176,6 +176,8 @@ EXTRA_DIST = run-arextract.sh run-arsymtest.sh \ run-unstrip-test.sh run-unstrip-test2.sh \ testfile-info-link.bz2 testfile-info-link.debuginfo.bz2 \ testfile-info-link.stripped.bz2 run-unstrip-test3.sh \ + run-unstrip-test4.sh testfile-strtab.bz2 \ + testfile-strtab.stripped.bz2 testfile-strtab.debuginfo.bz2 \ run-unstrip-M.sh run-elfstrmerge-test.sh \ run-elflint-self.sh run-ranlib-test.sh run-ranlib-test2.sh \ run-ranlib-test3.sh run-ranlib-test4.sh \ diff --git a/tests/run-unstrip-test4.sh b/tests/run-unstrip-test4.sh new file mode 100755 index 000000000..6ca5d0ec4 --- /dev/null +++ b/tests/run-unstrip-test4.sh @@ -0,0 +1,18 @@ +# Test whether unstrip can combine a stripped kernel object that has +# limited .symtab/.strtab data, with a separate .debuginfo binary that +# has full .symtab/.strtab data. +# +# This was generated as part of a Chromium OS kernel build: +# +# emerge-kevin chromeos-kernel-4_4 +# +# Setup instructions: +# +# https://www.chromium.org/chromium-os/developer-guide +# https://www.chromium.org/chromium-os/how-tos-and-troubleshooting/kernel-faq + +original=testfile-strtab +stripped=testfile-strtab.stripped +debugfile=testfile-strtab.debuginfo + +. $srcdir/run-unstrip-test.sh diff --git a/tests/testfile-strtab.bz2 b/tests/testfile-strtab.bz2 new file mode 100644 index 000000000..4eda14def Binary files /dev/null and b/tests/testfile-strtab.bz2 differ diff --git a/tests/testfile-strtab.debuginfo.bz2 b/tests/testfile-strtab.debuginfo.bz2 new file mode 100644 index 000000000..6fb81642c Binary files /dev/null and b/tests/testfile-strtab.debuginfo.bz2 differ diff --git a/tests/testfile-strtab.stripped.bz2 b/tests/testfile-strtab.stripped.bz2 new file mode 100644 index 000000000..779bfdbf2 Binary files /dev/null and b/tests/testfile-strtab.stripped.bz2 differ