From: Josh Stone Date: Tue, 11 Jan 2011 05:28:46 +0000 (-0800) Subject: Test cases for libdwfl vs prelink. X-Git-Tag: elfutils-0.151~8 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=ffa02004b21f24b14281c30045139be61075b73f;p=thirdparty%2Felfutils.git Test cases for libdwfl vs prelink. --- diff --git a/tests/ChangeLog b/tests/ChangeLog index 0176fb495..f6aee50b0 100644 --- a/tests/ChangeLog +++ b/tests/ChangeLog @@ -1,3 +1,13 @@ +2011-01-10 Josh Stone + + * run-prelink-addr-test.sh: New test for prelinked addrs. + * Makefile.am (TESTS, EXTRA_DIST): Add it. + * testfile52.so.bz2, testfile52.so.debug.bz2: New data files. + * testfile52.prelink.so.bz2: New data file, shows REL->RELA. + * testfile53.bz2, testfile53.debug.bz2: New data files. + * testfile53.prelink.bz2: New data file, shows ET_EXEC remap. + * Makefile.am (EXTRA_DIST): Add them. + 2010-06-04 Roland McGrath * run-unstrip-test.sh: Also test modifying the file in place. diff --git a/tests/Makefile.am b/tests/Makefile.am index 008008acc..4650a59e7 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -83,7 +83,7 @@ TESTS = run-arextract.sh run-arsymtest.sh newfile test-nlist \ run-dwfl-bug-offline-rel.sh run-dwfl-addr-sect.sh \ run-disasm-x86.sh run-disasm-x86-64.sh \ run-early-offscn.sh run-dwarf-getmacros.sh \ - run-test-flag-nobits.sh + run-test-flag-nobits.sh run-prelink-addr-test.sh # run-show-ciefde.sh if !STANDALONE @@ -139,7 +139,10 @@ EXTRA_DIST = run-arextract.sh run-arsymtest.sh \ testfile44.S.bz2 testfile44.expect.bz2 run-disasm-x86.sh \ testfile45.S.bz2 testfile45.expect.bz2 run-disasm-x86-64.sh \ testfile46.bz2 testfile47.bz2 testfile48.bz2 testfile48.debug.bz2 \ - testfile49.bz2 testfile50.bz2 testfile51.bz2 + testfile49.bz2 testfile50.bz2 testfile51.bz2 \ + run-prelink-addr-test.sh testfile52.so.bz2 testfile52.so.debug.bz2 \ + testfile52.prelink.so.bz2 testfile53.bz2 testfile53.debug.bz2 \ + testfile53.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 new file mode 100755 index 000000000..9c19988c0 --- /dev/null +++ b/tests/run-prelink-addr-test.sh @@ -0,0 +1,87 @@ +#! /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 +# . + +. $srcdir/test-subr.sh + + +# testfile52.c: +# #include +# int foo() { exit(0); } +# +# gcc -m32 -g -shared testfile52.c -o testfile52.so +# eu-strip -f testfile52.so.debug testfile52.so +# cp testfile52.so testfile52.prelink.so +# prelink -N testfile52.prelink.so + +testfiles testfile52.so testfile52.prelink.so testfile52.so.debug +tempfiles testmaps52 + +cat > testmaps52 <