]> git.ipfire.org Git - thirdparty/elfutils.git/commitdiff
Add data-only prelink tests
authorJosh Stone <jistone@redhat.com>
Wed, 12 Jan 2011 03:16:59 +0000 (19:16 -0800)
committerRoland McGrath <roland@redhat.com>
Wed, 12 Jan 2011 18:27:43 +0000 (10:27 -0800)
tests/ChangeLog
tests/Makefile.am
tests/run-prelink-addr-test.sh
tests/testfile54-32.noshdrs.so.bz2 [new file with mode: 0755]
tests/testfile54-32.prelink.so.bz2 [new file with mode: 0755]
tests/testfile54-32.so.bz2 [new file with mode: 0755]
tests/testfile54-32.so.debug.bz2 [new file with mode: 0755]
tests/testfile54-64.noshdrs.so.bz2 [new file with mode: 0755]
tests/testfile54-64.prelink.so.bz2 [new file with mode: 0755]
tests/testfile54-64.so.bz2 [new file with mode: 0755]
tests/testfile54-64.so.debug.bz2 [new file with mode: 0755]

index bb5634da2811ce1921a305842923299adb01b9f5..fa2a28e3552db1f5faf3bd34e439cc6e6feab66f 100644 (file)
@@ -1,5 +1,12 @@
 2011-01-11  Josh Stone  <jistone@redhat.com>
 
+       * run-prelink-addr-test.sh: Add testfile54, 32 and 64-bit.
+       * testfile54-32.so.bz2, testfile54-32.so.debug.bz2,
+       testfile54-32.prelink.so.bz2, testfile54-32.noshdrs.so.bz2,
+       testfile54-64.so.bz2, testfile54-64.so.debug.bz2,
+       testfile54-64.prelink.so.bz2, testfile54-64.noshdrs.so.bz2: New.
+       * Makefile.am (EXTRA_DIST): Add and update all.
+
        * run-prelink-addr-test.sh: Run 32 and 64-bit testfile53 tests.
        * testfile53.bz2, testfile53.debug.bz2,
        testfile53.prelink.bz2: Deleted, so...
index 9f191ce215ed71f2616f74eeff54d242569311da..04805f057d2693aed224f6116bbaa9d8fa813d25 100644 (file)
@@ -147,7 +147,11 @@ EXTRA_DIST = run-arextract.sh run-arsymtest.sh \
             testfile52-64.prelink.so.bz2 testfile52-64.noshdrs.so.bz2 \
             testfile53-32.bz2 testfile53-32.debug.bz2 \
             testfile53-32.prelink.bz2 testfile53-64.bz2 \
-            testfile53-64.debug.bz2 testfile53-64.prelink.bz2
+            testfile53-64.debug.bz2 testfile53-64.prelink.bz2 \
+            testfile54-32.so.bz2 testfile54-32.so.debug.bz2 \
+            testfile54-32.prelink.so.bz2 testfile54-32.noshdrs.so.bz2 \
+            testfile54-64.so.bz2 testfile54-64.so.debug.bz2 \
+            testfile54-64.prelink.so.bz2 testfile54-64.noshdrs.so.bz2
 
 installed_TESTS_ENVIRONMENT = libdir=$(DESTDIR)$(libdir) \
                              bindir=$(DESTDIR)$(bindir) \
index e554d4b0b14381ddfa9fdadc7f6c9c368e973c9b..f32b8b709a599ff96e55e18450f2b869cc43a2af 100755 (executable)
@@ -135,3 +135,74 @@ main+0x2
 main+0x3
 /home/jistone/src/elfutils/tests/testfile53-64.c:2
 EOF
+
+
+# testfile54.c:
+#   extern void * stdin;
+#   static void * pstdin = &stdin;
+#   void * const foo = &pstdin;
+#
+# gcc -m32 -g -shared -nostartfiles testfile54-32.c -o testfile54-32.so
+# eu-strip -f testfile54-32.so.debug testfile54-32.so
+# cp testfile54-32.so testfile54-32.prelink.so
+# prelink -N testfile54-32.prelink.so
+# cp testfile54-32.so testfile54-32.noshdrs.so
+# prelink -r 0x42000000 testfile54-32.noshdrs.so
+# eu-strip --remove-comment --strip-sections testfile54-32.noshdrs.so
+testfiles testfile54-32.so testfile54-32.so.debug
+testfiles testfile54-32.prelink.so testfile54-32.noshdrs.so
+tempfiles testmaps54-32
+
+cat > testmaps54-32 <<EOF
+00111000-00112000 r--p 00000000 fd:01 1 `pwd`/testfile54-32.so
+00112000-00113000 rw-p 00000000 fd:01 1 `pwd`/testfile54-32.so
+41000000-41001000 r--p 00000000 fd:01 2 `pwd`/testfile54-32.prelink.so
+41001000-41002000 rw-p 00000000 fd:01 2 `pwd`/testfile54-32.prelink.so
+42000000-42001000 r--p 00000000 fd:01 3 `pwd`/testfile54-32.noshdrs.so
+42001000-42002000 rw-p 00000000 fd:01 3 `pwd`/testfile54-32.noshdrs.so
+EOF
+
+testrun_compare ../src/addr2line -S -M testmaps54-32 \
+    0x1111fc 0x1122a4 0x410001fd 0x410012a5 0x420001fe <<\EOF
+foo
+??:0
+pstdin
+??:0
+foo+0x1
+??:0
+pstdin+0x1
+??:0
+foo+0x2
+??:0
+EOF
+
+# Repeat testfile64 in 64-bit
+testfiles testfile54-64.so testfile54-64.so.debug
+testfiles testfile54-64.prelink.so testfile54-64.noshdrs.so
+tempfiles testmaps54-64
+
+cat > testmaps54-64 <<EOF
+1000000000-1000001000 r--p 00000000 fd:11 1 `pwd`/testfile54-64.so
+1000001000-1000200000 ---p 00001000 fd:11 1 `pwd`/testfile54-64.so
+1000200000-1000201000 rw-p 00000000 fd:11 1 `pwd`/testfile54-64.so
+3000000000-3000001000 r--p 00000000 fd:11 2 `pwd`/testfile54-64.prelink.so
+3000001000-3000200000 ---p 00001000 fd:11 2 `pwd`/testfile54-64.prelink.so
+3000200000-3000201000 rw-p 00000000 fd:11 2 `pwd`/testfile54-64.prelink.so
+3800000000-3800001000 r--p 00000000 fd:11 3 `pwd`/testfile54-64.noshdrs.so
+3800001000-3800200000 ---p 00001000 fd:11 3 `pwd`/testfile54-64.noshdrs.so
+3800200000-3800201000 rw-p 00000000 fd:11 3 `pwd`/testfile54-64.noshdrs.so
+EOF
+
+testrun_compare ../src/addr2line -S -M testmaps54-64 \
+    0x10000002f8 0x1000200448 0x30000002f9 0x3000200449 0x38000002fa <<\EOF
+foo
+??:0
+pstdin
+??:0
+foo+0x1
+??:0
+pstdin+0x1
+??:0
+foo+0x2
+??:0
+EOF
diff --git a/tests/testfile54-32.noshdrs.so.bz2 b/tests/testfile54-32.noshdrs.so.bz2
new file mode 100755 (executable)
index 0000000..846bc91
Binary files /dev/null and b/tests/testfile54-32.noshdrs.so.bz2 differ
diff --git a/tests/testfile54-32.prelink.so.bz2 b/tests/testfile54-32.prelink.so.bz2
new file mode 100755 (executable)
index 0000000..85c8526
Binary files /dev/null and b/tests/testfile54-32.prelink.so.bz2 differ
diff --git a/tests/testfile54-32.so.bz2 b/tests/testfile54-32.so.bz2
new file mode 100755 (executable)
index 0000000..4bc4fa3
Binary files /dev/null and b/tests/testfile54-32.so.bz2 differ
diff --git a/tests/testfile54-32.so.debug.bz2 b/tests/testfile54-32.so.debug.bz2
new file mode 100755 (executable)
index 0000000..79dd614
Binary files /dev/null and b/tests/testfile54-32.so.debug.bz2 differ
diff --git a/tests/testfile54-64.noshdrs.so.bz2 b/tests/testfile54-64.noshdrs.so.bz2
new file mode 100755 (executable)
index 0000000..3da726a
Binary files /dev/null and b/tests/testfile54-64.noshdrs.so.bz2 differ
diff --git a/tests/testfile54-64.prelink.so.bz2 b/tests/testfile54-64.prelink.so.bz2
new file mode 100755 (executable)
index 0000000..e296a1d
Binary files /dev/null and b/tests/testfile54-64.prelink.so.bz2 differ
diff --git a/tests/testfile54-64.so.bz2 b/tests/testfile54-64.so.bz2
new file mode 100755 (executable)
index 0000000..6072bf1
Binary files /dev/null and b/tests/testfile54-64.so.bz2 differ
diff --git a/tests/testfile54-64.so.debug.bz2 b/tests/testfile54-64.so.debug.bz2
new file mode 100755 (executable)
index 0000000..6b45390
Binary files /dev/null and b/tests/testfile54-64.so.debug.bz2 differ