summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKevin Cernekee <cernekee@chromium.org>2016-10-23 10:25:56 -0700
committerMark Wielaard <mjw@redhat.com>2016-10-24 12:48:43 +0200
commit33ca0e1b9dfb47c6f9836c7fc19d04bd34337767 (patch)
tree008b0e81bbf00f98832d88be73fe34459f2e213c
parent502380c7acbb12055941fac248df77132caa7194 (diff)
downloadelfutils-33ca0e1b9dfb47c6f9836c7fc19d04bd34337767.tar.gz
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 <cernekee@chromium.org>
-rw-r--r--tests/ChangeLog12
-rw-r--r--tests/Makefile.am6
-rwxr-xr-xtests/run-unstrip-test4.sh18
-rw-r--r--tests/testfile-strtab.bz2bin0 -> 189062 bytes
-rw-r--r--tests/testfile-strtab.debuginfo.bz2bin0 -> 176208 bytes
-rw-r--r--tests/testfile-strtab.stripped.bz2bin0 -> 17108 bytes
6 files changed, 33 insertions, 3 deletions
diff --git a/tests/ChangeLog b/tests/ChangeLog
index 31904e76..3d34778b 100644
--- a/tests/ChangeLog
+++ b/tests/ChangeLog
@@ -1,4 +1,14 @@
-2015-10-11 Akihiko Odaki <akihiko.odaki.4i@stu.hosei.ac.jp>
+2016-10-22 Kevin Cernekee <cernekee@chromium.org>
+
+ * 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 <akihiko.odaki.4i@stu.hosei.ac.jp>
* arextract.c: Remove sys/param.h include, add system.h include.
diff --git a/tests/Makefile.am b/tests/Makefile.am
index e331cb55..d4659cdb 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 00000000..6ca5d0ec
--- /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 00000000..4eda14de
--- /dev/null
+++ b/tests/testfile-strtab.bz2
Binary files differ
diff --git a/tests/testfile-strtab.debuginfo.bz2 b/tests/testfile-strtab.debuginfo.bz2
new file mode 100644
index 00000000..6fb81642
--- /dev/null
+++ b/tests/testfile-strtab.debuginfo.bz2
Binary files differ
diff --git a/tests/testfile-strtab.stripped.bz2 b/tests/testfile-strtab.stripped.bz2
new file mode 100644
index 00000000..779bfdbf
--- /dev/null
+++ b/tests/testfile-strtab.stripped.bz2
Binary files differ