Roland McGrath | 9aa8ef7 | 2007-05-18 08:59:43 +0000 | [diff] [blame] | 1 | #! /bin/sh |
Roland McGrath | ec86e5f | 2010-06-14 17:44:38 -0700 | [diff] [blame] | 2 | # Copyright (C) 2007-2010 Red Hat, Inc. |
Mark Wielaard | de2ed97 | 2012-06-05 17:15:16 +0200 | [diff] [blame] | 3 | # This file is part of elfutils. |
Roland McGrath | 9aa8ef7 | 2007-05-18 08:59:43 +0000 | [diff] [blame] | 4 | # |
Mark Wielaard | de2ed97 | 2012-06-05 17:15:16 +0200 | [diff] [blame] | 5 | # This file is free software; you can redistribute it and/or modify |
| 6 | # it under the terms of the GNU General Public License as published by |
| 7 | # the Free Software Foundation; either version 3 of the License, or |
| 8 | # (at your option) any later version. |
Roland McGrath | 9aa8ef7 | 2007-05-18 08:59:43 +0000 | [diff] [blame] | 9 | # |
Mark Wielaard | de2ed97 | 2012-06-05 17:15:16 +0200 | [diff] [blame] | 10 | # elfutils is distributed in the hope that it will be useful, but |
Roland McGrath | 9aa8ef7 | 2007-05-18 08:59:43 +0000 | [diff] [blame] | 11 | # WITHOUT ANY WARRANTY; without even the implied warranty of |
Mark Wielaard | de2ed97 | 2012-06-05 17:15:16 +0200 | [diff] [blame] | 12 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 13 | # GNU General Public License for more details. |
Roland McGrath | 9aa8ef7 | 2007-05-18 08:59:43 +0000 | [diff] [blame] | 14 | # |
Mark Wielaard | de2ed97 | 2012-06-05 17:15:16 +0200 | [diff] [blame] | 15 | # You should have received a copy of the GNU General Public License |
| 16 | # along with this program. If not, see <http://www.gnu.org/licenses/>. |
Roland McGrath | 9aa8ef7 | 2007-05-18 08:59:43 +0000 | [diff] [blame] | 17 | |
| 18 | . $srcdir/test-subr.sh |
| 19 | |
| 20 | original=${original:-testfile12} |
| 21 | stripped=${stripped:-testfile17} |
| 22 | debugfile=${debugfile:-${stripped}.debug} |
| 23 | |
| 24 | testfiles $original $stripped $debugfile |
Roland McGrath | ec86e5f | 2010-06-14 17:44:38 -0700 | [diff] [blame] | 25 | tempfiles testfile.unstrip testfile.inplace |
Roland McGrath | 9aa8ef7 | 2007-05-18 08:59:43 +0000 | [diff] [blame] | 26 | |
| 27 | # These are old reference output from run-test-strip6.sh, when |
| 28 | # strip left the .debug file with unchanged sh_size in |
| 29 | # stripped sections that shrank in the stripped file. strip |
| 30 | # no longer does that, but unstrip must still handle it. |
| 31 | |
Mark Wielaard | 86be792 | 2013-04-26 23:44:25 +0200 | [diff] [blame] | 32 | testrun ${abs_top_builddir}/src/unstrip -o testfile.unstrip $stripped $debugfile |
Roland McGrath | 9aa8ef7 | 2007-05-18 08:59:43 +0000 | [diff] [blame] | 33 | |
Mark Wielaard | 86be792 | 2013-04-26 23:44:25 +0200 | [diff] [blame] | 34 | testrun ${abs_top_builddir}/src/elfcmp --hash-inexact $original testfile.unstrip |
Roland McGrath | ec86e5f | 2010-06-14 17:44:38 -0700 | [diff] [blame] | 35 | |
| 36 | # Also test modifying the file in place. |
| 37 | |
| 38 | rm -f testfile.inplace |
| 39 | cp $debugfile testfile.inplace |
| 40 | chmod 644 testfile.inplace |
Mark Wielaard | 86be792 | 2013-04-26 23:44:25 +0200 | [diff] [blame] | 41 | testrun ${abs_top_builddir}/src/unstrip $stripped testfile.inplace |
Roland McGrath | ec86e5f | 2010-06-14 17:44:38 -0700 | [diff] [blame] | 42 | |
Mark Wielaard | 86be792 | 2013-04-26 23:44:25 +0200 | [diff] [blame] | 43 | testrun ${abs_top_builddir}/src/elfcmp --hash-inexact $original testfile.inplace |