1#! /bin/sh
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/strptr testfile <<\EOF
24Strings in section 32:
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'
60EOF
61
62testrun_compare ${abs_top_builddir}/tests/strptr testfile10 <<\EOF
63Strings in section 30:
64[0] ''
65[1] '.symtab'
66[9] '.strtab'
67[11] '.shstrtab'
68[1b] '.hash'
69[21] '.dynsym'
70[29] '.dynstr'
71[31] '.gnu.version'
72[3e] '.gnu.version_r'
73[4d] '.rela.dyn'
74[57] '.init'
75[5d] '.text'
76[63] '.fini'
77[69] '.eh_frame'
78[73] '.data'
79[79] '.dynamic'
80[82] '.ctors'
81[89] '.dtors'
82[90] '.jcr'
83[95] '.plt'
84[9a] '.got'
85[9f] '.sdata'
86[a6] '.sbss'
87[ac] '.bss'
88[b1] '.comment'
89[ba] '.debug_aranges'
90[c9] '.debug_pubnames'
91[d9] '.debug_abbrev'
92[e7] '.debug_line'
93[f3] '.debug_frame'
94[100] '.debug_str'
95[10b] '.rela.debug_info'
96EOF
97
98exit 0
99