blob: 3b6c4457f1d79d94d4d90505dc265b499d5d0629 [file] [log] [blame]
Ulrich Drepperb08d5a82005-07-26 05:00:05 +00001#! /bin/sh
2# Copyright (C) 2005 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 testfile testfile2 testfile8 testfile14 testfile23
Ulrich Drepperb08d5a82005-07-26 05:00:05 +000022
Mark Wielaard86be7922013-04-26 23:44:25 +020023testrun_compare ${abs_builddir}/line2addr -e testfile f.c:4 testfile f.c:8 <<\EOF
Roland McGrathd17fac72005-08-23 08:20:21 +000024f.c:4 -> 0x804846b (/home/drepper/gnu/new-bu/build/ttt/f.c:4)
Roland McGrath1b8b4462005-11-16 01:33:38 +000025EOF
26
Mark Wielaard86be7922013-04-26 23:44:25 +020027testrun_compare ${abs_builddir}/line2addr -e testfile2 m.c:6 b.c:1 <<\EOF
Roland McGrathd17fac72005-08-23 08:20:21 +000028m.c:6 -> 0x100004cc (/shoggoth/drepper/m.c:6)
29b.c:1 -> 0x10000470 (/shoggoth/drepper/b.c:4)
Roland McGrath1b8b4462005-11-16 01:33:38 +000030EOF
31
Mark Wielaard86be7922013-04-26 23:44:25 +020032testrun_compare ${abs_builddir}/line2addr -e testfile8 strip.c:953 strip.c:365 <<\EOF
Roland McGrathd17fac72005-08-23 08:20:21 +000033strip.c:953 -> (.text)+0x169f (/home/drepper/gnu/elfutils/build/src/../../src/strip.c:953)
34strip.c:953 -> (.text)+0x16aa (/home/drepper/gnu/elfutils/build/src/../../src/strip.c:953)
35strip.c:365 -> (.text)+0x278b (/home/drepper/gnu/elfutils/build/src/../../src/strip.c:365)
36strip.c:365 -> (.text)+0x2797 (/home/drepper/gnu/elfutils/build/src/../../src/strip.c:365)
Roland McGrath1b8b4462005-11-16 01:33:38 +000037EOF
38
Mark Wielaard86be7922013-04-26 23:44:25 +020039testrun_compare ${abs_builddir}/line2addr -e testfile14 v.c:6 <<\EOF
Roland McGrathd17fac72005-08-23 08:20:21 +000040v.c:6 -> 0x400468 (/home/drepper/local/elfutils-build/20050425/v.c:6)
41v.c:6 -> 0x400487 (/home/drepper/local/elfutils-build/20050425/v.c:6)
Roland McGrath1b8b4462005-11-16 01:33:38 +000042EOF
43
Mark Wielaard86be7922013-04-26 23:44:25 +020044testrun_compare ${abs_builddir}/line2addr -e testfile23 foo.c:2 foo.c:6 <<\EOF
Roland McGrathd17fac72005-08-23 08:20:21 +000045foo.c:2 -> (.init.text)+0xc (/home/roland/stock-elfutils-build/foo.c:2)
46foo.c:6 -> (.text)+0xc (/home/roland/stock-elfutils-build/foo.c:6)
Ulrich Drepperb08d5a82005-07-26 05:00:05 +000047EOF
48
Ulrich Drepperb08d5a82005-07-26 05:00:05 +000049exit 0