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