1#!/usr/local/bin/bash
2# Copyright (C) 2015 Red Hat, Inc.
3# This file is part of elfutils.
4#
5# 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.
9#
10# elfutils is distributed in the hope that it will be useful, but
11# WITHOUT ANY WARRANTY; without even the implied warranty of
12# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13# GNU General Public License for more details.
14#
15# 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/>.
17
18. $srcdir/test-subr.sh
19
20# A random 32bit and 64bit testfile
21testfiles testfile testfile10
22
23testrun_compare ${abs_top_builddir}/tests/zstrptr testfile <<\EOF
24Strings in section 32 (compressed):
25[0] ''
26[1] '.symtab'
27[9] '.strtab'
28[11] '.shstrtab'
29[1b] '.interp'
30[23] '.note.ABI-tag'
31[31] '.hash'
32[37] '.dynsym'
33[3f] '.dynstr'
34[47] '.gnu.version'
35[54] '.gnu.version_r'
36[63] '.rel.got'
37[6c] '.rel.plt'
38[75] '.init'
39[7b] '.plt'
40[80] '.text'
41[86] '.fini'
42[8c] '.rodata'
43[94] '.data'
44[9a] '.eh_frame'
45[a4] '.ctors'
46[ab] '.dtors'
47[b2] '.got'
48[b7] '.dynamic'
49[c0] '.sbss'
50[c6] '.bss'
51[cb] '.stab'
52[d1] '.stabstr'
53[da] '.comment'
54[e3] '.debug_aranges'
55[f2] '.debug_pubnames'
56[102] '.debug_info'
57[10e] '.debug_abbrev'
58[11c] '.debug_line'
59[128] '.note'
60Strings in section 32 (uncompressed):
61[0] ''
62[1] '.symtab'
63[9] '.strtab'
64[11] '.shstrtab'
65[1b] '.interp'
66[23] '.note.ABI-tag'
67[31] '.hash'
68[37] '.dynsym'
69[3f] '.dynstr'
70[47] '.gnu.version'
71[54] '.gnu.version_r'
72[63] '.rel.got'
73[6c] '.rel.plt'
74[75] '.init'
75[7b] '.plt'
76[80] '.text'
77[86] '.fini'
78[8c] '.rodata'
79[94] '.data'
80[9a] '.eh_frame'
81[a4] '.ctors'
82[ab] '.dtors'
83[b2] '.got'
84[b7] '.dynamic'
85[c0] '.sbss'
86[c6] '.bss'
87[cb] '.stab'
88[d1] '.stabstr'
89[da] '.comment'
90[e3] '.debug_aranges'
91[f2] '.debug_pubnames'
92[102] '.debug_info'
93[10e] '.debug_abbrev'
94[11c] '.debug_line'
95[128] '.note'
96EOF
97
98testrun_compare ${abs_top_builddir}/tests/zstrptr testfile10 <<\EOF
99Strings in section 30 (compressed):
100[0] ''
101[1] '.symtab'
102[9] '.strtab'
103[11] '.shstrtab'
104[1b] '.hash'
105[21] '.dynsym'
106[29] '.dynstr'
107[31] '.gnu.version'
108[3e] '.gnu.version_r'
109[4d] '.rela.dyn'
110[57] '.init'
111[5d] '.text'
112[63] '.fini'
113[69] '.eh_frame'
114[73] '.data'
115[79] '.dynamic'
116[82] '.ctors'
117[89] '.dtors'
118[90] '.jcr'
119[95] '.plt'
120[9a] '.got'
121[9f] '.sdata'
122[a6] '.sbss'
123[ac] '.bss'
124[b1] '.comment'
125[ba] '.debug_aranges'
126[c9] '.debug_pubnames'
127[d9] '.debug_abbrev'
128[e7] '.debug_line'
129[f3] '.debug_frame'
130[100] '.debug_str'
131[10b] '.rela.debug_info'
132Strings in section 30 (uncompressed):
133[0] ''
134[1] '.symtab'
135[9] '.strtab'
136[11] '.shstrtab'
137[1b] '.hash'
138[21] '.dynsym'
139[29] '.dynstr'
140[31] '.gnu.version'
141[3e] '.gnu.version_r'
142[4d] '.rela.dyn'
143[57] '.init'
144[5d] '.text'
145[63] '.fini'
146[69] '.eh_frame'
147[73] '.data'
148[79] '.dynamic'
149[82] '.ctors'
150[89] '.dtors'
151[90] '.jcr'
152[95] '.plt'
153[9a] '.got'
154[9f] '.sdata'
155[a6] '.sbss'
156[ac] '.bss'
157[b1] '.comment'
158[ba] '.debug_aranges'
159[c9] '.debug_pubnames'
160[d9] '.debug_abbrev'
161[e7] '.debug_line'
162[f3] '.debug_frame'
163[100] '.debug_str'
164[10b] '.rela.debug_info'
165EOF
166
167exit 0
168