Blame tests/run-readelf-z.sh

Packit 032894
#! /bin/sh
Packit 032894
# Copyright (C) 2015 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
# See run-elfgetchdr.sh for testfiles.
Packit 032894
Packit 032894
testfiles testfile-zgnu64
Packit 032894
testrun_compare ${abs_top_builddir}/src/readelf -z -S testfile-zgnu64 <<\EOF
Packit 032894
There are 9 section headers, starting at offset 0x3e0:
Packit 032894
Packit 032894
Section Headers:
Packit 032894
[Nr] Name                 Type         Addr             Off      Size     ES Flags Lk Inf Al
Packit 032894
     [Compression  Size     Al]
Packit 032894
[ 0]                      NULL         0000000000000000 00000000 00000000  0        0   0  0
Packit 032894
[ 1] .text                PROGBITS     0000000000400078 00000078 0000002a  0 AX     0   0  1
Packit 032894
[ 2] .zdebug_aranges      PROGBITS     0000000000000000 00000260 00000032  0        0   0 16
Packit 032894
     [GNU ZLIB     00000060   ]
Packit 032894
[ 3] .zdebug_info         PROGBITS     0000000000000000 00000292 0000006f  0        0   0  1
Packit 032894
     [GNU ZLIB     000000aa   ]
Packit 032894
[ 4] .debug_abbrev        PROGBITS     0000000000000000 00000301 00000028  0        0   0  1
Packit 032894
[ 5] .zdebug_line         PROGBITS     0000000000000000 00000329 0000005b  0        0   0  1
Packit 032894
     [GNU ZLIB     0000008d   ]
Packit 032894
[ 6] .shstrtab            STRTAB       0000000000000000 00000384 00000059  0        0   0  1
Packit 032894
[ 7] .symtab              SYMTAB       0000000000000000 000000a8 00000168 24        8   8  8
Packit 032894
[ 8] .strtab              STRTAB       0000000000000000 00000210 0000004b  0        0   0  1
Packit 032894
Packit 032894
EOF
Packit 032894
Packit 032894
testfiles testfile-zgnu64be
Packit 032894
testrun_compare ${abs_top_builddir}/src/readelf -z -S testfile-zgnu64be <<\EOF
Packit 032894
There are 10 section headers, starting at offset 0x438:
Packit 032894
Packit 032894
Section Headers:
Packit 032894
[Nr] Name                 Type         Addr             Off      Size     ES Flags Lk Inf Al
Packit 032894
     [Compression  Size     Al]
Packit 032894
[ 0]                      NULL         0000000000000000 00000000 00000000  0        0   0  0
Packit 032894
[ 1] .text                PROGBITS     0000000010000078 00000078 00000074  0 AX     0   0  8
Packit 032894
[ 2] .eh_frame            PROGBITS     00000000100000ec 000000ec 00000000  0 A      0   0  4
Packit 032894
[ 3] .zdebug_aranges      PROGBITS     0000000000000000 000002c0 00000034  0        0   0 16
Packit 032894
     [GNU ZLIB     00000060   ]
Packit 032894
[ 4] .zdebug_info         PROGBITS     0000000000000000 000002f4 00000059  0        0   0  1
Packit 032894
     [GNU ZLIB     0000007e   ]
Packit 032894
[ 5] .debug_abbrev        PROGBITS     0000000000000000 0000034d 00000028  0        0   0  1
Packit 032894
[ 6] .zdebug_line         PROGBITS     0000000000000000 00000375 0000005b  0        0   0  1
Packit 032894
     [GNU ZLIB     0000008d   ]
Packit 032894
[ 7] .shstrtab            STRTAB       0000000000000000 000003d0 00000063  0        0   0  1
Packit 032894
[ 8] .symtab              SYMTAB       0000000000000000 000000f0 00000180 24        9   9  8
Packit 032894
[ 9] .strtab              STRTAB       0000000000000000 00000270 00000044  0        0   0  1
Packit 032894
Packit 032894
EOF
Packit 032894
Packit 032894
testfiles testfile-zgabi64
Packit 032894
testrun_compare ${abs_top_builddir}/src/readelf -z -S testfile-zgabi64 <<\EOF
Packit 032894
There are 9 section headers, starting at offset 0x400:
Packit 032894
Packit 032894
Section Headers:
Packit 032894
[Nr] Name                 Type         Addr             Off      Size     ES Flags Lk Inf Al
Packit 032894
     [Compression  Size     Al]
Packit 032894
[ 0]                      NULL         0000000000000000 00000000 00000000  0        0   0  0
Packit 032894
[ 1] .text                PROGBITS     0000000000400078 00000078 0000002a  0 AX     0   0  1
Packit 032894
[ 2] .debug_aranges       PROGBITS     0000000000000000 00000260 0000003e  0 C      0   0 16
Packit 032894
     [ELF ZLIB (1) 00000060 16]
Packit 032894
[ 3] .debug_info          PROGBITS     0000000000000000 0000029e 0000007b  0 C      0   0  1
Packit 032894
     [ELF ZLIB (1) 000000aa  1]
Packit 032894
[ 4] .debug_abbrev        PROGBITS     0000000000000000 00000319 00000028  0        0   0  1
Packit 032894
[ 5] .debug_line          PROGBITS     0000000000000000 00000341 00000067  0 C      0   0  1
Packit 032894
     [ELF ZLIB (1) 0000008d  1]
Packit 032894
[ 6] .shstrtab            STRTAB       0000000000000000 000003a8 00000056  0        0   0  1
Packit 032894
[ 7] .symtab              SYMTAB       0000000000000000 000000a8 00000168 24        8   8  8
Packit 032894
[ 8] .strtab              STRTAB       0000000000000000 00000210 0000004b  0        0   0  1
Packit 032894
Packit 032894
EOF
Packit 032894
Packit 032894
testfiles testfile-zgabi64be
Packit 032894
testrun_compare ${abs_top_builddir}/src/readelf -z -S testfile-zgabi64be <<\EOF
Packit 032894
There are 10 section headers, starting at offset 0x458:
Packit 032894
Packit 032894
Section Headers:
Packit 032894
[Nr] Name                 Type         Addr             Off      Size     ES Flags Lk Inf Al
Packit 032894
     [Compression  Size     Al]
Packit 032894
[ 0]                      NULL         0000000000000000 00000000 00000000  0        0   0  0
Packit 032894
[ 1] .text                PROGBITS     0000000010000078 00000078 00000074  0 AX     0   0  8
Packit 032894
[ 2] .eh_frame            PROGBITS     00000000100000ec 000000ec 00000000  0 A      0   0  4
Packit 032894
[ 3] .debug_aranges       PROGBITS     0000000000000000 000002c0 00000040  0 C      0   0 16
Packit 032894
     [ELF ZLIB (1) 00000060 16]
Packit 032894
[ 4] .debug_info          PROGBITS     0000000000000000 00000300 00000065  0 C      0   0  1
Packit 032894
     [ELF ZLIB (1) 0000007e  1]
Packit 032894
[ 5] .debug_abbrev        PROGBITS     0000000000000000 00000365 00000028  0        0   0  1
Packit 032894
[ 6] .debug_line          PROGBITS     0000000000000000 0000038d 00000067  0 C      0   0  1
Packit 032894
     [ELF ZLIB (1) 0000008d  1]
Packit 032894
[ 7] .shstrtab            STRTAB       0000000000000000 000003f4 00000060  0        0   0  1
Packit 032894
[ 8] .symtab              SYMTAB       0000000000000000 000000f0 00000180 24        9   9  8
Packit 032894
[ 9] .strtab              STRTAB       0000000000000000 00000270 00000044  0        0   0  1
Packit 032894
Packit 032894
EOF
Packit 032894
Packit 032894
testfiles testfile-zgnu32
Packit 032894
testrun_compare ${abs_top_builddir}/src/readelf -z -S testfile-zgnu32 <<\EOF
Packit 032894
There are 9 section headers, starting at offset 0x33c:
Packit 032894
Packit 032894
Section Headers:
Packit 032894
[Nr] Name                 Type         Addr     Off    Size   ES Flags Lk Inf Al
Packit 032894
     [Compression  Size   Al]
Packit 032894
[ 0]                      NULL         00000000 000000 000000  0        0   0  0
Packit 032894
[ 1] .text                PROGBITS     08048054 000054 00002a  0 AX     0   0  1
Packit 032894
[ 2] .zdebug_aranges      PROGBITS     00000000 0001c0 000031  0        0   0  8
Packit 032894
     [GNU ZLIB     000040   ]
Packit 032894
[ 3] .zdebug_info         PROGBITS     00000000 0001f1 00006f  0        0   0  1
Packit 032894
     [GNU ZLIB     00009a   ]
Packit 032894
[ 4] .debug_abbrev        PROGBITS     00000000 000260 000028  0        0   0  1
Packit 032894
[ 5] .zdebug_line         PROGBITS     00000000 000288 00005a  0        0   0  1
Packit 032894
     [GNU ZLIB     000085   ]
Packit 032894
[ 6] .shstrtab            STRTAB       00000000 0002e2 000059  0        0   0  1
Packit 032894
[ 7] .symtab              SYMTAB       00000000 000080 0000f0 16        8   8  4
Packit 032894
[ 8] .strtab              STRTAB       00000000 000170 00004b  0        0   0  1
Packit 032894
Packit 032894
EOF
Packit 032894
Packit 032894
testfiles testfile-zgnu32be
Packit 032894
testrun_compare ${abs_top_builddir}/src/readelf -z -S testfile-zgnu32be <<\EOF
Packit 032894
There are 10 section headers, starting at offset 0x390:
Packit 032894
Packit 032894
Section Headers:
Packit 032894
[Nr] Name                 Type         Addr     Off    Size   ES Flags Lk Inf Al
Packit 032894
     [Compression  Size   Al]
Packit 032894
[ 0]                      NULL         00000000 000000 000000  0        0   0  0
Packit 032894
[ 1] .text                PROGBITS     01800054 000054 000074  0 AX     0   0  1
Packit 032894
[ 2] .eh_frame            PROGBITS     018000c8 0000c8 000000  0 A      0   0  4
Packit 032894
[ 3] .zdebug_aranges      PROGBITS     00000000 000220 000033  0        0   0  8
Packit 032894
     [GNU ZLIB     000040   ]
Packit 032894
[ 4] .zdebug_info         PROGBITS     00000000 000253 000058  0        0   0  1
Packit 032894
     [GNU ZLIB     00006e   ]
Packit 032894
[ 5] .debug_abbrev        PROGBITS     00000000 0002ab 000028  0        0   0  1
Packit 032894
[ 6] .zdebug_line         PROGBITS     00000000 0002d3 000059  0        0   0  1
Packit 032894
     [GNU ZLIB     000085   ]
Packit 032894
[ 7] .shstrtab            STRTAB       00000000 00032c 000063  0        0   0  1
Packit 032894
[ 8] .symtab              SYMTAB       00000000 0000c8 000110 16        9   9  4
Packit 032894
[ 9] .strtab              STRTAB       00000000 0001d8 000045  0        0   0  1
Packit 032894
Packit 032894
EOF
Packit 032894
Packit 032894
testfiles testfile-zgabi32
Packit 032894
testrun_compare ${abs_top_builddir}/src/readelf -z -S testfile-zgabi32 <<\EOF
Packit 032894
There are 9 section headers, starting at offset 0x338:
Packit 032894
Packit 032894
Section Headers:
Packit 032894
[Nr] Name                 Type         Addr     Off    Size   ES Flags Lk Inf Al
Packit 032894
     [Compression  Size   Al]
Packit 032894
[ 0]                      NULL         00000000 000000 000000  0        0   0  0
Packit 032894
[ 1] .text                PROGBITS     08048054 000054 00002a  0 AX     0   0  1
Packit 032894
[ 2] .debug_aranges       PROGBITS     00000000 0001c0 000031  0 C      0   0  8
Packit 032894
     [ELF ZLIB (1) 000040  8]
Packit 032894
[ 3] .debug_info          PROGBITS     00000000 0001f1 00006f  0 C      0   0  1
Packit 032894
     [ELF ZLIB (1) 00009a  1]
Packit 032894
[ 4] .debug_abbrev        PROGBITS     00000000 000260 000028  0        0   0  1
Packit 032894
[ 5] .debug_line          PROGBITS     00000000 000288 00005a  0 C      0   0  1
Packit 032894
     [ELF ZLIB (1) 000085  1]
Packit 032894
[ 6] .shstrtab            STRTAB       00000000 0002e2 000056  0        0   0  1
Packit 032894
[ 7] .symtab              SYMTAB       00000000 000080 0000f0 16        8   8  4
Packit 032894
[ 8] .strtab              STRTAB       00000000 000170 00004b  0        0   0  1
Packit 032894
Packit 032894
EOF
Packit 032894
Packit 032894
testfiles testfile-zgabi32be
Packit 032894
testrun_compare ${abs_top_builddir}/src/readelf -z -S testfile-zgabi32be <<\EOF
Packit 032894
There are 10 section headers, starting at offset 0x38c:
Packit 032894
Packit 032894
Section Headers:
Packit 032894
[Nr] Name                 Type         Addr     Off    Size   ES Flags Lk Inf Al
Packit 032894
     [Compression  Size   Al]
Packit 032894
[ 0]                      NULL         00000000 000000 000000  0        0   0  0
Packit 032894
[ 1] .text                PROGBITS     01800054 000054 000074  0 AX     0   0  1
Packit 032894
[ 2] .eh_frame            PROGBITS     018000c8 0000c8 000000  0 A      0   0  4
Packit 032894
[ 3] .debug_aranges       PROGBITS     00000000 000220 000033  0 C      0   0  8
Packit 032894
     [ELF ZLIB (1) 000040  8]
Packit 032894
[ 4] .debug_info          PROGBITS     00000000 000253 000058  0 C      0   0  1
Packit 032894
     [ELF ZLIB (1) 00006e  1]
Packit 032894
[ 5] .debug_abbrev        PROGBITS     00000000 0002ab 000028  0        0   0  1
Packit 032894
[ 6] .debug_line          PROGBITS     00000000 0002d3 000059  0 C      0   0  1
Packit 032894
     [ELF ZLIB (1) 000085  1]
Packit 032894
[ 7] .shstrtab            STRTAB       00000000 00032c 000060  0        0   0  1
Packit 032894
[ 8] .symtab              SYMTAB       00000000 0000c8 000110 16        9   9  4
Packit 032894
[ 9] .strtab              STRTAB       00000000 0001d8 000045  0        0   0  1
Packit 032894
Packit 032894
EOF
Packit 032894
Packit 032894
exit 0