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# See run-readelf-zdebug.sh for testfile.
21
22testfiles testfile-zdebug
23testrun_compare ${abs_top_builddir}/src/readelf -z -p.zdebug_str testfile-zdebug <<\EOF
24
25String section [35] '.zdebug_str' contains 2431 bytes (6433 uncompressed) at offset 0x1da3:
26  [     0]  UINT64_MAX 18446744073709551615UL
27  [    22]  __DBL_DENORM_MIN__ ((double)4.94065645841246544177e-324L)
28  [    5c]  __linux 1
29  [    66]  __SIZEOF_SIZE_T__ 8
30  [    7a]  __UINTPTR_TYPE__ long unsigned int
31  [    9d]  __SIZEOF_POINTER__ 8
32  [    b2]  __UINT8_MAX__ 255
33  [    c4]  __PTRDIFF_MAX__ 9223372036854775807L
34  [    e9]  __DEC64_MANT_DIG__ 16
35  [    ff]  __FLT_RADIX__ 2
36  [   10f]  __DEC32_MIN__ 1E-95DF
37  [   125]  __unix__ 1
38  [   130]  testfile-zdebug.c
39  [   142]  __UINT_LEAST64_MAX__ 18446744073709551615UL
40  [   16e]  __SIZEOF_WINT_T__ 4
41  [   182]  __LONG_MAX__ 9223372036854775807L
42  [   1a4]  __LDBL_MIN__ 3.36210314311209350626e-4932L
43  [   1cf]  __GCC_ATOMIC_SHORT_LOCK_FREE 2
44  [   1ee]  __LP64__ 1
45  [   1f9]  __UINT64_C(c) c ## UL
46  [   20f]  __DBL_HAS_INFINITY__ 1
47  [   226]  __SSE2_MATH__ 1
48  [   236]  __linux__ 1
49  [   242]  __STDC_HOSTED__ 1
50  [   254]  __WINT_MIN__ 0U
51  [   264]  __x86_64__ 1
52  [   271]  __UINT32_TYPE__ unsigned int
53  [   28e]  __UINT_LEAST8_MAX__ 255
54  [   2a6]  __DEC64_SUBNORMAL_MIN__ 0.000000000000001E-383DD
55  [   2d7]  __FLT_MAX__ 3.40282346638528859812e+38F
56  [   2ff]  long unsigned int
57  [   311]  __DBL_MANT_DIG__ 53
58  [   325]  linux 1
59  [   32d]  __DBL_HAS_QUIET_NAN__ 1
60  [   345]  __UINT8_TYPE__ unsigned char
61  [   362]  __DEC32_MAX_EXP__ 97
62  [   377]  __INT32_TYPE__ int
63  [   38a]  __SIG_ATOMIC_TYPE__ int
64  [   3a2]  __DEC64_MAX_EXP__ 385
65  [   3b8]  __DBL_MIN_EXP__ (-1021)
66  [   3d0]  _LP64 1
67  [   3d8]  __LDBL_HAS_INFINITY__ 1
68  [   3f0]  __INT_FAST64_TYPE__ long int
69  [   40d]  __gnu_linux__ 1
70  [   41d]  __GCC_ATOMIC_WCHAR_T_LOCK_FREE 2
71  [   43e]  __UINT_FAST64_TYPE__ long unsigned int
72  [   465]  __BYTE_ORDER__ __ORDER_LITTLE_ENDIAN__
73  [   48c]  __UINT16_MAX__ 65535
74  [   4a1]  __FLOAT_WORD_ORDER__ __ORDER_LITTLE_ENDIAN__
75  [   4ce]  __PRAGMA_REDEFINE_EXTNAME 1
76  [   4ea]  __INT_LEAST16_TYPE__ short int
77  [   509]  __k8__ 1
78  [   512]  __DECIMAL_DIG__ 21
79  [   525]  main
80  [   52a]  __DBL_MAX__ ((double)1.79769313486231570815e+308L)
81  [   55d]  __INT16_TYPE__ short int
82  [   576]  __LDBL_HAS_QUIET_NAN__ 1
83  [   58f]  __SIZEOF_DOUBLE__ 8
84  [   5a3]  __DEC32_SUBNORMAL_MIN__ 0.000001E-95DF
85  [   5ca]  __ATOMIC_SEQ_CST 5
86  [   5dd]  __UINT64_TYPE__ long unsigned int
87  [   5ff]  __INT_LEAST32_TYPE__ int
88  [   618]  __INT_LEAST64_MAX__ 9223372036854775807L
89  [   641]  __OPTIMIZE__ 1
90  [   650]  __INTMAX_C(c) c ## L
91  [   665]  __GCC_ATOMIC_CHAR32_T_LOCK_FREE 2
92  [   687]  __INT_FAST8_MAX__ 127
93  [   69d]  __PTRDIFF_TYPE__ long int
94  [   6b7]  __LDBL_MIN_EXP__ (-16381)
95  [   6d1]  __SIZEOF_LONG_LONG__ 8
96  [   6e8]  __FLT_DIG__ 6
97  [   6f6]  __UINTMAX_MAX__ 18446744073709551615UL
98  [   71d]  __SIZEOF_WCHAR_T__ 4
99  [   732]  __INT64_C(c) c ## L
100  [   746]  __UINTPTR_MAX__ 18446744073709551615UL
101  [   76d]  __FLT_MAX_10_EXP__ 38
102  [   783]  __FLT_MIN__ 1.17549435082228750797e-38F
103  [   7ab]  __UINT_LEAST64_TYPE__ long unsigned int
104  [   7d3]  __SIZEOF_LONG_DOUBLE__ 16
105  [   7ed]  __SIZE_MAX__ 18446744073709551615UL
106  [   811]  __INT8_C(c) c
107  [   81f]  __amd64__ 1
108  [   82b]  __INT_LEAST64_TYPE__ long int
109  [   849]  __INT_FAST64_MAX__ 9223372036854775807L
110  [   871]  __DEC_EVAL_METHOD__ 2
111  [   887]  __DEC32_MAX__ 9.999999E96DF
112  [   8a3]  __GNUC_MINOR__ 8
113  [   8b4]  __WCHAR_MAX__ 2147483647
114  [   8cd]  __SIZE_TYPE__ long unsigned int
115  [   8ed]  __INT8_MAX__ 127
116  [   8fe]  __INTMAX_MAX__ 9223372036854775807L
117  [   922]  __ATOMIC_HLE_RELEASE 131072
118  [   93e]  __FLT_HAS_QUIET_NAN__ 1
119  [   956]  __DBL_EPSILON__ ((double)2.22044604925031308085e-16L)
120  [   98c]  __FLT_MIN_EXP__ (-125)
121  [   9a3]  __INT_LEAST8_MAX__ 127
122  [   9ba]  __SIZEOF_INT128__ 16
123  [   9cf]  __INTPTR_MAX__ 9223372036854775807L
124  [   9f3]  __INTPTR_TYPE__ long int
125  [   a0c]  __LDBL_MIN_10_EXP__ (-4931)
126  [   a28]  __GCC_ATOMIC_POINTER_LOCK_FREE 2
127  [   a49]  __UINT_LEAST32_MAX__ 4294967295U
128  [   a6a]  __SIZEOF_SHORT__ 2
129  [   a7d]  __LDBL_MAX_10_EXP__ 4932
130  [   a96]  __INT16_C(c) c
131  [   aa5]  __MMX__ 1
132  [   aaf]  unix 1
133  [   ab6]  __FLT_MAX_EXP__ 128
134  [   aca]  __DEC64_MAX__ 9.999999999999999E384DD
135  [   af0]  __FLT_EPSILON__ 1.19209289550781250000e-7F
136  [   b1b]  __INT_FAST16_TYPE__ long int
137  [   b38]  __VERSION__ "4.8.2 20140120 (Red Hat 4.8.2-15)"
138  [   b68]  __GCC_ATOMIC_LLONG_LOCK_FREE 2
139  [   b87]  __DEC128_MIN_EXP__ (-6142)
140  [   ba2]  __ATOMIC_RELEASE 3
141  [   bb5]  __GNUC_PATCHLEVEL__ 2
142  [   bcb]  __UINT_FAST64_MAX__ 18446744073709551615UL
143  [   bf6]  __DBL_DECIMAL_DIG__ 17
144  [   c0d]  __DBL_DIG__ 15
145  [   c1c]  __FLT_MANT_DIG__ 24
146  [   c30]  __FLT_DECIMAL_DIG__ 9
147  [   c46]  __INT16_MAX__ 32767
148  [   c5a]  __DEC128_MIN__ 1E-6143DL
149  [   c73]  __BIGGEST_ALIGNMENT__ 16
150  [   c8c]  __INT64_MAX__ 9223372036854775807L
151  [   caf]  __INT_FAST32_TYPE__ long int
152  [   ccc]  __GCC_ATOMIC_INT_LOCK_FREE 2
153  [   ce9]  __DEC128_MAX_EXP__ 6145
154  [   d01]  __GCC_HAVE_SYNC_COMPARE_AND_SWAP_4 1
155  [   d26]  __FXSR__ 1
156  [   d31]  __INT8_TYPE__ signed char
157  [   d4b]  __ATOMIC_ACQ_REL 4
158  [   d5e]  __UINT_LEAST16_MAX__ 65535
159  [   d79]  __UINTMAX_TYPE__ long unsigned int
160  [   d9c]  __UINT_FAST8_MAX__ 255
161  [   db3]  __ORDER_BIG_ENDIAN__ 4321
162  [   dcd]  __INT_LEAST32_MAX__ 2147483647
163  [   dec]  __UINT_LEAST16_TYPE__ short unsigned int
164  [   e15]  __INT_FAST8_TYPE__ signed char
165  [   e34]  __DBL_MAX_EXP__ 1024
166  [   e49]  __STDC__ 1
167  [   e54]  __ELF__ 1
168  [   e5e]  __FLT_EVAL_METHOD__ 0
169  [   e74]  __ATOMIC_ACQUIRE 2
170  [   e87]  __DEC64_EPSILON__ 1E-15DD
171  [   ea1]  __INT32_MAX__ 2147483647
172  [   eba]  __GCC_ATOMIC_CHAR_LOCK_FREE 2
173  [   ed8]  __DEC128_EPSILON__ 1E-33DL
174  [   ef3]  __UINT_FAST8_TYPE__ unsigned char
175  [   f15]  __amd64 1
176  [   f1f]  __DEC32_MIN_EXP__ (-94)
177  [   f37]  __GCC_HAVE_DWARF2_CFI_ASM 1
178  [   f53]  __LDBL_DIG__ 18
179  [   f63]  __UINT32_MAX__ 4294967295U
180  [   f7e]  __GNUC_GNU_INLINE__ 1
181  [   f94]  __SSE2__ 1
182  [   f9f]  __ATOMIC_HLE_ACQUIRE 65536
183  [   fba]  __SSE_MATH__ 1
184  [   fc9]  __INT_FAST16_MAX__ 9223372036854775807L
185  [   ff1]  __LDBL_MAX__ 1.18973149535723176502e+4932L
186  [  101c]  __DBL_MIN__ ((double)2.22507385850720138309e-308L)
187  [  104f]  __DEC128_MANT_DIG__ 34
188  [  1066]  __INT32_C(c) c
189  [  1075]  __DEC64_MIN_EXP__ (-382)
190  [  108e]  __WCHAR_MIN__ (-__WCHAR_MAX__ - 1)
191  [  10b1]  __GCC_ATOMIC_CHAR16_T_LOCK_FREE 2
192  [  10d3]  __LDBL_MAX_EXP__ 16384
193  [  10ea]  __DEC32_MANT_DIG__ 7
194  [  10ff]  __DEC128_MAX__ 9.999999999999999999999999999999999E6144DL
195  [  1139]  __CHAR32_TYPE__ unsigned int
196  [  1156]  __INT_LEAST8_TYPE__ signed char
197  [  1176]  __UINT16_C(c) c
198  [  1186]  __GCC_ATOMIC_BOOL_LOCK_FREE 2
199  [  11a4]  __SIZEOF_FLOAT__ 4
200  [  11b7]  __GCC_HAVE_SYNC_COMPARE_AND_SWAP_8 1
201  [  11dc]  __DBL_MAX_10_EXP__ 308
202  [  11f3]  __LDBL_EPSILON__ 1.08420217248550443401e-19L
203  [  1220]  __ORDER_PDP_ENDIAN__ 3412
204  [  123a]  __ORDER_LITTLE_ENDIAN__ 1234
205  [  1257]  __WINT_TYPE__ unsigned int
206  [  1272]  __unix 1
207  [  127b]  __ATOMIC_RELAXED 0
208  [  128e]  __UINT_FAST32_MAX__ 18446744073709551615UL
209  [  12b9]  __INT_FAST32_MAX__ 9223372036854775807L
210  [  12e1]  __SIG_ATOMIC_MAX__ 2147483647
211  [  12ff]  __UINT_FAST32_TYPE__ long unsigned int
212  [  1326]  __INT_MAX__ 2147483647
213  [  133d]  __GXX_ABI_VERSION 1002
214  [  1354]  __SIZEOF_INT__ 4
215  [  1365]  char
216  [  136a]  __UINT_FAST16_TYPE__ long unsigned int
217  [  1391]  __LDBL_DENORM_MIN__ 3.64519953188247460253e-4951L
218  [  13c3]  __WINT_MAX__ 4294967295U
219  [  13dc]  __FLT_HAS_INFINITY__ 1
220  [  13f3]  __SHRT_MAX__ 32767
221  [  1406]  __INT_LEAST16_MAX__ 32767
222  [  1420]  __LONG_LONG_MAX__ 9223372036854775807LL
223  [  1448]  __SIZEOF_LONG__ 8
224  [  145a]  __INTMAX_TYPE__ long int
225  [  1473]  __LDBL_HAS_DENORM__ 1
226  [  1489]  __code_model_small__ 1
227  [  14a0]  __REGISTER_PREFIX__
228  [  14b5]  __ATOMIC_CONSUME 1
229  [  14c8]  __DEC128_SUBNORMAL_MIN__ 0.000000000000000000000000000000001E-6143DL
230  [  150d]  __GNUC__ 4
231  [  1518]  __UINT16_TYPE__ short unsigned int
232  [  153b]  __SSE__ 1
233  [  1545]  __UINT32_C(c) c ## U
234  [  155a]  __k8 1
235  [  1561]  __UINTMAX_C(c) c ## UL
236  [  1578]  __GCC_HAVE_SYNC_COMPARE_AND_SWAP_2 1
237  [  159d]  __SIZEOF_PTRDIFF_T__ 8
238  [  15b4]  __CHAR_BIT__ 8
239  [  15c3]  __SIG_ATOMIC_MIN__ (-__SIG_ATOMIC_MAX__ - 1)
240  [  15f0]  __DEC32_EPSILON__ 1E-6DF
241  [  1609]  __UINT_LEAST32_TYPE__ unsigned int
242  [  162c]  __DBL_HAS_DENORM__ 1
243  [  1641]  /tmp
244  [  1646]  __LDBL_MANT_DIG__ 64
245  [  165b]  __GCC_ATOMIC_LONG_LOCK_FREE 2
246  [  1679]  __DECIMAL_BID_FORMAT__ 1
247  [  1692]  __FLT_MIN_10_EXP__ (-37)
248  [  16ab]  __GCC_ATOMIC_TEST_AND_SET_TRUEVAL 1
249  [  16cf]  __WCHAR_TYPE__ int
250  [  16e2]  __FINITE_MATH_ONLY__ 0
251  [  16f9]  argc
252  [  16fe]  __USER_LABEL_PREFIX__
253  [  1715]  __CHAR16_TYPE__ short unsigned int
254  [  1738]  __UINT64_MAX__ 18446744073709551615UL
255  [  175e]  __UINT8_C(c) c
256  [  176d]  __x86_64 1
257  [  1778]  __UINT_LEAST8_TYPE__ unsigned char
258  [  179b]  __INT64_TYPE__ long int
259  [  17b3]  __GCC_HAVE_SYNC_COMPARE_AND_SWAP_1 1
260  [  17d8]  argv
261  [  17dd]  __GNUC_RH_RELEASE__ 15
262  [  17f4]  __UINT_FAST16_MAX__ 18446744073709551615UL
263  [  181f]  __FLT_HAS_DENORM__ 1
264  [  1834]  __DEC64_MIN__ 1E-383DD
265  [  184b]  __DBL_MIN_10_EXP__ (-307)
266  [  1865]  __FLT_DENORM_MIN__ 1.40129846432481707092e-45F
267  [  1894]  GNU C 4.8.2 20140120 (Red Hat 4.8.2-15) -mtune=generic -march=x86-64 -g3 -O3 -fuse-ld=gold -fno-asynchronous-unwind-tables
268  [  190f]  __SCHAR_MAX__ 127
269EOF
270
271exit 0
272