Blame tests/run-addrname-test.sh

Packit 032894
#! /bin/sh
Packit 032894
# Copyright (C) 2007, 2008 Red Hat, Inc.
Packit 032894
# This file is part of elfutils.
Packit 032894
#
Packit 032894
# This file is free software; you can redistribute it and/or modify
Packit 032894
# it under the terms of the GNU General Public License as published by
Packit 032894
# the Free Software Foundation; either version 3 of the License, or
Packit 032894
# (at your option) any later version.
Packit 032894
#
Packit 032894
# elfutils is distributed in the hope that it will be useful, but
Packit 032894
# WITHOUT ANY WARRANTY; without even the implied warranty of
Packit 032894
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
Packit 032894
# GNU General Public License for more details.
Packit 032894
#
Packit 032894
# You should have received a copy of the GNU General Public License
Packit 032894
# along with this program.  If not, see <http://www.gnu.org/licenses/>.
Packit 032894
Packit 032894
. $srcdir/test-subr.sh
Packit 032894
Packit 032894
testfiles testfile34 testfile38 testfile41 testfile49
Packit 032894
Packit 032894
testrun_compare ${abs_top_builddir}/src/addr2line -f -e testfile34 \
Packit 032894
				 0x08048074 0x08048075 0x08048076 \
Packit 032894
				 0x08049078 0x08048080 0x08049080 <<\EOF
Packit 032894
foo
Packit 032894
??:0
Packit 032894
bar
Packit 032894
??:0
Packit 032894
_etext
Packit 032894
??:0
Packit 032894
data1
Packit 032894
??:0
Packit 032894
??
Packit 032894
??:0
Packit 032894
_end
Packit 032894
??:0
Packit 032894
EOF
Packit 032894
Packit 032894
testrun_compare ${abs_top_builddir}/src/addr2line -S -e testfile38 0x02 0x10a 0x211 0x31a <<\EOF
Packit 032894
t1_global_outer+0x2
Packit 032894
??:0
Packit 032894
t2_global_symbol+0x2
Packit 032894
??:0
Packit 032894
t3_global_after_0+0x1
Packit 032894
??:0
Packit 032894
(.text)+0x31a
Packit 032894
??:0
Packit 032894
EOF
Packit 032894
Packit 032894
testrun_compare ${abs_top_builddir}/src/addr2line -S -e testfile41 0x1 0x104 <<\EOF
Packit 032894
small_global_at_large_global+0x1
Packit 032894
??:0
Packit 032894
small_global_first_at_large_global+0x1
Packit 032894
??:0
Packit 032894
EOF
Packit 032894
Packit 032894
testfiles testfile12 testfile14
Packit 032894
tempfiles testmaps
Packit 032894
Packit 032894
cat > testmaps <
Packit 032894
00400000-00401000 r-xp 00000000 fd:01 4006812                            `pwd`/testfile14
Packit 032894
00500000-00501000 rw-p 00000000 fd:01 4006812                            `pwd`/testfile14
Packit 032894
01000000-01001000 r-xp 00000000 fd:01 1234567				 `pwd`/testfile12
Packit 032894
01100000-01011000 rw-p 00000000 fd:01 1234567				 `pwd`/testfile12
Packit 032894
2aaaaaaab000-2aaaaaaad000 rw-p 2aaaaaaab000 00:00 0 
Packit 032894
2aaaaaae2000-2aaaaaae3000 rw-p 2aaaaaae2000 00:00 0 
Packit 032894
7fff61068000-7fff6107d000 rw-p 7ffffffea000 00:00 0                      [stack]
Packit 032894
7fff611fe000-7fff61200000 r-xp 7fff611fe000 00:00 0                      [vdso]
Packit 032894
ffffffffff600000-ffffffffff601000 r-xp 00000000 00:00 0                  [vsyscall]
Packit 032894
EOF
Packit 032894
Packit 032894
testrun_compare ${abs_top_builddir}/src/addr2line -S -M testmaps 0x40047c 0x10009db <<\EOF
Packit 032894
caller+0x14
Packit 032894
/home/drepper/local/elfutils-build/20050425/v.c:11
Packit 032894
foo+0xb
Packit 032894
/home/drepper/local/elfutils-build/20030710/u.c:5
Packit 032894
EOF
Packit 032894
Packit 032894
#	.section .text
Packit 032894
#	nop #0
Packit 032894
#sizeless_foo:
Packit 032894
#	nop #1
Packit 032894
#	nop #2
Packit 032894
#sized_bar:
Packit 032894
#	nop #3
Packit 032894
#	nop #4
Packit 032894
#sizeless_baz:
Packit 032894
#	nop #5
Packit 032894
#	nop #6
Packit 032894
#	.size sized_bar, . - sized_bar
Packit 032894
#	nop #7
Packit 032894
#	nop #8
Packit 032894
#sizeless_x:
Packit 032894
#	nop #9
Packit 032894
#	.org 0x100
Packit 032894
#	nop #0
Packit 032894
#	.globl global_outer
Packit 032894
#global_outer:
Packit 032894
#	nop #1
Packit 032894
#	nop #2
Packit 032894
#	.globl global_in_global
Packit 032894
#global_in_global:
Packit 032894
#	nop #3
Packit 032894
#	nop #4
Packit 032894
#	.size global_in_global, . - global_in_global
Packit 032894
#local_in_global:
Packit 032894
#	nop #5 
Packit 032894
#	nop #6 
Packit 032894
#	.size local_in_global, . - local_in_global
Packit 032894
#	nop #7
Packit 032894
#	nop #8
Packit 032894
#.Lsizeless1:
Packit 032894
#	nop #9
Packit 032894
#	nop #10
Packit 032894
#	.size global_outer, . - global_outer
Packit 032894
#	nop #11
Packit 032894
#	.org 0x200
Packit 032894
#	nop #0
Packit 032894
#local_outer:
Packit 032894
#	nop #1
Packit 032894
#	nop #2
Packit 032894
#	.globl global_in_local
Packit 032894
#global_in_local:
Packit 032894
#	nop #3
Packit 032894
#	nop #4
Packit 032894
#	.size global_in_local, . - global_in_local
Packit 032894
#local_in_local:
Packit 032894
#	nop #5 
Packit 032894
#	nop #6 
Packit 032894
#	.size local_in_local, . - local_in_local
Packit 032894
#	nop #7
Packit 032894
#	nop #8
Packit 032894
#.Lsizeless2:
Packit 032894
#	nop #9
Packit 032894
#	nop #10
Packit 032894
#	.size local_outer, . - local_outer
Packit 032894
#	nop #11
Packit 032894
testrun_compare ${abs_top_builddir}/src/addr2line -S -e testfile49 \
Packit 032894
    		0 1 2 3 4 5 6 7 8 9 \
Packit 032894
		0x100 0x101 0x102 0x103 0x104 0x105 \
Packit 032894
		0x106 0x107 0x108 0x109 0x10a 0x10b \
Packit 032894
		0x200 0x201 0x202 0x203 0x204 0x205 \
Packit 032894
		0x206 0x207 0x208 0x209 0x20a 0x20b <<\EOF
Packit 032894
(.text)+0
Packit 032894
??:0
Packit 032894
sizeless_foo
Packit 032894
??:0
Packit 032894
sizeless_foo+0x1
Packit 032894
??:0
Packit 032894
sized_bar
Packit 032894
??:0
Packit 032894
sized_bar+0x1
Packit 032894
??:0
Packit 032894
sized_bar+0x2
Packit 032894
??:0
Packit 032894
sized_bar+0x3
Packit 032894
??:0
Packit 032894
(.text)+0x7
Packit 032894
??:0
Packit 032894
(.text)+0x8
Packit 032894
??:0
Packit 032894
sizeless_x
Packit 032894
??:0
Packit 032894
sizeless_x+0xf7
Packit 032894
??:0
Packit 032894
global_outer
Packit 032894
??:0
Packit 032894
global_outer+0x1
Packit 032894
??:0
Packit 032894
global_in_global
Packit 032894
??:0
Packit 032894
global_in_global+0x1
Packit 032894
??:0
Packit 032894
global_outer+0x4
Packit 032894
??:0
Packit 032894
global_outer+0x5
Packit 032894
??:0
Packit 032894
global_outer+0x6
Packit 032894
??:0
Packit 032894
global_outer+0x7
Packit 032894
??:0
Packit 032894
global_outer+0x8
Packit 032894
??:0
Packit 032894
global_outer+0x9
Packit 032894
??:0
Packit 032894
(.text)+0x10b
Packit 032894
??:0
Packit 032894
(.text)+0x200
Packit 032894
??:0
Packit 032894
local_outer
Packit 032894
??:0
Packit 032894
local_outer+0x1
Packit 032894
??:0
Packit 032894
global_in_local
Packit 032894
??:0
Packit 032894
global_in_local+0x1
Packit 032894
??:0
Packit 032894
local_in_local
Packit 032894
??:0
Packit 032894
local_in_local+0x1
Packit 032894
??:0
Packit 032894
local_outer+0x6
Packit 032894
??:0
Packit 032894
local_outer+0x7
Packit 032894
??:0
Packit 032894
local_outer+0x8
Packit 032894
??:0
Packit 032894
local_outer+0x9
Packit 032894
??:0
Packit 032894
(.text)+0x20b
Packit 032894
??:0
Packit 032894
EOF
Packit 032894
Packit 032894
#	.macro global label size
Packit 032894
#\label:	.globl \label
Packit 032894
#	.size \label, \size
Packit 032894
#	.endm
Packit 032894
#	.macro weak label size
Packit 032894
#\label:	.weak \label
Packit 032894
#	.size \label, \size
Packit 032894
#	.endm
Packit 032894
#	.macro local label size
Packit 032894
#\label:	.size \label, \size
Packit 032894
#	.endm
Packit 032894
#	.macro offset val
Packit 032894
#	.ifne (. - _start) - \val
Packit 032894
#	.err
Packit 032894
#	.endif
Packit 032894
#	.byte \val
Packit 032894
#	.endm
Packit 032894
#
Packit 032894
#_start:
Packit 032894
#	offset 0
Packit 032894
#
Packit 032894
#	local glocal, 1
Packit 032894
#	weak gweak, 1
Packit 032894
#	global gglobal1, 2
Packit 032894
#	global gglobal2, 1
Packit 032894
#	global gglobal3, 1
Packit 032894
#	offset 1
Packit 032894
#	/* Symbols end here.  */
Packit 032894
#	offset 2
Packit 032894
#	/* gglobal1 ends here.  */
Packit 032894
#	offset 3
Packit 032894
#
Packit 032894
#	local g0local, 0
Packit 032894
#	weak g0weak, 0
Packit 032894
#	global g0global1, 0
Packit 032894
#	global g0global2, 0
Packit 032894
#	offset 4
Packit 032894
#
Packit 032894
#	local wlocal, 1
Packit 032894
#	weak wweak1, 2
Packit 032894
#	weak wweak2, 1
Packit 032894
#	weak wweak3, 1
Packit 032894
#	offset 5
Packit 032894
#	/* Symbols end here.  */
Packit 032894
#	offset 6
Packit 032894
#	/* wweak1 ends here.  */
Packit 032894
#	offset 7
Packit 032894
#
Packit 032894
#	local w0local, 0
Packit 032894
#	weak w0weak1, 0
Packit 032894
#	weak w0weak2, 0
Packit 032894
#	offset 8
Packit 032894
#
Packit 032894
#	local llocal1, 2
Packit 032894
#	local llocal2, 1
Packit 032894
#	local llocal3, 1
Packit 032894
#	offset 9
Packit 032894
#	/* Symbols end here.  */
Packit 032894
#	offset 10
Packit 032894
#	/* llocal1 ends here.  */
Packit 032894
#	offset 11
Packit 032894
#
Packit 032894
#	local l0local1, 0
Packit 032894
#	local l0local2, 0
Packit 032894
#	offset 12
Packit 032894
testfiles testfile64
Packit 032894
testrun_compare ${abs_top_builddir}/src/addr2line -S -e testfile64 1 4 5 8 9 c <<\EOF
Packit 032894
gglobal2
Packit 032894
??:0
Packit 032894
g0global2
Packit 032894
??:0
Packit 032894
wweak2
Packit 032894
??:0
Packit 032894
w0weak2
Packit 032894
??:0
Packit 032894
llocal2
Packit 032894
??:0
Packit 032894
l0local2
Packit 032894
??:0
Packit 032894
EOF
Packit 032894
Packit 032894
testfiles testfile65
Packit 032894
testrun_compare ${abs_top_builddir}/src/addr2line -S --core=testfile65 0x7fff94bffa30 <<\EOF
Packit 032894
__vdso_time
Packit 032894
??:0
Packit 032894
EOF
Packit 032894
Packit 032894
#	.section	".text"
Packit 032894
#	.globl _start
Packit 032894
#	.section	".opd","aw"
Packit 032894
#_start:	.quad	.L._start,.TOC.@tocbase
Packit 032894
#	.previous
Packit 032894
#	.type	_start, @function
Packit 032894
#.L._start:
Packit 032894
#	.byte	0x7d, 0x82, 0x10, 0x08
Packit 032894
#	.size	_start,.-.L._start
Packit 032894
testfiles testfile66 testfile66.core
Packit 032894
testrun_compare ${abs_top_builddir}/src/addr2line -x -e testfile66 _start 0x2d8 0x2db 0x2dc 0x103d0 0x103d3 0x103d4<
Packit 032894
_start (.text)
Packit 032894
??:0
Packit 032894
_start (.text)
Packit 032894
??:0
Packit 032894
_start+0x3 (.text)
Packit 032894
??:0
Packit 032894
()+0x2dc
Packit 032894
??:0
Packit 032894
_start (.opd)
Packit 032894
??:0
Packit 032894
_start+0x3 (.opd)
Packit 032894
??:0
Packit 032894
()+0x103d4
Packit 032894
??:0
Packit 032894
EOF
Packit 032894
testrun_compare ${abs_top_builddir}/src/addr2line -x -e testfile66 --core=testfile66.core _start 0x461b02d8 0x461c03d0<<\EOF
Packit 032894
_start (.text)
Packit 032894
??:0
Packit 032894
_start (.text)
Packit 032894
??:0
Packit 032894
_start (.opd)
Packit 032894
??:0
Packit 032894
EOF
Packit 032894
Packit 032894
testfiles testfile69.core testfile69.so
Packit 032894
testrun_compare ${abs_top_builddir}/src/addr2line --core=./testfile69.core -S 0x7f0bc6a33535 0x7f0bc6a33546 <<\EOF
Packit 032894
libstatic+0x9
Packit 032894
??:0
Packit 032894
libglobal+0x9
Packit 032894
??:0
Packit 032894
EOF
Packit 032894
Packit 032894
testfiles testfile70.exec testfile70.core
Packit 032894
testrun_compare ${abs_top_builddir}/src/addr2line -S -e testfile70.exec --core=testfile70.core 0x7ff2cfe9b6b5 <<\EOF
Packit 032894
main+0x9
Packit 032894
??:0
Packit 032894
EOF
Packit 032894
testrun_compare ${abs_top_builddir}/src/addr2line -S --core=testfile70.core -e testfile70.exec 0x7ff2cfe9b6b5 <<\EOF
Packit 032894
main+0x9
Packit 032894
??:0
Packit 032894
EOF
Packit 032894
Packit 032894
testfiles test-core-lib.so test-core.core test-core.exec
Packit 032894
testrun_compare ${abs_top_builddir}/src/addr2line -S -e test-core.exec --core=test-core.core 0x7f67f2aaf619 <<\EOF
Packit 032894
libfunc+0x9
Packit 032894
??:0
Packit 032894
EOF
Packit 032894
Packit 032894
exit 0