Brian Silverman | 8649792 | 2018-02-10 19:28:39 -0500 | [diff] [blame] | 1 | #! /bin/sh |
| 2 | # Copyright (C) 2005, 2007, 2008, 2015 Red Hat, Inc. |
| 3 | # This file is part of elfutils. |
| 4 | # Written by Ulrich Drepper <drepper@redhat.com>, 2005. |
| 5 | # |
| 6 | # This file is free software; you can redistribute it and/or modify |
| 7 | # it under the terms of the GNU General Public License as published by |
| 8 | # the Free Software Foundation; either version 3 of the License, or |
| 9 | # (at your option) any later version. |
| 10 | # |
| 11 | # elfutils is distributed in the hope that it will be useful, but |
| 12 | # WITHOUT ANY WARRANTY; without even the implied warranty of |
| 13 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 14 | # GNU General Public License for more details. |
| 15 | # |
| 16 | # You should have received a copy of the GNU General Public License |
| 17 | # along with this program. If not, see <http://www.gnu.org/licenses/>. |
| 18 | |
| 19 | . $srcdir/test-subr.sh |
| 20 | |
| 21 | testfiles testfile18 |
| 22 | |
| 23 | testrun_compare ${abs_top_builddir}/src/elflint --gnu-ld testfile18 <<\EOF |
| 24 | section [ 8] '.rela.dyn': relocation 1: copy relocation against symbol of type FUNC |
| 25 | EOF |
| 26 | |
| 27 | testfiles testfile32 |
| 28 | testrun ${abs_top_builddir}/src/elflint -q testfile32 |
| 29 | |
| 30 | testfiles testfile33 |
| 31 | testrun ${abs_top_builddir}/src/elflint -q testfile33 |
| 32 | |
| 33 | testfiles testfile42 |
| 34 | testrun ${abs_top_builddir}/src/elflint -q --gnu-ld testfile42 |
| 35 | |
| 36 | # Contains debuginfo, compress it, recheck |
| 37 | tempfiles testfile42z |
| 38 | testrun ${abs_top_builddir}/src/elfcompress -f -q -o testfile42z testfile42 |
| 39 | testrun ${abs_top_builddir}/src/elflint -q --gnu-ld testfile42z |
| 40 | |
| 41 | testfiles testfile46 |
| 42 | testrun ${abs_top_builddir}/src/elflint -q testfile46 |
| 43 | |
| 44 | # see also run-readelf-d.sh |
| 45 | testfiles testlib_dynseg.so |
| 46 | testrun ${abs_top_builddir}/src/elflint -q --gnu-ld testlib_dynseg.so |
| 47 | |
| 48 | # s390x has SHT_HASH with sh_entsize 8 (really should be 4, but see common.h) |
| 49 | # This was wrongly checked when comparing .gnu.hash and .hash. |
| 50 | # Simple "int main (int argc, char **argv) { return 0; }" |
| 51 | # gcc -Xlinker --hash-style=both -o testfile-s390x-hash-both s390x-hash-both.c |
| 52 | testfiles testfile-s390x-hash-both |
| 53 | testrun ${abs_top_builddir}/src/elflint -q --gnu-ld testfile-s390x-hash-both |
| 54 | |
| 55 | # Compress the symtab/strtab just because and recheck |
| 56 | tempfiles testfile-s390x-hash-bothz |
| 57 | testrun ${abs_top_builddir}/src/elfcompress -f -q --name='.s??tab' -o testfile-s390x-hash-bothz testfile-s390x-hash-both |
| 58 | testrun ${abs_top_builddir}/src/elflint -q --gnu-ld testfile-s390x-hash-bothz |
| 59 | |
| 60 | exit 0 |