diff options
Diffstat (limited to 'elfutils/tests')
29 files changed, 1317 insertions, 349 deletions
diff --git a/elfutils/tests/ChangeLog b/elfutils/tests/ChangeLog index 6f5e4584..276462c8 100644 --- a/elfutils/tests/ChangeLog +++ b/elfutils/tests/ChangeLog @@ -1,3 +1,109 @@ +2012-08-24 Mark Wielaard <mjw@redhat.com> + + * Makefile.am (EXTRA_DIST): Add testfile60.bz2. + +2012-08-22 Jeff Kenton <jkenton@tilera.com> + + * testfile60.bz2: New testfile. + * run-allregs.sh: Run reg_test testfile60. + +2012-08-24 Mark Wielaard <mjw@redhat.com> + + * Makefile.am (TESTS): Only add run-readelf-dwz-multi.sh if + ENABLE_DWZ. + +2012-08-16 Mark Wielaard <mjw@redhat.com> + + * allregs.c (dwarf_encoding_string): Rewritten using known-dwarf + macros. + * show-die-info.c (tagnames): Removed. + (attrs): Removed. + (dwarf_tag_string): New function using known-dwarf macros. + (dwarf_attr_string): Likewise. + (handle): Call dwarf_tag_string and dwarf_attr_string instead. + * run-readelf-dwz-multi.sh: Expect language C89, not ISO C89. + +2012-06-27 Mark Wielaard <mjw@redhat.com> + + * Makefile.am (TESTS): Add run-readelf-dwz-multi.sh. + (EXTRA_DIST): Add run-readelf-dwz-multi.sh, + libtestfile_multi_shared.so.bz2, testfile_multi.dwz.bz2 and + testfile_multi_main.bz2. + * run-readelf-dwz-multi.sh: New test. + * libtestfile_multi_shared.so.bz2: New testfile. + * testfile_multi.dwz.bz2: New testifle. + * testfile_multi_main.bz2: New testifle. + +2012-08-01 Petr Machata <pmachata@redhat.com> + + * run-test-archive64.sh: New test. + * testarchive64.a.bz2: New testfile. + * Makefile.am (TESTS): Add run-test-archive64.sh. + (EXTRA_DIST): Likewise. + +2012-08-01 Mark Wielaard <mjw@redhat.com> + + * run-nm-self.sh: New test. + * run-readelf-self.sh: Likewise. + * test-subr.sh (testrun_on_self_quiet): New function. + * Makefile.am (TESTS): Add run-nm-self.sh and run-readelf-self.sh. + (EXTRA_DIST): Likewise. + +2012-08-01 Mark Wielaard <mjw@redhat.com> + + * test-subr.sh (self_test_files): New list of files. + (testrun_on_self): New function. + * run-elflint-self.sh: Use testrun_on_self. + +2012-07-19 Mark Wielaard <mjw@redhat.com> + + * Makefile.am (check_PROGRAMS): Add test-elf_cntl_gelf_getshdr. + (TESTS): Add run-elf_cntl_gelf_getshdr.sh. + (EXTRA_DIST): Likewise. + (test_elf_cntl_gelf_getshdr_LDADD): New. + test-elf_cntl_gelf_getshdr.c: New test program. + run-elf_cntl_gelf_getshdr.sh: New test script. + +2012-07-19 Mark Wielaard <mjw@redhat.com> + + * run-elflint-self.sh: runtests on ../backends/*so files. + +2012-07-19 Mark Wielaard <mjw@redhat.com> + + * run-unstrip-n.sh: test_cleanup. + * Makefile.am (EXTRA_DIST): Add testcore-rtlib-ppc.bz2. + +2012-07-11 Mark Wielaard <mjw@redhat.com> + + * run-readelf-macro.sh: New test. + * testfilemacro.bz2: New testfile. + * Makefile.am (TESTS): Add run-readelf-macro.sh. + (EXTRA_DIST): Add run-readelf-macro.sh and testfilemacro.bz2. + +2012-06-27 Mark Wielaard <mjw@redhat.com> + + * run-readelf-gdb-index.sh: New test. + * testfilegdbindex5.bz2: New testfile. + * testfilegdbindex7.bz2: Likewise. + * Makefile.am (TESTS): Add run-readelf-gdb-index.sh. + (EXTRA_DIST): run-readelf-gdb_index.sh, testfilegdbindex5.bz2 and + testfilegdbindex7.bz2. + +2012-07-17 Mark Wielaard <mjw@redhat.com> + + * testcore-rtlib-ppc.bz2: New testfile. + * run-unstrip-n.sh: Check new ppc core testfile. + +2012-06-26 Mike Frysinger <vapier@gentoo.org> + + * Makefile.am (check_PROGRAMS): Rename from noinst_PROGRAMS. + +2012-06-26 Mark Wielaard <mjw@redhat.com> + + * run-macro-test.sh: New test. + * testfile-macinfo.bz2: New testfile. + * testfile-macros.bz2: Likewise. + 2012-05-07 Mark Wielaard <mjw@redhat.com> * low_high_pc.c: Use proper inttypes in printf formats. diff --git a/elfutils/tests/Makefile.am b/elfutils/tests/Makefile.am index ced7831b..d8783e5a 100644 --- a/elfutils/tests/Makefile.am +++ b/elfutils/tests/Makefile.am @@ -40,7 +40,7 @@ else tests_rpath = no endif -noinst_PROGRAMS = arextract arsymtest newfile saridx scnnames sectiondump \ +check_PROGRAMS = arextract arsymtest newfile saridx scnnames sectiondump \ showptable update1 update2 update3 update4 test-nlist \ show-die-info get-files get-lines get-pubnames \ get-aranges allfcts line2addr addrscopes funcscopes \ @@ -50,7 +50,8 @@ noinst_PROGRAMS = arextract arsymtest newfile saridx scnnames sectiondump \ dwfl-addr-sect dwfl-bug-report early-offscn \ dwfl-bug-getmodules dwarf-getmacros addrcfi \ test-flag-nobits dwarf-getstring rerequest_tag \ - alldts md5-sha1-test typeiter low_high_pc + alldts md5-sha1-test typeiter low_high_pc \ + test-elf_cntl_gelf_getshdr asm_TESTS = asm-tst1 asm-tst2 asm-tst3 asm-tst4 asm-tst5 \ asm-tst6 asm-tst7 asm-tst8 asm-tst9 @@ -69,8 +70,10 @@ TESTS = run-arextract.sh run-arsymtest.sh newfile test-nlist \ run-ranlib-test2.sh run-ranlib-test3.sh run-ranlib-test4.sh \ run-addrscopes.sh run-strings-test.sh run-funcscopes.sh \ run-find-prologues.sh run-allregs.sh \ + run-nm-self.sh run-readelf-self.sh \ run-readelf-test1.sh run-readelf-test2.sh run-readelf-test3.sh \ run-readelf-test4.sh run-readelf-twofiles.sh \ + run-readelf-macro.sh \ run-native-test.sh run-bug1-test.sh \ dwfl-bug-addr-overflow run-addrname-test.sh \ dwfl-bug-fd-leak dwfl-bug-report \ @@ -79,18 +82,24 @@ TESTS = run-arextract.sh run-arsymtest.sh newfile test-nlist \ run-early-offscn.sh run-dwarf-getmacros.sh \ run-test-flag-nobits.sh run-prelink-addr-test.sh \ run-dwarf-getstring.sh run-rerequest_tag.sh run-typeiter.sh \ - run-readelf-d.sh run-unstrip-n.sh run-low_high_pc.sh + run-readelf-d.sh run-readelf-gdb_index.sh run-unstrip-n.sh \ + run-low_high_pc.sh run-macro-test.sh run-elf_cntl_gelf_getshdr.sh \ + run-test-archive64.sh if !STANDALONE -noinst_PROGRAMS += msg_tst md5-sha1-test +check_PROGRAMS += msg_tst md5-sha1-test TESTS += msg_tst md5-sha1-test endif if HAVE_LIBASM -noinst_PROGRAMS += $(asm_TESTS) +check_PROGRAMS += $(asm_TESTS) TESTS += $(asm_TESTS) endif +if ENABLE_DWZ +TESTS += run-readelf-dwz-multi.sh +endif + EXTRA_DIST = run-arextract.sh run-arsymtest.sh \ run-show-die-info.sh run-get-files.sh run-get-lines.sh \ @@ -110,6 +119,7 @@ EXTRA_DIST = run-arextract.sh run-arsymtest.sh \ run-elflint-self.sh run-ranlib-test.sh run-ranlib-test2.sh \ run-ranlib-test3.sh run-ranlib-test4.sh \ run-addrscopes.sh run-strings-test.sh run-funcscopes.sh \ + run-nm-self.sh run-readelf-self.sh \ run-find-prologues.sh run-allregs.sh run-native-test.sh \ run-addrname-test.sh run-dwfl-bug-offline-rel.sh \ run-dwfl-addr-sect.sh run-early-offscn.sh \ @@ -138,6 +148,9 @@ EXTRA_DIST = run-arextract.sh run-arsymtest.sh \ testfile45.S.bz2 testfile45.expect.bz2 run-disasm-x86-64.sh \ testfile46.bz2 testfile47.bz2 testfile48.bz2 testfile48.debug.bz2 \ testfile49.bz2 testfile50.bz2 testfile51.bz2 \ + run-readelf-macro.sh testfilemacro.bz2 \ + run-readelf-dwz-multi.sh libtestfile_multi_shared.so.bz2 \ + testfile_multi.dwz.bz2 testfile_multi_main.bz2 \ run-prelink-addr-test.sh \ testfile52-32.so.bz2 testfile52-32.so.debug.bz2 \ testfile52-32.prelink.so.bz2 testfile52-32.noshdrs.so.bz2 \ @@ -156,8 +169,14 @@ EXTRA_DIST = run-arextract.sh run-arsymtest.sh \ testfile56.bz2 testfile57.bz2 testfile58.bz2 \ run-typeiter.sh testfile59.bz2 \ run-readelf-d.sh testlib_dynseg.so.bz2 \ - run-unstrip-n.sh testcore-rtlib.bz2 \ - run-low_high_pc.sh testfile_low_high_pc.bz2 + run-readelf-gdb_index.sh testfilegdbindex5.bz2 \ + testfilegdbindex7.bz2 \ + run-unstrip-n.sh testcore-rtlib.bz2 testcore-rtlib-ppc.bz2 \ + run-low_high_pc.sh testfile_low_high_pc.bz2 \ + run-macro-test.sh testfile-macinfo.bz2 testfile-macros.bz2 \ + run-elf_cntl_gelf_getshdr.sh \ + run-test-archive64.sh testarchive64.a.bz2 \ + testfile60.bz2 installed_TESTS_ENVIRONMENT = libdir=$(DESTDIR)$(libdir) \ bindir=$(DESTDIR)$(bindir) \ @@ -257,6 +276,7 @@ alldts_LDADD = $(libebl) $(libelf) $(libmudflap) md5_sha1_test_LDADD = $(libeu) typeiter_LDADD = $(libdw) $(libelf) $(libmudflap) low_high_pc_LDADD = $(libdw) $(libelf) $(libmudflap) +test_elf_cntl_gelf_getshdr_LDADD = $(libelf) $(libmudflap) if GCOV check: check-am coverage diff --git a/elfutils/tests/Makefile.in b/elfutils/tests/Makefile.in index 5e2be840..30a10ad8 100644 --- a/elfutils/tests/Makefile.in +++ b/elfutils/tests/Makefile.in @@ -1,9 +1,9 @@ -# Makefile.in generated by automake 1.11.1 from Makefile.am. +# Makefile.in generated by automake 1.11.3 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, -# Inc. +# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software +# Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. @@ -14,7 +14,6 @@ # PARTICULAR PURPOSE. @SET_MAKE@ - VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ @@ -44,7 +43,7 @@ DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ @STANDALONE_FALSE@am__append_3 = -Wl,-rpath-link,../libasm:../libdw:../libelf @TESTS_RPATH_TRUE@am__append_4 = -Wl,-rpath,$(BUILD_RPATH) -noinst_PROGRAMS = arextract$(EXEEXT) arsymtest$(EXEEXT) \ +check_PROGRAMS = arextract$(EXEEXT) arsymtest$(EXEEXT) \ newfile$(EXEEXT) saridx$(EXEEXT) scnnames$(EXEEXT) \ sectiondump$(EXEEXT) showptable$(EXEEXT) update1$(EXEEXT) \ update2$(EXEEXT) update3$(EXEEXT) update4$(EXEEXT) \ @@ -61,7 +60,8 @@ noinst_PROGRAMS = arextract$(EXEEXT) arsymtest$(EXEEXT) \ dwarf-getmacros$(EXEEXT) addrcfi$(EXEEXT) \ test-flag-nobits$(EXEEXT) dwarf-getstring$(EXEEXT) \ rerequest_tag$(EXEEXT) alldts$(EXEEXT) md5-sha1-test$(EXEEXT) \ - typeiter$(EXEEXT) low_high_pc$(EXEEXT) $(am__EXEEXT_1) \ + typeiter$(EXEEXT) low_high_pc$(EXEEXT) \ + test-elf_cntl_gelf_getshdr$(EXEEXT) $(am__EXEEXT_1) \ $(am__EXEEXT_3) TESTS = run-arextract.sh run-arsymtest.sh newfile$(EXEEXT) \ test-nlist$(EXEEXT) update1$(EXEEXT) update2$(EXEEXT) \ @@ -77,9 +77,11 @@ TESTS = run-arextract.sh run-arsymtest.sh newfile$(EXEEXT) \ run-elflint-test.sh run-elflint-self.sh run-ranlib-test.sh \ run-ranlib-test2.sh run-ranlib-test3.sh run-ranlib-test4.sh \ run-addrscopes.sh run-strings-test.sh run-funcscopes.sh \ - run-find-prologues.sh run-allregs.sh run-readelf-test1.sh \ - run-readelf-test2.sh run-readelf-test3.sh run-readelf-test4.sh \ - run-readelf-twofiles.sh run-native-test.sh run-bug1-test.sh \ + run-find-prologues.sh run-allregs.sh run-nm-self.sh \ + run-readelf-self.sh run-readelf-test1.sh run-readelf-test2.sh \ + run-readelf-test3.sh run-readelf-test4.sh \ + run-readelf-twofiles.sh run-readelf-macro.sh \ + run-native-test.sh run-bug1-test.sh \ dwfl-bug-addr-overflow$(EXEEXT) run-addrname-test.sh \ dwfl-bug-fd-leak$(EXEEXT) dwfl-bug-report$(EXEEXT) \ run-dwfl-bug-offline-rel.sh run-dwfl-addr-sect.sh \ @@ -87,12 +89,15 @@ TESTS = run-arextract.sh run-arsymtest.sh newfile$(EXEEXT) \ run-dwarf-getmacros.sh run-test-flag-nobits.sh \ run-prelink-addr-test.sh run-dwarf-getstring.sh \ run-rerequest_tag.sh run-typeiter.sh run-readelf-d.sh \ - run-unstrip-n.sh run-low_high_pc.sh $(am__EXEEXT_1) \ - $(am__EXEEXT_3) + run-readelf-gdb_index.sh run-unstrip-n.sh run-low_high_pc.sh \ + run-macro-test.sh run-elf_cntl_gelf_getshdr.sh \ + run-test-archive64.sh $(am__EXEEXT_1) $(am__EXEEXT_3) \ + $(am__append_9) @STANDALONE_FALSE@am__append_5 = msg_tst md5-sha1-test @STANDALONE_FALSE@am__append_6 = msg_tst md5-sha1-test @HAVE_LIBASM_TRUE@am__append_7 = $(asm_TESTS) @HAVE_LIBASM_TRUE@am__append_8 = $(asm_TESTS) +@ENABLE_DWZ_TRUE@am__append_9 = run-readelf-dwz-multi.sh subdir = tests ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/nls.m4 $(top_srcdir)/m4/po.m4 \ @@ -110,7 +115,6 @@ am__EXEEXT_2 = asm-tst1$(EXEEXT) asm-tst2$(EXEEXT) asm-tst3$(EXEEXT) \ asm-tst4$(EXEEXT) asm-tst5$(EXEEXT) asm-tst6$(EXEEXT) \ asm-tst7$(EXEEXT) asm-tst8$(EXEEXT) asm-tst9$(EXEEXT) @HAVE_LIBASM_TRUE@am__EXEEXT_3 = $(am__EXEEXT_2) -PROGRAMS = $(noinst_PROGRAMS) addrcfi_SOURCES = addrcfi.c addrcfi_OBJECTS = addrcfi.$(OBJEXT) am__DEPENDENCIES_1 = @@ -310,6 +314,11 @@ show_die_info_DEPENDENCIES = $(am__DEPENDENCIES_4) \ showptable_SOURCES = showptable.c showptable_OBJECTS = showptable.$(OBJEXT) showptable_DEPENDENCIES = $(am__DEPENDENCIES_2) $(am__DEPENDENCIES_1) +test_elf_cntl_gelf_getshdr_SOURCES = test-elf_cntl_gelf_getshdr.c +test_elf_cntl_gelf_getshdr_OBJECTS = \ + test-elf_cntl_gelf_getshdr.$(OBJEXT) +test_elf_cntl_gelf_getshdr_DEPENDENCIES = $(am__DEPENDENCIES_2) \ + $(am__DEPENDENCIES_1) test_flag_nobits_SOURCES = test-flag-nobits.c test_flag_nobits_OBJECTS = test-flag-nobits.$(OBJEXT) test_flag_nobits_DEPENDENCIES = $(am__DEPENDENCIES_2) \ @@ -354,9 +363,9 @@ SOURCES = addrcfi.c addrscopes.c alldts.c allfcts.c allregs.c \ get-pubnames.c hash.c line2addr.c low_high_pc.c \ md5-sha1-test.c msg_tst.c newfile.c newscn.c rdwrmmap.c \ rerequest_tag.c saridx.c scnnames.c sectiondump.c \ - show-abbrev.c show-die-info.c showptable.c test-flag-nobits.c \ - test-nlist.c typeiter.c update1.c update2.c update3.c \ - update4.c + show-abbrev.c show-die-info.c showptable.c \ + test-elf_cntl_gelf_getshdr.c test-flag-nobits.c test-nlist.c \ + typeiter.c update1.c update2.c update3.c update4.c DIST_SOURCES = addrcfi.c addrscopes.c alldts.c allfcts.c allregs.c \ arextract.c arls.c arsymtest.c asm-tst1.c asm-tst2.c \ asm-tst3.c asm-tst4.c asm-tst5.c asm-tst6.c asm-tst7.c \ @@ -368,9 +377,9 @@ DIST_SOURCES = addrcfi.c addrscopes.c alldts.c allfcts.c allregs.c \ get-pubnames.c hash.c line2addr.c low_high_pc.c \ md5-sha1-test.c msg_tst.c newfile.c newscn.c rdwrmmap.c \ rerequest_tag.c saridx.c scnnames.c sectiondump.c \ - show-abbrev.c show-die-info.c showptable.c test-flag-nobits.c \ - test-nlist.c typeiter.c update1.c update2.c update3.c \ - update4.c + show-abbrev.c show-die-info.c showptable.c \ + test-elf_cntl_gelf_getshdr.c test-flag-nobits.c test-nlist.c \ + typeiter.c update1.c update2.c update3.c update4.c ETAGS = etags CTAGS = ctags am__tty_colors = \ @@ -529,6 +538,7 @@ EXTRA_DIST = run-arextract.sh run-arsymtest.sh \ run-elflint-self.sh run-ranlib-test.sh run-ranlib-test2.sh \ run-ranlib-test3.sh run-ranlib-test4.sh \ run-addrscopes.sh run-strings-test.sh run-funcscopes.sh \ + run-nm-self.sh run-readelf-self.sh \ run-find-prologues.sh run-allregs.sh run-native-test.sh \ run-addrname-test.sh run-dwfl-bug-offline-rel.sh \ run-dwfl-addr-sect.sh run-early-offscn.sh \ @@ -557,6 +567,9 @@ EXTRA_DIST = run-arextract.sh run-arsymtest.sh \ testfile45.S.bz2 testfile45.expect.bz2 run-disasm-x86-64.sh \ testfile46.bz2 testfile47.bz2 testfile48.bz2 testfile48.debug.bz2 \ testfile49.bz2 testfile50.bz2 testfile51.bz2 \ + run-readelf-macro.sh testfilemacro.bz2 \ + run-readelf-dwz-multi.sh libtestfile_multi_shared.so.bz2 \ + testfile_multi.dwz.bz2 testfile_multi_main.bz2 \ run-prelink-addr-test.sh \ testfile52-32.so.bz2 testfile52-32.so.debug.bz2 \ testfile52-32.prelink.so.bz2 testfile52-32.noshdrs.so.bz2 \ @@ -575,8 +588,14 @@ EXTRA_DIST = run-arextract.sh run-arsymtest.sh \ testfile56.bz2 testfile57.bz2 testfile58.bz2 \ run-typeiter.sh testfile59.bz2 \ run-readelf-d.sh testlib_dynseg.so.bz2 \ - run-unstrip-n.sh testcore-rtlib.bz2 \ - run-low_high_pc.sh testfile_low_high_pc.bz2 + run-readelf-gdb_index.sh testfilegdbindex5.bz2 \ + testfilegdbindex7.bz2 \ + run-unstrip-n.sh testcore-rtlib.bz2 testcore-rtlib-ppc.bz2 \ + run-low_high_pc.sh testfile_low_high_pc.bz2 \ + run-macro-test.sh testfile-macinfo.bz2 testfile-macros.bz2 \ + run-elf_cntl_gelf_getshdr.sh \ + run-test-archive64.sh testarchive64.a.bz2 \ + testfile60.bz2 installed_TESTS_ENVIRONMENT = libdir=$(DESTDIR)$(libdir) \ bindir=$(DESTDIR)$(bindir) \ @@ -660,6 +679,7 @@ alldts_LDADD = $(libebl) $(libelf) $(libmudflap) md5_sha1_test_LDADD = $(libeu) typeiter_LDADD = $(libdw) $(libelf) $(libmudflap) low_high_pc_LDADD = $(libdw) $(libelf) $(libmudflap) +test_elf_cntl_gelf_getshdr_LDADD = $(libelf) $(libmudflap) all: all-am .SUFFIXES: @@ -685,6 +705,7 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; +$(top_srcdir)/config/eu.am: $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh @@ -695,174 +716,177 @@ $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): -clean-noinstPROGRAMS: - -test -z "$(noinst_PROGRAMS)" || rm -f $(noinst_PROGRAMS) -addrcfi$(EXEEXT): $(addrcfi_OBJECTS) $(addrcfi_DEPENDENCIES) +clean-checkPROGRAMS: + -test -z "$(check_PROGRAMS)" || rm -f $(check_PROGRAMS) +addrcfi$(EXEEXT): $(addrcfi_OBJECTS) $(addrcfi_DEPENDENCIES) $(EXTRA_addrcfi_DEPENDENCIES) @rm -f addrcfi$(EXEEXT) $(LINK) $(addrcfi_OBJECTS) $(addrcfi_LDADD) $(LIBS) -addrscopes$(EXEEXT): $(addrscopes_OBJECTS) $(addrscopes_DEPENDENCIES) +addrscopes$(EXEEXT): $(addrscopes_OBJECTS) $(addrscopes_DEPENDENCIES) $(EXTRA_addrscopes_DEPENDENCIES) @rm -f addrscopes$(EXEEXT) $(LINK) $(addrscopes_OBJECTS) $(addrscopes_LDADD) $(LIBS) -alldts$(EXEEXT): $(alldts_OBJECTS) $(alldts_DEPENDENCIES) +alldts$(EXEEXT): $(alldts_OBJECTS) $(alldts_DEPENDENCIES) $(EXTRA_alldts_DEPENDENCIES) @rm -f alldts$(EXEEXT) $(LINK) $(alldts_OBJECTS) $(alldts_LDADD) $(LIBS) -allfcts$(EXEEXT): $(allfcts_OBJECTS) $(allfcts_DEPENDENCIES) +allfcts$(EXEEXT): $(allfcts_OBJECTS) $(allfcts_DEPENDENCIES) $(EXTRA_allfcts_DEPENDENCIES) @rm -f allfcts$(EXEEXT) $(LINK) $(allfcts_OBJECTS) $(allfcts_LDADD) $(LIBS) -allregs$(EXEEXT): $(allregs_OBJECTS) $(allregs_DEPENDENCIES) +allregs$(EXEEXT): $(allregs_OBJECTS) $(allregs_DEPENDENCIES) $(EXTRA_allregs_DEPENDENCIES) @rm -f allregs$(EXEEXT) $(LINK) $(allregs_OBJECTS) $(allregs_LDADD) $(LIBS) -arextract$(EXEEXT): $(arextract_OBJECTS) $(arextract_DEPENDENCIES) +arextract$(EXEEXT): $(arextract_OBJECTS) $(arextract_DEPENDENCIES) $(EXTRA_arextract_DEPENDENCIES) @rm -f arextract$(EXEEXT) $(LINK) $(arextract_OBJECTS) $(arextract_LDADD) $(LIBS) -arls$(EXEEXT): $(arls_OBJECTS) $(arls_DEPENDENCIES) +arls$(EXEEXT): $(arls_OBJECTS) $(arls_DEPENDENCIES) $(EXTRA_arls_DEPENDENCIES) @rm -f arls$(EXEEXT) $(LINK) $(arls_OBJECTS) $(arls_LDADD) $(LIBS) -arsymtest$(EXEEXT): $(arsymtest_OBJECTS) $(arsymtest_DEPENDENCIES) +arsymtest$(EXEEXT): $(arsymtest_OBJECTS) $(arsymtest_DEPENDENCIES) $(EXTRA_arsymtest_DEPENDENCIES) @rm -f arsymtest$(EXEEXT) $(LINK) $(arsymtest_OBJECTS) $(arsymtest_LDADD) $(LIBS) -asm-tst1$(EXEEXT): $(asm_tst1_OBJECTS) $(asm_tst1_DEPENDENCIES) +asm-tst1$(EXEEXT): $(asm_tst1_OBJECTS) $(asm_tst1_DEPENDENCIES) $(EXTRA_asm_tst1_DEPENDENCIES) @rm -f asm-tst1$(EXEEXT) $(LINK) $(asm_tst1_OBJECTS) $(asm_tst1_LDADD) $(LIBS) -asm-tst2$(EXEEXT): $(asm_tst2_OBJECTS) $(asm_tst2_DEPENDENCIES) +asm-tst2$(EXEEXT): $(asm_tst2_OBJECTS) $(asm_tst2_DEPENDENCIES) $(EXTRA_asm_tst2_DEPENDENCIES) @rm -f asm-tst2$(EXEEXT) $(LINK) $(asm_tst2_OBJECTS) $(asm_tst2_LDADD) $(LIBS) -asm-tst3$(EXEEXT): $(asm_tst3_OBJECTS) $(asm_tst3_DEPENDENCIES) +asm-tst3$(EXEEXT): $(asm_tst3_OBJECTS) $(asm_tst3_DEPENDENCIES) $(EXTRA_asm_tst3_DEPENDENCIES) @rm -f asm-tst3$(EXEEXT) $(LINK) $(asm_tst3_OBJECTS) $(asm_tst3_LDADD) $(LIBS) -asm-tst4$(EXEEXT): $(asm_tst4_OBJECTS) $(asm_tst4_DEPENDENCIES) +asm-tst4$(EXEEXT): $(asm_tst4_OBJECTS) $(asm_tst4_DEPENDENCIES) $(EXTRA_asm_tst4_DEPENDENCIES) @rm -f asm-tst4$(EXEEXT) $(LINK) $(asm_tst4_OBJECTS) $(asm_tst4_LDADD) $(LIBS) -asm-tst5$(EXEEXT): $(asm_tst5_OBJECTS) $(asm_tst5_DEPENDENCIES) +asm-tst5$(EXEEXT): $(asm_tst5_OBJECTS) $(asm_tst5_DEPENDENCIES) $(EXTRA_asm_tst5_DEPENDENCIES) @rm -f asm-tst5$(EXEEXT) $(LINK) $(asm_tst5_OBJECTS) $(asm_tst5_LDADD) $(LIBS) -asm-tst6$(EXEEXT): $(asm_tst6_OBJECTS) $(asm_tst6_DEPENDENCIES) +asm-tst6$(EXEEXT): $(asm_tst6_OBJECTS) $(asm_tst6_DEPENDENCIES) $(EXTRA_asm_tst6_DEPENDENCIES) @rm -f asm-tst6$(EXEEXT) $(LINK) $(asm_tst6_OBJECTS) $(asm_tst6_LDADD) $(LIBS) -asm-tst7$(EXEEXT): $(asm_tst7_OBJECTS) $(asm_tst7_DEPENDENCIES) +asm-tst7$(EXEEXT): $(asm_tst7_OBJECTS) $(asm_tst7_DEPENDENCIES) $(EXTRA_asm_tst7_DEPENDENCIES) @rm -f asm-tst7$(EXEEXT) $(LINK) $(asm_tst7_OBJECTS) $(asm_tst7_LDADD) $(LIBS) -asm-tst8$(EXEEXT): $(asm_tst8_OBJECTS) $(asm_tst8_DEPENDENCIES) +asm-tst8$(EXEEXT): $(asm_tst8_OBJECTS) $(asm_tst8_DEPENDENCIES) $(EXTRA_asm_tst8_DEPENDENCIES) @rm -f asm-tst8$(EXEEXT) $(LINK) $(asm_tst8_OBJECTS) $(asm_tst8_LDADD) $(LIBS) -asm-tst9$(EXEEXT): $(asm_tst9_OBJECTS) $(asm_tst9_DEPENDENCIES) +asm-tst9$(EXEEXT): $(asm_tst9_OBJECTS) $(asm_tst9_DEPENDENCIES) $(EXTRA_asm_tst9_DEPENDENCIES) @rm -f asm-tst9$(EXEEXT) $(LINK) $(asm_tst9_OBJECTS) $(asm_tst9_LDADD) $(LIBS) -dwarf-getmacros$(EXEEXT): $(dwarf_getmacros_OBJECTS) $(dwarf_getmacros_DEPENDENCIES) +dwarf-getmacros$(EXEEXT): $(dwarf_getmacros_OBJECTS) $(dwarf_getmacros_DEPENDENCIES) $(EXTRA_dwarf_getmacros_DEPENDENCIES) @rm -f dwarf-getmacros$(EXEEXT) $(LINK) $(dwarf_getmacros_OBJECTS) $(dwarf_getmacros_LDADD) $(LIBS) -dwarf-getstring$(EXEEXT): $(dwarf_getstring_OBJECTS) $(dwarf_getstring_DEPENDENCIES) +dwarf-getstring$(EXEEXT): $(dwarf_getstring_OBJECTS) $(dwarf_getstring_DEPENDENCIES) $(EXTRA_dwarf_getstring_DEPENDENCIES) @rm -f dwarf-getstring$(EXEEXT) $(LINK) $(dwarf_getstring_OBJECTS) $(dwarf_getstring_LDADD) $(LIBS) -dwfl-addr-sect$(EXEEXT): $(dwfl_addr_sect_OBJECTS) $(dwfl_addr_sect_DEPENDENCIES) +dwfl-addr-sect$(EXEEXT): $(dwfl_addr_sect_OBJECTS) $(dwfl_addr_sect_DEPENDENCIES) $(EXTRA_dwfl_addr_sect_DEPENDENCIES) @rm -f dwfl-addr-sect$(EXEEXT) $(LINK) $(dwfl_addr_sect_OBJECTS) $(dwfl_addr_sect_LDADD) $(LIBS) -dwfl-bug-addr-overflow$(EXEEXT): $(dwfl_bug_addr_overflow_OBJECTS) $(dwfl_bug_addr_overflow_DEPENDENCIES) +dwfl-bug-addr-overflow$(EXEEXT): $(dwfl_bug_addr_overflow_OBJECTS) $(dwfl_bug_addr_overflow_DEPENDENCIES) $(EXTRA_dwfl_bug_addr_overflow_DEPENDENCIES) @rm -f dwfl-bug-addr-overflow$(EXEEXT) $(LINK) $(dwfl_bug_addr_overflow_OBJECTS) $(dwfl_bug_addr_overflow_LDADD) $(LIBS) -dwfl-bug-fd-leak$(EXEEXT): $(dwfl_bug_fd_leak_OBJECTS) $(dwfl_bug_fd_leak_DEPENDENCIES) +dwfl-bug-fd-leak$(EXEEXT): $(dwfl_bug_fd_leak_OBJECTS) $(dwfl_bug_fd_leak_DEPENDENCIES) $(EXTRA_dwfl_bug_fd_leak_DEPENDENCIES) @rm -f dwfl-bug-fd-leak$(EXEEXT) $(LINK) $(dwfl_bug_fd_leak_OBJECTS) $(dwfl_bug_fd_leak_LDADD) $(LIBS) -dwfl-bug-getmodules$(EXEEXT): $(dwfl_bug_getmodules_OBJECTS) $(dwfl_bug_getmodules_DEPENDENCIES) +dwfl-bug-getmodules$(EXEEXT): $(dwfl_bug_getmodules_OBJECTS) $(dwfl_bug_getmodules_DEPENDENCIES) $(EXTRA_dwfl_bug_getmodules_DEPENDENCIES) @rm -f dwfl-bug-getmodules$(EXEEXT) $(LINK) $(dwfl_bug_getmodules_OBJECTS) $(dwfl_bug_getmodules_LDADD) $(LIBS) -dwfl-bug-report$(EXEEXT): $(dwfl_bug_report_OBJECTS) $(dwfl_bug_report_DEPENDENCIES) +dwfl-bug-report$(EXEEXT): $(dwfl_bug_report_OBJECTS) $(dwfl_bug_report_DEPENDENCIES) $(EXTRA_dwfl_bug_report_DEPENDENCIES) @rm -f dwfl-bug-report$(EXEEXT) $(LINK) $(dwfl_bug_report_OBJECTS) $(dwfl_bug_report_LDADD) $(LIBS) -dwflmodtest$(EXEEXT): $(dwflmodtest_OBJECTS) $(dwflmodtest_DEPENDENCIES) +dwflmodtest$(EXEEXT): $(dwflmodtest_OBJECTS) $(dwflmodtest_DEPENDENCIES) $(EXTRA_dwflmodtest_DEPENDENCIES) @rm -f dwflmodtest$(EXEEXT) $(LINK) $(dwflmodtest_OBJECTS) $(dwflmodtest_LDADD) $(LIBS) -early-offscn$(EXEEXT): $(early_offscn_OBJECTS) $(early_offscn_DEPENDENCIES) +early-offscn$(EXEEXT): $(early_offscn_OBJECTS) $(early_offscn_DEPENDENCIES) $(EXTRA_early_offscn_DEPENDENCIES) @rm -f early-offscn$(EXEEXT) $(LINK) $(early_offscn_OBJECTS) $(early_offscn_LDADD) $(LIBS) -ecp$(EXEEXT): $(ecp_OBJECTS) $(ecp_DEPENDENCIES) +ecp$(EXEEXT): $(ecp_OBJECTS) $(ecp_DEPENDENCIES) $(EXTRA_ecp_DEPENDENCIES) @rm -f ecp$(EXEEXT) $(LINK) $(ecp_OBJECTS) $(ecp_LDADD) $(LIBS) -find-prologues$(EXEEXT): $(find_prologues_OBJECTS) $(find_prologues_DEPENDENCIES) +find-prologues$(EXEEXT): $(find_prologues_OBJECTS) $(find_prologues_DEPENDENCIES) $(EXTRA_find_prologues_DEPENDENCIES) @rm -f find-prologues$(EXEEXT) $(LINK) $(find_prologues_OBJECTS) $(find_prologues_LDADD) $(LIBS) -funcretval$(EXEEXT): $(funcretval_OBJECTS) $(funcretval_DEPENDENCIES) +funcretval$(EXEEXT): $(funcretval_OBJECTS) $(funcretval_DEPENDENCIES) $(EXTRA_funcretval_DEPENDENCIES) @rm -f funcretval$(EXEEXT) $(LINK) $(funcretval_OBJECTS) $(funcretval_LDADD) $(LIBS) -funcscopes$(EXEEXT): $(funcscopes_OBJECTS) $(funcscopes_DEPENDENCIES) +funcscopes$(EXEEXT): $(funcscopes_OBJECTS) $(funcscopes_DEPENDENCIES) $(EXTRA_funcscopes_DEPENDENCIES) @rm -f funcscopes$(EXEEXT) $(LINK) $(funcscopes_OBJECTS) $(funcscopes_LDADD) $(LIBS) -get-aranges$(EXEEXT): $(get_aranges_OBJECTS) $(get_aranges_DEPENDENCIES) +get-aranges$(EXEEXT): $(get_aranges_OBJECTS) $(get_aranges_DEPENDENCIES) $(EXTRA_get_aranges_DEPENDENCIES) @rm -f get-aranges$(EXEEXT) $(LINK) $(get_aranges_OBJECTS) $(get_aranges_LDADD) $(LIBS) -get-files$(EXEEXT): $(get_files_OBJECTS) $(get_files_DEPENDENCIES) +get-files$(EXEEXT): $(get_files_OBJECTS) $(get_files_DEPENDENCIES) $(EXTRA_get_files_DEPENDENCIES) @rm -f get-files$(EXEEXT) $(LINK) $(get_files_OBJECTS) $(get_files_LDADD) $(LIBS) -get-lines$(EXEEXT): $(get_lines_OBJECTS) $(get_lines_DEPENDENCIES) +get-lines$(EXEEXT): $(get_lines_OBJECTS) $(get_lines_DEPENDENCIES) $(EXTRA_get_lines_DEPENDENCIES) @rm -f get-lines$(EXEEXT) $(LINK) $(get_lines_OBJECTS) $(get_lines_LDADD) $(LIBS) -get-pubnames$(EXEEXT): $(get_pubnames_OBJECTS) $(get_pubnames_DEPENDENCIES) +get-pubnames$(EXEEXT): $(get_pubnames_OBJECTS) $(get_pubnames_DEPENDENCIES) $(EXTRA_get_pubnames_DEPENDENCIES) @rm -f get-pubnames$(EXEEXT) $(LINK) $(get_pubnames_OBJECTS) $(get_pubnames_LDADD) $(LIBS) -hash$(EXEEXT): $(hash_OBJECTS) $(hash_DEPENDENCIES) +hash$(EXEEXT): $(hash_OBJECTS) $(hash_DEPENDENCIES) $(EXTRA_hash_DEPENDENCIES) @rm -f hash$(EXEEXT) $(LINK) $(hash_OBJECTS) $(hash_LDADD) $(LIBS) -line2addr$(EXEEXT): $(line2addr_OBJECTS) $(line2addr_DEPENDENCIES) +line2addr$(EXEEXT): $(line2addr_OBJECTS) $(line2addr_DEPENDENCIES) $(EXTRA_line2addr_DEPENDENCIES) @rm -f line2addr$(EXEEXT) $(LINK) $(line2addr_OBJECTS) $(line2addr_LDADD) $(LIBS) -low_high_pc$(EXEEXT): $(low_high_pc_OBJECTS) $(low_high_pc_DEPENDENCIES) +low_high_pc$(EXEEXT): $(low_high_pc_OBJECTS) $(low_high_pc_DEPENDENCIES) $(EXTRA_low_high_pc_DEPENDENCIES) @rm -f low_high_pc$(EXEEXT) $(LINK) $(low_high_pc_OBJECTS) $(low_high_pc_LDADD) $(LIBS) -md5-sha1-test$(EXEEXT): $(md5_sha1_test_OBJECTS) $(md5_sha1_test_DEPENDENCIES) +md5-sha1-test$(EXEEXT): $(md5_sha1_test_OBJECTS) $(md5_sha1_test_DEPENDENCIES) $(EXTRA_md5_sha1_test_DEPENDENCIES) @rm -f md5-sha1-test$(EXEEXT) $(LINK) $(md5_sha1_test_OBJECTS) $(md5_sha1_test_LDADD) $(LIBS) -msg_tst$(EXEEXT): $(msg_tst_OBJECTS) $(msg_tst_DEPENDENCIES) +msg_tst$(EXEEXT): $(msg_tst_OBJECTS) $(msg_tst_DEPENDENCIES) $(EXTRA_msg_tst_DEPENDENCIES) @rm -f msg_tst$(EXEEXT) $(LINK) $(msg_tst_OBJECTS) $(msg_tst_LDADD) $(LIBS) -newfile$(EXEEXT): $(newfile_OBJECTS) $(newfile_DEPENDENCIES) +newfile$(EXEEXT): $(newfile_OBJECTS) $(newfile_DEPENDENCIES) $(EXTRA_newfile_DEPENDENCIES) @rm -f newfile$(EXEEXT) $(LINK) $(newfile_OBJECTS) $(newfile_LDADD) $(LIBS) -newscn$(EXEEXT): $(newscn_OBJECTS) $(newscn_DEPENDENCIES) +newscn$(EXEEXT): $(newscn_OBJECTS) $(newscn_DEPENDENCIES) $(EXTRA_newscn_DEPENDENCIES) @rm -f newscn$(EXEEXT) $(LINK) $(newscn_OBJECTS) $(newscn_LDADD) $(LIBS) -rdwrmmap$(EXEEXT): $(rdwrmmap_OBJECTS) $(rdwrmmap_DEPENDENCIES) +rdwrmmap$(EXEEXT): $(rdwrmmap_OBJECTS) $(rdwrmmap_DEPENDENCIES) $(EXTRA_rdwrmmap_DEPENDENCIES) @rm -f rdwrmmap$(EXEEXT) $(LINK) $(rdwrmmap_OBJECTS) $(rdwrmmap_LDADD) $(LIBS) -rerequest_tag$(EXEEXT): $(rerequest_tag_OBJECTS) $(rerequest_tag_DEPENDENCIES) +rerequest_tag$(EXEEXT): $(rerequest_tag_OBJECTS) $(rerequest_tag_DEPENDENCIES) $(EXTRA_rerequest_tag_DEPENDENCIES) @rm -f rerequest_tag$(EXEEXT) $(LINK) $(rerequest_tag_OBJECTS) $(rerequest_tag_LDADD) $(LIBS) -saridx$(EXEEXT): $(saridx_OBJECTS) $(saridx_DEPENDENCIES) +saridx$(EXEEXT): $(saridx_OBJECTS) $(saridx_DEPENDENCIES) $(EXTRA_saridx_DEPENDENCIES) @rm -f saridx$(EXEEXT) $(LINK) $(saridx_OBJECTS) $(saridx_LDADD) $(LIBS) -scnnames$(EXEEXT): $(scnnames_OBJECTS) $(scnnames_DEPENDENCIES) +scnnames$(EXEEXT): $(scnnames_OBJECTS) $(scnnames_DEPENDENCIES) $(EXTRA_scnnames_DEPENDENCIES) @rm -f scnnames$(EXEEXT) $(LINK) $(scnnames_OBJECTS) $(scnnames_LDADD) $(LIBS) -sectiondump$(EXEEXT): $(sectiondump_OBJECTS) $(sectiondump_DEPENDENCIES) +sectiondump$(EXEEXT): $(sectiondump_OBJECTS) $(sectiondump_DEPENDENCIES) $(EXTRA_sectiondump_DEPENDENCIES) @rm -f sectiondump$(EXEEXT) $(LINK) $(sectiondump_OBJECTS) $(sectiondump_LDADD) $(LIBS) -show-abbrev$(EXEEXT): $(show_abbrev_OBJECTS) $(show_abbrev_DEPENDENCIES) +show-abbrev$(EXEEXT): $(show_abbrev_OBJECTS) $(show_abbrev_DEPENDENCIES) $(EXTRA_show_abbrev_DEPENDENCIES) @rm -f show-abbrev$(EXEEXT) $(LINK) $(show_abbrev_OBJECTS) $(show_abbrev_LDADD) $(LIBS) -show-die-info$(EXEEXT): $(show_die_info_OBJECTS) $(show_die_info_DEPENDENCIES) +show-die-info$(EXEEXT): $(show_die_info_OBJECTS) $(show_die_info_DEPENDENCIES) $(EXTRA_show_die_info_DEPENDENCIES) @rm -f show-die-info$(EXEEXT) $(LINK) $(show_die_info_OBJECTS) $(show_die_info_LDADD) $(LIBS) -showptable$(EXEEXT): $(showptable_OBJECTS) $(showptable_DEPENDENCIES) +showptable$(EXEEXT): $(showptable_OBJECTS) $(showptable_DEPENDENCIES) $(EXTRA_showptable_DEPENDENCIES) @rm -f showptable$(EXEEXT) $(LINK) $(showptable_OBJECTS) $(showptable_LDADD) $(LIBS) -test-flag-nobits$(EXEEXT): $(test_flag_nobits_OBJECTS) $(test_flag_nobits_DEPENDENCIES) +test-elf_cntl_gelf_getshdr$(EXEEXT): $(test_elf_cntl_gelf_getshdr_OBJECTS) $(test_elf_cntl_gelf_getshdr_DEPENDENCIES) $(EXTRA_test_elf_cntl_gelf_getshdr_DEPENDENCIES) + @rm -f test-elf_cntl_gelf_getshdr$(EXEEXT) + $(LINK) $(test_elf_cntl_gelf_getshdr_OBJECTS) $(test_elf_cntl_gelf_getshdr_LDADD) $(LIBS) +test-flag-nobits$(EXEEXT): $(test_flag_nobits_OBJECTS) $(test_flag_nobits_DEPENDENCIES) $(EXTRA_test_flag_nobits_DEPENDENCIES) @rm -f test-flag-nobits$(EXEEXT) $(LINK) $(test_flag_nobits_OBJECTS) $(test_flag_nobits_LDADD) $(LIBS) -test-nlist$(EXEEXT): $(test_nlist_OBJECTS) $(test_nlist_DEPENDENCIES) +test-nlist$(EXEEXT): $(test_nlist_OBJECTS) $(test_nlist_DEPENDENCIES) $(EXTRA_test_nlist_DEPENDENCIES) @rm -f test-nlist$(EXEEXT) $(LINK) $(test_nlist_OBJECTS) $(test_nlist_LDADD) $(LIBS) -typeiter$(EXEEXT): $(typeiter_OBJECTS) $(typeiter_DEPENDENCIES) +typeiter$(EXEEXT): $(typeiter_OBJECTS) $(typeiter_DEPENDENCIES) $(EXTRA_typeiter_DEPENDENCIES) @rm -f typeiter$(EXEEXT) $(LINK) $(typeiter_OBJECTS) $(typeiter_LDADD) $(LIBS) -update1$(EXEEXT): $(update1_OBJECTS) $(update1_DEPENDENCIES) +update1$(EXEEXT): $(update1_OBJECTS) $(update1_DEPENDENCIES) $(EXTRA_update1_DEPENDENCIES) @rm -f update1$(EXEEXT) $(LINK) $(update1_OBJECTS) $(update1_LDADD) $(LIBS) -update2$(EXEEXT): $(update2_OBJECTS) $(update2_DEPENDENCIES) +update2$(EXEEXT): $(update2_OBJECTS) $(update2_DEPENDENCIES) $(EXTRA_update2_DEPENDENCIES) @rm -f update2$(EXEEXT) $(LINK) $(update2_OBJECTS) $(update2_LDADD) $(LIBS) -update3$(EXEEXT): $(update3_OBJECTS) $(update3_DEPENDENCIES) +update3$(EXEEXT): $(update3_OBJECTS) $(update3_DEPENDENCIES) $(EXTRA_update3_DEPENDENCIES) @rm -f update3$(EXEEXT) $(LINK) $(update3_OBJECTS) $(update3_LDADD) $(LIBS) -update4$(EXEEXT): $(update4_OBJECTS) $(update4_DEPENDENCIES) +update4$(EXEEXT): $(update4_OBJECTS) $(update4_DEPENDENCIES) $(EXTRA_update4_DEPENDENCIES) @rm -f update4$(EXEEXT) $(LINK) $(update4_OBJECTS) $(update4_LDADD) $(LIBS) @@ -921,6 +945,7 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/show-abbrev.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/show-die-info.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/showptable.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-elf_cntl_gelf_getshdr.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-flag-nobits.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-nlist.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/typeiter.Po@am__quote@ @@ -1076,14 +1101,15 @@ check-TESTS: $(TESTS) fi; \ dashes=`echo "$$dashes" | sed s/./=/g`; \ if test "$$failed" -eq 0; then \ - echo "$$grn$$dashes"; \ + col="$$grn"; \ else \ - echo "$$red$$dashes"; \ + col="$$red"; \ fi; \ - echo "$$banner"; \ - test -z "$$skipped" || echo "$$skipped"; \ - test -z "$$report" || echo "$$report"; \ - echo "$$dashes$$std"; \ + echo "$${col}$$dashes$${std}"; \ + echo "$${col}$$banner$${std}"; \ + test -z "$$skipped" || echo "$${col}$$skipped$${std}"; \ + test -z "$$report" || echo "$${col}$$report$${std}"; \ + echo "$${col}$$dashes$${std}"; \ test "$$failed" -eq 0; \ else :; fi @@ -1118,9 +1144,10 @@ distdir: $(DISTFILES) fi; \ done check-am: all-am + $(MAKE) $(AM_MAKEFLAGS) $(check_PROGRAMS) $(MAKE) $(AM_MAKEFLAGS) check-TESTS check: check-am -all-am: Makefile $(PROGRAMS) +all-am: Makefile installdirs: install: install-am install-exec: install-exec-am @@ -1132,10 +1159,15 @@ install-am: all-am installcheck: installcheck-am install-strip: - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - `test -z '$(STRIP)' || \ - echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install + if test -z '$(STRIP)'; then \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + install; \ + else \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ + fi mostlyclean-generic: clean-generic: @@ -1151,7 +1183,7 @@ maintainer-clean-generic: @STANDALONE_TRUE@installcheck-local: clean: clean-am -clean-am: clean-generic clean-noinstPROGRAMS mostlyclean-am +clean-am: clean-checkPROGRAMS clean-generic mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) @@ -1221,7 +1253,7 @@ uninstall-am: .MAKE: check-am install-am install-strip .PHONY: CTAGS GTAGS all all-am check check-TESTS check-am clean \ - clean-generic clean-noinstPROGRAMS ctags distclean \ + clean-checkPROGRAMS clean-generic ctags distclean \ distclean-compile distclean-generic distclean-tags distdir dvi \ dvi-am html html-am info info-am install install-am \ install-data install-data-am install-dvi install-dvi-am \ diff --git a/elfutils/tests/allregs.c b/elfutils/tests/allregs.c index b30d8999..b103ce18 100644 --- a/elfutils/tests/allregs.c +++ b/elfutils/tests/allregs.c @@ -28,43 +28,25 @@ #include ELFUTILS_HEADER(dwfl) #include <dwarf.h> +#include "../libdw/known-dwarf.h" static const char * dwarf_encoding_string (unsigned int code) { - static const char *known[] = + static const char *const known[] = { - [DW_ATE_void] = "void", - [DW_ATE_address] = "address", - [DW_ATE_boolean] = "boolean", - [DW_ATE_complex_float] = "complex_float", - [DW_ATE_float] = "float", - [DW_ATE_signed] = "signed", - [DW_ATE_signed_char] = "signed_char", - [DW_ATE_unsigned] = "unsigned", - [DW_ATE_unsigned_char] = "unsigned_char", - [DW_ATE_imaginary_float] = "imaginary_float", - [DW_ATE_packed_decimal] = "packed_decimal", - [DW_ATE_numeric_string] = "numeric_string", - [DW_ATE_edited] = "edited", - [DW_ATE_signed_fixed] = "signed_fixed", - [DW_ATE_unsigned_fixed] = "unsigned_fixed", - [DW_ATE_decimal_float] = "decimal_float", +#define ONE_KNOWN_DW_ATE(NAME, CODE) [CODE] = #NAME, + ALL_KNOWN_DW_ATE +#undef ONE_KNOWN_DW_ATE }; - if (code < sizeof (known) / sizeof (known[0])) + if (likely (code < sizeof (known) / sizeof (known[0]))) return known[code]; - if (code >= DW_ATE_lo_user && code <= DW_ATE_hi_user) - { - static char buf[30]; - snprintf (buf, sizeof (buf), "lo_user+%u", code - DW_ATE_lo_user); - return buf; - } - - return "???"; + return NULL; } + static int first_module (Dwfl_Module *mod, void **userdatap __attribute__ ((unused)), diff --git a/elfutils/tests/libtestfile_multi_shared.so.bz2 b/elfutils/tests/libtestfile_multi_shared.so.bz2 Binary files differnew file mode 100755 index 00000000..e9eb6a70 --- /dev/null +++ b/elfutils/tests/libtestfile_multi_shared.so.bz2 diff --git a/elfutils/tests/run-allregs.sh b/elfutils/tests/run-allregs.sh index cc483429..09657153 100755 --- a/elfutils/tests/run-allregs.sh +++ b/elfutils/tests/run-allregs.sh @@ -2584,4 +2584,73 @@ FPU registers: 63: $fpcr (fpcr), unsigned 64 bits EOF +regs_test testfile60 <<\EOF +integer registers: + 0: r0 (r0), signed 64 bits + 1: r1 (r1), signed 64 bits + 2: r2 (r2), signed 64 bits + 3: r3 (r3), signed 64 bits + 4: r4 (r4), signed 64 bits + 5: r5 (r5), signed 64 bits + 6: r6 (r6), signed 64 bits + 7: r7 (r7), signed 64 bits + 8: r8 (r8), signed 64 bits + 9: r9 (r9), signed 64 bits + 10: r10 (r10), signed 64 bits + 11: r11 (r11), signed 64 bits + 12: r12 (r12), signed 64 bits + 13: r13 (r13), signed 64 bits + 14: r14 (r14), signed 64 bits + 15: r15 (r15), signed 64 bits + 16: r16 (r16), signed 64 bits + 17: r17 (r17), signed 64 bits + 18: r18 (r18), signed 64 bits + 19: r19 (r19), signed 64 bits + 20: r20 (r20), signed 64 bits + 21: r21 (r21), signed 64 bits + 22: r22 (r22), signed 64 bits + 23: r23 (r23), signed 64 bits + 24: r24 (r24), signed 64 bits + 25: r25 (r25), signed 64 bits + 26: r26 (r26), signed 64 bits + 27: r27 (r27), signed 64 bits + 28: r28 (r28), signed 64 bits + 29: r29 (r29), signed 64 bits + 30: r30 (r30), signed 64 bits + 31: r31 (r31), signed 64 bits + 32: r32 (r32), signed 64 bits + 33: r33 (r33), signed 64 bits + 34: r34 (r34), signed 64 bits + 35: r35 (r35), signed 64 bits + 36: r36 (r36), signed 64 bits + 37: r37 (r37), signed 64 bits + 38: r38 (r38), signed 64 bits + 39: r39 (r39), signed 64 bits + 40: r40 (r40), signed 64 bits + 41: r41 (r41), signed 64 bits + 42: r42 (r42), signed 64 bits + 43: r43 (r43), signed 64 bits + 44: r44 (r44), signed 64 bits + 45: r45 (r45), signed 64 bits + 46: r46 (r46), signed 64 bits + 47: r47 (r47), signed 64 bits + 48: r48 (r48), signed 64 bits + 49: r49 (r49), signed 64 bits + 50: r50 (r50), signed 64 bits + 51: r51 (r51), signed 64 bits + 52: r52 (r52), signed 64 bits + 53: tp (tp), address 64 bits + 54: sp (sp), address 64 bits + 55: lr (lr), address 64 bits + 56: sn (sn), unsigned 64 bits + 57: idn0 (idn0), unsigned 64 bits + 58: idn1 (idn1), unsigned 64 bits + 59: udn0 (udn0), unsigned 64 bits + 60: udn1 (udn1), unsigned 64 bits + 61: udn2 (udn2), unsigned 64 bits + 62: udn3 (udn3), unsigned 64 bits + 63: zero (zero), unsigned 64 bits + 64: pc (pc), address 64 bits +EOF + exit 0 diff --git a/elfutils/tests/run-elf_cntl_gelf_getshdr.sh b/elfutils/tests/run-elf_cntl_gelf_getshdr.sh new file mode 100755 index 00000000..41a7d15b --- /dev/null +++ b/elfutils/tests/run-elf_cntl_gelf_getshdr.sh @@ -0,0 +1,30 @@ +#! /bin/sh +# Copyright (C) 2012 Red Hat, Inc. +# This file is part of elfutils. +# +# This file is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 3 of the License, or +# (at your option) any later version. +# +# elfutils is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see <http://www.gnu.org/licenses/>. + +. $srcdir/test-subr.sh + +# However we open the elf file, the shdrs should be the same. +testrun ./test-elf_cntl_gelf_getshdr READ test-elf_cntl_gelf_getshdr \ + > test_shdr.out + +testrun_compare ./test-elf_cntl_gelf_getshdr MMAP test-elf_cntl_gelf_getshdr \ + < test_shdr.out + +testrun_compare ./test-elf_cntl_gelf_getshdr FDREAD test-elf_cntl_gelf_getshdr \ + < test_shdr.out + +rm -f test_shdr.out diff --git a/elfutils/tests/run-elflint-self.sh b/elfutils/tests/run-elflint-self.sh index 8aca9e18..4b010087 100755 --- a/elfutils/tests/run-elflint-self.sh +++ b/elfutils/tests/run-elflint-self.sh @@ -18,37 +18,4 @@ . $srcdir/test-subr.sh -status=0 -runtest() { -# Uncomment for debuging -# echo $1 - if [ -f $1 ]; then - testrun ../src/elflint --quiet --gnu-ld $1 || - { echo "*** failure in $1"; status=1; } - fi -} - -runtest ../src/addr2line -runtest ../src/elfcmp -runtest ../src/elflint -runtest ../src/findtextrel -runtest ../src/ld -runtest ../src/nm -runtest ../src/objdump -runtest ../src/readelf -runtest ../src/size -runtest ../src/strip -runtest ../libelf/libelf.so -runtest ../libdw/libdw.so -runtest ../libasm/libasm.so -runtest ../libebl/libebl_alpha.so -runtest ../libebl/libebl_arm.so -runtest ../libebl/libebl_i386.so -runtest ../libebl/libebl_ia64.so -runtest ../libebl/libebl_ppc.so -runtest ../libebl/libebl_ppc64.so -runtest ../libebl/libebl_sh.so -runtest ../libebl/libebl_sparc.so -runtest ../libebl/libebl_x86_64.so - -exit $status +testrun_on_self ../src/elflint --quiet --gnu-ld diff --git a/elfutils/tests/run-macro-test.sh b/elfutils/tests/run-macro-test.sh new file mode 100755 index 00000000..70a16edf --- /dev/null +++ b/elfutils/tests/run-macro-test.sh @@ -0,0 +1,53 @@ +#! /bin/sh +# Copyright (C) 2012 Red Hat, Inc. +# This file is part of elfutils. +# +# This file is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 3 of the License, or +# (at your option) any later version. +# +# elfutils is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see <http://www.gnu.org/licenses/>. + +. $srcdir/test-subr.sh + +# #include <string.h> +# +# #define HELLO "world" +# +# int +# main(int argc, char ** argv) +# { +# return strlen (HELLO); +# } +# +# gcc -gdwarf-4 -g3 -o testfile-macros macro.c +# gcc -gstrict-dwarf -gdwarf-4 -g3 -o testfile-macinfo macro.c + +testfiles testfile-macinfo testfile-macros + +status=0 + +testrun ../src/readelf --debug-dump=info testfile-macinfo \ + | grep macro_info > readelf.macros.out || + { echo "*** failure readelf --debug-dump=info testfile-macinfo"; status=1; } +testrun_compare cat readelf.macros.out <<\EOF + macro_info (sec_offset) 0 +EOF + +testrun ../src/readelf --debug-dump=info testfile-macros \ + | grep GNU_macros > readelf.macros.out || + { echo "*** failure readelf --debug-dump=info testfile-macros"; status=1; } +testrun_compare cat readelf.macros.out <<\EOF + GNU_macros (sec_offset) 0 +EOF + +rm -f readelf.macros.out + +exit $status diff --git a/elfutils/tests/run-nm-self.sh b/elfutils/tests/run-nm-self.sh new file mode 100755 index 00000000..0fe0ec62 --- /dev/null +++ b/elfutils/tests/run-nm-self.sh @@ -0,0 +1,26 @@ +#! /bin/sh +# Copyright (C) 2012 Red Hat, Inc. +# This file is part of elfutils. +# +# This file is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 3 of the License, or +# (at your option) any later version. +# +# elfutils is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see <http://www.gnu.org/licenses/>. + +. $srcdir/test-subr.sh + +for what_arg in --debug-syms --defined-only --dynamic --extern-only; do + for format_arg in --format=bsd --format=sysv --format=posix; do + for out_arg in --numeric-sort --no-sort --reverse-sort; do + testrun_on_self_quiet ../src/nm $what_arg $format_arg $out_arg + done + done +done diff --git a/elfutils/tests/run-readelf-dwz-multi.sh b/elfutils/tests/run-readelf-dwz-multi.sh new file mode 100755 index 00000000..aadbbbe1 --- /dev/null +++ b/elfutils/tests/run-readelf-dwz-multi.sh @@ -0,0 +1,156 @@ +#! /bin/sh +# Copyright (C) 2012 Red Hat, Inc. +# This file is part of elfutils. +# +# This file is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 3 of the License, or +# (at your option) any later version. +# +# elfutils is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see <http://www.gnu.org/licenses/>. + +. $srcdir/test-subr.sh + +# common.h +# +# #include <stdio.h> +# +# struct foobar +# { +# int foo; +# struct foobar *bar; +# }; +# +# extern int call_foo(struct foobar *foobar_struct_ptr); + +# main.c +# +# #include "common.h" +# +# int main(int argc, char ** argv) +# { +# struct foobar b; +# b.foo = 42; +# b.bar = &b; +# +# return call_foo(b.bar); +# } + +# shared.c +# +# #include "common.h" +# +# int call_foo(struct foobar *fb) +# { +# return fb->bar->foo - 42; +# } + +# gcc -fPIC -g -c -Wall shared.c +# gcc -shared -o libtestfile_multi_shared.so shared.o +# gcc -g -o testfile_multi_main -L. -ltestfile_multi_shared main.c -Wl,-rpath,. +# dwz -m testfile_multi.dwz testfile_multi_main libtestfile_multi_shared.so + +testfiles libtestfile_multi_shared.so testfile_multi_main testfile_multi.dwz + +testrun_compare ../src/readelf --debug-dump=info testfile_multi_main <<\EOF + +DWARF section [28] '.debug_info' at offset 0x1078: + [Offset] + Compilation unit at offset 0: + Version: 4, Abbreviation section offset: 0, Address size: 8, Offset size: 4 + [ b] compile_unit + producer (strp) "GNU C 4.7.0 20120507 (Red Hat 4.7.0-5) -mtune=generic -march=x86-64 -g" + language (data1) C89 (1) + name (strp) "main.c" + comp_dir (GNU_strp_alt) "/home/mark/src/tests/dwz" + low_pc (addr) 0x00000000004006ac <main> + high_pc (udata) 44 + stmt_list (sec_offset) 0 + [ 26] imported_unit + import (GNU_ref_alt) [ b] + [ 2b] pointer_type + byte_size (data1) 8 + type (GNU_ref_alt) [ 53] + [ 31] subprogram + external (flag_present) + name (strp) "main" + decl_file (data1) 1 + decl_line (data1) 3 + prototyped (flag_present) + type (GNU_ref_alt) [ 3e] + low_pc (addr) 0x00000000004006ac <main> + high_pc (udata) 44 + frame_base (exprloc) + [ 0] call_frame_cfa + GNU_all_tail_call_sites (flag_present) + sibling (ref_udata) [ 6e] + [ 48] formal_parameter + name (strp) "argc" + decl_file (data1) 1 + decl_line (data1) 3 + type (GNU_ref_alt) [ 3e] + location (exprloc) + [ 0] fbreg -36 + [ 56] formal_parameter + name (strp) "argv" + decl_file (data1) 1 + decl_line (data1) 3 + type (ref_udata) [ 6e] + location (exprloc) + [ 0] fbreg -48 + [ 61] variable + name (string) "b" + decl_file (data1) 1 + decl_line (data1) 5 + type (GNU_ref_alt) [ 5a] + location (exprloc) + [ 0] fbreg -32 + [ 6e] pointer_type + byte_size (data1) 8 + type (ref_udata) [ 2b] +EOF + +testrun_compare ../src/readelf --debug-dump=info libtestfile_multi_shared.so <<\EOF + +DWARF section [25] '.debug_info' at offset 0x106c: + [Offset] + Compilation unit at offset 0: + Version: 4, Abbreviation section offset: 0, Address size: 8, Offset size: 4 + [ b] compile_unit + producer (strp) "GNU C 4.7.0 20120507 (Red Hat 4.7.0-5) -fpreprocessed -mtune=generic -march=x86-64 -g -fPIC" + language (data1) C89 (1) + name (strp) "shared.c" + comp_dir (GNU_strp_alt) "/home/mark/src/tests/dwz" + low_pc (addr) +0x0000000000000670 <call_foo> + high_pc (udata) 23 + stmt_list (sec_offset) 0 + [ 26] imported_unit + import (GNU_ref_alt) [ b] + [ 2b] subprogram + external (flag_present) + name (strp) "call_foo" + decl_file (data1) 1 + decl_line (data1) 3 + prototyped (flag_present) + type (GNU_ref_alt) [ 3e] + low_pc (addr) +0x0000000000000670 <call_foo> + high_pc (udata) 23 + frame_base (exprloc) + [ 0] call_frame_cfa + GNU_all_call_sites (flag_present) + [ 41] formal_parameter + name (string) "fb" + decl_file (data1) 1 + decl_line (data1) 3 + type (GNU_ref_alt) [ 76] + location (exprloc) + [ 0] fbreg -24 +EOF + +exit 0 diff --git a/elfutils/tests/run-readelf-gdb_index.sh b/elfutils/tests/run-readelf-gdb_index.sh new file mode 100755 index 00000000..31c94c14 --- /dev/null +++ b/elfutils/tests/run-readelf-gdb_index.sh @@ -0,0 +1,130 @@ +#! /bin/sh +# Copyright (C) 2012 Red Hat, Inc. +# This file is part of elfutils. +# +# This file is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 3 of the License, or +# (at your option) any later version. +# +# elfutils is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see <http://www.gnu.org/licenses/>. + +. $srcdir/test-subr.sh + +# common.h +# struct foo +# { +# const char *bar; +# }; +# +# extern char *global; +# int say (struct foo *prefix); + +# hello.c +# #include "common.h" +# +# static char *hello = "Hello"; +# +# int +# main (int argc, char **argv) +# { +# struct foo baz; +# global = hello; +# baz.bar = global; +# return say(&baz); +# } + +# world.c +# #include "common.h" +# +# char *global; +# +# static int hello (const char *bar) +# { +# return bar == global; +# } +# +# int +# say (struct foo *prefix) +# { +# return hello (prefix->bar); +# } + +# gcc -g -fdebug-types-section -c hello.c +# gcc -g -fdebug-types-section -c world.c +# gcc -g -fdebug-types-section -o testfilegdbindex7 hello.o world.o +# gdb testfilegdbindex7 +# (gdb) save gdb-index . +# objcopy --add-section .gdb_index=testfilegdbindex7.gdb-index --set-section-flags .gdb_index=readonly testfilegdbindex7 testfilegdbindex7 + +testfiles testfilegdbindex5 testfilegdbindex7 + +testrun_compare ../src/readelf --debug-dump=gdb_index testfilegdbindex5 <<\EOF + +GDB section [33] '.gdb_index' at offset 0xe76 contains 8383 bytes : + Version: 5 + CU offset: 0x18 + TU offset: 0x38 + address offset: 0x50 + symbol offset: 0x78 + constant offset: 0x2078 + + CU list at offset 0x18 contains 2 entries: + [ 0] start: 00000000, length: 184 + [ 1] start: 0x0000b8, length: 204 + + TU list at offset 0x38 contains 1 entries: + [ 0] CU offset: 0, type offset: 29, signature: 0x87e03f92cc37cdf0 + + Address list at offset 0x50 contains 2 entries: + [ 0] 0x000000000040049c <main>..0x00000000004004d1 <main+0x35>, CU index: 0 + [ 1] 0x00000000004004d4 <hello>..0x000000000040050b <say+0x1c>, CU index: 1 + + Symbol table at offset 0x50 contains 1024 slots: + [ 123] symbol: global, CUs: 1 + [ 489] symbol: main, CUs: 0 + [ 518] symbol: char, CUs: 0 + [ 661] symbol: foo, CUs: 0T + [ 741] symbol: hello, CUs: 0, 1 + [ 746] symbol: say, CUs: 1 + [ 754] symbol: int, CUs: 0 +EOF + +testrun_compare ../src/readelf --debug-dump=gdb_index testfilegdbindex7 <<\EOF + +GDB section [33] '.gdb_index' at offset 0xe76 contains 8399 bytes : + Version: 7 + CU offset: 0x18 + TU offset: 0x38 + address offset: 0x50 + symbol offset: 0x78 + constant offset: 0x2078 + + CU list at offset 0x18 contains 2 entries: + [ 0] start: 00000000, length: 184 + [ 1] start: 0x0000b8, length: 204 + + TU list at offset 0x38 contains 1 entries: + [ 0] CU offset: 0, type offset: 29, signature: 0x87e03f92cc37cdf0 + + Address list at offset 0x50 contains 2 entries: + [ 0] 0x000000000040049c <main>..0x00000000004004d1 <main+0x35>, CU index: 0 + [ 1] 0x00000000004004d4 <hello>..0x000000000040050b <say+0x1c>, CU index: 1 + + Symbol table at offset 0x50 contains 1024 slots: + [ 123] symbol: global, CUs: 1 (var:G) + [ 489] symbol: main, CUs: 0 (func:G) + [ 518] symbol: char, CUs: 0 (type:S) + [ 661] symbol: foo, CUs: 0T (type:S) + [ 741] symbol: hello, CUs: 0 (var:S), 1 (func:S) + [ 746] symbol: say, CUs: 1 (func:G) + [ 754] symbol: int, CUs: 0 (type:S) +EOF + +exit 0 diff --git a/elfutils/tests/run-readelf-macro.sh b/elfutils/tests/run-readelf-macro.sh new file mode 100755 index 00000000..c65992bd --- /dev/null +++ b/elfutils/tests/run-readelf-macro.sh @@ -0,0 +1,345 @@ +#! /bin/sh +# Copyright (C) 2012 Red Hat, Inc. +# This file is part of elfutils. +# +# This file is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 3 of the License, or +# (at your option) any later version. +# +# elfutils is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see <http://www.gnu.org/licenses/>. + +. $srcdir/test-subr.sh + +# common.h +# #define ONE 1 +# #define TWO 2 +# #define THREE 3 +# +# #define WORLD "World" +# +# int say (const char *prefix); +# +# #define A 'a' +# #define B b +# #define C "C" +# +# #ifdef THREE +# #undef THREE +# #define THREE(ARG1,ARG2,ARG3) ARG3 +# #endif + +# hello.c +# #include "common.h" +# +# int +# main (int argc, char **argv) +# { +# return say (WORLD); +# } + +# world.c +# #include "common.h" +# +# int +# say (const char *prefix) +# { +# return prefix ? ONE : TWO; +# } + +# gcc -g3 -c hello.c +# gcc -g3 -c world.c +# gcc -g3 -o testfilemacro hello.o world.o + +testfiles testfilemacro + +testrun_compare ../src/readelf --debug-dump=macro testfilemacro <<\EOF + +DWARF section [32] '.debug_macro' at offset 0x2480: + + Offset: 0x0 + Version: 4 + Flag: 0x2 + Offset length: 4 + .debug_line offset: 0x0 + + #include offset 0x1a + start_file 0, [1] /home/mark/src/tests/hello.c + start_file 1, [2] /home/mark/src/tests/common.h + #include offset 0x582 + end_file + end_file + + Offset: 0x1a + Version: 4 + Flag: 0x0 + Offset length: 4 + + #define __STDC__ 1, line 1 (indirect) + #define __STDC_HOSTED__ 1, line 1 (indirect) + #define __GNUC__ 4, line 1 (indirect) + #define __GNUC_MINOR__ 7, line 1 (indirect) + #define __GNUC_PATCHLEVEL__ 1, line 1 (indirect) + #define __VERSION__ "4.7.1 20120629 (Red Hat 4.7.1-1)", line 1 (indirect) + #define __GNUC_RH_RELEASE__ 1, line 1 (indirect) + #define __ATOMIC_RELAXED 0, line 1 (indirect) + #define __ATOMIC_SEQ_CST 5, line 1 (indirect) + #define __ATOMIC_ACQUIRE 2, line 1 (indirect) + #define __ATOMIC_RELEASE 3, line 1 (indirect) + #define __ATOMIC_ACQ_REL 4, line 1 (indirect) + #define __ATOMIC_CONSUME 1, line 1 (indirect) + #define __FINITE_MATH_ONLY__ 0, line 1 (indirect) + #define _LP64 1, line 1 (indirect) + #define __LP64__ 1, line 1 (indirect) + #define __SIZEOF_INT__ 4, line 1 (indirect) + #define __SIZEOF_LONG__ 8, line 1 (indirect) + #define __SIZEOF_LONG_LONG__ 8, line 1 (indirect) + #define __SIZEOF_SHORT__ 2, line 1 (indirect) + #define __SIZEOF_FLOAT__ 4, line 1 (indirect) + #define __SIZEOF_DOUBLE__ 8, line 1 (indirect) + #define __SIZEOF_LONG_DOUBLE__ 16, line 1 (indirect) + #define __SIZEOF_SIZE_T__ 8, line 1 (indirect) + #define __CHAR_BIT__ 8, line 1 (indirect) + #define __BIGGEST_ALIGNMENT__ 16, line 1 (indirect) + #define __ORDER_LITTLE_ENDIAN__ 1234, line 1 (indirect) + #define __ORDER_BIG_ENDIAN__ 4321, line 1 (indirect) + #define __ORDER_PDP_ENDIAN__ 3412, line 1 (indirect) + #define __BYTE_ORDER__ __ORDER_LITTLE_ENDIAN__, line 1 (indirect) + #define __FLOAT_WORD_ORDER__ __ORDER_LITTLE_ENDIAN__, line 1 (indirect) + #define __SIZEOF_POINTER__ 8, line 1 (indirect) + #define __SIZE_TYPE__ long unsigned int, line 1 (indirect) + #define __PTRDIFF_TYPE__ long int, line 1 (indirect) + #define __WCHAR_TYPE__ int, line 1 (indirect) + #define __WINT_TYPE__ unsigned int, line 1 (indirect) + #define __INTMAX_TYPE__ long int, line 1 (indirect) + #define __UINTMAX_TYPE__ long unsigned int, line 1 (indirect) + #define __CHAR16_TYPE__ short unsigned int, line 1 (indirect) + #define __CHAR32_TYPE__ unsigned int, line 1 (indirect) + #define __SIG_ATOMIC_TYPE__ int, line 1 (indirect) + #define __INT8_TYPE__ signed char, line 1 (indirect) + #define __INT16_TYPE__ short int, line 1 (indirect) + #define __INT32_TYPE__ int, line 1 (indirect) + #define __INT64_TYPE__ long int, line 1 (indirect) + #define __UINT8_TYPE__ unsigned char, line 1 (indirect) + #define __UINT16_TYPE__ short unsigned int, line 1 (indirect) + #define __UINT32_TYPE__ unsigned int, line 1 (indirect) + #define __UINT64_TYPE__ long unsigned int, line 1 (indirect) + #define __INT_LEAST8_TYPE__ signed char, line 1 (indirect) + #define __INT_LEAST16_TYPE__ short int, line 1 (indirect) + #define __INT_LEAST32_TYPE__ int, line 1 (indirect) + #define __INT_LEAST64_TYPE__ long int, line 1 (indirect) + #define __UINT_LEAST8_TYPE__ unsigned char, line 1 (indirect) + #define __UINT_LEAST16_TYPE__ short unsigned int, line 1 (indirect) + #define __UINT_LEAST32_TYPE__ unsigned int, line 1 (indirect) + #define __UINT_LEAST64_TYPE__ long unsigned int, line 1 (indirect) + #define __INT_FAST8_TYPE__ signed char, line 1 (indirect) + #define __INT_FAST16_TYPE__ long int, line 1 (indirect) + #define __INT_FAST32_TYPE__ long int, line 1 (indirect) + #define __INT_FAST64_TYPE__ long int, line 1 (indirect) + #define __UINT_FAST8_TYPE__ unsigned char, line 1 (indirect) + #define __UINT_FAST16_TYPE__ long unsigned int, line 1 (indirect) + #define __UINT_FAST32_TYPE__ long unsigned int, line 1 (indirect) + #define __UINT_FAST64_TYPE__ long unsigned int, line 1 (indirect) + #define __INTPTR_TYPE__ long int, line 1 (indirect) + #define __UINTPTR_TYPE__ long unsigned int, line 1 (indirect) + #define __GXX_ABI_VERSION 1002, line 1 (indirect) + #define __SCHAR_MAX__ 127, line 1 (indirect) + #define __SHRT_MAX__ 32767, line 1 (indirect) + #define __INT_MAX__ 2147483647, line 1 (indirect) + #define __LONG_MAX__ 9223372036854775807L, line 1 (indirect) + #define __LONG_LONG_MAX__ 9223372036854775807LL, line 1 (indirect) + #define __WCHAR_MAX__ 2147483647, line 1 (indirect) + #define __WCHAR_MIN__ (-__WCHAR_MAX__ - 1), line 1 (indirect) + #define __WINT_MAX__ 4294967295U, line 1 (indirect) + #define __WINT_MIN__ 0U, line 1 (indirect) + #define __PTRDIFF_MAX__ 9223372036854775807L, line 1 (indirect) + #define __SIZE_MAX__ 18446744073709551615UL, line 1 (indirect) + #define __INTMAX_MAX__ 9223372036854775807L, line 1 (indirect) + #define __INTMAX_C(c) c ## L, line 1 (indirect) + #define __UINTMAX_MAX__ 18446744073709551615UL, line 1 (indirect) + #define __UINTMAX_C(c) c ## UL, line 1 (indirect) + #define __SIG_ATOMIC_MAX__ 2147483647, line 1 (indirect) + #define __SIG_ATOMIC_MIN__ (-__SIG_ATOMIC_MAX__ - 1), line 1 (indirect) + #define __INT8_MAX__ 127, line 1 (indirect) + #define __INT16_MAX__ 32767, line 1 (indirect) + #define __INT32_MAX__ 2147483647, line 1 (indirect) + #define __INT64_MAX__ 9223372036854775807L, line 1 (indirect) + #define __UINT8_MAX__ 255, line 1 (indirect) + #define __UINT16_MAX__ 65535, line 1 (indirect) + #define __UINT32_MAX__ 4294967295U, line 1 (indirect) + #define __UINT64_MAX__ 18446744073709551615UL, line 1 (indirect) + #define __INT_LEAST8_MAX__ 127, line 1 (indirect) + #define __INT8_C(c) c, line 1 (indirect) + #define __INT_LEAST16_MAX__ 32767, line 1 (indirect) + #define __INT16_C(c) c, line 1 (indirect) + #define __INT_LEAST32_MAX__ 2147483647, line 1 (indirect) + #define __INT32_C(c) c, line 1 (indirect) + #define __INT_LEAST64_MAX__ 9223372036854775807L, line 1 (indirect) + #define __INT64_C(c) c ## L, line 1 (indirect) + #define __UINT_LEAST8_MAX__ 255, line 1 (indirect) + #define __UINT8_C(c) c, line 1 (indirect) + #define __UINT_LEAST16_MAX__ 65535, line 1 (indirect) + #define __UINT16_C(c) c, line 1 (indirect) + #define __UINT_LEAST32_MAX__ 4294967295U, line 1 (indirect) + #define __UINT32_C(c) c ## U, line 1 (indirect) + #define __UINT_LEAST64_MAX__ 18446744073709551615UL, line 1 (indirect) + #define __UINT64_C(c) c ## UL, line 1 (indirect) + #define __INT_FAST8_MAX__ 127, line 1 (indirect) + #define __INT_FAST16_MAX__ 9223372036854775807L, line 1 (indirect) + #define __INT_FAST32_MAX__ 9223372036854775807L, line 1 (indirect) + #define __INT_FAST64_MAX__ 9223372036854775807L, line 1 (indirect) + #define __UINT_FAST8_MAX__ 255, line 1 (indirect) + #define __UINT_FAST16_MAX__ 18446744073709551615UL, line 1 (indirect) + #define __UINT_FAST32_MAX__ 18446744073709551615UL, line 1 (indirect) + #define __UINT_FAST64_MAX__ 18446744073709551615UL, line 1 (indirect) + #define __INTPTR_MAX__ 9223372036854775807L, line 1 (indirect) + #define __UINTPTR_MAX__ 18446744073709551615UL, line 1 (indirect) + #define __FLT_EVAL_METHOD__ 0, line 1 (indirect) + #define __DEC_EVAL_METHOD__ 2, line 1 (indirect) + #define __FLT_RADIX__ 2, line 1 (indirect) + #define __FLT_MANT_DIG__ 24, line 1 (indirect) + #define __FLT_DIG__ 6, line 1 (indirect) + #define __FLT_MIN_EXP__ (-125), line 1 (indirect) + #define __FLT_MIN_10_EXP__ (-37), line 1 (indirect) + #define __FLT_MAX_EXP__ 128, line 1 (indirect) + #define __FLT_MAX_10_EXP__ 38, line 1 (indirect) + #define __FLT_DECIMAL_DIG__ 9, line 1 (indirect) + #define __FLT_MAX__ 3.40282346638528859812e+38F, line 1 (indirect) + #define __FLT_MIN__ 1.17549435082228750797e-38F, line 1 (indirect) + #define __FLT_EPSILON__ 1.19209289550781250000e-7F, line 1 (indirect) + #define __FLT_DENORM_MIN__ 1.40129846432481707092e-45F, line 1 (indirect) + #define __FLT_HAS_DENORM__ 1, line 1 (indirect) + #define __FLT_HAS_INFINITY__ 1, line 1 (indirect) + #define __FLT_HAS_QUIET_NAN__ 1, line 1 (indirect) + #define __DBL_MANT_DIG__ 53, line 1 (indirect) + #define __DBL_DIG__ 15, line 1 (indirect) + #define __DBL_MIN_EXP__ (-1021), line 1 (indirect) + #define __DBL_MIN_10_EXP__ (-307), line 1 (indirect) + #define __DBL_MAX_EXP__ 1024, line 1 (indirect) + #define __DBL_MAX_10_EXP__ 308, line 1 (indirect) + #define __DBL_DECIMAL_DIG__ 17, line 1 (indirect) + #define __DBL_MAX__ ((double)1.79769313486231570815e+308L), line 1 (indirect) + #define __DBL_MIN__ ((double)2.22507385850720138309e-308L), line 1 (indirect) + #define __DBL_EPSILON__ ((double)2.22044604925031308085e-16L), line 1 (indirect) + #define __DBL_DENORM_MIN__ ((double)4.94065645841246544177e-324L), line 1 (indirect) + #define __DBL_HAS_DENORM__ 1, line 1 (indirect) + #define __DBL_HAS_INFINITY__ 1, line 1 (indirect) + #define __DBL_HAS_QUIET_NAN__ 1, line 1 (indirect) + #define __LDBL_MANT_DIG__ 64, line 1 (indirect) + #define __LDBL_DIG__ 18, line 1 (indirect) + #define __LDBL_MIN_EXP__ (-16381), line 1 (indirect) + #define __LDBL_MIN_10_EXP__ (-4931), line 1 (indirect) + #define __LDBL_MAX_EXP__ 16384, line 1 (indirect) + #define __LDBL_MAX_10_EXP__ 4932, line 1 (indirect) + #define __DECIMAL_DIG__ 21, line 1 (indirect) + #define __LDBL_MAX__ 1.18973149535723176502e+4932L, line 1 (indirect) + #define __LDBL_MIN__ 3.36210314311209350626e-4932L, line 1 (indirect) + #define __LDBL_EPSILON__ 1.08420217248550443401e-19L, line 1 (indirect) + #define __LDBL_DENORM_MIN__ 3.64519953188247460253e-4951L, line 1 (indirect) + #define __LDBL_HAS_DENORM__ 1, line 1 (indirect) + #define __LDBL_HAS_INFINITY__ 1, line 1 (indirect) + #define __LDBL_HAS_QUIET_NAN__ 1, line 1 (indirect) + #define __DEC32_MANT_DIG__ 7, line 1 (indirect) + #define __DEC32_MIN_EXP__ (-94), line 1 (indirect) + #define __DEC32_MAX_EXP__ 97, line 1 (indirect) + #define __DEC32_MIN__ 1E-95DF, line 1 (indirect) + #define __DEC32_MAX__ 9.999999E96DF, line 1 (indirect) + #define __DEC32_EPSILON__ 1E-6DF, line 1 (indirect) + #define __DEC32_SUBNORMAL_MIN__ 0.000001E-95DF, line 1 (indirect) + #define __DEC64_MANT_DIG__ 16, line 1 (indirect) + #define __DEC64_MIN_EXP__ (-382), line 1 (indirect) + #define __DEC64_MAX_EXP__ 385, line 1 (indirect) + #define __DEC64_MIN__ 1E-383DD, line 1 (indirect) + #define __DEC64_MAX__ 9.999999999999999E384DD, line 1 (indirect) + #define __DEC64_EPSILON__ 1E-15DD, line 1 (indirect) + #define __DEC64_SUBNORMAL_MIN__ 0.000000000000001E-383DD, line 1 (indirect) + #define __DEC128_MANT_DIG__ 34, line 1 (indirect) + #define __DEC128_MIN_EXP__ (-6142), line 1 (indirect) + #define __DEC128_MAX_EXP__ 6145, line 1 (indirect) + #define __DEC128_MIN__ 1E-6143DL, line 1 (indirect) + #define __DEC128_MAX__ 9.999999999999999999999999999999999E6144DL, line 1 (indirect) + #define __DEC128_EPSILON__ 1E-33DL, line 1 (indirect) + #define __DEC128_SUBNORMAL_MIN__ 0.000000000000000000000000000000001E-6143DL, line 1 (indirect) + #define __REGISTER_PREFIX__ , line 1 (indirect) + #define __USER_LABEL_PREFIX__ , line 1 (indirect) + #define __GNUC_GNU_INLINE__ 1, line 1 (indirect) + #define __NO_INLINE__ 1, line 1 (indirect) + #define __GCC_HAVE_SYNC_COMPARE_AND_SWAP_1 1, line 1 (indirect) + #define __GCC_HAVE_SYNC_COMPARE_AND_SWAP_2 1, line 1 (indirect) + #define __GCC_HAVE_SYNC_COMPARE_AND_SWAP_4 1, line 1 (indirect) + #define __GCC_HAVE_SYNC_COMPARE_AND_SWAP_8 1, line 1 (indirect) + #define __GCC_ATOMIC_BOOL_LOCK_FREE 2, line 1 (indirect) + #define __GCC_ATOMIC_CHAR_LOCK_FREE 2, line 1 (indirect) + #define __GCC_ATOMIC_CHAR16_T_LOCK_FREE 2, line 1 (indirect) + #define __GCC_ATOMIC_CHAR32_T_LOCK_FREE 2, line 1 (indirect) + #define __GCC_ATOMIC_WCHAR_T_LOCK_FREE 2, line 1 (indirect) + #define __GCC_ATOMIC_SHORT_LOCK_FREE 2, line 1 (indirect) + #define __GCC_ATOMIC_INT_LOCK_FREE 2, line 1 (indirect) + #define __GCC_ATOMIC_LONG_LOCK_FREE 2, line 1 (indirect) + #define __GCC_ATOMIC_LLONG_LOCK_FREE 2, line 1 (indirect) + #define __GCC_ATOMIC_TEST_AND_SET_TRUEVAL 1, line 1 (indirect) + #define __GCC_ATOMIC_POINTER_LOCK_FREE 2, line 1 (indirect) + #define __GCC_HAVE_DWARF2_CFI_ASM 1, line 1 (indirect) + #define __PRAGMA_REDEFINE_EXTNAME 1, line 1 (indirect) + #define __SIZEOF_INT128__ 16, line 1 (indirect) + #define __SIZEOF_WCHAR_T__ 4, line 1 (indirect) + #define __SIZEOF_WINT_T__ 4, line 1 (indirect) + #define __SIZEOF_PTRDIFF_T__ 8, line 1 (indirect) + #define __amd64 1, line 1 (indirect) + #define __amd64__ 1, line 1 (indirect) + #define __x86_64 1, line 1 (indirect) + #define __x86_64__ 1, line 1 (indirect) + #define __k8 1, line 1 (indirect) + #define __k8__ 1, line 1 (indirect) + #define __MMX__ 1, line 1 (indirect) + #define __SSE__ 1, line 1 (indirect) + #define __SSE2__ 1, line 1 (indirect) + #define __SSE_MATH__ 1, line 1 (indirect) + #define __SSE2_MATH__ 1, line 1 (indirect) + #define __gnu_linux__ 1, line 1 (indirect) + #define __linux 1, line 1 (indirect) + #define __linux__ 1, line 1 (indirect) + #define linux 1, line 1 (indirect) + #define __unix 1, line 1 (indirect) + #define __unix__ 1, line 1 (indirect) + #define unix 1, line 1 (indirect) + #define __ELF__ 1, line 1 (indirect) + #define __DECIMAL_BID_FORMAT__ 1, line 1 (indirect) + + Offset: 0x582 + Version: 4 + Flag: 0x0 + Offset length: 4 + + #define ONE 1, line 1 (indirect) + #define TWO 2, line 2 (indirect) + #define THREE 3, line 3 (indirect) + #define WORLD "World", line 5 (indirect) + #define A 'a', line 9 (indirect) + #define B b, line 10 + #define C "C", line 11 (indirect) + #undef THREE, line 14 (indirect) + #define THREE(ARG1,ARG2,ARG3) ARG3, line 15 (indirect) + + Offset: 0x5bc + Version: 4 + Flag: 0x2 + Offset length: 4 + .debug_line offset: 0x47 + + #include offset 0x1a + start_file 0, [1] /home/mark/src/tests/world.c + start_file 1, [2] /home/mark/src/tests/common.h + #include offset 0x582 + end_file + end_file + +EOF + +exit 0 diff --git a/elfutils/tests/run-readelf-self.sh b/elfutils/tests/run-readelf-self.sh new file mode 100755 index 00000000..4602712c --- /dev/null +++ b/elfutils/tests/run-readelf-self.sh @@ -0,0 +1,21 @@ +#! /bin/sh +# Copyright (C) 2012 Red Hat, Inc. +# This file is part of elfutils. +# +# This file is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 3 of the License, or +# (at your option) any later version. +# +# elfutils is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see <http://www.gnu.org/licenses/>. + +. $srcdir/test-subr.sh + +# Just makes sure readelf doesn't crash +testrun_on_self_quiet ../src/readelf -a -w diff --git a/elfutils/tests/run-test-archive64.sh b/elfutils/tests/run-test-archive64.sh new file mode 100755 index 00000000..26552ac9 --- /dev/null +++ b/elfutils/tests/run-test-archive64.sh @@ -0,0 +1,43 @@ +#! /bin/sh +# Copyright (C) 2012 Red Hat, Inc. +# This file is part of elfutils. +# +# This file is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 3 of the License, or +# (at your option) any later version. +# +# elfutils is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see <http://www.gnu.org/licenses/>. + +. $srcdir/test-subr.sh + +# The test archive was produced on an s390x machine using the +# following command sequence: +# echo 'int aaa(void){}' | gcc -x c /dev/stdin -c -o aaa.o +# echo 'int bbb(void){} int bbb2(void){}' | gcc -x c /dev/stdin -c -o bbb.o +# echo 'int ccc(void){} int ccc2(void){} int ccc3(void){}' \ +# | gcc -x c /dev/stdin -c -o ccc.o +# ar cru testarchive64.a aaa.o bbb.o ccc.o +testfiles testarchive64.a + +testrun_compare ../src/readelf -c testarchive64.a <<\EOF + +Index of archive 'testarchive64.a' has 7 entries: +Archive member 'aaa.o' contains: + aaa +Archive member 'bbb.o' contains: + bbb + bbb2 +Archive member 'ccc.o' contains: + ccc + ccc2 + ccc3 +EOF + +exit 0 diff --git a/elfutils/tests/run-unstrip-n.sh b/elfutils/tests/run-unstrip-n.sh index 342a6adc..1353b1dd 100755 --- a/elfutils/tests/run-unstrip-n.sh +++ b/elfutils/tests/run-unstrip-n.sh @@ -31,7 +31,7 @@ # # gcc -m32 -o rt_crash -lrt rt_crash.c -testfiles testcore-rtlib +testfiles testcore-rtlib testcore-rtlib-ppc testrun_compare ../src/unstrip -n --core=testcore-rtlib <<\EOF 0x8048000+0x2000 f1c600bc36cb91bf01f9a63a634ecb79aa4c3199@0x8048178 . - [exe] @@ -42,4 +42,15 @@ testrun_compare ../src/unstrip -n --core=testcore-rtlib <<\EOF 0xf77d7000+0x21000 6d2cb32650054f1c176d01d48713a4a5e5e84c1a@0xf77d7124 /lib/ld-linux.so.2 - ld-linux.so.2 EOF +testrun_compare ../src/unstrip -n --core=testcore-rtlib-ppc <<\EOF +0x10000000+0x20000 979b7a26747cc09bd84a42b311b5288c704baea5@0x10000174 . - [exe] +0x100000+0x10000 708b900b05176964512a6b0fe90c2a0c9d73d726@0x100334 . - linux-vdso32.so.1 +0xfd50000+0x30000 3f7d21508470322d2f47acddc20ab10516edba99@0xfd50164 /lib/librt.so.1 - librt.so.1 +0xfdf0000+0x1c0000 edf3dd232e09d01b90683889bd16b9406c52d4de@0xfdf0184 /lib/libc.so.6 - libc.so.6 +0xfdb0000+0x40000 f6ee91d4c629bc7dacc10534cb30056914e7e0b5@0xfdb0164 /lib/libpthread.so.0 - libpthread.so.0 +0xffb0000+0x50000 edec437a85026a1cf8cda94003706202733130c1@0xffb0124 /lib/ld.so.1 - ld.so.1 +EOF + +test_cleanup + exit 0 diff --git a/elfutils/tests/show-die-info.c b/elfutils/tests/show-die-info.c index cdd0d54f..0c298acd 100644 --- a/elfutils/tests/show-die-info.c +++ b/elfutils/tests/show-die-info.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1998, 1999, 2000, 2001, 2002, 2004, 2006 Red Hat, Inc. +/* Copyright (C) 1998-2002, 2004, 2006, 2012 Red Hat, Inc. This file is part of elfutils. Written by Ulrich Drepper <drepper@redhat.com>, 1998. @@ -26,191 +26,33 @@ #include <string.h> #include <unistd.h> +#include "../libdw/known-dwarf.h" -static const char *tagnames[] = +static const char * +dwarf_tag_string (unsigned int tag) { - [DW_TAG_array_type] = "DW_TAG_array_type", - [DW_TAG_class_type] = "DW_TAG_class_type", - [DW_TAG_entry_point] = "DW_TAG_entry_point", - [DW_TAG_enumeration_type] = "DW_TAG_enumeration_type", - [DW_TAG_formal_parameter] = "DW_TAG_formal_parameter", - [DW_TAG_imported_declaration] = "DW_TAG_imported_declaration", - [DW_TAG_label] = "DW_TAG_label", - [DW_TAG_lexical_block] = "DW_TAG_lexical_block", - [DW_TAG_member] = "DW_TAG_member", - [DW_TAG_pointer_type] = "DW_TAG_pointer_type", - [DW_TAG_reference_type] = "DW_TAG_reference_type", - [DW_TAG_compile_unit] = "DW_TAG_compile_unit", - [DW_TAG_string_type] = "DW_TAG_string_type", - [DW_TAG_structure_type] = "DW_TAG_structure_type", - [DW_TAG_subroutine_type] = "DW_TAG_subroutine_type", - [DW_TAG_typedef] = "DW_TAG_typedef", - [DW_TAG_union_type] = "DW_TAG_union_type", - [DW_TAG_unspecified_parameters] = "DW_TAG_unspecified_parameters", - [DW_TAG_variant] = "DW_TAG_variant", - [DW_TAG_common_block] = "DW_TAG_common_block", - [DW_TAG_common_inclusion] = "DW_TAG_common_inclusion", - [DW_TAG_inheritance] = "DW_TAG_inheritance", - [DW_TAG_inlined_subroutine] = "DW_TAG_inlined_subroutine", - [DW_TAG_module] = "DW_TAG_module", - [DW_TAG_ptr_to_member_type] = "DW_TAG_ptr_to_member_type", - [DW_TAG_set_type] = "DW_TAG_set_type", - [DW_TAG_subrange_type] = "DW_TAG_subrange_type", - [DW_TAG_with_stmt] = "DW_TAG_with_stmt", - [DW_TAG_access_declaration] = "DW_TAG_access_declaration", - [DW_TAG_base_type] = "DW_TAG_base_type", - [DW_TAG_catch_block] = "DW_TAG_catch_block", - [DW_TAG_const_type] = "DW_TAG_const_type", - [DW_TAG_constant] = "DW_TAG_constant", - [DW_TAG_enumerator] = "DW_TAG_enumerator", - [DW_TAG_file_type] = "DW_TAG_file_type", - [DW_TAG_friend] = "DW_TAG_friend", - [DW_TAG_namelist] = "DW_TAG_namelist", - [DW_TAG_namelist_item] = "DW_TAG_namelist_item", - [DW_TAG_packed_type] = "DW_TAG_packed_type", - [DW_TAG_subprogram] = "DW_TAG_subprogram", - [DW_TAG_template_type_parameter] = "DW_TAG_template_type_parameter", - [DW_TAG_template_value_parameter] = "DW_TAG_template_value_parameter", - [DW_TAG_thrown_type] = "DW_TAG_thrown_type", - [DW_TAG_try_block] = "DW_TAG_try_block", - [DW_TAG_variant_part] = "DW_TAG_variant_part", - [DW_TAG_variable] = "DW_TAG_variable", - [DW_TAG_volatile_type] = "DW_TAG_volatile_type", - [DW_TAG_dwarf_procedure] = "DW_TAG_dwarf_procedure", - [DW_TAG_restrict_type] = "DW_TAG_restrict_type", - [DW_TAG_interface_type] = "DW_TAG_interface_type", - [DW_TAG_namespace] = "DW_TAG_namespace", - [DW_TAG_imported_module] = "DW_TAG_imported_module", - [DW_TAG_unspecified_type] = "DW_TAG_unspecified_type", - [DW_TAG_partial_unit] = "DW_TAG_partial_unit", - [DW_TAG_imported_unit] = "DW_TAG_imported_unit", - [DW_TAG_mutable_type] = "DW_TAG_mutable_type", - [DW_TAG_condition] = "DW_TAG_condition", - [DW_TAG_shared_type] = "DW_TAG_shared_type", -}; -#define ntagnames (sizeof (tagnames) / sizeof (tagnames[0])) - - -const struct -{ - int code; - const char *name; -} attrs[] = + switch (tag) + { +#define ONE_KNOWN_DW_TAG(NAME, CODE) case CODE: return #NAME; + ALL_KNOWN_DW_TAG +#undef ONE_KNOWN_DW_TAG + default: + return NULL; + } +} + +static const char * +dwarf_attr_string (unsigned int attrnum) { - { DW_AT_sibling, "sibling" }, - { DW_AT_location, "location" }, - { DW_AT_name, "name" }, - { DW_AT_ordering, "ordering" }, - { DW_AT_subscr_data, "subscr_data" }, - { DW_AT_byte_size, "byte_size" }, - { DW_AT_bit_offset, "bit_offset" }, - { DW_AT_bit_size, "bit_size" }, - { DW_AT_element_list, "element_list" }, - { DW_AT_stmt_list, "stmt_list" }, - { DW_AT_low_pc, "low_pc" }, - { DW_AT_high_pc, "high_pc" }, - { DW_AT_language, "language" }, - { DW_AT_member, "member" }, - { DW_AT_discr, "discr" }, - { DW_AT_discr_value, "discr_value" }, - { DW_AT_visibility, "visibility" }, - { DW_AT_import, "import" }, - { DW_AT_string_length, "string_length" }, - { DW_AT_common_reference, "common_reference" }, - { DW_AT_comp_dir, "comp_dir" }, - { DW_AT_const_value, "const_value" }, - { DW_AT_containing_type, "containing_type" }, - { DW_AT_default_value, "default_value" }, - { DW_AT_inline, "inline" }, - { DW_AT_is_optional, "is_optional" }, - { DW_AT_lower_bound, "lower_bound" }, - { DW_AT_producer, "producer" }, - { DW_AT_prototyped, "prototyped" }, - { DW_AT_return_addr, "return_addr" }, - { DW_AT_start_scope, "start_scope" }, - { DW_AT_bit_stride, "bit_stride" }, - { DW_AT_upper_bound, "upper_bound" }, - { DW_AT_abstract_origin, "abstract_origin" }, - { DW_AT_accessibility, "accessibility" }, - { DW_AT_address_class, "address_class" }, - { DW_AT_artificial, "artificial" }, - { DW_AT_base_types, "base_types" }, - { DW_AT_calling_convention, "calling_convention" }, - { DW_AT_count, "count" }, - { DW_AT_data_member_location, "data_member_location" }, - { DW_AT_decl_column, "decl_column" }, - { DW_AT_decl_file, "decl_file" }, - { DW_AT_decl_line, "decl_line" }, - { DW_AT_declaration, "declaration" }, - { DW_AT_discr_list, "discr_list" }, - { DW_AT_encoding, "encoding" }, - { DW_AT_external, "external" }, - { DW_AT_frame_base, "frame_base" }, - { DW_AT_friend, "friend" }, - { DW_AT_identifier_case, "identifier_case" }, - { DW_AT_macro_info, "macro_info" }, - { DW_AT_namelist_item, "namelist_item" }, - { DW_AT_priority, "priority" }, - { DW_AT_segment, "segment" }, - { DW_AT_specification, "specification" }, - { DW_AT_static_link, "static_link" }, - { DW_AT_type, "type" }, - { DW_AT_use_location, "use_location" }, - { DW_AT_variable_parameter, "variable_parameter" }, - { DW_AT_virtuality, "virtuality" }, - { DW_AT_vtable_elem_location, "vtable_elem_location" }, - { DW_AT_allocated, "allocated" }, - { DW_AT_associated, "associated" }, - { DW_AT_data_location, "data_location" }, - { DW_AT_byte_stride, "byte_stride" }, - { DW_AT_entry_pc, "entry_pc" }, - { DW_AT_use_UTF8, "use_UTF8" }, - { DW_AT_extension, "extension" }, - { DW_AT_ranges, "ranges" }, - { DW_AT_trampoline, "trampoline" }, - { DW_AT_call_column, "call_column" }, - { DW_AT_call_file, "call_file" }, - { DW_AT_call_line, "call_line" }, - { DW_AT_description, "description" }, - { DW_AT_binary_scale, "binary_scale" }, - { DW_AT_decimal_scale, "decimal_scale" }, - { DW_AT_small, "small" }, - { DW_AT_decimal_sign, "decimal_sign" }, - { DW_AT_digit_count, "digit_count" }, - { DW_AT_picture_string, "picture_string" }, - { DW_AT_mutable, "mutable" }, - { DW_AT_threads_scaled, "threads_scaled" }, - { DW_AT_explicit, "explicit" }, - { DW_AT_object_pointer, "object_pointer" }, - { DW_AT_endianity, "endianity" }, - { DW_AT_elemental, "elemental" }, - { DW_AT_pure, "pure" }, - { DW_AT_recursive, "recursive" }, - { DW_AT_MIPS_fde, "MIPS_fde" }, - { DW_AT_MIPS_loop_begin, "MIPS_loop_begin" }, - { DW_AT_MIPS_tail_loop_begin, "MIPS_tail_loop_begin" }, - { DW_AT_MIPS_epilog_begin, "MIPS_epilog_begin" }, - { DW_AT_MIPS_loop_unroll_factor, "MIPS_loop_unroll_factor" }, - { DW_AT_MIPS_software_pipeline_depth, "MIPS_software_pipeline_depth" }, - { DW_AT_MIPS_linkage_name, "MIPS_linkage_name" }, - { DW_AT_MIPS_stride, "MIPS_stride" }, - { DW_AT_MIPS_abstract_name, "MIPS_abstract_name" }, - { DW_AT_MIPS_clone_origin, "MIPS_clone_origin" }, - { DW_AT_MIPS_has_inlines, "MIPS_has_inlines" }, - { DW_AT_MIPS_stride_byte, "MIPS_stride_byte" }, - { DW_AT_MIPS_stride_elem, "MIPS_stride_elem" }, - { DW_AT_MIPS_ptr_dopetype, "MIPS_ptr_dopetype" }, - { DW_AT_MIPS_allocatable_dopetype, "MIPS_allocatable_dopetype" }, - { DW_AT_MIPS_assumed_shape_dopetype, "MIPS_assumed_shape_dopetype" }, - { DW_AT_MIPS_assumed_size, "MIPS_assumed_size" }, - { DW_AT_sf_names, "sf_names" }, - { DW_AT_src_info, "src_info" }, - { DW_AT_mac_info, "mac_info" }, - { DW_AT_src_coords, "src_coords" }, - { DW_AT_body_begin, "body_begin" }, - { DW_AT_body_end, "body_end" }, -}; -#define nattrs (sizeof (attrs) / sizeof (attrs[0])) + switch (attrnum) + { +#define ONE_KNOWN_DW_AT(NAME, CODE) case CODE: return #NAME; + ALL_KNOWN_DW_AT +#undef ONE_KNOWN_DW_AT + default: + return NULL; + } +} void @@ -230,9 +72,8 @@ handle (Dwarf *dbg, Dwarf_Die *die, int n) tag = dwarf_tag (die); if (tag != DW_TAG_invalid) { - if (tag < ntagnames) - str = tagnames[tag]; - else + str = dwarf_tag_string (tag); + if (str == NULL) { snprintf (buf, sizeof buf, "%#x", tag); str = buf; @@ -248,15 +89,15 @@ handle (Dwarf *dbg, Dwarf_Die *die, int n) off = dwarf_dieoffset (die); cuoff = dwarf_cuoffset (die); - printf ("%*s%s\n", n * 5, "", str); + printf ("%*sDW_TAG_%s\n", n * 5, "", str); printf ("%*s Name : %s\n", n * 5, "", name); printf ("%*s Offset : %lld\n", n * 5, "", (long long int) off); printf ("%*s CU offset : %lld\n", n * 5, "", (long long int) cuoff); printf ("%*s Attrs :", n * 5, ""); - for (cnt = 0; cnt < nattrs; ++cnt) - if (dwarf_hasattr (die, attrs[cnt].code)) - printf (" %s", attrs[cnt].name); + for (cnt = 0; cnt < 0xffff; ++cnt) + if (dwarf_hasattr (die, cnt)) + printf (" %s", dwarf_attr_string (cnt)); puts (""); if (dwarf_hasattr (die, DW_AT_low_pc) && dwarf_lowpc (die, &addr) == 0) diff --git a/elfutils/tests/test-elf_cntl_gelf_getshdr.c b/elfutils/tests/test-elf_cntl_gelf_getshdr.c new file mode 100644 index 00000000..b561b53c --- /dev/null +++ b/elfutils/tests/test-elf_cntl_gelf_getshdr.c @@ -0,0 +1,103 @@ +/* Copyright (C) 2012 Red Hat, Inc. + This file is part of elfutils. + + This file is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + elfutils is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +#include <sys/types.h> +#include <sys/stat.h> +#include <stdio.h> +#include <stdlib.h> +#include <unistd.h> +#include <errno.h> +#include <string.h> +#include <fcntl.h> +#include <gelf.h> +#include <libelf.h> +#include <stdbool.h> +#include <inttypes.h> + +int +main (int argc, char *argv[]) +{ + if (argc != 3) + { + fprintf (stderr, "Needs two arguments.\n"); + fprintf (stderr, "First needs to be 'READ', 'MMAP' or 'FDREAD'\n"); + fprintf (stderr, "Second is the ELF file to read.\n"); + exit (2); /* user error */ + } + + bool do_mmap = false; + bool close_fd = false; + if (strcmp (argv[1], "READ") == 0) + { + do_mmap = false; + close_fd = false; + } + else if (strcmp (argv[1], "MMAP") == 0) + { + do_mmap = true; + close_fd = false; + } + else if (strcmp (argv[1], "FDREAD") == 0) + { + do_mmap = false; + close_fd = true; + } + else + { + fprintf (stderr, "First arg needs to be 'READ', 'MMAP' or 'FDREAD'\n"); + exit (2); /* user error */ + } + + elf_version (EV_CURRENT); + + int fd = open (argv[2], O_RDONLY); + if (fd < 0) + { + fprintf (stderr, "Cannot open input file %s: %s\n", argv[2], + strerror (errno)); + exit (2); + } + + Elf *elf = elf_begin (fd, do_mmap ? ELF_C_READ_MMAP : ELF_C_READ, NULL); + if (elf == NULL) + { + fprintf (stderr, "elf_begin failed for %s: %s\n", argv[2], + elf_errmsg (-1)); + exit (2); + } + + if (! do_mmap && close_fd) + { + if (elf_cntl (elf, ELF_C_FDREAD) < 0) + { + fprintf (stderr, "elf_cntl failed for %s: %s\n", argv[2], + elf_errmsg (-1)); + exit (1); + } + close (fd); + } + + Elf_Scn *scn = NULL; + while ((scn = elf_nextscn (elf, scn)) != NULL) + { + GElf_Shdr shdr_mem; + GElf_Shdr *shdr = gelf_getshdr (scn, &shdr_mem); + printf ("Section at offset %#0" PRIx64 "\n", shdr->sh_offset); + } + + elf_end (elf); + exit (0); +} diff --git a/elfutils/tests/test-subr.sh b/elfutils/tests/test-subr.sh index 09efa534..ff29136f 100644 --- a/elfutils/tests/test-subr.sh +++ b/elfutils/tests/test-subr.sh @@ -103,3 +103,36 @@ program_transform() { echo "$*" | sed "${program_transform_name}" } + +self_test_files=`echo ../src/addr2line ../src/elfcmp ../src/elflint \ +../src/findtextrel ../src/ld ../src/nm ../src/objdump ../src/readelf \ +../src/size ../src/strip ../libelf/libelf.so ../libdw/libdw.so \ +../libasm/libasm.so ../backends/libebl_*.so` + +# Provide a command to run on all self-test files with testrun. +testrun_on_self() +{ + exit_status=0 + + for file in $self_test_files; do + testrun $* $file \ + || { echo "*** failure in $* $file"; exit_status=1; } + done + + # Only exit if something failed + if test $exit_status != 0; then exit $exit_status; fi +} + +# Same as above, but redirects stdout to /dev/null +testrun_on_self_quiet() +{ + exit_status=0 + + for file in $self_test_files; do + testrun $* $file > /dev/null \ + || { echo "*** failure in $* $file"; exit_status=1; } + done + + # Only exit if something failed + if test $exit_status != 0; then exit $exit_status; fi +} diff --git a/elfutils/tests/testarchive64.a.bz2 b/elfutils/tests/testarchive64.a.bz2 Binary files differnew file mode 100644 index 00000000..4b546033 --- /dev/null +++ b/elfutils/tests/testarchive64.a.bz2 diff --git a/elfutils/tests/testcore-rtlib-ppc.bz2 b/elfutils/tests/testcore-rtlib-ppc.bz2 Binary files differnew file mode 100644 index 00000000..a3cec603 --- /dev/null +++ b/elfutils/tests/testcore-rtlib-ppc.bz2 diff --git a/elfutils/tests/testfile-macinfo.bz2 b/elfutils/tests/testfile-macinfo.bz2 Binary files differnew file mode 100755 index 00000000..e6cc5f1c --- /dev/null +++ b/elfutils/tests/testfile-macinfo.bz2 diff --git a/elfutils/tests/testfile-macros.bz2 b/elfutils/tests/testfile-macros.bz2 Binary files differnew file mode 100755 index 00000000..d74df94c --- /dev/null +++ b/elfutils/tests/testfile-macros.bz2 diff --git a/elfutils/tests/testfile60.bz2 b/elfutils/tests/testfile60.bz2 Binary files differnew file mode 100755 index 00000000..6a0cd7bc --- /dev/null +++ b/elfutils/tests/testfile60.bz2 diff --git a/elfutils/tests/testfile_multi.dwz.bz2 b/elfutils/tests/testfile_multi.dwz.bz2 Binary files differnew file mode 100644 index 00000000..1f52fb69 --- /dev/null +++ b/elfutils/tests/testfile_multi.dwz.bz2 diff --git a/elfutils/tests/testfile_multi_main.bz2 b/elfutils/tests/testfile_multi_main.bz2 Binary files differnew file mode 100755 index 00000000..bc6ca5fd --- /dev/null +++ b/elfutils/tests/testfile_multi_main.bz2 diff --git a/elfutils/tests/testfilegdbindex5.bz2 b/elfutils/tests/testfilegdbindex5.bz2 Binary files differnew file mode 100755 index 00000000..45ee945a --- /dev/null +++ b/elfutils/tests/testfilegdbindex5.bz2 diff --git a/elfutils/tests/testfilegdbindex7.bz2 b/elfutils/tests/testfilegdbindex7.bz2 Binary files differnew file mode 100755 index 00000000..2a7c6c2c --- /dev/null +++ b/elfutils/tests/testfilegdbindex7.bz2 diff --git a/elfutils/tests/testfilemacro.bz2 b/elfutils/tests/testfilemacro.bz2 Binary files differnew file mode 100755 index 00000000..7db51ff5 --- /dev/null +++ b/elfutils/tests/testfilemacro.bz2 |