1## Process this file with automake to create Makefile.in
2##
3## Copyright (C) 1996-2019 Red Hat, Inc.
4## This file is part of elfutils.
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##
19include $(top_srcdir)/config/eu.am
20BUILD_RPATH = \$$ORIGIN/../libasm:\$$ORIGIN/../libdw:\$$ORIGIN/../backends:\$$ORIGIN/../libelf
21
22AM_CPPFLAGS += -I$(top_srcdir)/libasm -I$(top_srcdir)/libdw \
23	    -I$(top_srcdir)/libdwfl -I$(top_srcdir)/libdwelf \
24	    -I$(top_srcdir)/libebl -I$(top_srcdir)/libelf \
25	    -I$(top_srcdir)/lib -I..
26AM_LDFLAGS = -Wl,-rpath-link,../libasm:../libdw:../libelf
27
28if TESTS_RPATH
29AM_LDFLAGS += -Wl,-rpath,$(BUILD_RPATH)
30tests_rpath = yes
31else
32tests_rpath = no
33endif
34
35check_PROGRAMS = arextract arsymtest newfile saridx scnnames sectiondump \
36		  showptable update1 update2 update3 update4 test-nlist \
37		  show-die-info get-files next-files get-lines next-lines \
38		  get-pubnames \
39		  get-aranges allfcts line2addr addrscopes funcscopes \
40		  show-abbrev hash newscn ecp dwflmodtest \
41		  find-prologues funcretval allregs rdwrmmap \
42		  dwfl-bug-addr-overflow arls dwfl-bug-fd-leak \
43		  dwfl-addr-sect dwfl-bug-report early-offscn \
44		  dwfl-bug-getmodules dwarf-getmacros dwarf-ranges addrcfi \
45		  dwarfcfi \
46		  test-flag-nobits dwarf-getstring rerequest_tag \
47		  alldts typeiter typeiter2 low_high_pc \
48		  test-elf_cntl_gelf_getshdr dwflsyms dwfllines \
49		  dwfl-report-elf-align dwfl-report-segment-contiguous \
50		  varlocs backtrace backtrace-child \
51		  backtrace-data backtrace-dwarf debuglink debugaltlink \
52		  buildid deleted deleted-lib.so aggregate_size peel_type \
53		  vdsosyms \
54		  getsrc_die strptr newdata elfstrtab dwfl-proc-attach \
55		  elfshphehdr elfstrmerge dwelfgnucompressed elfgetchdr \
56		  elfgetzdata elfputzdata zstrptr emptyfile vendorelf \
57		  fillfile dwarf_default_lower_bound dwarf-die-addr-die \
58		  get-units-invalid get-units-split attr-integrate-skel \
59		  all-dwarf-ranges unit-info next_cfi \
60		  elfcopy addsections xlate_notes elfrdwrnop \
61		  dwelf_elf_e_machine_string \
62		  getphdrnum leb128 read_unaligned \
63		  msg_tst system-elf-libelf-test \
64		  $(asm_TESTS)
65
66asm_TESTS = asm-tst1 asm-tst2 asm-tst3 asm-tst4 asm-tst5 \
67	    asm-tst6 asm-tst7 asm-tst8 asm-tst9
68
69if BIARCH
70check_PROGRAMS += backtrace-child-biarch
71endif
72
73# Substitute $(COMPILE).
74backtrace-child-biarch$(EXEEXT): backtrace-child.c
75	$(AM_V_CC)$(CC_BIARCH) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
76		     $(AM_CPPFLAGS) $(CPPFLAGS) \
77		     $(AM_CFLAGS) $(CFLAGS) $(backtrace_child_CFLAGS) \
78		     $(AM_LDFLAGS) $(LDFLAGS) $(backtrace_child_LDFLAGS) \
79		     -o $@ $<
80
81if GCOV
82GCOV_FLAGS=-fprofile-arcs -ftest-coverage
83else
84GCOV_FLAGS=
85endif
86
87# test_nlist checks its own symbol table, and expects various symbols
88# to be in the order as specified in the source file. Explicitly set
89# minimal CFLAGS
90test-nlist$(EXEEXT): test-nlist.c
91	$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
92	  $(AM_CPPFLAGS) $(CPPFLAGS) \
93	  $(test_nlist_CFLAGS) $(GCOV_FLAGS) -o $@ $< $(test_nlist_LDADD)
94
95TESTS = run-arextract.sh run-arsymtest.sh run-ar.sh newfile test-nlist \
96	update1 update2 update3 update4 \
97	run-show-die-info.sh run-get-files.sh run-get-lines.sh \
98	run-next-files.sh run-next-lines.sh \
99	run-get-pubnames.sh run-get-aranges.sh run-allfcts.sh \
100	run-show-abbrev.sh run-line2addr.sh hash \
101	run-large-elf-file.sh \
102	newscn run-strip-test.sh run-strip-test2.sh \
103	run-strip-test3.sh run-strip-test4.sh run-strip-test5.sh \
104	run-strip-test6.sh run-strip-test7.sh run-strip-test8.sh \
105	run-strip-test9.sh run-strip-test10.sh run-strip-test11.sh \
106	run-strip-test12.sh \
107	run-strip-nothing.sh run-strip-g.sh run-annobingroup.sh \
108	run-strip-groups.sh run-strip-reloc.sh run-strip-strmerge.sh \
109	run-strip-nobitsalign.sh run-strip-remove-keep.sh \
110	run-unstrip-test.sh run-unstrip-test2.sh run-unstrip-test3.sh \
111	run-unstrip-test4.sh run-unstrip-M.sh run-elfstrmerge-test.sh \
112	run-ecp-test.sh run-ecp-test2.sh run-alldts.sh \
113	run-elflint-test.sh run-elflint-self.sh run-ranlib-test.sh \
114	run-ranlib-test2.sh run-ranlib-test3.sh run-ranlib-test4.sh \
115	run-addrscopes.sh run-strings-test.sh run-funcscopes.sh \
116	run-find-prologues.sh run-allregs.sh run-addrcfi.sh \
117	run-dwarfcfi.sh run-nm-syms.sh \
118	run-nm-self.sh run-readelf-self.sh run-readelf-info-plus.sh \
119	run-readelf-compressed.sh \
120	run-readelf-const-values.sh \
121	run-varlocs-self.sh run-exprlocs-self.sh \
122	run-readelf-test1.sh run-readelf-test2.sh run-readelf-test3.sh \
123	run-readelf-test4.sh run-readelf-twofiles.sh \
124	run-readelf-macro.sh run-readelf-loc.sh run-readelf-ranges.sh \
125	run-readelf-aranges.sh run-readelf-line.sh run-readelf-z.sh \
126	run-readelf-frames.sh \
127	run-readelf-n.sh \
128	run-retain.sh \
129	run-native-test.sh run-bug1-test.sh \
130	run-debuglink.sh run-debugaltlink.sh run-buildid.sh \
131	dwfl-bug-addr-overflow run-addrname-test.sh \
132	dwfl-bug-fd-leak dwfl-bug-report dwfl-report-segment-contiguous \
133	run-dwfl-bug-offline-rel.sh run-dwfl-addr-sect.sh \
134	run-disasm-x86.sh run-disasm-x86-64.sh \
135	run-early-offscn.sh run-dwarf-getmacros.sh run-dwarf-ranges.sh \
136	run-test-flag-nobits.sh run-prelink-addr-test.sh \
137	run-dwarf-getstring.sh run-rerequest_tag.sh run-typeiter.sh \
138	run-readelf-d.sh run-readelf-gdb_index.sh run-unstrip-n.sh \
139	run-low_high_pc.sh run-macro-test.sh run-elf_cntl_gelf_getshdr.sh \
140	run-test-archive64.sh run-readelf-vmcoreinfo.sh \
141	run-readelf-mixed-corenote.sh run-dwfllines.sh \
142	run-readelf-variant.sh \
143	run-dwfl-report-elf-align.sh run-addr2line-test.sh \
144	run-addr2line-i-test.sh run-addr2line-i-lex-test.sh \
145	run-addr2line-i-demangle-test.sh run-addr2line-alt-debugpath.sh \
146	run-varlocs.sh run-exprlocs.sh run-funcretval.sh \
147	run-backtrace-native.sh run-backtrace-data.sh run-backtrace-dwarf.sh \
148	run-backtrace-native-biarch.sh run-backtrace-native-core.sh \
149	run-backtrace-native-core-biarch.sh run-backtrace-core-x86_64.sh \
150	run-backtrace-fp-core-x86_64.sh \
151	run-backtrace-fp-core-aarch64.sh \
152	run-backtrace-fp-core-ppc64le.sh \
153	run-backtrace-core-x32.sh \
154	run-backtrace-core-i386.sh run-backtrace-fp-core-i386.sh \
155	run-backtrace-core-ppc.sh \
156	run-backtrace-core-s390x.sh run-backtrace-core-s390.sh \
157	run-backtrace-core-aarch64.sh run-backtrace-core-sparc.sh \
158	run-backtrace-demangle.sh run-stack-d-test.sh run-stack-i-test.sh \
159	run-stack-demangled-test.sh run-readelf-zx.sh run-readelf-zp.sh \
160	run-readelf-addr.sh run-readelf-str.sh \
161	run-readelf-types.sh \
162	run-readelf-dwz-multi.sh run-allfcts-multi.sh run-deleted.sh \
163	run-linkmap-cut.sh run-aggregate-size.sh run-peel-type.sh \
164	vdsosyms run-readelf-A.sh \
165	run-getsrc-die.sh run-strptr.sh newdata elfstrtab dwfl-proc-attach \
166	elfshphehdr run-lfs-symbols.sh run-dwelfgnucompressed.sh \
167	run-elfgetchdr.sh \
168	run-elfgetzdata.sh run-elfputzdata.sh run-zstrptr.sh \
169	run-compress-test.sh \
170	run-readelf-zdebug.sh run-readelf-zdebug-rel.sh \
171	emptyfile vendorelf fillfile dwarf_default_lower_bound \
172	run-dwarf-die-addr-die.sh \
173	run-get-units-invalid.sh run-get-units-split.sh \
174	run-attr-integrate-skel.sh \
175	run-all-dwarf-ranges.sh run-unit-info.sh \
176	run-reloc-bpf.sh \
177	run-next-cfi.sh run-next-cfi-self.sh \
178	run-reverse-sections.sh run-reverse-sections-self.sh \
179	run-copyadd-sections.sh run-copymany-sections.sh \
180	run-typeiter-many.sh run-strip-test-many.sh \
181	run-strip-version.sh run-xlate-note.sh \
182	run-readelf-discr.sh \
183	run-dwelf_elf_e_machine_string.sh \
184	run-elfclassify.sh run-elfclassify-self.sh \
185	run-disasm-riscv64.sh \
186	run-pt_gnu_prop-tests.sh \
187	run-getphdrnum.sh run-test-includes.sh \
188	leb128 read_unaligned \
189	msg_tst system-elf-libelf-test \
190	$(asm_TESTS) run-disasm-bpf.sh
191
192if !BIARCH
193export ELFUTILS_DISABLE_BIARCH = 1
194endif
195
196if !DEMANGLE
197export ELFUTILS_DISABLE_DEMANGLE = 1
198endif
199
200if LZMA
201TESTS += run-readelf-s.sh run-dwflsyms.sh
202endif
203
204if HAVE_ZSTD
205TESTS += run-readelf-compressed-zstd.sh
206endif
207
208if DEBUGINFOD
209check_PROGRAMS += debuginfod_build_id_find
210# With the dummy delegation doesn't work
211if !DUMMY_LIBDEBUGINFOD
212TESTS += run-debuginfod-find.sh
213endif
214endif
215
216EXTRA_DIST = run-arextract.sh run-arsymtest.sh run-ar.sh \
217	     run-show-die-info.sh run-get-files.sh run-get-lines.sh \
218	     run-next-files.sh run-next-lines.sh testfile-only-debug-line.bz2 \
219	     run-get-pubnames.sh run-get-aranges.sh \
220	     run-show-abbrev.sh run-strip-test.sh \
221	     run-strip-test2.sh run-ecp-test.sh run-ecp-test2.sh \
222	     testfile.bz2 testfile2.bz2 testfile3.bz2 testfile4.bz2 \
223	     testfile5.bz2 testfile6.bz2 testfile7.bz2 testfile8.bz2 \
224	     testfile9.bz2 testfile10.bz2 testfile11.bz2 testfile12.bz2 \
225	     testfile13.bz2 run-strip-test3.sh run-allfcts.sh \
226	     testfile_class_func.bz2 testfile_nested_funcs.bz2 \
227	     testfile-lto-gcc10.bz2 \
228	     testfile-lto-gcc9.bz2 testfile-lto-gcc8.bz2 \
229	     run-line2addr.sh run-elflint-test.sh testfile14.bz2 \
230	     run-strip-test4.sh run-strip-test5.sh run-strip-test6.sh \
231	     run-strip-test7.sh run-strip-test8.sh run-strip-groups.sh \
232	     run-strip-test9.sh run-strip-test10.sh run-strip-test11.sh \
233	     run-strip-test12.sh \
234	     run-strip-nothing.sh run-strip-remove-keep.sh run-strip-g.sh \
235	     run-annobingroup.sh testfile-annobingroup.o.bz2 \
236	     testfile-annobingroup-i386.o.bz2 \
237	     testfile-annobingroup-x86_64.o.bz2 \
238	     run-strip-strmerge.sh run-strip-nobitsalign.sh \
239	     testfile-nobitsalign.bz2 testfile-nobitsalign.strip.bz2 \
240	     run-strip-reloc.sh hello_i386.ko.bz2 hello_x86_64.ko.bz2 \
241	     hello_ppc64.ko.bz2 hello_s390.ko.bz2 hello_aarch64.ko.bz2 \
242	     hello_m68k.ko.bz2 hello_riscv64.ko.bz2 hello_csky.ko.bz2 \
243	     run-unstrip-test.sh run-unstrip-test2.sh \
244	     testfile-info-link.bz2 testfile-info-link.debuginfo.bz2 \
245	     testfile-info-link.stripped.bz2 run-unstrip-test3.sh \
246	     run-unstrip-test4.sh testfile-strtab.bz2 \
247	     testfile-strtab.stripped.bz2 testfile-strtab.debuginfo.bz2 \
248	     run-unstrip-M.sh run-elfstrmerge-test.sh \
249	     run-elflint-self.sh run-ranlib-test.sh run-ranlib-test2.sh \
250	     run-ranlib-test3.sh run-ranlib-test4.sh \
251	     run-addrscopes.sh run-strings-test.sh run-funcscopes.sh \
252	     run-nm-syms.sh testfilesyms32.bz2 testfilesyms64.bz2 \
253	     run-nm-self.sh run-readelf-self.sh run-readelf-info-plus.sh \
254	     run-readelf-compressed.sh \
255	     run-readelf-compressed-zstd.sh \
256	     run-readelf-const-values.sh testfile-const-values.debug.bz2 \
257	     run-addrcfi.sh run-dwarfcfi.sh \
258	     testfile11-debugframe.bz2 testfile12-debugframe.bz2 \
259	     testfileaarch64-debugframe.bz2 testfilearm-debugframe.bz2 \
260	     testfileppc32-debugframe.bz2 testfileppc64-debugframe.bz2 \
261	     testfilecsky.bz2 \
262	     run-varlocs-self.sh run-exprlocs-self.sh \
263	     run-find-prologues.sh run-allregs.sh run-native-test.sh \
264	     run-addrname-test.sh run-dwfl-bug-offline-rel.sh \
265	     run-dwfl-addr-sect.sh run-early-offscn.sh \
266	     run-dwarf-getmacros.sh \
267	     run-dwarf-ranges.sh debug-ranges-no-lowpc.o.bz2 \
268	     testfileranges4.debug.bz2 testfileranges5.debug.bz2 \
269	     testfilesplitranges5.debug.bz2 \
270	     testfile-ranges-hello5.dwo.bz2 testfile-ranges-world5.dwo.bz2 \
271	     run-test-flag-nobits.sh \
272	     run-dwarf-getstring.sh run-rerequest_tag.sh run-alldts.sh \
273	     testfile15.bz2 testfile15.debug.bz2 \
274	     testfile16.bz2 testfile16.debug.bz2 \
275	     testfile17.bz2 testfile17.debug.bz2 \
276	     testfile18.bz2 testfile19.bz2 testfile19.index.bz2 \
277	     testfile20.bz2 testfile20.index.bz2 \
278	     testfile21.bz2 testfile21.index.bz2 \
279	     testfile22.bz2 testfile23.bz2 testfile24.bz2 testfile25.bz2 \
280	     testfile26.bz2 testfile27.bz2 \
281	     coverage.sh test-subr.sh test-wrapper.sh \
282	     run-readelf-test1.sh run-readelf-test2.sh run-readelf-test3.sh \
283	     run-readelf-test4.sh run-readelf-twofiles.sh \
284	     run-bug1-test.sh testfile28.bz2 testfile28.rdwr.bz2 \
285	     run-debuglink.sh run-debugaltlink.sh run-buildid.sh \
286	     testfile29.bz2 testfile29.rdwr.bz2 \
287	     testfile30.bz2 testfile31.bz2 testfile32.bz2 testfile33.bz2 \
288	     testfile34.bz2 testfile35.bz2 testfile35.debug.bz2 \
289	     testfile36.bz2 testfile36.debug.bz2 \
290	     testfile37.bz2 testfile37.debug.bz2 \
291	     testfile38.bz2 testfile39.bz2 testfile40.bz2 testfile40.debug.bz2 \
292	     testfile41.bz2 testfile42.bz2 testfile42_noshdrs.bz2 \
293	     testfile43.bz2 \
294	     testfile44.S.bz2 testfile44.expect.bz2 run-disasm-x86.sh \
295	     testfile45.S.bz2 testfile45.expect.bz2 run-disasm-x86-64.sh \
296	     testfile46.bz2 testfile47.bz2 testfile48.bz2 testfile48.debug.bz2 \
297	     testfile49.bz2 testfile50.bz2 testfile51.bz2 \
298	     testfile-macros-0xff.bz2 \
299	     run-readelf-macro.sh testfilemacro.bz2 \
300	     run-readelf-loc.sh testfileloc.bz2 \
301	     splitdwarf4-not-split4.dwo.bz2 \
302	     testfile-splitdwarf4-not-split4.debug.bz2 \
303	     run-readelf-ranges.sh \
304	     run-readelf-aranges.sh run-readelf-line.sh testfilefoobarbaz.bz2 \
305	     testfile-ppc64-min-instr.bz2 \
306	     testfile-dwarf-45.source \
307	     testfile-dwarf-4.bz2 testfile-dwarf-5.bz2 \
308	     run-readelf-z.sh \
309	     run-readelf-dwz-multi.sh libtestfile_multi_shared.so.bz2 \
310	     testfile_multi.dwz.bz2 testfile_multi_main.bz2 \
311	     testfile-dwzstr.bz2 testfile-dwzstr.multi.bz2 \
312	     run-readelf-addr.sh run-readelf-str.sh \
313	     run-readelf-types.sh \
314	     run-readelf-frames.sh \
315	     run-readelf-n.sh \
316	     testfile-gnu-property-note.bz2 testfile-gnu-property-note.o.bz2 \
317	     testfile_gnu_props.32le.o.bz2 \
318	     testfile_gnu_props.64le.o.bz2 \
319	     testfile_gnu_props.32be.o.bz2 \
320	     testfile_gnu_props.64be.o.bz2 \
321	     testfile-gnu-property-note-aarch64.bz2 \
322	     run-retain.sh testfile-retain.o.bz2 \
323	     run-allfcts-multi.sh \
324	     test-offset-loop.bz2 test-offset-loop.alt.bz2 \
325	     run-prelink-addr-test.sh \
326	     testfile52-32.so.bz2 testfile52-32.so.debug.bz2 \
327	     testfile52-32.prelink.so.bz2 testfile52-32.noshdrs.so.bz2 \
328	     testfile52-64.so.bz2 testfile52-64.so.debug.bz2 \
329	     testfile52-64.prelink.so.bz2 testfile52-64.noshdrs.so.bz2 \
330	     testfile53-32.bz2 testfile53-32.debug.bz2 \
331	     testfile53-32.prelink.bz2 testfile53-64.bz2 \
332	     testfile53-64.debug.bz2 testfile53-64.prelink.bz2 \
333	     testfile54-32.so.bz2 testfile54-32.so.debug.bz2 \
334	     testfile54-32.prelink.so.bz2 testfile54-32.noshdrs.so.bz2 \
335	     testfile54-64.so.bz2 testfile54-64.so.debug.bz2 \
336	     testfile54-64.prelink.so.bz2 testfile54-64.noshdrs.so.bz2 \
337	     testfile55-32.bz2 testfile55-32.debug.bz2 \
338	     testfile55-32.prelink.bz2 testfile55-64.bz2 \
339	     testfile55-64.debug.bz2 testfile55-64.prelink.bz2 \
340	     testfile56.bz2 testfile57.bz2 testfile58.bz2 \
341	     run-typeiter.sh testfile59.bz2 \
342	     run-readelf-d.sh testlib_dynseg.so.bz2 \
343	     testfile-s390x-hash-both.bz2 \
344	     run-readelf-gdb_index.sh testfilegdbindex5.bz2 \
345	     testfilegdbindex7.bz2 \
346	     run-readelf-s.sh testfilebazdbg.bz2 testfilebazdyn.bz2 \
347	     testfilebazmin.bz2 testfilebazdbg.debug.bz2 testfilebazmdb.bz2 \
348	     testfilebaztab.bz2 testfilebasmin.bz2 testfilebaxmin.bz2 \
349	     testfilebazdbg_pl.bz2 testfilebazmin_pl.bz2 \
350	     testfilebazdbg_plr.bz2 testfilebazmin_plr.bz2 \
351	     testfilebazdbgppc64.bz2 testfilebazdbgppc64.debug.bz2 \
352	     testfilebazdbgppc64_pl.bz2 testfilebazdbgppc64_plr.bz2 \
353	     testfilebazdynppc64.bz2 testfilebazmdbppc64.bz2 \
354	     testfilebazminppc64.bz2 testfilebazminppc64_pl.bz2 \
355	     testfilebazminppc64_plr.bz2 testfilebaztabppc64.bz2 \
356	     run-readelf-variant.sh testfile-ada-variant.bz2 \
357	     run-dwflsyms.sh \
358	     run-unstrip-n.sh testcore-rtlib.bz2 testcore-rtlib-ppc.bz2 \
359	     run-low_high_pc.sh testfile_low_high_pc.bz2 \
360	     run-macro-test.sh testfile-macinfo.bz2 testfile-macros.bz2 \
361	     run-elf_cntl_gelf_getshdr.sh \
362	     run-test-archive64.sh testarchive64.a.bz2 \
363	     testfile61.bz2 \
364	     run-readelf-vmcoreinfo.sh testfile62.bz2 \
365	     run-readelf-mixed-corenote.sh testfile63.bz2 testfile64.bz2 \
366	     testfile65.bz2 testfile67.bz2 testfile68.bz2 \
367	     testfile69.core.bz2 testfile69.so.bz2 \
368	     testfile70.core.bz2 testfile70.exec.bz2 testfile71.bz2 \
369	     run-dwfllines.sh run-dwfl-report-elf-align.sh \
370	     testfile-dwfl-report-elf-align-shlib.so.bz2 \
371	     testfilenolines.bz2 test-core-lib.so.bz2 test-core.core.bz2 \
372	     test-core.exec.bz2 run-addr2line-test.sh \
373	     run-addr2line-i-test.sh testfile-inlines.bz2 \
374	     run-addr2line-i-lex-test.sh testfile-lex-inlines.bz2 \
375	     run-addr2line-i-demangle-test.sh run-addr2line-alt-debugpath.sh \
376	     testfileppc32.bz2 testfileppc64.bz2 \
377	     testfiles390.bz2 testfiles390x.bz2 \
378	     testfilearm.bz2 testfileaarch64.bz2 \
379	     run-varlocs.sh run-exprlocs.sh testfile-stridex.bz2 \
380	     testfile_const_type.c testfile_const_type.bz2 \
381	     testfile_implicit_pointer.c testfile_implicit_pointer.bz2 \
382	     testfile_parameter_ref.c testfile_parameter_ref.bz2 \
383	     testfile_entry_value.c testfile_entry_value.bz2 \
384	     testfile_implicit_value.c testfile_implicit_value.bz2 \
385	     testfile_aarch64_core.bz2 testfile_i686_core.bz2 \
386	     addrx_constx-4.dwo.bz2 addrx_constx-5.dwo.bz2 \
387	     testfile-addrx_constx-4.bz2 testfile-addrx_constx-5.bz2 \
388	     run-funcretval.sh funcretval_test.c funcretval_test_aarch64.bz2 \
389	     run-backtrace-data.sh run-backtrace-dwarf.sh cleanup-13.c \
390	     run-backtrace-native.sh run-backtrace-native-biarch.sh \
391	     run-backtrace-native-core.sh run-backtrace-native-core-biarch.sh \
392	     run-backtrace-core-x86_64.sh run-backtrace-core-i386.sh \
393	     run-backtrace-fp-core-x86_64.sh \
394	     run-backtrace-core-x32.sh \
395	     run-backtrace-fp-core-aarch64.sh \
396	     backtrace.aarch64.fp.core.bz2 backtrace.aarch64.fp.exec.bz2 \
397	     backtrace-subr.sh backtrace.i386.core.bz2 backtrace.i386.exec.bz2 \
398	     run-backtrace-fp-core-i386.sh \
399	     backtrace.i386.fp.core.bz2 backtrace.i386.fp.exec.bz2 \
400	     run-backtrace-fp-core-ppc64le.sh \
401	     backtrace.ppc64le.fp.core.bz2 backtrace.ppc64le.fp.exec.bz2 \
402	     backtrace.x86_64.core.bz2 backtrace.x86_64.exec.bz2 \
403	     backtrace.x86_64.fp.core.bz2 backtrace.x86_64.fp.exec.bz2 \
404	     backtrace.ppc.core.bz2 backtrace.ppc.exec.bz2 \
405	     run-backtrace-core-ppc.sh testfile66.bz2 testfile66.core.bz2 \
406	     backtrace.s390x.core.bz2 backtrace.s390x.exec.bz2 \
407	     backtrace.s390.core.bz2 backtrace.s390.exec.bz2 \
408	     run-backtrace-core-s390x.sh run-backtrace-core-s390.sh \
409	     run-backtrace-core-aarch64.sh \
410	     backtrace.aarch64.core.bz2 backtrace.aarch64.exec.bz2 \
411	     run-backtrace-core-sparc.sh \
412	     backtrace.sparc.core.bz2 backtrace.sparc.exec.bz2 \
413	     run-backtrace-demangle.sh testfile-backtrace-demangle.bz2 \
414	     testfile-backtrace-demangle.cc \
415	     testfile-backtrace-demangle.core.bz2 \
416	     run-stack-d-test.sh run-stack-i-test.sh \
417	     run-stack-demangled-test.sh \
418	     testfiledwarfinlines.bz2 testfiledwarfinlines.core.bz2 \
419	     run-readelf-zdebug.sh testfile-debug.bz2 testfile-zdebug.bz2 \
420	     run-readelf-zdebug-rel.sh testfile-debug-rel.o.bz2 \
421	     testfile-debug-rel-g.o.bz2 testfile-debug-rel-z.o.bz2 \
422	     run-readelf-zx.sh run-readelf-zp.sh \
423	     run-deleted.sh run-linkmap-cut.sh linkmap-cut-lib.so.bz2 \
424	     linkmap-cut.bz2 linkmap-cut.core.bz2 \
425	     run-aggregate-size.sh testfile-sizes1.o.bz2 testfile-sizes2.o.bz2 \
426	     testfile-sizes3.o.bz2 testfile-sizes4.o.bz2 testfile-sizes4.s \
427	     run-peel-type.sh \
428	     run-readelf-A.sh testfileppc32attrs.o.bz2 \
429	     testfilesparc64attrs.o.bz2 testfileppc64attrs.o.bz2 \
430	     testfile-debug-types.bz2 \
431	     run-getsrc-die.sh run-strptr.sh \
432	     testfile-x32-core.bz2 testfile-x32.bz2 \
433	     backtrace.x32.core.bz2 backtrace.x32.exec.bz2 \
434	     testfile-x32-s.bz2 testfile-x32-d.bz2 testfile-x32-debug.bz2 \
435	     run-lfs-symbols.sh lfs-symbols testfile-nolfs.bz2 \
436	     testfile-zgnu32.bz2 testfile-zgnu64.bz2 \
437	     testfile-zgnu32be.bz2 testfile-zgnu64be.bz2 \
438	     run-dwelfgnucompressed.sh \
439	     testfile-zgabi32.bz2 testfile-zgabi64.bz2 \
440	     testfile-zgabi32be.bz2 testfile-zgabi64be.bz2 \
441	     run-elfgetchdr.sh run-elfgetzdata.sh run-elfputzdata.sh \
442	     run-zstrptr.sh run-compress-test.sh \
443	     run-disasm-bpf.sh \
444	     testfile-bpf-dis1.expect.bz2 testfile-bpf-dis1.o.bz2 \
445	     run-reloc-bpf.sh \
446	     testfile-bpf-reloc.expect.bz2 testfile-bpf-reloc.o.bz2 \
447	     testfile-m68k-core.bz2 testfile-m68k.bz2 testfile-m68k-s.bz2 \
448	     run-dwarf-die-addr-die.sh \
449	     run-get-units-invalid.sh run-get-units-split.sh \
450	     testfile-hello4.dwo.bz2 testfile-hello5.dwo.bz2 \
451	     testfile-splitdwarf-4.bz2 testfile-splitdwarf-5.bz2 \
452	     testfile-world5.dwo.bz2 testfile-world4.dwo.bz2 \
453	     run-attr-integrate-skel.sh \
454	     run-all-dwarf-ranges.sh testfilesplitranges4.debug.bz2 \
455	     testfile-ranges-hello.dwo.bz2 testfile-ranges-world.dwo.bz2 \
456	     run-unit-info.sh run-next-cfi.sh run-next-cfi-self.sh \
457	     testfile-riscv64.bz2 testfile-riscv64-s.bz2 \
458	     testfile-riscv64-core.bz2 \
459	     run-reverse-sections.sh run-reverse-sections-self.sh \
460	     run-copyadd-sections.sh run-copymany-sections.sh \
461	     run-large-elf-file.sh \
462	     run-typeiter-many.sh run-strip-test-many.sh \
463	     testfile-debug-rel-ppc64-g.o.bz2 \
464	     testfile-debug-rel-ppc64-z.o.bz2 \
465	     testfile-debug-rel-ppc64.o.bz2 \
466	     run-strip-version.sh testfile-version.bz2 \
467	     run-xlate-note.sh \
468	     run-readelf-discr.sh \
469	     testfile-rng.debug.bz2 testfile-urng.debug.bz2 \
470	     run-dwelf_elf_e_machine_string.sh \
471	     run-elfclassify.sh run-elfclassify-self.sh \
472	     run-disasm-riscv64.sh \
473	     testfile-riscv64-dis1.o.bz2 testfile-riscv64-dis1.expect.bz2 \
474             run-debuginfod-find.sh \
475	     debuginfod-rpms/fedora30/hello2-1.0-2.src.rpm \
476	     debuginfod-rpms/fedora30/hello2-1.0-2.x86_64.rpm \
477	     debuginfod-rpms/fedora30/hello2-debuginfo-1.0-2.x86_64.rpm \
478	     debuginfod-rpms/fedora30/hello2-debugsource-1.0-2.x86_64.rpm \
479	     debuginfod-rpms/fedora30/hello2-two-1.0-2.x86_64.rpm \
480	     debuginfod-rpms/fedora30/hello2-two-debuginfo-1.0-2.x86_64.rpm \
481	     debuginfod-rpms/fedora31/hello3-1.0-2.src.rpm \
482	     debuginfod-rpms/fedora31/hello3-1.0-2.x86_64.rpm \
483	     debuginfod-rpms/fedora31/hello3-debuginfo-1.0-2.x86_64.rpm \
484	     debuginfod-rpms/fedora31/hello3-debugsource-1.0-2.x86_64.rpm \
485	     debuginfod-rpms/fedora31/hello3-two-1.0-2.x86_64.rpm \
486	     debuginfod-rpms/fedora31/hello3-two-debuginfo-1.0-2.x86_64.rpm \
487	     debuginfod-rpms/hello2.spec. \
488	     debuginfod-rpms/rhel6/hello2-1.0-2.i686.rpm \
489	     debuginfod-rpms/rhel6/hello2-1.0-2.src.rpm \
490	     debuginfod-rpms/rhel6/hello2-debuginfo-1.0-2.i686.rpm \
491	     debuginfod-rpms/rhel6/hello2-two-1.0-2.i686.rpm \
492	     debuginfod-rpms/rhel7/hello2-1.0-2.src.rpm \
493	     debuginfod-rpms/rhel7/hello2-1.0-2.x86_64.rpm \
494	     debuginfod-rpms/rhel7/hello2-debuginfo-1.0-2.x86_64.rpm \
495	     debuginfod-rpms/rhel7/hello2-two-1.0-2.x86_64.rpm \
496	     debuginfod-rpms/rhel7/hello2-two-1.0-2.x86_64.rpm \
497	     debuginfod-debs/hithere-dbgsym_1.0-1_amd64.ddeb \
498	     debuginfod-debs/hithere_1.0-1.debian.tar.xz \
499	     debuginfod-debs/hithere_1.0-1.dsc \
500	     debuginfod-debs/hithere_1.0-1_amd64.deb \
501	     debuginfod-debs/hithere_1.0.orig.tar.gz \
502	     debuginfod-tars/hello-1-1-x86_64.pkg.tar.xz \
503	     debuginfod-tars/hello-debug-1-1-x86_64.pkg.tar.bz2 \
504	     debuginfod-tars/pacman-sources/PKGBUILD \
505	     debuginfod-tars/pacman-sources/README.md \
506	     debuginfod-tars/pacman-sources/hello.c \
507	     run-pt_gnu_prop-tests.sh \
508	     testfile_pt_gnu_prop.bz2 testfile_pt_gnu_prop32.bz2 \
509	     run-getphdrnum.sh testfile-phdrs.elf.bz2 \
510	     run-test-includes.sh
511
512
513if USE_VALGRIND
514valgrind_cmd='valgrind -q --leak-check=full --error-exitcode=1'
515endif
516
517
518installed_TESTS_ENVIRONMENT = libdir=$(DESTDIR)$(libdir); \
519			      bindir=$(DESTDIR)$(bindir); \
520			      LC_ALL=C; LANG=C; \
521			      VALGRIND_CMD=$(valgrind_cmd); \
522			      abs_srcdir=$(abs_srcdir); \
523			      abs_builddir=$(abs_builddir); \
524			      abs_top_builddir=$(abs_top_builddir); \
525			      export abs_srcdir; export abs_builddir; \
526			      export abs_top_builddir; \
527			      export libdir; export bindir; \
528			      export LC_ALL; export LANG; export VALGRIND_CMD; \
529			      unset DEBUGINFOD_URLS; \
530			      NM=$(NM); export NM; \
531			      CC=$(CC); export CC;
532installed_LOG_COMPILER = $(abs_srcdir)/test-wrapper.sh \
533			 installed $(tests_rpath) \
534			 '$(program_transform_name)'
535TESTS_ENVIRONMENT = LC_ALL=C; LANG=C; VALGRIND_CMD=$(valgrind_cmd); \
536		    abs_srcdir=$(abs_srcdir);  abs_builddir=$(abs_builddir); \
537		    abs_top_builddir=$(abs_top_builddir); \
538		    export abs_srcdir; export abs_builddir; \
539		    export abs_top_builddir; \
540		    export LC_ALL; export LANG; export VALGRIND_CMD; \
541		    unset DEBUGINFOD_URLS; \
542		    NM=$(NM); export NM; \
543		    CC=$(CC); export CC;
544LOG_COMPILER = $(abs_srcdir)/test-wrapper.sh \
545	       $(abs_top_builddir)/libdw:$(abs_top_builddir)/backends:$(abs_top_builddir)/libelf:$(abs_top_builddir)/libasm:$(abs_top_builddir)/debuginfod
546
547installcheck-local:
548	$(MAKE) $(AM_MAKEFLAGS) \
549		TESTS_ENVIRONMENT="$(installed_TESTS_ENVIRONMENT)" \
550		LOG_COMPILER="$(installed_LOG_COMPILER)" check-TESTS
551
552if BUILD_STATIC
553libdw = ../libdw/libdw.a -lz $(zip_LIBS) $(libelf) $(libebl) -ldl -lpthread
554libelf = ../libelf/libelf.a -lz
555libasm = ../libasm/libasm.a
556else
557libdw = ../libdw/libdw.so
558libelf = ../libelf/libelf.so
559libasm = ../libasm/libasm.so
560endif
561libebl = ../libebl/libebl.a ../backends/libebl_backends.a ../libcpu/libcpu.a
562libeu = ../lib/libeu.a
563
564arextract_LDADD = $(libelf)
565arsymtest_LDADD = $(libelf)
566newfile_LDADD = $(libelf)
567saridx_LDADD = $(libelf)
568scnnames_LDADD = $(libelf)
569sectiondump_LDADD = $(libelf)
570showptable_LDADD = $(libelf)
571hash_LDADD = $(libelf)
572test_nlist_CFLAGS =-g -O0
573test_nlist_LDADD = $(libelf)
574msg_tst_LDADD = $(libelf)
575newscn_LDADD = $(libelf)
576early_offscn_LDADD = $(libelf)
577ecp_LDADD = $(libelf)
578update1_LDADD = $(libelf)
579update2_LDADD = $(libelf)
580update3_LDADD = $(libdw) $(libelf)
581update4_LDADD = $(libdw) $(libelf)
582show_die_info_LDADD = $(libdw) $(libelf)
583get_pubnames_LDADD = $(libdw) $(libelf)
584show_abbrev_LDADD = $(libdw) $(libelf)
585get_lines_LDADD = $(libdw) $(libelf)
586next_lines_LDADD = $(libdw) $(libelf)
587get_files_LDADD = $(libdw) $(libelf)
588next_files_LDADD = $(libdw) $(libelf)
589get_aranges_LDADD = $(libdw) $(libelf)
590allfcts_LDADD = $(libdw) $(libelf)
591line2addr_LDADD = $(libdw) $(argp_LDADD)
592addrscopes_LDADD = $(libdw) $(argp_LDADD)
593funcscopes_LDADD = $(libdw) $(argp_LDADD)
594funcretval_LDADD = $(libdw) $(argp_LDADD)
595allregs_LDADD = $(libdw) $(argp_LDADD)
596find_prologues_LDADD = $(libdw) $(argp_LDADD)
597#show_ciefde_LDADD = ../libdwarf/libdwarf.so $(libelf)
598asm_tst1_LDADD = $(libasm) $(libebl) $(libelf) $(libdw)
599asm_tst2_LDADD = $(libasm) $(libebl) $(libelf) $(libdw)
600asm_tst3_LDADD = $(libasm) $(libebl) $(libelf) $(libdw)
601asm_tst4_LDADD = $(libasm) $(libebl) $(libelf) $(libdw)
602asm_tst5_LDADD = $(libasm) $(libebl) $(libelf) $(libdw)
603asm_tst6_LDADD = $(libasm) $(libebl) $(libelf) $(libdw)
604asm_tst7_LDADD = $(libasm) $(libebl) $(libelf) $(libdw)
605asm_tst8_LDADD = $(libasm) $(libebl) $(libelf) $(libdw)
606asm_tst9_LDADD = $(libasm) $(libebl) $(libelf) $(libdw)
607dwflmodtest_LDADD = $(libdw) $(libebl) $(libelf) $(argp_LDADD)
608rdwrmmap_LDADD = $(libelf)
609dwfl_bug_addr_overflow_LDADD = $(libdw) $(libebl) $(libelf)
610arls_LDADD = $(libelf)
611dwfl_bug_fd_leak_LDADD = $(libdw) $(libebl) $(libelf)
612dwfl_bug_report_LDADD = $(libdw) $(libebl) $(libelf)
613dwfl_bug_getmodules_LDADD = $(libdw) $(libebl) $(libelf)
614dwfl_addr_sect_LDADD = $(libdw) $(libebl) $(libelf) $(argp_LDADD)
615dwarf_getmacros_LDADD = $(libdw)
616dwarf_ranges_LDADD = $(libdw)
617dwarf_getstring_LDADD = $(libdw)
618addrcfi_LDADD = $(libdw) $(libebl) $(libelf) $(argp_LDADD)
619dwarfcfi_LDADD = $(libdw) $(libelf)
620test_flag_nobits_LDADD = $(libelf)
621rerequest_tag_LDADD = $(libdw)
622alldts_LDADD = $(libdw) $(libelf)
623typeiter_LDADD = $(libdw) $(libelf)
624typeiter2_LDADD = $(libdw) $(libelf)
625low_high_pc_LDADD = $(libdw) $(libelf) $(argp_LDADD)
626test_elf_cntl_gelf_getshdr_LDADD = $(libelf)
627dwflsyms_LDADD = $(libdw) $(libelf) $(argp_LDADD)
628dwfllines_LDADD = $(libdw) $(libelf) $(argp_LDADD)
629dwfl_report_elf_align_LDADD = $(libdw)
630dwfl_report_segment_contiguous_LDADD = $(libdw) $(libebl) $(libelf)
631varlocs_LDADD = $(libdw) $(libelf) $(argp_LDADD)
632backtrace_LDADD = $(libdw) $(libelf) $(argp_LDADD)
633# backtrace-child-biarch also uses those *_CFLAGS and *_LDLAGS variables:
634backtrace_child_CFLAGS = $(fpie_CFLAGS)
635backtrace_child_LDFLAGS = -pie -pthread
636backtrace_child_biarch_SOURCES = backtrace-child.c
637backtrace_data_LDADD = $(libdw) $(libelf)
638backtrace_dwarf_CFLAGS = -Wno-unused-parameter
639backtrace_dwarf_LDADD = $(libdw) $(libelf)
640debuglink_LDADD = $(libdw) $(libelf)
641debugaltlink_LDADD = $(libdw) $(libelf)
642buildid_LDADD = $(libdw) $(libelf)
643deleted_LDADD = ./deleted-lib.so
644deleted_lib_so_LDFLAGS = -shared
645deleted_lib_so_CFLAGS = $(fpic_CFLAGS) -fasynchronous-unwind-tables
646aggregate_size_LDADD = $(libdw) $(libelf) $(argp_LDADD)
647peel_type_LDADD = $(libdw) $(libelf) $(argp_LDADD)
648vdsosyms_LDADD = $(libdw) $(libelf)
649getsrc_die_LDADD = $(libdw) $(libelf)
650strptr_LDADD = $(libelf)
651newdata_LDADD = $(libelf)
652elfstrtab_LDADD = $(libelf)
653dwfl_proc_attach_LDADD = $(libdw)
654dwfl_proc_attach_LDFLAGS = -pthread $(AM_LDFLAGS)
655elfshphehdr_LDADD =$(libelf)
656elfstrmerge_LDADD = $(libdw) $(libelf)
657dwelfgnucompressed_LDADD = $(libelf) $(libdw)
658elfgetchdr_LDADD = $(libelf) $(libdw)
659elfgetzdata_LDADD = $(libelf)
660elfputzdata_LDADD = $(libelf)
661zstrptr_LDADD = $(libelf)
662emptyfile_LDADD = $(libelf)
663vendorelf_LDADD = $(libelf)
664fillfile_LDADD = $(libelf)
665dwarf_default_lower_bound_LDADD = $(libdw)
666dwarf_die_addr_die_LDADD = $(libdw)
667get_units_invalid_LDADD = $(libdw)
668get_units_split_LDADD = $(libdw)
669attr_integrate_skel_LDADD = $(libdw)
670all_dwarf_ranges_LDADD = $(libdw)
671unit_info_LDADD = $(libdw)
672next_cfi_LDADD = $(libelf) $(libdw)
673elfcopy_LDADD = $(libelf)
674addsections_LDADD = $(libelf)
675debuginfod_build_id_find_LDADD = $(libelf) $(libdw)
676xlate_notes_LDADD = $(libelf)
677elfrdwrnop_LDADD = $(libelf)
678dwelf_elf_e_machine_string_LDADD = $(libelf) $(libdw)
679getphdrnum_LDADD = $(libelf) $(libdw)
680leb128_LDADD = $(libelf) $(libdw)
681read_unaligned_LDADD = $(libelf) $(libdw)
682
683# We want to test the libelf header against the system elf.h header.
684# Don't include any -I CPPFLAGS. Except when we install our own elf.h.
685if !INSTALL_ELFH
686system_elf_libelf_test_CPPFLAGS =
687else
688system_elf_libelf_test_CPPFLAGS = -I$(top_srcdir)/libelf
689endif
690system_elf_libelf_test_LDADD = $(libelf)
691
692# A lock file used to make sure only one test dumps core at a time
693CLEANFILES += core-dump-backtrace.lock
694
695if GCOV
696check: check-am coverage
697.PHONY: coverage
698coverage:
699	-$(srcdir)/coverage.sh
700endif
701