Blame tests/run-dwfl-report-elf-align.sh

Packit Service 97d2fb
#! /bin/sh
Packit Service 97d2fb
# Copyright (C) 2013 Red Hat, Inc.
Packit Service 97d2fb
# This file is part of elfutils.
Packit Service 97d2fb
#
Packit Service 97d2fb
# This file is free software; you can redistribute it and/or modify
Packit Service 97d2fb
# it under the terms of the GNU General Public License as published by
Packit Service 97d2fb
# the Free Software Foundation; either version 3 of the License, or
Packit Service 97d2fb
# (at your option) any later version.
Packit Service 97d2fb
#
Packit Service 97d2fb
# elfutils is distributed in the hope that it will be useful, but
Packit Service 97d2fb
# WITHOUT ANY WARRANTY; without even the implied warranty of
Packit Service 97d2fb
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
Packit Service 97d2fb
# GNU General Public License for more details.
Packit Service 97d2fb
#
Packit Service 97d2fb
# You should have received a copy of the GNU General Public License
Packit Service 97d2fb
# along with this program.  If not, see <http://www.gnu.org/licenses/>.
Packit Service 97d2fb
Packit Service 97d2fb
. $srcdir/test-subr.sh
Packit Service 97d2fb
Packit Service 97d2fb
testfiles testfile-dwfl-report-elf-align-shlib.so
Packit Service 97d2fb
Packit Service 97d2fb
# /proc/PID/maps when the process was running:
Packit Service 97d2fb
# 7f3560c92000-7f3560c93000 r-xp 00000000 fd:02 25037063 testfile-dwfl-report-elf-align-shlib.so
Packit Service 97d2fb
# 7f3560c93000-7f3560e92000 ---p 00001000 fd:02 25037063 testfile-dwfl-report-elf-align-shlib.so
Packit Service 97d2fb
# 7f3560e92000-7f3560e93000 rw-p 00000000 fd:02 25037063 testfile-dwfl-report-elf-align-shlib.so
Packit Service 97d2fb
# testfile-dwfl-report-elf-align-shlib.so:
Packit Service 97d2fb
# Program Headers:
Packit Service 97d2fb
#   Type           Offset   VirtAddr           PhysAddr           FileSiz  MemSiz   Flg Align
Packit Service 97d2fb
#   LOAD           0x000000 0x0000000000000000 0x0000000000000000 0x00065c 0x00065c R E 0x200000
Packit Service 97d2fb
#   LOAD           0x000660 0x0000000000200660 0x0000000000200660 0x0001f0 0x000200 RW  0x200000
Packit Service 97d2fb
# Symbol table '.dynsym' contains 12 entries:
Packit Service 97d2fb
#    Num:    Value          Size Type    Bind   Vis      Ndx Name
Packit Service 97d2fb
#      8: 000000000000057c    11 FUNC    GLOBAL DEFAULT   11 shlib
Packit Service 97d2fb
# GDB output showing proper relocation:
Packit Service 97d2fb
# #1  0x00007f3560c92585 in shlib () from ./testfile-dwfl-report-elf-align-shlib.so
Packit Service 97d2fb
#
Packit Service 97d2fb
# 0x7f3560c92000 is VMA address of first byte of testfile-dwfl-report-elf-align-shlib.so.
Packit Service 97d2fb
# 0x7f3560c92585 = 0x7f3560c92000 + 0x585
Packit Service 97d2fb
# where 0x585 is any address inside the shlib function: 0x57c .. 0x57c + 11 -1
Packit Service 97d2fb
Packit Service 97d2fb
testrun ${abs_builddir}/dwfl-report-elf-align ./testfile-dwfl-report-elf-align-shlib.so \
Packit Service 97d2fb
				0x7f3560c92000 0x7f3560c92585 shlib
Packit Service 97d2fb
Packit Service 97d2fb
exit 0