Ulrich Drepper | b08d5a8 | 2005-07-26 05:00:05 +0000 | [diff] [blame] | 1 | #! /bin/sh |
Mark Wielaard | f4dc764 | 2016-02-09 14:18:49 +0100 | [diff] [blame] | 2 | # Copyright (C) 2005, 2007, 2008, 2015 Red Hat, Inc. |
Mark Wielaard | de2ed97 | 2012-06-05 17:15:16 +0200 | [diff] [blame] | 3 | # This file is part of elfutils. |
Ulrich Drepper | b08d5a8 | 2005-07-26 05:00:05 +0000 | [diff] [blame] | 4 | # Written by Ulrich Drepper <drepper@redhat.com>, 2005. |
Roland McGrath | 6d0c2e8 | 2006-04-05 00:59:43 +0000 | [diff] [blame] | 5 | # |
Mark Wielaard | de2ed97 | 2012-06-05 17:15:16 +0200 | [diff] [blame] | 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. |
Ulrich Drepper | b08d5a8 | 2005-07-26 05:00:05 +0000 | [diff] [blame] | 10 | # |
Mark Wielaard | de2ed97 | 2012-06-05 17:15:16 +0200 | [diff] [blame] | 11 | # elfutils is distributed in the hope that it will be useful, but |
Ulrich Drepper | 361df7d | 2006-04-04 21:38:57 +0000 | [diff] [blame] | 12 | # WITHOUT ANY WARRANTY; without even the implied warranty of |
Mark Wielaard | de2ed97 | 2012-06-05 17:15:16 +0200 | [diff] [blame] | 13 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 14 | # GNU General Public License for more details. |
Ulrich Drepper | b08d5a8 | 2005-07-26 05:00:05 +0000 | [diff] [blame] | 15 | # |
Mark Wielaard | de2ed97 | 2012-06-05 17:15:16 +0200 | [diff] [blame] | 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/>. |
Ulrich Drepper | 361df7d | 2006-04-04 21:38:57 +0000 | [diff] [blame] | 18 | |
Roland McGrath | 1b8b446 | 2005-11-16 01:33:38 +0000 | [diff] [blame] | 19 | . $srcdir/test-subr.sh |
Ulrich Drepper | b08d5a8 | 2005-07-26 05:00:05 +0000 | [diff] [blame] | 20 | |
Roland McGrath | 1b8b446 | 2005-11-16 01:33:38 +0000 | [diff] [blame] | 21 | testfiles testfile18 |
Ulrich Drepper | b08d5a8 | 2005-07-26 05:00:05 +0000 | [diff] [blame] | 22 | |
Mark Wielaard | 86be792 | 2013-04-26 23:44:25 +0200 | [diff] [blame] | 23 | testrun_compare ${abs_top_builddir}/src/elflint --gnu-ld testfile18 <<\EOF |
Ulrich Drepper | b08d5a8 | 2005-07-26 05:00:05 +0000 | [diff] [blame] | 24 | section [ 8] '.rela.dyn': relocation 1: copy relocation against symbol of type FUNC |
| 25 | EOF |
| 26 | |
Ulrich Drepper | aa915fd | 2007-02-05 07:25:33 +0000 | [diff] [blame] | 27 | testfiles testfile32 |
Mark Wielaard | 86be792 | 2013-04-26 23:44:25 +0200 | [diff] [blame] | 28 | testrun ${abs_top_builddir}/src/elflint -q testfile32 |
Ulrich Drepper | aa915fd | 2007-02-05 07:25:33 +0000 | [diff] [blame] | 29 | |
| 30 | testfiles testfile33 |
Mark Wielaard | 86be792 | 2013-04-26 23:44:25 +0200 | [diff] [blame] | 31 | testrun ${abs_top_builddir}/src/elflint -q testfile33 |
Ulrich Drepper | aa915fd | 2007-02-05 07:25:33 +0000 | [diff] [blame] | 32 | |
Ulrich Drepper | b597dfa | 2007-10-16 05:21:27 +0000 | [diff] [blame] | 33 | testfiles testfile42 |
Mark Wielaard | 86be792 | 2013-04-26 23:44:25 +0200 | [diff] [blame] | 34 | testrun ${abs_top_builddir}/src/elflint -q --gnu-ld testfile42 |
Ulrich Drepper | b597dfa | 2007-10-16 05:21:27 +0000 | [diff] [blame] | 35 | |
Mark Wielaard | caf135b | 2017-04-05 17:09:27 +0200 | [diff] [blame] | 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 | |
Roland McGrath | 658094a | 2008-02-22 08:14:07 +0000 | [diff] [blame] | 41 | testfiles testfile46 |
Mark Wielaard | 86be792 | 2013-04-26 23:44:25 +0200 | [diff] [blame] | 42 | testrun ${abs_top_builddir}/src/elflint -q testfile46 |
Roland McGrath | 059c83e | 2008-02-21 06:19:39 +0000 | [diff] [blame] | 43 | |
Mark Wielaard | 191d1f0 | 2012-04-02 17:11:25 +0200 | [diff] [blame] | 44 | # see also run-readelf-d.sh |
| 45 | testfiles testlib_dynseg.so |
Mark Wielaard | 86be792 | 2013-04-26 23:44:25 +0200 | [diff] [blame] | 46 | testrun ${abs_top_builddir}/src/elflint -q --gnu-ld testlib_dynseg.so |
Mark Wielaard | 191d1f0 | 2012-04-02 17:11:25 +0200 | [diff] [blame] | 47 | |
Mark Wielaard | f4dc764 | 2016-02-09 14:18:49 +0100 | [diff] [blame] | 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 | |
Mark Wielaard | caf135b | 2017-04-05 17:09:27 +0200 | [diff] [blame] | 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 | |
Ulrich Drepper | b08d5a8 | 2005-07-26 05:00:05 +0000 | [diff] [blame] | 60 | exit 0 |