Blame tests/run-readelf-d.sh

Packit 032894
#! /bin/sh
Packit 032894
# Copyright (C) 2012 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
# #include <stdio.h>
Packit 032894
# 
Packit 032894
# __thread int i;
Packit 032894
# 
Packit 032894
# void print_i ()
Packit 032894
# {
Packit 032894
#   printf("%d\n", i);
Packit 032894
# }
Packit 032894
#
Packit 032894
# gcc -fPIC -shared -o testlib_dynseg.so testlib_dynseg.c
Packit 032894
# With ld --version
Packit 032894
# GNU gold (GNU Binutils 2.22.52.20120402) 1.11
Packit 032894
Packit 032894
testfiles testlib_dynseg.so
Packit 032894
Packit 032894
testrun_compare ${abs_top_builddir}/src/readelf -d testlib_dynseg.so <<\EOF
Packit 032894
Packit 032894
Dynamic segment contains 28 entries:
Packit 032894
 Addr: 0x00000000000017e0  Offset: 0x0007e0  Link to section: [ 3] '.dynstr'
Packit 032894
  Type              Value
Packit 032894
  PLTGOT            0x00000000000019c8
Packit 032894
  PLTRELSZ          72 (bytes)
Packit 032894
  JMPREL            0x0000000000000568
Packit 032894
  PLTREL            RELA
Packit 032894
  RELA              0x00000000000004d8
Packit 032894
  RELASZ            144 (bytes)
Packit 032894
  RELAENT           24 (bytes)
Packit 032894
  RELACOUNT         1
Packit 032894
  SYMTAB            0x0000000000000228
Packit 032894
  SYMENT            24 (bytes)
Packit 032894
  STRTAB            0x0000000000000360
Packit 032894
  STRSZ             190 (bytes)
Packit 032894
  GNU_HASH          0x0000000000000420
Packit 032894
  NEEDED            Shared library: [libc.so.6]
Packit 032894
  NEEDED            Shared library: [ld-linux-x86-64.so.2]
Packit 032894
  INIT              0x00000000000005b0
Packit 032894
  FINI              0x0000000000000748
Packit 032894
  VERSYM            0x0000000000000460
Packit 032894
  VERDEF            0x000000000000047c
Packit 032894
  VERDEFNUM         1
Packit 032894
  VERNEED           0x0000000000000498
Packit 032894
  VERNEEDNUM        2
Packit 032894
  NULL              
Packit 032894
  NULL              
Packit 032894
  NULL              
Packit 032894
  NULL              
Packit 032894
  NULL              
Packit 032894
  NULL              
Packit 032894
EOF
Packit 032894
Packit 032894
exit 0