blob: b0fdfcd616b66f1d5cc61d12f28eabe7604088b3 [file] [log] [blame]
Ulrich Drepperb08d5a82005-07-26 05:00:05 +00001#! /bin/sh
Roland McGrathc373d852006-10-10 00:25:21 +00002# Copyright (C) 1999, 2000, 2002, 2006 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>, 1999.
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 McGrathc373d852006-10-10 00:25:21 +000019. $srcdir/test-subr.sh
20
Mark Wielaard86be7922013-04-26 23:44:25 +020021lib=${abs_top_builddir}/libelf/libelf.a
Ulrich Drepperb08d5a82005-07-26 05:00:05 +000022okfile=arsymtest.ok
23tmpfile=arsymtest.tmp
24testfile=arsymtest.test
25
Roland McGrathc373d852006-10-10 00:25:21 +000026tempfiles $okfile $tmpfile $testfile
27
28result=77
Ulrich Drepperb08d5a82005-07-26 05:00:05 +000029if test -f $lib; then
30 # Generate list using `nm' we check against.
Michael Forneya45c8042013-11-01 00:51:04 -070031 ${NM} -s $lib |
Ulrich Drepperb08d5a82005-07-26 05:00:05 +000032 sed -e '1,/^Arch/d' -e '/^$/,$d' |
33 sort > $okfile
34
35 # Now run our program using libelf.
Mark Wielaard86be7922013-04-26 23:44:25 +020036 testrun ${abs_builddir}/arsymtest $lib $tmpfile || exit 1
Ulrich Drepperb08d5a82005-07-26 05:00:05 +000037 sort $tmpfile > $testfile
Ulrich Drepperb08d5a82005-07-26 05:00:05 +000038
39 # Compare the outputs.
40 if cmp $okfile $testfile; then
41 result=0
Ulrich Drepperb08d5a82005-07-26 05:00:05 +000042 else
43 result=1
44 fi
45fi
46
47exit $result