From cf51471777953c1c6cfcbe7ad5df09c23c1964be Mon Sep 17 00:00:00 2001 From: Josh Stone Date: Tue, 11 Jan 2011 19:16:58 -0800 Subject: Expand testfile53 for 32/64-bit --- tests/ChangeLog | 9 +++++++++ tests/Makefile.am | 4 +++- tests/run-prelink-addr-test.sh | 42 ++++++++++++++++++++++++++++------------ tests/testfile53-32.bz2 | Bin 0 -> 1628 bytes tests/testfile53-32.debug.bz2 | Bin 0 -> 1959 bytes tests/testfile53-32.prelink.bz2 | Bin 0 -> 2192 bytes tests/testfile53-64.bz2 | Bin 0 -> 1683 bytes tests/testfile53-64.debug.bz2 | Bin 0 -> 1927 bytes tests/testfile53-64.prelink.bz2 | Bin 0 -> 2180 bytes tests/testfile53.bz2 | Bin 1687 -> 0 bytes tests/testfile53.debug.bz2 | Bin 1897 -> 0 bytes tests/testfile53.prelink.bz2 | Bin 2192 -> 0 bytes 12 files changed, 42 insertions(+), 13 deletions(-) create mode 100755 tests/testfile53-32.bz2 create mode 100755 tests/testfile53-32.debug.bz2 create mode 100755 tests/testfile53-32.prelink.bz2 create mode 100755 tests/testfile53-64.bz2 create mode 100755 tests/testfile53-64.debug.bz2 create mode 100755 tests/testfile53-64.prelink.bz2 delete mode 100755 tests/testfile53.bz2 delete mode 100755 tests/testfile53.debug.bz2 delete mode 100755 tests/testfile53.prelink.bz2 diff --git a/tests/ChangeLog b/tests/ChangeLog index df97240a..bb5634da 100644 --- a/tests/ChangeLog +++ b/tests/ChangeLog @@ -1,5 +1,14 @@ 2011-01-11 Josh Stone + * run-prelink-addr-test.sh: Run 32 and 64-bit testfile53 tests. + * testfile53.bz2, testfile53.debug.bz2, + testfile53.prelink.bz2: Deleted, so... + * testfile53-64.bz2, testfile53-64.debug.bz2, + testfile53-64.prelink.bz2: Recreated with 64-bit names. + * testfile53-32.bz2, testfile53-32.debug.bz2, + testfile53-32.prelink.bz2: New in 32-bit. + * Makefile.am (EXTRA_DIST): Add and update all. + * run-prelink-addr-test.sh: Run 32 and 64-bit testfile52 tests. * testfile52.so.bz2, testfile52.so.debug.bz2, testfile52.prelink.so.bz2: Deleted, so... diff --git a/tests/Makefile.am b/tests/Makefile.am index 2ab961c3..9f191ce2 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -145,7 +145,9 @@ EXTRA_DIST = run-arextract.sh run-arsymtest.sh \ testfile52-32.prelink.so.bz2 testfile52-32.noshdrs.so.bz2 \ testfile52-64.so.bz2 testfile52-64.so.debug.bz2 \ testfile52-64.prelink.so.bz2 testfile52-64.noshdrs.so.bz2 \ - testfile53.bz2 testfile53.debug.bz2 testfile53.prelink.bz2 + testfile53-32.bz2 testfile53-32.debug.bz2 \ + testfile53-32.prelink.bz2 testfile53-64.bz2 \ + testfile53-64.debug.bz2 testfile53-64.prelink.bz2 installed_TESTS_ENVIRONMENT = libdir=$(DESTDIR)$(libdir) \ bindir=$(DESTDIR)$(bindir) \ diff --git a/tests/run-prelink-addr-test.sh b/tests/run-prelink-addr-test.sh index 6938ec15..e554d4b0 100755 --- a/tests/run-prelink-addr-test.sh +++ b/tests/run-prelink-addr-test.sh @@ -94,26 +94,44 @@ EOF # testfile53.c: -# char foo[2000]; +# char foo[0x1000]; # int main() { return 0; } # -# gcc -g testfile53.c -o testfile53 -# eu-strip -f testfile53.debug testfile53 -# cp testfile53 testfile53.prelinked -# prelink -N testfile53.prelinked -testfiles testfile53 testfile53.prelink testfile53.debug +# gcc -m32 -g testfile53-32.c -o testfile53-32 +# eu-strip -f testfile53-32.debug testfile53-32 +# cp testfile53-32 testfile53-32.prelink +# prelink -N testfile53-32.prelink +testfiles testfile53-32 testfile53-32.debug testfile53-32.prelink -testrun_compare ../src/addr2line -S -e testfile53 0x400474 0x400475 <<\EOF +testrun_compare ../src/addr2line -S -e testfile53-32 0x8048394 0x8048395 <<\EOF main -/home/jistone/src/elfutils/tests/testfile53.c:2 +/home/jistone/src/elfutils/tests/testfile53-32.c:2 main+0x1 -/home/jistone/src/elfutils/tests/testfile53.c:2 +/home/jistone/src/elfutils/tests/testfile53-32.c:2 EOF # prelink shuffled some of the sections, but .text is in the same place. -testrun_compare ../src/addr2line -S -e testfile53.prelink 0x400476 0x400477 <<\EOF +testrun_compare ../src/addr2line -S -e testfile53-32.prelink 0x8048396 0x8048397 <<\EOF main+0x2 -/home/jistone/src/elfutils/tests/testfile53.c:2 +/home/jistone/src/elfutils/tests/testfile53-32.c:2 main+0x3 -/home/jistone/src/elfutils/tests/testfile53.c:2 +/home/jistone/src/elfutils/tests/testfile53-32.c:2 +EOF + +# Repeat testfile53 in 64-bit, except use foo[0x800] to achieve the same +# prelink section shuffling. +testfiles testfile53-64 testfile53-64.debug testfile53-64.prelink + +testrun_compare ../src/addr2line -S -e testfile53-64 0x400474 0x400475 <<\EOF +main +/home/jistone/src/elfutils/tests/testfile53-64.c:2 +main+0x1 +/home/jistone/src/elfutils/tests/testfile53-64.c:2 +EOF + +testrun_compare ../src/addr2line -S -e testfile53-64.prelink 0x400476 0x400477 <<\EOF +main+0x2 +/home/jistone/src/elfutils/tests/testfile53-64.c:2 +main+0x3 +/home/jistone/src/elfutils/tests/testfile53-64.c:2 EOF diff --git a/tests/testfile53-32.bz2 b/tests/testfile53-32.bz2 new file mode 100755 index 00000000..7bf48d9f Binary files /dev/null and b/tests/testfile53-32.bz2 differ diff --git a/tests/testfile53-32.debug.bz2 b/tests/testfile53-32.debug.bz2 new file mode 100755 index 00000000..79ea566d Binary files /dev/null and b/tests/testfile53-32.debug.bz2 differ diff --git a/tests/testfile53-32.prelink.bz2 b/tests/testfile53-32.prelink.bz2 new file mode 100755 index 00000000..8e05abf0 Binary files /dev/null and b/tests/testfile53-32.prelink.bz2 differ diff --git a/tests/testfile53-64.bz2 b/tests/testfile53-64.bz2 new file mode 100755 index 00000000..235a7631 Binary files /dev/null and b/tests/testfile53-64.bz2 differ diff --git a/tests/testfile53-64.debug.bz2 b/tests/testfile53-64.debug.bz2 new file mode 100755 index 00000000..675c6eaf Binary files /dev/null and b/tests/testfile53-64.debug.bz2 differ diff --git a/tests/testfile53-64.prelink.bz2 b/tests/testfile53-64.prelink.bz2 new file mode 100755 index 00000000..853aba78 Binary files /dev/null and b/tests/testfile53-64.prelink.bz2 differ diff --git a/tests/testfile53.bz2 b/tests/testfile53.bz2 deleted file mode 100755 index 2e0e74c8..00000000 Binary files a/tests/testfile53.bz2 and /dev/null differ diff --git a/tests/testfile53.debug.bz2 b/tests/testfile53.debug.bz2 deleted file mode 100755 index ec36e982..00000000 Binary files a/tests/testfile53.debug.bz2 and /dev/null differ diff --git a/tests/testfile53.prelink.bz2 b/tests/testfile53.prelink.bz2 deleted file mode 100755 index b2f4dea9..00000000 Binary files a/tests/testfile53.prelink.bz2 and /dev/null differ -- cgit v1.2.1