blob: d0b6ed2468145a9d76398c648bf5811cf214a06c [file] [log] [blame]
Mark Wielaard191d1f02012-04-02 17:11:25 +02001#! /bin/sh
2# Copyright (C) 2012 Red Hat, Inc.
Mark Wielaardde2ed972012-06-05 17:15:16 +02003# This file is part of elfutils.
Mark Wielaard191d1f02012-04-02 17:11:25 +02004#
Mark Wielaardde2ed972012-06-05 17:15:16 +02005# This file is free software; you can redistribute it and/or modify
6# it under the terms of the GNU General Public License as published by
7# the Free Software Foundation; either version 3 of the License, or
8# (at your option) any later version.
Mark Wielaard191d1f02012-04-02 17:11:25 +02009#
Mark Wielaardde2ed972012-06-05 17:15:16 +020010# elfutils is distributed in the hope that it will be useful, but
Mark Wielaard191d1f02012-04-02 17:11:25 +020011# WITHOUT ANY WARRANTY; without even the implied warranty of
Mark Wielaardde2ed972012-06-05 17:15:16 +020012# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13# GNU General Public License for more details.
Mark Wielaard191d1f02012-04-02 17:11:25 +020014#
Mark Wielaardde2ed972012-06-05 17:15:16 +020015# You should have received a copy of the GNU General Public License
16# along with this program. If not, see <http://www.gnu.org/licenses/>.
Mark Wielaard191d1f02012-04-02 17:11:25 +020017
18. $srcdir/test-subr.sh
19
20# #include <stdio.h>
21#
22# __thread int i;
23#
24# void print_i ()
25# {
26# printf("%d\n", i);
27# }
28#
29# gcc -fPIC -shared -o testlib_dynseg.so testlib_dynseg.c
30# With ld --version
31# GNU gold (GNU Binutils 2.22.52.20120402) 1.11
32
33testfiles testlib_dynseg.so
34
Mark Wielaard86be7922013-04-26 23:44:25 +020035testrun_compare ${abs_top_builddir}/src/readelf -d testlib_dynseg.so <<\EOF
Mark Wielaard191d1f02012-04-02 17:11:25 +020036
37Dynamic segment contains 28 entries:
38 Addr: 0x00000000000017e0 Offset: 0x0007e0 Link to section: [ 3] '.dynstr'
39 Type Value
40 PLTGOT 0x00000000000019c8
41 PLTRELSZ 72 (bytes)
42 JMPREL 0x0000000000000568
43 PLTREL RELA
44 RELA 0x00000000000004d8
45 RELASZ 144 (bytes)
46 RELAENT 24 (bytes)
47 RELACOUNT 1
48 SYMTAB 0x0000000000000228
49 SYMENT 24 (bytes)
50 STRTAB 0x0000000000000360
51 STRSZ 190 (bytes)
52 GNU_HASH 0x0000000000000420
53 NEEDED Shared library: [libc.so.6]
54 NEEDED Shared library: [ld-linux-x86-64.so.2]
55 INIT 0x00000000000005b0
56 FINI 0x0000000000000748
57 VERSYM 0x0000000000000460
58 VERDEF 0x000000000000047c
59 VERDEFNUM 1
60 VERNEED 0x0000000000000498
61 VERNEEDNUM 2
62 NULL
63 NULL
64 NULL
65 NULL
66 NULL
67 NULL
68EOF
69
70exit 0