Ulrich Drepper | b08d5a8 | 2005-07-26 05:00:05 +0000 | [diff] [blame^] | 1 | #! /bin/sh |
| 2 | # Copyright (C) 1999, 2000, 2002, 2003, 2005 Red Hat, Inc. |
| 3 | # Written by Ulrich Drepper <drepper@redhat.com>, 1999. |
| 4 | # |
| 5 | # This program is Open Source software; you can redistribute it and/or |
| 6 | # modify it under the terms of the Open Software License version 1.0 as |
| 7 | # published by the Open Source Initiative. |
| 8 | # |
| 9 | # You should have received a copy of the Open Software License along |
| 10 | # with this program; if not, you may obtain a copy of the Open Software |
| 11 | # License version 1.0 from http://www.opensource.org/licenses/osl.php or |
| 12 | # by writing the Open Source Initiative c/o Lawrence Rosen, Esq., |
| 13 | # 3001 King Ranch Road, Ukiah, CA 95482. |
| 14 | set -e |
| 15 | |
| 16 | original=${original:-testfile11} |
| 17 | stripped=${stripped:-testfile7} |
| 18 | debugout=${debugfile:+-f testfile.debug.temp -F $debugfile} |
| 19 | |
| 20 | # Don't fail if we cannot decompress the file. |
| 21 | bunzip2 -c $srcdir/$original.bz2 > $original 2>/dev/null || exit 0 |
| 22 | |
| 23 | # Don't fail if we cannot decompress the file. |
| 24 | bunzip2 -c $srcdir/$stripped.bz2 > $stripped 2>/dev/null || exit 0 |
| 25 | |
| 26 | # Don't fail if we cannot decompress the file. |
| 27 | test -z "$debugfile" || |
| 28 | bunzip2 -c $srcdir/$debugfile.bz2 > $debugfile 2>/dev/null || exit 0 |
| 29 | |
| 30 | LD_LIBRARY_PATH=../libebl:../libelf${LD_LIBRARY_PATH:+:}$LD_LIBRARY_PATH \ |
| 31 | ../src/strip -o testfile.temp $debugout $original |
| 32 | |
| 33 | cmp $stripped testfile.temp |
| 34 | |
| 35 | # Check elflint and the expected result. |
| 36 | LD_LIBRARY_PATH=../libebl:../libelf${LD_LIBRARY_PATH:+:}$LD_LIBRARY_PATH \ |
| 37 | ../src/elflint -q testfile.temp |
| 38 | |
| 39 | test -z "$debugfile" || { |
| 40 | cmp $debugfile testfile.debug.temp |
| 41 | |
| 42 | # Check elflint and the expected result. |
| 43 | LD_LIBRARY_PATH=../libebl:../libelf${LD_LIBRARY_PATH:+:}$LD_LIBRARY_PATH \ |
| 44 | ../src/elflint -q -d testfile.debug.temp |
| 45 | |
| 46 | rm -f "$debugfile" |
| 47 | } |
| 48 | |
| 49 | rm -f $original $stripped testfile.temp testfile.debug.temp |
| 50 | |
| 51 | exit 0 |