blob: caf172a616319b37ab2e9f828754aaf88680cc17 [file] [log] [blame]
Ulrich Drepperb08d5a82005-07-26 05:00:05 +00001#! /bin/sh
Mark Wielaardf4dc7642016-02-09 14:18:49 +01002# Copyright (C) 2005, 2007, 2008, 2015 Red Hat, Inc.
Mark Wielaardde2ed972012-06-05 17:15:16 +02003# This file is part of elfutils.
Ulrich Drepperb08d5a82005-07-26 05:00:05 +00004# Written by Ulrich Drepper <drepper@redhat.com>, 2005.
Roland McGrath6d0c2e82006-04-05 00:59:43 +00005#
Mark Wielaardde2ed972012-06-05 17:15:16 +02006# 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 Drepperb08d5a82005-07-26 05:00:05 +000010#
Mark Wielaardde2ed972012-06-05 17:15:16 +020011# elfutils is distributed in the hope that it will be useful, but
Ulrich Drepper361df7d2006-04-04 21:38:57 +000012# WITHOUT ANY WARRANTY; without even the implied warranty of
Mark Wielaardde2ed972012-06-05 17:15:16 +020013# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14# GNU General Public License for more details.
Ulrich Drepperb08d5a82005-07-26 05:00:05 +000015#
Mark Wielaardde2ed972012-06-05 17:15:16 +020016# 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 Drepper361df7d2006-04-04 21:38:57 +000018
Roland McGrath1b8b4462005-11-16 01:33:38 +000019. $srcdir/test-subr.sh
Ulrich Drepperb08d5a82005-07-26 05:00:05 +000020
Roland McGrath1b8b4462005-11-16 01:33:38 +000021testfiles testfile18
Ulrich Drepperb08d5a82005-07-26 05:00:05 +000022
Mark Wielaard86be7922013-04-26 23:44:25 +020023testrun_compare ${abs_top_builddir}/src/elflint --gnu-ld testfile18 <<\EOF
Ulrich Drepperb08d5a82005-07-26 05:00:05 +000024section [ 8] '.rela.dyn': relocation 1: copy relocation against symbol of type FUNC
25EOF
26
Ulrich Drepperaa915fd2007-02-05 07:25:33 +000027testfiles testfile32
Mark Wielaard86be7922013-04-26 23:44:25 +020028testrun ${abs_top_builddir}/src/elflint -q testfile32
Ulrich Drepperaa915fd2007-02-05 07:25:33 +000029
30testfiles testfile33
Mark Wielaard86be7922013-04-26 23:44:25 +020031testrun ${abs_top_builddir}/src/elflint -q testfile33
Ulrich Drepperaa915fd2007-02-05 07:25:33 +000032
Ulrich Drepperb597dfa2007-10-16 05:21:27 +000033testfiles testfile42
Mark Wielaard86be7922013-04-26 23:44:25 +020034testrun ${abs_top_builddir}/src/elflint -q --gnu-ld testfile42
Ulrich Drepperb597dfa2007-10-16 05:21:27 +000035
Mark Wielaardcaf135b2017-04-05 17:09:27 +020036# Contains debuginfo, compress it, recheck
37tempfiles testfile42z
38testrun ${abs_top_builddir}/src/elfcompress -f -q -o testfile42z testfile42
39testrun ${abs_top_builddir}/src/elflint -q --gnu-ld testfile42z
40
Roland McGrath658094a2008-02-22 08:14:07 +000041testfiles testfile46
Mark Wielaard86be7922013-04-26 23:44:25 +020042testrun ${abs_top_builddir}/src/elflint -q testfile46
Roland McGrath059c83e2008-02-21 06:19:39 +000043
Mark Wielaard191d1f02012-04-02 17:11:25 +020044# see also run-readelf-d.sh
45testfiles testlib_dynseg.so
Mark Wielaard86be7922013-04-26 23:44:25 +020046testrun ${abs_top_builddir}/src/elflint -q --gnu-ld testlib_dynseg.so
Mark Wielaard191d1f02012-04-02 17:11:25 +020047
Mark Wielaardf4dc7642016-02-09 14:18:49 +010048# 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
52testfiles testfile-s390x-hash-both
53testrun ${abs_top_builddir}/src/elflint -q --gnu-ld testfile-s390x-hash-both
54
Mark Wielaardcaf135b2017-04-05 17:09:27 +020055# Compress the symtab/strtab just because and recheck
56tempfiles testfile-s390x-hash-bothz
57testrun ${abs_top_builddir}/src/elfcompress -f -q --name='.s??tab' -o testfile-s390x-hash-bothz testfile-s390x-hash-both
58testrun ${abs_top_builddir}/src/elflint -q --gnu-ld testfile-s390x-hash-bothz
59
Ulrich Drepperb08d5a82005-07-26 05:00:05 +000060exit 0