1#!/usr/local/bin/bash
2# Copyright (C) 2005, 2006, 2008 Red Hat, Inc.
3# This file is part of elfutils.
4# Written by Ulrich Drepper <drepper@redhat.com>, 2005.
5#
6# This file is free software; you can redistribute it and/or modify
7# it under the terms of the GNU General Public License as published by
8# the Free Software Foundation; either version 3 of the License, or
9# (at your option) any later version.
10#
11# elfutils is distributed in the hope that it will be useful, but
12# WITHOUT ANY WARRANTY; without even the implied warranty of
13# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14# GNU General Public License for more details.
15#
16# You should have received a copy of the GNU General Public License
17# along with this program.  If not, see <http://www.gnu.org/licenses/>.
18
19. $srcdir/test-subr.sh
20
21files="testfile `seq 2 9 | while read n; do echo testfile$n; done`"
22testfiles $files
23
24testrun_compare ${abs_top_builddir}/src/strings -tx -f $files <<\EOF
25testfile:      f4 /lib/ld-linux.so.2
26testfile:     1c9 __gmon_start__
27testfile:     1d8 libc.so.6
28testfile:     1e2 __cxa_finalize
29testfile:     1f1 __deregister_frame_info
30testfile:     209 _IO_stdin_used
31testfile:     218 __libc_start_main
32testfile:     22a __register_frame_info
33testfile:     240 GLIBC_2.1.3
34testfile:     24c GLIBC_2.0
35testfile:     338 PTRh
36testfile:     345 QVh,
37testfile2:     114 /lib/ld.so.1
38testfile2:     1f1 __gmon_start__
39testfile2:     200 __deregister_frame_info
40testfile2:     218 __register_frame_info
41testfile2:     22e libc.so.6
42testfile2:     238 __cxa_finalize
43testfile2:     247 _IO_stdin_used
44testfile2:     256 __libc_start_main
45testfile2:     268 GLIBC_2.1.3
46testfile2:     274 GLIBC_2.0
47testfile2:     488 }a[xN
48testfile2:     4a8 }a[xN
49testfile2:     50c }a[xN
50testfile2:     540 }?Kx
51testfile3:      f4 /lib/ld-linux.so.2
52testfile3:     1c9 __gmon_start__
53testfile3:     1d8 libc.so.6
54testfile3:     1e2 __cxa_finalize
55testfile3:     1f1 __deregister_frame_info
56testfile3:     209 _IO_stdin_used
57testfile3:     218 __libc_start_main
58testfile3:     22a __register_frame_info
59testfile3:     240 GLIBC_2.1.3
60testfile3:     24c GLIBC_2.0
61testfile3:     338 PTRh
62testfile3:     345 QVh,
63testfile4:      f4 /lib/ld-linux.so.2
64testfile4:     8e1 __gmon_start__
65testfile4:     8f0 __terminate_func
66testfile4:     901 stderr
67testfile4:     908 __tf9type_info
68testfile4:     917 __tf16__user_type_info
69testfile4:     92e __tf19__pointer_type_info
70testfile4:     948 __tf16__attr_type_info
71testfile4:     95f __tf16__func_type_info
72testfile4:     976 __vt_9type_info
73testfile4:     986 __vt_19__pointer_type_info
74testfile4:     9a1 __vt_16__attr_type_info
75testfile4:     9b9 __vt_16__func_type_info
76testfile4:     9d1 __vt_16__ptmf_type_info
77testfile4:     9e9 __vt_16__ptmd_type_info
78testfile4:     a01 __vt_17__array_type_info
79testfile4:     a1a __tiv
80testfile4:     a20 __vt_19__builtin_type_info
81testfile4:     a3b __tix
82testfile4:     a41 __til
83testfile4:     a47 __tii
84testfile4:     a4d __tis
85testfile4:     a53 __tib
86testfile4:     a59 __tic
87testfile4:     a5f __tiw
88testfile4:     a65 __tir
89testfile4:     a6b __tid
90testfile4:     a71 __tif
91testfile4:     a77 __tiUi
92testfile4:     a7e __tiUl
93testfile4:     a85 __tiUx
94testfile4:     a8c __tiUs
95testfile4:     a93 __tiUc
96testfile4:     a9a __tiSc
97testfile4:     aa1 __ti19__pointer_type_info
98testfile4:     abb __ti9type_info
99testfile4:     aca __ti16__attr_type_info
100testfile4:     ae1 __ti19__builtin_type_info
101testfile4:     afb __ti16__func_type_info
102testfile4:     b12 __ti16__ptmf_type_info
103testfile4:     b29 __ti16__ptmd_type_info
104testfile4:     b40 __ti17__array_type_info
105testfile4:     b58 __cplus_type_matcher
106testfile4:     b6d __vt_13bad_exception
107testfile4:     b82 __vt_9exception
108testfile4:     b92 _._13bad_exception
109testfile4:     ba5 __vt_8bad_cast
110testfile4:     bb4 _._8bad_cast
111testfile4:     bc1 __vt_10bad_typeid
112testfile4:     bd3 _._10bad_typeid
113testfile4:     be3 __ti9exception
114testfile4:     bf2 __ti13bad_exception
115testfile4:     c06 __vt_16__user_type_info
116testfile4:     c1e __vt_17__class_type_info
117testfile4:     c37 __vt_14__si_type_info
118testfile4:     c4d __ti8bad_cast
119testfile4:     c5b __ti10bad_typeid
120testfile4:     c6c __ti16__user_type_info
121testfile4:     c83 __ti14__si_type_info
122testfile4:     c98 __ti17__class_type_info
123testfile4:     cb0 libc.so.6
124testfile4:     cba __register_frame
125testfile4:     ccb pthread_create
126testfile4:     cda pthread_getspecific
127testfile4:     cee pthread_key_delete
128testfile4:     d01 __cxa_finalize
129testfile4:     d10 malloc
130testfile4:     d17 __frame_state_for
131testfile4:     d29 abort
132testfile4:     d2f __register_frame_table
133testfile4:     d46 fprintf
134testfile4:     d4e pthread_once
135testfile4:     d5b __deregister_frame_info
136testfile4:     d73 pthread_key_create
137testfile4:     d86 memset
138testfile4:     d8d strcmp
139testfile4:     d94 pthread_mutex_unlock
140testfile4:     da9 __deregister_frame
141testfile4:     dbc pthread_mutex_lock
142testfile4:     dcf _IO_stdin_used
143testfile4:     dde __libc_start_main
144testfile4:     df0 strlen
145testfile4:     df7 __register_frame_info_table
146testfile4:     e13 __register_frame_info
147testfile4:     e29 pthread_setspecific
148testfile4:     e3d free
149testfile4:     e42 GLIBC_2.1.3
150testfile4:     e4e GLIBC_2.0
151testfile4:    1308 PTRh<
152testfile4:    194b [^_]
153testfile4:    19bf [^_]
154testfile4:    1dd9 wT9L>
155testfile4:    1f3b [^_]
156testfile4:    1fae [^_]
157testfile4:    21c1 BZQRP
158testfile4:    237f [^_]
159testfile4:    2431 JWRV
160testfile4:    2454 [^_]
161testfile4:    2506 JWRV
162testfile4:    2529 [^_]
163testfile4:    2b6c [^_]
164testfile4:    2b9d ZYPV
165testfile4:    2c28 [^_]
166testfile4:    2c4d ZYPV
167testfile4:    2ce2 [^_]
168testfile4:    2dfb X^_]
169testfile4:    2fc8 [^_]
170testfile4:    307d tq;F
171testfile4:    315a [^_]
172testfile4:    31a5 :zt	1
173testfile4:    3238 [^_]
174testfile4:    32f8 AXY_VR
175testfile4:    334a [^_]
176testfile4:    37ab [^_]
177testfile4:    38b8 sU;E
178testfile4:    38f2 QRPV
179testfile4:    3926 [^_]
180testfile4:    3bfe QRWP
181testfile4:    3e65 [^_]
182testfile4:    4136 [^_]
183testfile4:    472d [^_]
184testfile4:    47a5 0[^_]
185testfile4:    48ab [^_]
186testfile4:    4ab1 _ZPV
187testfile4:    4b53 _ZPV
188testfile4:    4bd3 _ZPV
189testfile4:    4e05 PQWj
190testfile4:    4f75 [^_]
191testfile4:    4f9b u$;E u
192testfile4:    4feb [^_]
193testfile4:    5080 [^_]
194testfile4:    50a8 }$9u
195testfile4:    5149 [^_]
196testfile4:    51b0 [^_]
197testfile4:    539b [^_]
198testfile4:    53b5 E 9E
199testfile4:    540d x!)E
200testfile4:    5598 U$	B
201testfile4:    571c [^_]
202testfile4:    5819 [^_]
203testfile4:    5922 [^_]
204testfile4:    59c2 [^_]
205testfile4:    5a62 [^_]
206testfile4:    5b02 [^_]
207testfile4:    5ba2 [^_]
208testfile4:    5c42 [^_]
209testfile4:    5ce2 [^_]
210testfile4:    6112 [^_]
211testfile4:    62bb [^_]
212testfile4:    639b [^_]
213testfile4:    6436 [^_]
214testfile4:    6468 val is zero
215testfile4:    6480 Internal Compiler Bug: No runtime type matcher.
216testfile4:    64dc 19__pointer_type_info
217testfile4:    64f2 16__attr_type_info
218testfile4:    6505 19__builtin_type_info
219testfile4:    651b 16__func_type_info
220testfile4:    652e 16__ptmf_type_info
221testfile4:    6541 16__ptmd_type_info
222testfile4:    6554 17__array_type_info
223testfile4:    6568 9exception
224testfile4:    6573 13bad_exception
225testfile4:    6583 9type_info
226testfile4:    658e 8bad_cast
227testfile4:    6598 10bad_typeid
228testfile4:    65a5 16__user_type_info
229testfile4:    65b8 14__si_type_info
230testfile4:    65c9 17__class_type_info
231testfile4:    6fc1 H. $
232testfile5:      f4 /lib/ld-linux.so.2
233testfile5:     1c9 __gmon_start__
234testfile5:     1d8 libc.so.6
235testfile5:     1e2 __cxa_finalize
236testfile5:     1f1 __deregister_frame_info
237testfile5:     209 _IO_stdin_used
238testfile5:     218 __libc_start_main
239testfile5:     22a __register_frame_info
240testfile5:     240 GLIBC_2.1.3
241testfile5:     24c GLIBC_2.0
242testfile5:     338 PTRh
243testfile5:     345 QVhD
244testfile6:     114 /lib/ld-linux.so.2
245testfile6:     3d9 libstdc++.so.5
246testfile6:     3e8 _ZTVSt16invalid_argument
247testfile6:     401 _ZNSaIcEC1Ev
248testfile6:     40e _ZTSSt16invalid_argument
249testfile6:     427 _ZTVN10__cxxabiv120__si_class_type_infoE
250testfile6:     450 _ZNSsD1Ev
251testfile6:     45a _ZdlPv
252testfile6:     461 __cxa_end_catch
253testfile6:     471 __gxx_personality_v0
254testfile6:     486 _ZTISt9exception
255testfile6:     497 _ZNSaIcED1Ev
256testfile6:     4a4 _ZTISt11logic_error
257testfile6:     4b8 _ZNSt16invalid_argumentD1Ev
258testfile6:     4d4 _ZTVN10__cxxabiv117__class_type_infoE
259testfile6:     4fa __cxa_throw
260testfile6:     506 _ZNSt16invalid_argumentC1ERKSs
261testfile6:     525 _ZNSsC1EPKcRKSaIcE
262testfile6:     538 _ZNSt11logic_errorD2Ev
263testfile6:     54f _ZTVN10__cxxabiv121__vmi_class_type_infoE
264testfile6:     579 _ZNSt16invalid_argumentD0Ev
265testfile6:     595 __cxa_begin_catch
266testfile6:     5a7 __cxa_allocate_exception
267testfile6:     5c0 _ZNKSt11logic_error4whatEv
268testfile6:     5db _Jv_RegisterClasses
269testfile6:     5ef _ZTISt16invalid_argument
270testfile6:     608 __gmon_start__
271testfile6:     617 libm.so.6
272testfile6:     621 _IO_stdin_used
273testfile6:     630 libgcc_s.so.1
274testfile6:     63e _Unwind_Resume
275testfile6:     64d libc.so.6
276testfile6:     657 __libc_start_main
277testfile6:     669 GCC_3.0
278testfile6:     671 GLIBC_2.0
279testfile6:     67b GLIBCPP_3.2
280testfile6:     687 CXXABI_1.2
281testfile6:     908 PTRh
282testfile6:     e48 gdb.1
283testfile6:     ec8 N10__gnu_test9gnu_obj_1E
284testfile6:     ee1 N10__gnu_test9gnu_obj_2IiEE
285testfile6:     efd N10__gnu_test9gnu_obj_2IlEE
286testfile6:     f19 St16invalid_argument
287testfile7:     114 /lib/ld-linux.so.2
288testfile7:     3d9 libstdc++.so.5
289testfile7:     3e8 _ZTVSt16invalid_argument
290testfile7:     401 _ZNSaIcEC1Ev
291testfile7:     40e _ZTSSt16invalid_argument
292testfile7:     427 _ZTVN10__cxxabiv120__si_class_type_infoE
293testfile7:     450 _ZNSsD1Ev
294testfile7:     45a _ZdlPv
295testfile7:     461 __cxa_end_catch
296testfile7:     471 __gxx_personality_v0
297testfile7:     486 _ZTISt9exception
298testfile7:     497 _ZNSaIcED1Ev
299testfile7:     4a4 _ZTISt11logic_error
300testfile7:     4b8 _ZNSt16invalid_argumentD1Ev
301testfile7:     4d4 _ZTVN10__cxxabiv117__class_type_infoE
302testfile7:     4fa __cxa_throw
303testfile7:     506 _ZNSt16invalid_argumentC1ERKSs
304testfile7:     525 _ZNSsC1EPKcRKSaIcE
305testfile7:     538 _ZNSt11logic_errorD2Ev
306testfile7:     54f _ZTVN10__cxxabiv121__vmi_class_type_infoE
307testfile7:     579 _ZNSt16invalid_argumentD0Ev
308testfile7:     595 __cxa_begin_catch
309testfile7:     5a7 __cxa_allocate_exception
310testfile7:     5c0 _ZNKSt11logic_error4whatEv
311testfile7:     5db _Jv_RegisterClasses
312testfile7:     5ef _ZTISt16invalid_argument
313testfile7:     608 __gmon_start__
314testfile7:     617 libm.so.6
315testfile7:     621 _IO_stdin_used
316testfile7:     630 libgcc_s.so.1
317testfile7:     63e _Unwind_Resume
318testfile7:     64d libc.so.6
319testfile7:     657 __libc_start_main
320testfile7:     669 GCC_3.0
321testfile7:     671 GLIBC_2.0
322testfile7:     67b GLIBCPP_3.2
323testfile7:     687 CXXABI_1.2
324testfile7:     908 PTRh
325testfile7:     e48 gdb.1
326testfile7:     ec8 N10__gnu_test9gnu_obj_1E
327testfile7:     ee1 N10__gnu_test9gnu_obj_2IiEE
328testfile7:     efd N10__gnu_test9gnu_obj_2IlEE
329testfile7:     f19 St16invalid_argument
330testfile8:      79 XZh;
331testfile8:      87 YXh<
332testfile8:     14f SQh[
333testfile8:     259 t5Wj
334testfile8:     502 WRVQ
335testfile8:    1fe7 ZYPj
336testfile8:    2115 u'Pj
337testfile8:    7bba FILE
338testfile8:    7bbf preserve-dates
339testfile8:    7bce remove-comment
340testfile8:    7bdd Remove .comment section
341testfile8:    7bf6 ${prefix}/share
342testfile8:    7c06 elfutils
343testfile8:    7c0f a.out
344testfile8:    7c15 0.58
345testfile8:    7c1a strip (Red Hat %s) %s
346testfile8:    7c31 2002
347testfile8:    7c36 Ulrich Drepper
348testfile8:    7c45 Written by %s.
349testfile8:    7c55 cannot stat input file "%s"
350testfile8:    7c71 %s: INTERNAL ERROR: %s
351testfile8:    7c88 while opening "%s"
352testfile8:    7c9b handle_elf
353testfile8:    7ca6 ../../src/strip.c
354testfile8:    7cb8 shdr_info[cnt].group_idx != 0
355testfile8:    7cd6 illformed file `%s'
356testfile8:    7cea elf_ndxscn (scn) == cnt
357testfile8:    7d02 .shstrtab
358testfile8:    7d0c while writing `%s': %s
359testfile8:    7d23 ((sym->st_info) & 0xf) == 3
360testfile8:    7d3f shndxdata != ((void *)0)
361testfile8:    7d58 scn != ((void *)0)
362testfile8:    7d6b .gnu_debuglink
363testfile8:    7d7a .comment
364testfile8:    7d83 cannot open `%s'
365testfile8:    7da0 Place stripped output into FILE
366testfile8:    7dc0 Extract the removed sections into FILE
367testfile8:    7e00 Copy modified/access timestamps to the output
368testfile8:    7e40 Only one input file allowed together with '-o' and '-f'
369testfile8:    7e80 Copyright (C) %s Red Hat, Inc.
370testfile8:    7e9f This is free software; see the source for copying conditions.  There is NO
371testfile8:    7eea warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
372testfile8:    7f40 Report bugs to <drepper@redhat.com>.
373testfile8:    7f80 %s: File format not recognized
374testfile8:    7fa0 cannot set access and modification date of "%s"
375testfile8:    7fe0 cannot create new file `%s': %s
376testfile8:    8000 error while finishing `%s': %s
377testfile8:    8020 shdr_info[shdr_info[cnt].shdr.sh_link].version_idx == 0
378testfile8:    8060 shdr_info[shdr_info[cnt].shdr.sh_link].symtab_idx == 0
379testfile8:    80a0 %s: error while creating ELF header: %s
380testfile8:    80e0 %s: error while reading the file: %s
381testfile8:    8120 sec < 0xff00 || shndxdata != ((void *)0)
382testfile8:    8160 (versiondata->d_size / sizeof (GElf_Versym)) >= shdr_info[cnt].data->d_size / elsize
383testfile8:    81c0 shdr_info[cnt].shdr.sh_type == 11
384testfile8:    8200 (versiondata->d_size / sizeof (Elf32_Word)) >= shdr_info[cnt].data->d_size / elsize
385testfile8:    8260 shdr_info[cnt].shdr.sh_type == 18
386testfile8:    82a0 shdr_info[cnt].data != ((void *)0)
387testfile8:    82e0 elf_ndxscn (shdr_info[cnt].newscn) == idx
388testfile8:    8320 while create section header section: %s
389testfile8:    8360 cannot allocate section data: %s
390testfile8:    83a0 elf_ndxscn (shdr_info[cnt].newscn) == shdr_info[cnt].idx
391testfile8:    83e0 while generating output file: %s
392testfile8:    8420 while preparing output for `%s'
393testfile8:    8440 shdr_info[cnt].shdr.sh_type == 2
394testfile8:    8480 shdr_info[idx].data != ((void *)0)
395testfile8:    84c0 cannot determine number of sections: %s
396testfile8:    8500 cannot get section header string table index
397testfile8:    85c0 Discard symbols from object files.
398testfile8:    85e3 [FILE...]
399testfile9:      79 XZh;
400testfile9:      87 YXh<
401testfile9:     14f SQh[
402testfile9:     259 t5Wj
403testfile9:     502 WRVQ
404testfile9:    1fe7 ZYPj
405testfile9:    2115 u'Pj
406testfile9:    3414 FILE
407testfile9:    3419 preserve-dates
408testfile9:    3428 remove-comment
409testfile9:    3437 Remove .comment section
410testfile9:    3450 ${prefix}/share
411testfile9:    3460 elfutils
412testfile9:    3469 a.out
413testfile9:    346f 0.58
414testfile9:    3474 strip (Red Hat %s) %s
415testfile9:    348b 2002
416testfile9:    3490 Ulrich Drepper
417testfile9:    349f Written by %s.
418testfile9:    34af cannot stat input file "%s"
419testfile9:    34cb %s: INTERNAL ERROR: %s
420testfile9:    34e2 while opening "%s"
421testfile9:    34f5 handle_elf
422testfile9:    3500 ../../src/strip.c
423testfile9:    3512 shdr_info[cnt].group_idx != 0
424testfile9:    3530 illformed file `%s'
425testfile9:    3544 elf_ndxscn (scn) == cnt
426testfile9:    355c .shstrtab
427testfile9:    3566 while writing `%s': %s
428testfile9:    357d ((sym->st_info) & 0xf) == 3
429testfile9:    3599 shndxdata != ((void *)0)
430testfile9:    35b2 scn != ((void *)0)
431testfile9:    35c5 .gnu_debuglink
432testfile9:    35d4 .comment
433testfile9:    35dd cannot open `%s'
434testfile9:    3600 Place stripped output into FILE
435testfile9:    3620 Extract the removed sections into FILE
436testfile9:    3660 Copy modified/access timestamps to the output
437testfile9:    36a0 Only one input file allowed together with '-o' and '-f'
438testfile9:    36e0 Copyright (C) %s Red Hat, Inc.
439testfile9:    36ff This is free software; see the source for copying conditions.  There is NO
440testfile9:    374a warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
441testfile9:    37a0 Report bugs to <drepper@redhat.com>.
442testfile9:    37e0 %s: File format not recognized
443testfile9:    3800 cannot set access and modification date of "%s"
444testfile9:    3840 cannot create new file `%s': %s
445testfile9:    3860 error while finishing `%s': %s
446testfile9:    3880 shdr_info[shdr_info[cnt].shdr.sh_link].version_idx == 0
447testfile9:    38c0 shdr_info[shdr_info[cnt].shdr.sh_link].symtab_idx == 0
448testfile9:    3900 %s: error while creating ELF header: %s
449testfile9:    3940 %s: error while reading the file: %s
450testfile9:    3980 sec < 0xff00 || shndxdata != ((void *)0)
451testfile9:    39c0 (versiondata->d_size / sizeof (GElf_Versym)) >= shdr_info[cnt].data->d_size / elsize
452testfile9:    3a20 shdr_info[cnt].shdr.sh_type == 11
453testfile9:    3a60 (versiondata->d_size / sizeof (Elf32_Word)) >= shdr_info[cnt].data->d_size / elsize
454testfile9:    3ac0 shdr_info[cnt].shdr.sh_type == 18
455testfile9:    3b00 shdr_info[cnt].data != ((void *)0)
456testfile9:    3b40 elf_ndxscn (shdr_info[cnt].newscn) == idx
457testfile9:    3b80 while create section header section: %s
458testfile9:    3bc0 cannot allocate section data: %s
459testfile9:    3c00 elf_ndxscn (shdr_info[cnt].newscn) == shdr_info[cnt].idx
460testfile9:    3c40 while generating output file: %s
461testfile9:    3c80 while preparing output for `%s'
462testfile9:    3ca0 shdr_info[cnt].shdr.sh_type == 2
463testfile9:    3ce0 shdr_info[idx].data != ((void *)0)
464testfile9:    3d20 cannot determine number of sections: %s
465testfile9:    3d60 cannot get section header string table index
466testfile9:    3e20 Discard symbols from object files.
467testfile9:    3e43 [FILE...]
468EOF
469
470exit 0
471