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