blob: dc7d3a423de2dcdb63786bda070971da0f68d0de [file] [log] [blame]
Roland McGrath9aa8ef72007-05-18 08:59:43 +00001#! /bin/sh
Roland McGrathec86e5f2010-06-14 17:44:38 -07002# Copyright (C) 2007-2010 Red Hat, Inc.
Mark Wielaardde2ed972012-06-05 17:15:16 +02003# This file is part of elfutils.
Roland McGrath9aa8ef72007-05-18 08:59:43 +00004#
Mark Wielaardde2ed972012-06-05 17:15:16 +02005# 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 McGrath9aa8ef72007-05-18 08:59:43 +00009#
Mark Wielaardde2ed972012-06-05 17:15:16 +020010# elfutils is distributed in the hope that it will be useful, but
Roland McGrath9aa8ef72007-05-18 08:59:43 +000011# WITHOUT ANY WARRANTY; without even the implied warranty of
Mark Wielaardde2ed972012-06-05 17:15:16 +020012# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13# GNU General Public License for more details.
Roland McGrath9aa8ef72007-05-18 08:59:43 +000014#
Mark Wielaardde2ed972012-06-05 17:15:16 +020015# 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 McGrath9aa8ef72007-05-18 08:59:43 +000017
18. $srcdir/test-subr.sh
19
20original=${original:-testfile12}
21stripped=${stripped:-testfile17}
22debugfile=${debugfile:-${stripped}.debug}
23
24testfiles $original $stripped $debugfile
Roland McGrathec86e5f2010-06-14 17:44:38 -070025tempfiles testfile.unstrip testfile.inplace
Roland McGrath9aa8ef72007-05-18 08:59:43 +000026
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 Wielaard86be7922013-04-26 23:44:25 +020032testrun ${abs_top_builddir}/src/unstrip -o testfile.unstrip $stripped $debugfile
Roland McGrath9aa8ef72007-05-18 08:59:43 +000033
Mark Wielaard86be7922013-04-26 23:44:25 +020034testrun ${abs_top_builddir}/src/elfcmp --hash-inexact $original testfile.unstrip
Roland McGrathec86e5f2010-06-14 17:44:38 -070035
36# Also test modifying the file in place.
37
38rm -f testfile.inplace
39cp $debugfile testfile.inplace
40chmod 644 testfile.inplace
Mark Wielaard86be7922013-04-26 23:44:25 +020041testrun ${abs_top_builddir}/src/unstrip $stripped testfile.inplace
Roland McGrathec86e5f2010-06-14 17:44:38 -070042
Mark Wielaard86be7922013-04-26 23:44:25 +020043testrun ${abs_top_builddir}/src/elfcmp --hash-inexact $original testfile.inplace