xref: /aosp_15_r20/external/elfutils/tests/run-readelf-str.sh (revision 7304104da70ce23c86437a01be71edd1a2d7f37e)
1*7304104dSAndroid Build Coastguard Worker#! /bin/sh
2*7304104dSAndroid Build Coastguard Worker# Copyright (C) 2018 Red Hat, Inc.
3*7304104dSAndroid Build Coastguard Worker# This file is part of elfutils.
4*7304104dSAndroid Build Coastguard Worker#
5*7304104dSAndroid Build Coastguard Worker# This file is free software; you can redistribute it and/or modify
6*7304104dSAndroid Build Coastguard Worker# it under the terms of the GNU General Public License as published by
7*7304104dSAndroid Build Coastguard Worker# the Free Software Foundation; either version 3 of the License, or
8*7304104dSAndroid Build Coastguard Worker# (at your option) any later version.
9*7304104dSAndroid Build Coastguard Worker#
10*7304104dSAndroid Build Coastguard Worker# elfutils is distributed in the hope that it will be useful, but
11*7304104dSAndroid Build Coastguard Worker# WITHOUT ANY WARRANTY; without even the implied warranty of
12*7304104dSAndroid Build Coastguard Worker# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13*7304104dSAndroid Build Coastguard Worker# GNU General Public License for more details.
14*7304104dSAndroid Build Coastguard Worker#
15*7304104dSAndroid Build Coastguard Worker# You should have received a copy of the GNU General Public License
16*7304104dSAndroid Build Coastguard Worker# along with this program.  If not, see <http://www.gnu.org/licenses/>.
17*7304104dSAndroid Build Coastguard Worker
18*7304104dSAndroid Build Coastguard Worker. $srcdir/test-subr.sh
19*7304104dSAndroid Build Coastguard Worker
20*7304104dSAndroid Build Coastguard Worker# See tests/testfile-dwarf-45.source
21*7304104dSAndroid Build Coastguard Workertestfiles testfile-splitdwarf-4 testfile-splitdwarf-5
22*7304104dSAndroid Build Coastguard Workertestfiles testfile-hello4.dwo testfile-hello5.dwo
23*7304104dSAndroid Build Coastguard Workertestfiles testfile-world4.dwo testfile-world5.dwo
24*7304104dSAndroid Build Coastguard Worker
25*7304104dSAndroid Build Coastguard Worker# DWARF4 GNU DebugFission No real table header.
26*7304104dSAndroid Build Coastguard Worker# We don't really need the skeleton, but we don't want any Warnings.
27*7304104dSAndroid Build Coastguard Workertestrun_compare ${abs_top_builddir}/src/readelf --dwarf-skeleton testfile-splitdwarf-4 --debug-dump=str testfile-hello4.dwo testfile-world4.dwo<<\EOF
28*7304104dSAndroid Build Coastguard Worker
29*7304104dSAndroid Build Coastguard Workertestfile-hello4.dwo:
30*7304104dSAndroid Build Coastguard Worker
31*7304104dSAndroid Build Coastguard Worker
32*7304104dSAndroid Build Coastguard WorkerDWARF section [ 5] '.debug_str_offsets.dwo' at offset 0x335:
33*7304104dSAndroid Build Coastguard WorkerTable at offset 0
34*7304104dSAndroid Build Coastguard Worker Offsets start at 0x0:
35*7304104dSAndroid Build Coastguard Worker [ 0] [       0]  "long long int"
36*7304104dSAndroid Build Coastguard Worker [ 1] [       e]  "frob"
37*7304104dSAndroid Build Coastguard Worker [ 2] [      13]  "long unsigned int"
38*7304104dSAndroid Build Coastguard Worker [ 3] [      25]  "/home/mark/src/elfutils/tests"
39*7304104dSAndroid Build Coastguard Worker [ 4] [      43]  "wchar_t"
40*7304104dSAndroid Build Coastguard Worker [ 5] [      4b]  "main"
41*7304104dSAndroid Build Coastguard Worker [ 6] [      50]  "long int"
42*7304104dSAndroid Build Coastguard Worker [ 7] [      59]  "GNU C17 9.0.0 20180515 (experimental) -mtune=generic -march=x86-64 -gdwarf-4 -gsplit-dwarf -gno-as-loc-support -gno-variable-location-views -O2"
43*7304104dSAndroid Build Coastguard Worker [ 8] [      e9]  "long double"
44*7304104dSAndroid Build Coastguard Worker [ 9] [      f5]  "hello.c"
45*7304104dSAndroid Build Coastguard Worker
46*7304104dSAndroid Build Coastguard Worker
47*7304104dSAndroid Build Coastguard WorkerDWARF section [ 6] '.debug_str.dwo' at offset 0x35d:
48*7304104dSAndroid Build Coastguard Worker Offset  String
49*7304104dSAndroid Build Coastguard Worker [   0]  "long long int"
50*7304104dSAndroid Build Coastguard Worker [   e]  "frob"
51*7304104dSAndroid Build Coastguard Worker [  13]  "long unsigned int"
52*7304104dSAndroid Build Coastguard Worker [  25]  "/home/mark/src/elfutils/tests"
53*7304104dSAndroid Build Coastguard Worker [  43]  "wchar_t"
54*7304104dSAndroid Build Coastguard Worker [  4b]  "main"
55*7304104dSAndroid Build Coastguard Worker [  50]  "long int"
56*7304104dSAndroid Build Coastguard Worker [  59]  "GNU C17 9.0.0 20180515 (experimental) -mtune=generic -march=x86-64 -gdwarf-4 -gsplit-dwarf -gno-as-loc-support -gno-variable-location-views -O2"
57*7304104dSAndroid Build Coastguard Worker [  e9]  "long double"
58*7304104dSAndroid Build Coastguard Worker [  f5]  "hello.c"
59*7304104dSAndroid Build Coastguard Worker
60*7304104dSAndroid Build Coastguard Workertestfile-world4.dwo:
61*7304104dSAndroid Build Coastguard Worker
62*7304104dSAndroid Build Coastguard Worker
63*7304104dSAndroid Build Coastguard WorkerDWARF section [ 5] '.debug_str_offsets.dwo' at offset 0x2e7:
64*7304104dSAndroid Build Coastguard WorkerTable at offset 0
65*7304104dSAndroid Build Coastguard Worker Offsets start at 0x0:
66*7304104dSAndroid Build Coastguard Worker [ 0] [       0]  "long long unsigned int"
67*7304104dSAndroid Build Coastguard Worker [ 1] [      17]  "/home/mark/src/elfutils/tests"
68*7304104dSAndroid Build Coastguard Worker [ 2] [      35]  "long long int"
69*7304104dSAndroid Build Coastguard Worker [ 3] [      43]  "signed char"
70*7304104dSAndroid Build Coastguard Worker [ 4] [      4f]  "long int"
71*7304104dSAndroid Build Coastguard Worker [ 5] [      58]  "world.c"
72*7304104dSAndroid Build Coastguard Worker [ 6] [      60]  "unsigned int"
73*7304104dSAndroid Build Coastguard Worker [ 7] [      6d]  "long unsigned int"
74*7304104dSAndroid Build Coastguard Worker [ 8] [      7f]  "short unsigned int"
75*7304104dSAndroid Build Coastguard Worker [ 9] [      92]  "frob"
76*7304104dSAndroid Build Coastguard Worker [10] [      97]  "calc"
77*7304104dSAndroid Build Coastguard Worker [11] [      9c]  "unsigned char"
78*7304104dSAndroid Build Coastguard Worker [12] [      aa]  "short int"
79*7304104dSAndroid Build Coastguard Worker [13] [      b4]  "exit"
80*7304104dSAndroid Build Coastguard Worker [14] [      b9]  "GNU C17 9.0.0 20180515 (experimental) -mtune=generic -march=x86-64 -gdwarf-4 -gsplit-dwarf -gno-as-loc-support -gno-variable-location-views -O2"
81*7304104dSAndroid Build Coastguard Worker [15] [     149]  "char"
82*7304104dSAndroid Build Coastguard Worker [16] [     14e]  "word"
83*7304104dSAndroid Build Coastguard Worker [17] [     153]  "argv"
84*7304104dSAndroid Build Coastguard Worker [18] [     158]  "argc"
85*7304104dSAndroid Build Coastguard Worker [19] [     15d]  "main"
86*7304104dSAndroid Build Coastguard Worker
87*7304104dSAndroid Build Coastguard Worker
88*7304104dSAndroid Build Coastguard WorkerDWARF section [ 6] '.debug_str.dwo' at offset 0x337:
89*7304104dSAndroid Build Coastguard Worker Offset  String
90*7304104dSAndroid Build Coastguard Worker [   0]  "long long unsigned int"
91*7304104dSAndroid Build Coastguard Worker [  17]  "/home/mark/src/elfutils/tests"
92*7304104dSAndroid Build Coastguard Worker [  35]  "long long int"
93*7304104dSAndroid Build Coastguard Worker [  43]  "signed char"
94*7304104dSAndroid Build Coastguard Worker [  4f]  "long int"
95*7304104dSAndroid Build Coastguard Worker [  58]  "world.c"
96*7304104dSAndroid Build Coastguard Worker [  60]  "unsigned int"
97*7304104dSAndroid Build Coastguard Worker [  6d]  "long unsigned int"
98*7304104dSAndroid Build Coastguard Worker [  7f]  "short unsigned int"
99*7304104dSAndroid Build Coastguard Worker [  92]  "frob"
100*7304104dSAndroid Build Coastguard Worker [  97]  "calc"
101*7304104dSAndroid Build Coastguard Worker [  9c]  "unsigned char"
102*7304104dSAndroid Build Coastguard Worker [  aa]  "short int"
103*7304104dSAndroid Build Coastguard Worker [  b4]  "exit"
104*7304104dSAndroid Build Coastguard Worker [  b9]  "GNU C17 9.0.0 20180515 (experimental) -mtune=generic -march=x86-64 -gdwarf-4 -gsplit-dwarf -gno-as-loc-support -gno-variable-location-views -O2"
105*7304104dSAndroid Build Coastguard Worker [ 149]  "char"
106*7304104dSAndroid Build Coastguard Worker [ 14e]  "word"
107*7304104dSAndroid Build Coastguard Worker [ 153]  "argv"
108*7304104dSAndroid Build Coastguard Worker [ 158]  "argc"
109*7304104dSAndroid Build Coastguard Worker [ 15d]  "main"
110*7304104dSAndroid Build Coastguard WorkerEOF
111*7304104dSAndroid Build Coastguard Worker
112*7304104dSAndroid Build Coastguard Worker# DWARF5 Real table header.
113*7304104dSAndroid Build Coastguard Worker# We don't really need the skeleton, but we don't want any Warnings.
114*7304104dSAndroid Build Coastguard Workertestrun_compare ${abs_top_builddir}/src/readelf --dwarf-skeleton testfile-splitdwarf-5 --debug-dump=str testfile-hello5.dwo testfile-world5.dwo<<\EOF
115*7304104dSAndroid Build Coastguard Worker
116*7304104dSAndroid Build Coastguard Workertestfile-hello5.dwo:
117*7304104dSAndroid Build Coastguard Worker
118*7304104dSAndroid Build Coastguard Worker
119*7304104dSAndroid Build Coastguard WorkerDWARF section [ 5] '.debug_str_offsets.dwo' at offset 0x353:
120*7304104dSAndroid Build Coastguard WorkerTable at offset 0
121*7304104dSAndroid Build Coastguard Worker
122*7304104dSAndroid Build Coastguard Worker Length:              44
123*7304104dSAndroid Build Coastguard Worker Offset size:          4
124*7304104dSAndroid Build Coastguard Worker DWARF version:        5
125*7304104dSAndroid Build Coastguard Worker Padding:              0
126*7304104dSAndroid Build Coastguard Worker
127*7304104dSAndroid Build Coastguard Worker Offsets start at 0x8:
128*7304104dSAndroid Build Coastguard Worker [ 0] [       0]  "long long int"
129*7304104dSAndroid Build Coastguard Worker [ 1] [       e]  "frob"
130*7304104dSAndroid Build Coastguard Worker [ 2] [      13]  "long unsigned int"
131*7304104dSAndroid Build Coastguard Worker [ 3] [      25]  "/home/mark/src/elfutils/tests"
132*7304104dSAndroid Build Coastguard Worker [ 4] [      43]  "wchar_t"
133*7304104dSAndroid Build Coastguard Worker [ 5] [      4b]  "main"
134*7304104dSAndroid Build Coastguard Worker [ 6] [      50]  "long int"
135*7304104dSAndroid Build Coastguard Worker [ 7] [      59]  "GNU C17 9.0.0 20180515 (experimental) -mtune=generic -march=x86-64 -gdwarf-5 -gsplit-dwarf -gno-as-loc-support -gno-variable-location-views -O2"
136*7304104dSAndroid Build Coastguard Worker [ 8] [      e9]  "long double"
137*7304104dSAndroid Build Coastguard Worker [ 9] [      f5]  "hello.c"
138*7304104dSAndroid Build Coastguard Worker
139*7304104dSAndroid Build Coastguard Worker
140*7304104dSAndroid Build Coastguard WorkerDWARF section [ 6] '.debug_str.dwo' at offset 0x383:
141*7304104dSAndroid Build Coastguard Worker Offset  String
142*7304104dSAndroid Build Coastguard Worker [   0]  "long long int"
143*7304104dSAndroid Build Coastguard Worker [   e]  "frob"
144*7304104dSAndroid Build Coastguard Worker [  13]  "long unsigned int"
145*7304104dSAndroid Build Coastguard Worker [  25]  "/home/mark/src/elfutils/tests"
146*7304104dSAndroid Build Coastguard Worker [  43]  "wchar_t"
147*7304104dSAndroid Build Coastguard Worker [  4b]  "main"
148*7304104dSAndroid Build Coastguard Worker [  50]  "long int"
149*7304104dSAndroid Build Coastguard Worker [  59]  "GNU C17 9.0.0 20180515 (experimental) -mtune=generic -march=x86-64 -gdwarf-5 -gsplit-dwarf -gno-as-loc-support -gno-variable-location-views -O2"
150*7304104dSAndroid Build Coastguard Worker [  e9]  "long double"
151*7304104dSAndroid Build Coastguard Worker [  f5]  "hello.c"
152*7304104dSAndroid Build Coastguard Worker
153*7304104dSAndroid Build Coastguard Workertestfile-world5.dwo:
154*7304104dSAndroid Build Coastguard Worker
155*7304104dSAndroid Build Coastguard Worker
156*7304104dSAndroid Build Coastguard WorkerDWARF section [ 5] '.debug_str_offsets.dwo' at offset 0x313:
157*7304104dSAndroid Build Coastguard WorkerTable at offset 0
158*7304104dSAndroid Build Coastguard Worker
159*7304104dSAndroid Build Coastguard Worker Length:              84
160*7304104dSAndroid Build Coastguard Worker Offset size:          4
161*7304104dSAndroid Build Coastguard Worker DWARF version:        5
162*7304104dSAndroid Build Coastguard Worker Padding:              0
163*7304104dSAndroid Build Coastguard Worker
164*7304104dSAndroid Build Coastguard Worker Offsets start at 0x8:
165*7304104dSAndroid Build Coastguard Worker [ 0] [       0]  "long long unsigned int"
166*7304104dSAndroid Build Coastguard Worker [ 1] [      17]  "GNU C17 9.0.0 20180515 (experimental) -mtune=generic -march=x86-64 -gdwarf-5 -gsplit-dwarf -gno-as-loc-support -gno-variable-location-views -O2"
167*7304104dSAndroid Build Coastguard Worker [ 2] [      a7]  "/home/mark/src/elfutils/tests"
168*7304104dSAndroid Build Coastguard Worker [ 3] [      c5]  "long long int"
169*7304104dSAndroid Build Coastguard Worker [ 4] [      d3]  "signed char"
170*7304104dSAndroid Build Coastguard Worker [ 5] [      df]  "long int"
171*7304104dSAndroid Build Coastguard Worker [ 6] [      e8]  "world.c"
172*7304104dSAndroid Build Coastguard Worker [ 7] [      f0]  "unsigned int"
173*7304104dSAndroid Build Coastguard Worker [ 8] [      fd]  "long unsigned int"
174*7304104dSAndroid Build Coastguard Worker [ 9] [     10f]  "short unsigned int"
175*7304104dSAndroid Build Coastguard Worker [10] [     122]  "frob"
176*7304104dSAndroid Build Coastguard Worker [11] [     127]  "calc"
177*7304104dSAndroid Build Coastguard Worker [12] [     12c]  "unsigned char"
178*7304104dSAndroid Build Coastguard Worker [13] [     13a]  "short int"
179*7304104dSAndroid Build Coastguard Worker [14] [     144]  "exit"
180*7304104dSAndroid Build Coastguard Worker [15] [     149]  "char"
181*7304104dSAndroid Build Coastguard Worker [16] [     14e]  "word"
182*7304104dSAndroid Build Coastguard Worker [17] [     153]  "argv"
183*7304104dSAndroid Build Coastguard Worker [18] [     158]  "argc"
184*7304104dSAndroid Build Coastguard Worker [19] [     15d]  "main"
185*7304104dSAndroid Build Coastguard Worker
186*7304104dSAndroid Build Coastguard Worker
187*7304104dSAndroid Build Coastguard WorkerDWARF section [ 6] '.debug_str.dwo' at offset 0x36b:
188*7304104dSAndroid Build Coastguard Worker Offset  String
189*7304104dSAndroid Build Coastguard Worker [   0]  "long long unsigned int"
190*7304104dSAndroid Build Coastguard Worker [  17]  "GNU C17 9.0.0 20180515 (experimental) -mtune=generic -march=x86-64 -gdwarf-5 -gsplit-dwarf -gno-as-loc-support -gno-variable-location-views -O2"
191*7304104dSAndroid Build Coastguard Worker [  a7]  "/home/mark/src/elfutils/tests"
192*7304104dSAndroid Build Coastguard Worker [  c5]  "long long int"
193*7304104dSAndroid Build Coastguard Worker [  d3]  "signed char"
194*7304104dSAndroid Build Coastguard Worker [  df]  "long int"
195*7304104dSAndroid Build Coastguard Worker [  e8]  "world.c"
196*7304104dSAndroid Build Coastguard Worker [  f0]  "unsigned int"
197*7304104dSAndroid Build Coastguard Worker [  fd]  "long unsigned int"
198*7304104dSAndroid Build Coastguard Worker [ 10f]  "short unsigned int"
199*7304104dSAndroid Build Coastguard Worker [ 122]  "frob"
200*7304104dSAndroid Build Coastguard Worker [ 127]  "calc"
201*7304104dSAndroid Build Coastguard Worker [ 12c]  "unsigned char"
202*7304104dSAndroid Build Coastguard Worker [ 13a]  "short int"
203*7304104dSAndroid Build Coastguard Worker [ 144]  "exit"
204*7304104dSAndroid Build Coastguard Worker [ 149]  "char"
205*7304104dSAndroid Build Coastguard Worker [ 14e]  "word"
206*7304104dSAndroid Build Coastguard Worker [ 153]  "argv"
207*7304104dSAndroid Build Coastguard Worker [ 158]  "argc"
208*7304104dSAndroid Build Coastguard Worker [ 15d]  "main"
209*7304104dSAndroid Build Coastguard WorkerEOF
210*7304104dSAndroid Build Coastguard Worker
211*7304104dSAndroid Build Coastguard Workerexit 0
212