summaryrefslogtreecommitdiff
path: root/elfutils/tests
diff options
context:
space:
mode:
Diffstat (limited to 'elfutils/tests')
-rw-r--r--elfutils/tests/ChangeLog59
-rw-r--r--elfutils/tests/Makefile.am95
-rw-r--r--elfutils/tests/Makefile.in261
-rw-r--r--elfutils/tests/allfcts.c50
-rw-r--r--elfutils/tests/line2addr.c65
-rwxr-xr-xelfutils/tests/run-allfcts.sh46
-rwxr-xr-xelfutils/tests/run-arextract.sh5
-rwxr-xr-xelfutils/tests/run-line2addr.sh44
-rwxr-xr-xelfutils/tests/run-strip-test.sh30
-rwxr-xr-xelfutils/tests/run-strip-test2.sh24
-rwxr-xr-xelfutils/tests/run-strip-test3.sh24
-rwxr-xr-xelfutils/tests/run-strip-test4.sh5
-rwxr-xr-xelfutils/tests/run-strip-test5.sh5
-rwxr-xr-xelfutils/tests/run-strip-test6.sh5
-rw-r--r--elfutils/tests/show-abbrev.c4
-rw-r--r--elfutils/tests/testfile14.bz2bin0 -> 2903 bytes
-rw-r--r--elfutils/tests/testfile15.bz2bin0 -> 3132 bytes
-rw-r--r--elfutils/tests/testfile15.debug.bz2bin0 -> 28499 bytes
-rw-r--r--elfutils/tests/testfile16.bz2bin0 -> 8424 bytes
-rw-r--r--elfutils/tests/testfile16.debug.bz2bin0 -> 23520 bytes
-rw-r--r--elfutils/tests/testfile17.bz2bin0 -> 1660 bytes
-rw-r--r--elfutils/tests/testfile17.debug.bz2bin0 -> 9134 bytes
-rw-r--r--[-rwxr-xr-x]elfutils/tests/testfile9.bz2bin8367 -> 8367 bytes
23 files changed, 514 insertions, 208 deletions
diff --git a/elfutils/tests/ChangeLog b/elfutils/tests/ChangeLog
index 05e36331..b1918d8f 100644
--- a/elfutils/tests/ChangeLog
+++ b/elfutils/tests/ChangeLog
@@ -1,3 +1,62 @@
+2005-05-08 Ulrich Drepper <drepper@redhat.com>
+
+ * run-line2addr.sh: Remove testfile14 at the end.
+
+ * run-strip-test.sh: Remove deubinfo test input file as well.
+
+ * Makefile.am (EXTRA_DIST): Newly added files incorrectly used
+ .bz, not .bz2.
+
+2005-05-03 Roland McGrath <roland@redhat.com>
+
+ * run-strip-test.sh: Use variables for test file names.
+ Optionally produce separate debug file and check it.
+ * run-strip-test2.sh: Use run-strip-test.sh via ., no duplication.
+ * run-strip-test3.sh: Likewise.
+ * run-strip-test4.sh: New file.
+ * run-strip-test5.sh: New file.
+ * run-strip-test6.sh: New file.
+ * testfile15.bz: New file.
+ * testfile15.debug.bz: New file.
+ * testfile16.bz: New file.
+ * testfile16.debug.bz: New file.
+ * testfile17.bz: New file.
+ * testfile17.debug.bz: New file.
+ * Makefile.am (TESTS, EXTRA_DIST): Add them.
+
+2005-04-25 Ulrich Drepper <drepper@redhat.com>
+
+ * run-line2addr.sh: Also use testfile14. Adjust for correct
+ return of multiple matches.
+ * testfile14.bz2: New file.
+ * Makefile.am (EXTRA_DIST): Add testfile14.bz2.
+
+ * show-abbrev.c (main): Adjust for dwarf_getabbrev interface change.
+
+2005-04-04 Roland McGrath <roland@frob.com>
+
+ * line2addr.c (main): Initialize LINES and NLINES before calling
+ dwarf_getsrc_file, and free LINES afterwards.
+
+ * allfcts.c (main): Use size_t for CUHL.
+
+2005-04-04 Ulrich Drepper <drepper@redhat.com>
+
+ * line2addr.c: New file.
+ * run-line2addr.sh: New file.
+ * Makefile.am: Add rules to build, run, and distribute new code.
+
+2005-04-02 Ulrich Drepper <drepper@redhat.com>
+
+ * allfcts.c: New file.
+ * run-allfcts.sh: New file.
+ * Makefile.am: Add rules to build, run, and distribute new code.
+
+2005-02-05 Ulrich Drepper <drepper@redhat.com>
+
+ * Makefile.am [MUDFLAP] (AM_CFLAGS): Add -fmudflap. Link all test
+ programs with -lmudflap.
+
2004-09-25 Ulrich Drepper <drepper@redhat.com>
* asm-tst4.c (main): Add LD_LIBRARY_PATH to elflint invocation.
diff --git a/elfutils/tests/Makefile.am b/elfutils/tests/Makefile.am
index 1e4f9a8d..769a2314 100644
--- a/elfutils/tests/Makefile.am
+++ b/elfutils/tests/Makefile.am
@@ -1,7 +1,6 @@
## Process this file with automake to create Makefile.in
-## Configure input file for elfutils.
##
-## Copyright (C) 1996-2002, 2003, 2004 Red Hat, Inc.
+## Copyright (C) 1996-2002, 2003, 2004, 2005 Red Hat, Inc.
##
## This program is Open Source software; you can redistribute it and/or
## modify it under the terms of the Open Software License version 1.0 as
@@ -14,8 +13,12 @@
## 3001 King Ranch Road, Ukiah, CA 95482.
##
DEFS = -DHAVE_CONFIG_H -D_GNU_SOURCE
-AM_CFLAGS = -Wall -Werror -std=gnu99
-if !MUDFLAP
+if MUDFLAP
+AM_CFLAGS = -Wall -Werror -std=gnu99 -fmudflap\
+ $(if $($(*F)_no_Wformat),-Wno-format,-Wformat=2)
+else
+AM_CFLAGS = -Wall -Werror -std=gnu99 \
+ $(if $($(*F)_no_Wformat),-Wno-format,-Wformat=2)
AM_LDFLAGS = -Wl,-rpath,\$$ORIGIN/../libasm:\$$ORIGIN/../libdw:\$$ORIGIN/../libebl:\$$ORIGIN/../libelf
endif
INCLUDES = -I$(top_srcdir)/libasm -I$(top_srcdir)/libdw \
@@ -25,7 +28,7 @@ INCLUDES = -I$(top_srcdir)/libasm -I$(top_srcdir)/libdw \
noinst_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 \
+ get-aranges allfcts line2addr \
show-abbrev hash asm-tst1 asm-tst2 asm-tst3 \
asm-tst4 asm-tst5 asm-tst6 asm-tst7 asm-tst8 asm-tst9 \
msg_tst newscn ecp
@@ -34,11 +37,12 @@ noinst_PROGRAMS = arextract arsymtest newfile saridx scnnames sectiondump \
TESTS = run-arextract.sh run-arsymtest.sh newfile test-nlist \
update1 update2 update3 update4 \
run-show-die-info.sh run-get-files.sh run-get-lines.sh \
- run-get-pubnames.sh run-get-aranges.sh \
- run-show-abbrev.sh hash asm-tst1 asm-tst2 \
+ run-get-pubnames.sh run-get-aranges.sh run-allfcts.sh \
+ run-show-abbrev.sh run-line2addr.sh hash asm-tst1 asm-tst2 \
asm-tst3 asm-tst4 asm-tst5 asm-tst6 asm-tst7 asm-tst8 asm-tst9 \
msg_tst newscn run-strip-test.sh run-strip-test2.sh \
- run-strip-test3.sh run-ecp-test.sh run-ecp-test2.sh
+ run-strip-test3.sh run-strip-test4.sh run-strip-test5.sh \
+ run-strip-test6.sh run-ecp-test.sh run-ecp-test2.sh
# run-show-ciefde.sh
EXTRA_DIST = run-arextract.sh run-arsymtest.sh \
@@ -49,12 +53,18 @@ EXTRA_DIST = run-arextract.sh run-arsymtest.sh \
testfile.bz2 testfile2.bz2 testfile3.bz2 testfile4.bz2 \
testfile5.bz2 testfile6.bz2 testfile7.bz2 testfile8.bz2 \
testfile9.bz2 testfile10.bz2 testfile11.bz2 testfile12.bz2 \
- testfile13.bz2 run-strip-test3.sh
+ testfile13.bz2 run-strip-test3.sh run-allfcts.sh \
+ run-line2addr.sh testfile14.bz2 \
+ run-strip-test4.sh run-strip-test5.sh run-strip-test6.sh \
+ testfile15.bz2 testfile15.debug.bz2 \
+ testfile16.bz2 testfile16.debug.bz2 \
+ testfile17.bz2 testfile17.debug.bz2
if MUDFLAP
libdw = ../libdw/libdw.a
libelf = ../libelf/libelf.a
libasm = ../libasm/libasm.a
+libmudflap = -lmudflap
else
libdw = ../libdw/libdw.so
libelf = ../libelf/libelf.so
@@ -62,37 +72,40 @@ libasm = ../libasm/libasm.so
endif
libebl = ../libebl/libebl.a
-arextract_LDADD = $(libelf)
-arsymtest_LDADD = $(libelf)
-newfile_LDADD = $(libelf)
-saridx_LDADD = $(libelf)
-scnnames_LDADD = $(libelf)
-sectiondump_LDADD = $(libelf)
-showptable_LDADD = $(libelf)
-hash_LDADD = $(libelf)
-test_nlist_LDADD = $(libelf)
-msg_tst_LDADD = $(libelf)
-newscn_LDADD = $(libelf)
-ecp_LDADD = $(libelf)
-update1_LDADD = $(libelf)
-update2_LDADD = $(libelf)
-update3_LDADD = $(libebl) $(libelf)
-update4_LDADD = $(libebl) $(libelf)
-show_die_info_LDADD = $(libdw) $(libelf)
-get_pubnames_LDADD = $(libdw) $(libelf)
-show_abbrev_LDADD = $(libdw) $(libelf)
-get_lines_LDADD = $(libdw) $(libelf)
-get_files_LDADD = $(libdw) $(libelf)
-get_aranges_LDADD = $(libdw) $(libelf)
-#show_ciefde_LDADD = ../libdwarf/libdwarf.so $(libelf)
-asm_tst1_LDADD = $(libasm) $(libebl) $(libelf)
-asm_tst2_LDADD = $(libasm) $(libebl) $(libelf)
-asm_tst3_LDADD = $(libasm) $(libebl) $(libelf)
-asm_tst4_LDADD = $(libasm) $(libebl) $(libelf)
-asm_tst5_LDADD = $(libasm) $(libebl) $(libelf)
-asm_tst6_LDADD = $(libasm) $(libebl) $(libelf)
-asm_tst7_LDADD = $(libasm) $(libebl) $(libelf)
-asm_tst8_LDADD = $(libasm) $(libebl) $(libelf)
-asm_tst9_LDADD = $(libasm) $(libebl) $(libelf)
+arextract_LDADD = $(libelf) $(libmudflap)
+arsymtest_LDADD = $(libelf) $(libmudflap)
+newfile_LDADD = $(libelf) $(libmudflap)
+saridx_LDADD = $(libelf) $(libmudflap)
+scnnames_LDADD = $(libelf) $(libmudflap)
+sectiondump_LDADD = $(libelf) $(libmudflap)
+showptable_LDADD = $(libelf) $(libmudflap)
+hash_LDADD = $(libelf) $(libmudflap)
+test_nlist_LDADD = $(libelf) $(libmudflap)
+msg_tst_LDADD = $(libelf) $(libmudflap)
+newscn_LDADD = $(libelf) $(libmudflap)
+ecp_LDADD = $(libelf) $(libmudflap)
+update1_LDADD = $(libelf) $(libmudflap)
+update2_LDADD = $(libelf) $(libmudflap)
+update3_LDADD = $(libebl) $(libelf) $(libmudflap)
+update4_LDADD = $(libebl) $(libelf) $(libmudflap)
+show_die_info_LDADD = $(libdw) $(libelf) $(libmudflap)
+get_pubnames_LDADD = $(libdw) $(libelf) $(libmudflap)
+show_abbrev_LDADD = $(libdw) $(libelf) $(libmudflap)
+get_lines_LDADD = $(libdw) $(libelf) $(libmudflap)
+get_files_LDADD = $(libdw) $(libelf) $(libmudflap)
+get_aranges_LDADD = $(libdw) $(libelf) $(libmudflap)
+allfcts_LDADD = $(libdw) $(libelf) $(libmudflap)
+line2addr_no_Wformat = yes
+line2addr_LDADD = $(libdw) $(libelf) $(libmudflap)
+#show_ciefde_LDADD = ../libdwarf/libdwarf.so $(libelf) $(libmudflap)
+asm_tst1_LDADD = $(libasm) $(libebl) $(libelf) $(libmudflap)
+asm_tst2_LDADD = $(libasm) $(libebl) $(libelf) $(libmudflap)
+asm_tst3_LDADD = $(libasm) $(libebl) $(libelf) $(libmudflap)
+asm_tst4_LDADD = $(libasm) $(libebl) $(libelf) $(libmudflap)
+asm_tst5_LDADD = $(libasm) $(libebl) $(libelf) $(libmudflap)
+asm_tst6_LDADD = $(libasm) $(libebl) $(libelf) $(libmudflap)
+asm_tst7_LDADD = $(libasm) $(libebl) $(libelf) $(libmudflap)
+asm_tst8_LDADD = $(libasm) $(libebl) $(libelf) $(libmudflap)
+asm_tst9_LDADD = $(libasm) $(libebl) $(libelf) $(libmudflap)
CLEANFILES = xxx
diff --git a/elfutils/tests/Makefile.in b/elfutils/tests/Makefile.in
index c5dd6529..7c661ec1 100644
--- a/elfutils/tests/Makefile.in
+++ b/elfutils/tests/Makefile.in
@@ -1,8 +1,8 @@
-# Makefile.in generated by automake 1.9.2 from Makefile.am.
+# Makefile.in generated by automake 1.9.5 from Makefile.am.
# @configure_input@
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
-# 2003, 2004 Free Software Foundation, Inc.
+# 2003, 2004, 2005 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,7 @@
@SET_MAKE@
-SOURCES = arextract.c arsymtest.c asm-tst1.c asm-tst2.c asm-tst3.c asm-tst4.c asm-tst5.c asm-tst6.c asm-tst7.c asm-tst8.c asm-tst9.c ecp.c get-aranges.c get-files.c get-lines.c get-pubnames.c hash.c msg_tst.c newfile.c newscn.c saridx.c scnnames.c sectiondump.c show-abbrev.c show-die-info.c showptable.c test-nlist.c update1.c update2.c update3.c update4.c
+SOURCES = allfcts.c arextract.c arsymtest.c asm-tst1.c asm-tst2.c asm-tst3.c asm-tst4.c asm-tst5.c asm-tst6.c asm-tst7.c asm-tst8.c asm-tst9.c ecp.c get-aranges.c get-files.c get-lines.c get-pubnames.c hash.c line2addr.c msg_tst.c newfile.c newscn.c saridx.c scnnames.c sectiondump.c show-abbrev.c show-die-info.c showptable.c test-nlist.c update1.c update2.c update3.c update4.c
srcdir = @srcdir@
top_srcdir = @top_srcdir@
@@ -44,17 +44,16 @@ noinst_PROGRAMS = arextract$(EXEEXT) arsymtest$(EXEEXT) \
update2$(EXEEXT) update3$(EXEEXT) update4$(EXEEXT) \
test-nlist$(EXEEXT) show-die-info$(EXEEXT) get-files$(EXEEXT) \
get-lines$(EXEEXT) get-pubnames$(EXEEXT) get-aranges$(EXEEXT) \
- show-abbrev$(EXEEXT) hash$(EXEEXT) 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) msg_tst$(EXEEXT) \
- newscn$(EXEEXT) ecp$(EXEEXT)
+ allfcts$(EXEEXT) line2addr$(EXEEXT) show-abbrev$(EXEEXT) \
+ hash$(EXEEXT) 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) msg_tst$(EXEEXT) newscn$(EXEEXT) \
+ ecp$(EXEEXT)
subdir = tests
DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ChangeLog
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/m4/gettext.m4 \
- $(top_srcdir)/m4/iconv.m4 $(top_srcdir)/m4/lib-ld.m4 \
- $(top_srcdir)/m4/lib-link.m4 $(top_srcdir)/m4/lib-prefix.m4 \
$(top_srcdir)/m4/progtest.m4 $(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
@@ -62,117 +61,132 @@ mkinstalldirs = $(SHELL) $(top_srcdir)/config/mkinstalldirs
CONFIG_HEADER = $(top_builddir)/config.h
CONFIG_CLEAN_FILES =
PROGRAMS = $(noinst_PROGRAMS)
+allfcts_SOURCES = allfcts.c
+allfcts_OBJECTS = allfcts.$(OBJEXT)
+@MUDFLAP_FALSE@am__DEPENDENCIES_1 = ../libdw/libdw.so
+@MUDFLAP_TRUE@am__DEPENDENCIES_1 = ../libdw/libdw.a
+@MUDFLAP_FALSE@am__DEPENDENCIES_2 = ../libelf/libelf.so
+@MUDFLAP_TRUE@am__DEPENDENCIES_2 = ../libelf/libelf.a
+am__DEPENDENCIES_3 =
+allfcts_DEPENDENCIES = $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_2) \
+ $(am__DEPENDENCIES_3)
arextract_SOURCES = arextract.c
arextract_OBJECTS = arextract.$(OBJEXT)
-@MUDFLAP_FALSE@am__DEPENDENCIES_1 = ../libelf/libelf.so
-@MUDFLAP_TRUE@am__DEPENDENCIES_1 = ../libelf/libelf.a
-arextract_DEPENDENCIES = $(am__DEPENDENCIES_1)
+arextract_DEPENDENCIES = $(am__DEPENDENCIES_2) $(am__DEPENDENCIES_3)
arsymtest_SOURCES = arsymtest.c
arsymtest_OBJECTS = arsymtest.$(OBJEXT)
-arsymtest_DEPENDENCIES = $(am__DEPENDENCIES_1)
+arsymtest_DEPENDENCIES = $(am__DEPENDENCIES_2) $(am__DEPENDENCIES_3)
asm_tst1_SOURCES = asm-tst1.c
asm_tst1_OBJECTS = asm-tst1.$(OBJEXT)
-@MUDFLAP_FALSE@am__DEPENDENCIES_2 = ../libasm/libasm.so
-@MUDFLAP_TRUE@am__DEPENDENCIES_2 = ../libasm/libasm.a
-am__DEPENDENCIES_3 = ../libebl/libebl.a
-asm_tst1_DEPENDENCIES = $(am__DEPENDENCIES_2) $(am__DEPENDENCIES_3) \
- $(am__DEPENDENCIES_1)
+@MUDFLAP_FALSE@am__DEPENDENCIES_4 = ../libasm/libasm.so
+@MUDFLAP_TRUE@am__DEPENDENCIES_4 = ../libasm/libasm.a
+am__DEPENDENCIES_5 = ../libebl/libebl.a
+asm_tst1_DEPENDENCIES = $(am__DEPENDENCIES_4) $(am__DEPENDENCIES_5) \
+ $(am__DEPENDENCIES_2) $(am__DEPENDENCIES_3)
asm_tst2_SOURCES = asm-tst2.c
asm_tst2_OBJECTS = asm-tst2.$(OBJEXT)
-asm_tst2_DEPENDENCIES = $(am__DEPENDENCIES_2) $(am__DEPENDENCIES_3) \
- $(am__DEPENDENCIES_1)
+asm_tst2_DEPENDENCIES = $(am__DEPENDENCIES_4) $(am__DEPENDENCIES_5) \
+ $(am__DEPENDENCIES_2) $(am__DEPENDENCIES_3)
asm_tst3_SOURCES = asm-tst3.c
asm_tst3_OBJECTS = asm-tst3.$(OBJEXT)
-asm_tst3_DEPENDENCIES = $(am__DEPENDENCIES_2) $(am__DEPENDENCIES_3) \
- $(am__DEPENDENCIES_1)
+asm_tst3_DEPENDENCIES = $(am__DEPENDENCIES_4) $(am__DEPENDENCIES_5) \
+ $(am__DEPENDENCIES_2) $(am__DEPENDENCIES_3)
asm_tst4_SOURCES = asm-tst4.c
asm_tst4_OBJECTS = asm-tst4.$(OBJEXT)
-asm_tst4_DEPENDENCIES = $(am__DEPENDENCIES_2) $(am__DEPENDENCIES_3) \
- $(am__DEPENDENCIES_1)
+asm_tst4_DEPENDENCIES = $(am__DEPENDENCIES_4) $(am__DEPENDENCIES_5) \
+ $(am__DEPENDENCIES_2) $(am__DEPENDENCIES_3)
asm_tst5_SOURCES = asm-tst5.c
asm_tst5_OBJECTS = asm-tst5.$(OBJEXT)
-asm_tst5_DEPENDENCIES = $(am__DEPENDENCIES_2) $(am__DEPENDENCIES_3) \
- $(am__DEPENDENCIES_1)
+asm_tst5_DEPENDENCIES = $(am__DEPENDENCIES_4) $(am__DEPENDENCIES_5) \
+ $(am__DEPENDENCIES_2) $(am__DEPENDENCIES_3)
asm_tst6_SOURCES = asm-tst6.c
asm_tst6_OBJECTS = asm-tst6.$(OBJEXT)
-asm_tst6_DEPENDENCIES = $(am__DEPENDENCIES_2) $(am__DEPENDENCIES_3) \
- $(am__DEPENDENCIES_1)
+asm_tst6_DEPENDENCIES = $(am__DEPENDENCIES_4) $(am__DEPENDENCIES_5) \
+ $(am__DEPENDENCIES_2) $(am__DEPENDENCIES_3)
asm_tst7_SOURCES = asm-tst7.c
asm_tst7_OBJECTS = asm-tst7.$(OBJEXT)
-asm_tst7_DEPENDENCIES = $(am__DEPENDENCIES_2) $(am__DEPENDENCIES_3) \
- $(am__DEPENDENCIES_1)
+asm_tst7_DEPENDENCIES = $(am__DEPENDENCIES_4) $(am__DEPENDENCIES_5) \
+ $(am__DEPENDENCIES_2) $(am__DEPENDENCIES_3)
asm_tst8_SOURCES = asm-tst8.c
asm_tst8_OBJECTS = asm-tst8.$(OBJEXT)
-asm_tst8_DEPENDENCIES = $(am__DEPENDENCIES_2) $(am__DEPENDENCIES_3) \
- $(am__DEPENDENCIES_1)
+asm_tst8_DEPENDENCIES = $(am__DEPENDENCIES_4) $(am__DEPENDENCIES_5) \
+ $(am__DEPENDENCIES_2) $(am__DEPENDENCIES_3)
asm_tst9_SOURCES = asm-tst9.c
asm_tst9_OBJECTS = asm-tst9.$(OBJEXT)
-asm_tst9_DEPENDENCIES = $(am__DEPENDENCIES_2) $(am__DEPENDENCIES_3) \
- $(am__DEPENDENCIES_1)
+asm_tst9_DEPENDENCIES = $(am__DEPENDENCIES_4) $(am__DEPENDENCIES_5) \
+ $(am__DEPENDENCIES_2) $(am__DEPENDENCIES_3)
ecp_SOURCES = ecp.c
ecp_OBJECTS = ecp.$(OBJEXT)
-ecp_DEPENDENCIES = $(am__DEPENDENCIES_1)
+ecp_DEPENDENCIES = $(am__DEPENDENCIES_2) $(am__DEPENDENCIES_3)
get_aranges_SOURCES = get-aranges.c
get_aranges_OBJECTS = get-aranges.$(OBJEXT)
-@MUDFLAP_FALSE@am__DEPENDENCIES_4 = ../libdw/libdw.so
-@MUDFLAP_TRUE@am__DEPENDENCIES_4 = ../libdw/libdw.a
-get_aranges_DEPENDENCIES = $(am__DEPENDENCIES_4) $(am__DEPENDENCIES_1)
+get_aranges_DEPENDENCIES = $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_2) \
+ $(am__DEPENDENCIES_3)
get_files_SOURCES = get-files.c
get_files_OBJECTS = get-files.$(OBJEXT)
-get_files_DEPENDENCIES = $(am__DEPENDENCIES_4) $(am__DEPENDENCIES_1)
+get_files_DEPENDENCIES = $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_2) \
+ $(am__DEPENDENCIES_3)
get_lines_SOURCES = get-lines.c
get_lines_OBJECTS = get-lines.$(OBJEXT)
-get_lines_DEPENDENCIES = $(am__DEPENDENCIES_4) $(am__DEPENDENCIES_1)
+get_lines_DEPENDENCIES = $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_2) \
+ $(am__DEPENDENCIES_3)
get_pubnames_SOURCES = get-pubnames.c
get_pubnames_OBJECTS = get-pubnames.$(OBJEXT)
-get_pubnames_DEPENDENCIES = $(am__DEPENDENCIES_4) \
- $(am__DEPENDENCIES_1)
+get_pubnames_DEPENDENCIES = $(am__DEPENDENCIES_1) \
+ $(am__DEPENDENCIES_2) $(am__DEPENDENCIES_3)
hash_SOURCES = hash.c
hash_OBJECTS = hash.$(OBJEXT)
-hash_DEPENDENCIES = $(am__DEPENDENCIES_1)
+hash_DEPENDENCIES = $(am__DEPENDENCIES_2) $(am__DEPENDENCIES_3)
+line2addr_SOURCES = line2addr.c
+line2addr_OBJECTS = line2addr.$(OBJEXT)
+line2addr_DEPENDENCIES = $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_2) \
+ $(am__DEPENDENCIES_3)
msg_tst_SOURCES = msg_tst.c
msg_tst_OBJECTS = msg_tst.$(OBJEXT)
-msg_tst_DEPENDENCIES = $(am__DEPENDENCIES_1)
+msg_tst_DEPENDENCIES = $(am__DEPENDENCIES_2) $(am__DEPENDENCIES_3)
newfile_SOURCES = newfile.c
newfile_OBJECTS = newfile.$(OBJEXT)
-newfile_DEPENDENCIES = $(am__DEPENDENCIES_1)
+newfile_DEPENDENCIES = $(am__DEPENDENCIES_2) $(am__DEPENDENCIES_3)
newscn_SOURCES = newscn.c
newscn_OBJECTS = newscn.$(OBJEXT)
-newscn_DEPENDENCIES = $(am__DEPENDENCIES_1)
+newscn_DEPENDENCIES = $(am__DEPENDENCIES_2) $(am__DEPENDENCIES_3)
saridx_SOURCES = saridx.c
saridx_OBJECTS = saridx.$(OBJEXT)
-saridx_DEPENDENCIES = $(am__DEPENDENCIES_1)
+saridx_DEPENDENCIES = $(am__DEPENDENCIES_2) $(am__DEPENDENCIES_3)
scnnames_SOURCES = scnnames.c
scnnames_OBJECTS = scnnames.$(OBJEXT)
-scnnames_DEPENDENCIES = $(am__DEPENDENCIES_1)
+scnnames_DEPENDENCIES = $(am__DEPENDENCIES_2) $(am__DEPENDENCIES_3)
sectiondump_SOURCES = sectiondump.c
sectiondump_OBJECTS = sectiondump.$(OBJEXT)
-sectiondump_DEPENDENCIES = $(am__DEPENDENCIES_1)
+sectiondump_DEPENDENCIES = $(am__DEPENDENCIES_2) $(am__DEPENDENCIES_3)
show_abbrev_SOURCES = show-abbrev.c
show_abbrev_OBJECTS = show-abbrev.$(OBJEXT)
-show_abbrev_DEPENDENCIES = $(am__DEPENDENCIES_4) $(am__DEPENDENCIES_1)
+show_abbrev_DEPENDENCIES = $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_2) \
+ $(am__DEPENDENCIES_3)
show_die_info_SOURCES = show-die-info.c
show_die_info_OBJECTS = show-die-info.$(OBJEXT)
-show_die_info_DEPENDENCIES = $(am__DEPENDENCIES_4) \
- $(am__DEPENDENCIES_1)
+show_die_info_DEPENDENCIES = $(am__DEPENDENCIES_1) \
+ $(am__DEPENDENCIES_2) $(am__DEPENDENCIES_3)
showptable_SOURCES = showptable.c
showptable_OBJECTS = showptable.$(OBJEXT)
-showptable_DEPENDENCIES = $(am__DEPENDENCIES_1)
+showptable_DEPENDENCIES = $(am__DEPENDENCIES_2) $(am__DEPENDENCIES_3)
test_nlist_SOURCES = test-nlist.c
test_nlist_OBJECTS = test-nlist.$(OBJEXT)
-test_nlist_DEPENDENCIES = $(am__DEPENDENCIES_1)
+test_nlist_DEPENDENCIES = $(am__DEPENDENCIES_2) $(am__DEPENDENCIES_3)
update1_SOURCES = update1.c
update1_OBJECTS = update1.$(OBJEXT)
-update1_DEPENDENCIES = $(am__DEPENDENCIES_1)
+update1_DEPENDENCIES = $(am__DEPENDENCIES_2) $(am__DEPENDENCIES_3)
update2_SOURCES = update2.c
update2_OBJECTS = update2.$(OBJEXT)
-update2_DEPENDENCIES = $(am__DEPENDENCIES_1)
+update2_DEPENDENCIES = $(am__DEPENDENCIES_2) $(am__DEPENDENCIES_3)
update3_SOURCES = update3.c
update3_OBJECTS = update3.$(OBJEXT)
-update3_DEPENDENCIES = $(am__DEPENDENCIES_3) $(am__DEPENDENCIES_1)
+update3_DEPENDENCIES = $(am__DEPENDENCIES_5) $(am__DEPENDENCIES_2) \
+ $(am__DEPENDENCIES_3)
update4_SOURCES = update4.c
update4_OBJECTS = update4.$(OBJEXT)
-update4_DEPENDENCIES = $(am__DEPENDENCIES_3) $(am__DEPENDENCIES_1)
+update4_DEPENDENCIES = $(am__DEPENDENCIES_5) $(am__DEPENDENCIES_2) \
+ $(am__DEPENDENCIES_3)
DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir)
depcomp = $(SHELL) $(top_srcdir)/config/depcomp
am__depfiles_maybe = depfiles
@@ -180,20 +194,20 @@ COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
CCLD = $(CC)
LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
-SOURCES = arextract.c arsymtest.c asm-tst1.c asm-tst2.c asm-tst3.c \
- asm-tst4.c asm-tst5.c asm-tst6.c asm-tst7.c asm-tst8.c \
- asm-tst9.c ecp.c get-aranges.c get-files.c get-lines.c \
- get-pubnames.c hash.c msg_tst.c newfile.c newscn.c saridx.c \
- scnnames.c sectiondump.c show-abbrev.c show-die-info.c \
- showptable.c test-nlist.c update1.c update2.c update3.c \
- update4.c
-DIST_SOURCES = arextract.c arsymtest.c asm-tst1.c asm-tst2.c \
+SOURCES = allfcts.c arextract.c arsymtest.c asm-tst1.c asm-tst2.c \
asm-tst3.c asm-tst4.c asm-tst5.c asm-tst6.c asm-tst7.c \
asm-tst8.c asm-tst9.c ecp.c get-aranges.c get-files.c \
- get-lines.c get-pubnames.c hash.c msg_tst.c newfile.c newscn.c \
- saridx.c scnnames.c sectiondump.c show-abbrev.c \
- show-die-info.c showptable.c test-nlist.c update1.c update2.c \
- update3.c update4.c
+ get-lines.c get-pubnames.c hash.c line2addr.c msg_tst.c \
+ newfile.c newscn.c saridx.c scnnames.c sectiondump.c \
+ show-abbrev.c show-die-info.c showptable.c test-nlist.c \
+ update1.c update2.c update3.c update4.c
+DIST_SOURCES = allfcts.c arextract.c arsymtest.c asm-tst1.c asm-tst2.c \
+ asm-tst3.c asm-tst4.c asm-tst5.c asm-tst6.c asm-tst7.c \
+ asm-tst8.c asm-tst9.c ecp.c get-aranges.c get-files.c \
+ get-lines.c get-pubnames.c hash.c line2addr.c msg_tst.c \
+ newfile.c newscn.c saridx.c scnnames.c sectiondump.c \
+ show-abbrev.c show-die-info.c showptable.c test-nlist.c \
+ update1.c update2.c update3.c update4.c
ETAGS = etags
CTAGS = ctags
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
@@ -208,7 +222,6 @@ AWK = @AWK@
CC = @CC@
CCDEPMODE = @CCDEPMODE@
CFLAGS = @CFLAGS@
-CPP = @CPP@
CPPFLAGS = @CPPFLAGS@
CYGPATH_W = @CYGPATH_W@
DATADIRNAME = @DATADIRNAME@
@@ -217,25 +230,19 @@ DEPDIR = @DEPDIR@
ECHO_C = @ECHO_C@
ECHO_N = @ECHO_N@
ECHO_T = @ECHO_T@
-EGREP = @EGREP@
EXEEXT = @EXEEXT@
GMSGFMT = @GMSGFMT@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
-INTLLIBS = @INTLLIBS@
LDFLAGS = @LDFLAGS@
LEX = @LEX@
LEXLIB = @LEXLIB@
LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@
-LIBICONV = @LIBICONV@
-LIBINTL = @LIBINTL@
LIBOBJS = @LIBOBJS@
LIBS = @LIBS@
LOCALEDIR = @LOCALEDIR@
-LTLIBICONV = @LTLIBICONV@
-LTLIBINTL = @LTLIBINTL@
LTLIBOBJS = @LTLIBOBJS@
MAKEINFO = @MAKEINFO@
MKINSTALLDIRS = @MKINSTALLDIRS@
@@ -253,7 +260,6 @@ PACKAGE_STRING = @PACKAGE_STRING@
PACKAGE_TARNAME = @PACKAGE_TARNAME@
PACKAGE_VERSION = @PACKAGE_VERSION@
PATH_SEPARATOR = @PATH_SEPARATOR@
-POSUB = @POSUB@
RANLIB = @RANLIB@
SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
@@ -301,7 +307,12 @@ sbindir = @sbindir@
sharedstatedir = @sharedstatedir@
sysconfdir = @sysconfdir@
target_alias = @target_alias@
-AM_CFLAGS = -Wall -Werror -std=gnu99
+@MUDFLAP_FALSE@AM_CFLAGS = -Wall -Werror -std=gnu99 \
+@MUDFLAP_FALSE@ $(if $($(*F)_no_Wformat),-Wno-format,-Wformat=2)
+
+@MUDFLAP_TRUE@AM_CFLAGS = -Wall -Werror -std=gnu99 -fmudflap\
+@MUDFLAP_TRUE@ $(if $($(*F)_no_Wformat),-Wno-format,-Wformat=2)
+
@MUDFLAP_FALSE@AM_LDFLAGS = -Wl,-rpath,\$$ORIGIN/../libasm:\$$ORIGIN/../libdw:\$$ORIGIN/../libebl:\$$ORIGIN/../libelf
INCLUDES = -I$(top_srcdir)/libasm -I$(top_srcdir)/libdw \
-I$(top_srcdir)/libebl -I$(top_srcdir)/libelf \
@@ -311,11 +322,12 @@ INCLUDES = -I$(top_srcdir)/libasm -I$(top_srcdir)/libdw \
TESTS = run-arextract.sh run-arsymtest.sh newfile test-nlist \
update1 update2 update3 update4 \
run-show-die-info.sh run-get-files.sh run-get-lines.sh \
- run-get-pubnames.sh run-get-aranges.sh \
- run-show-abbrev.sh hash asm-tst1 asm-tst2 \
+ run-get-pubnames.sh run-get-aranges.sh run-allfcts.sh \
+ run-show-abbrev.sh run-line2addr.sh hash asm-tst1 asm-tst2 \
asm-tst3 asm-tst4 asm-tst5 asm-tst6 asm-tst7 asm-tst8 asm-tst9 \
msg_tst newscn run-strip-test.sh run-strip-test2.sh \
- run-strip-test3.sh run-ecp-test.sh run-ecp-test2.sh
+ run-strip-test3.sh run-strip-test4.sh run-strip-test5.sh \
+ run-strip-test6.sh run-ecp-test.sh run-ecp-test2.sh
# run-show-ciefde.sh
EXTRA_DIST = run-arextract.sh run-arsymtest.sh \
@@ -326,7 +338,12 @@ EXTRA_DIST = run-arextract.sh run-arsymtest.sh \
testfile.bz2 testfile2.bz2 testfile3.bz2 testfile4.bz2 \
testfile5.bz2 testfile6.bz2 testfile7.bz2 testfile8.bz2 \
testfile9.bz2 testfile10.bz2 testfile11.bz2 testfile12.bz2 \
- testfile13.bz2 run-strip-test3.sh
+ testfile13.bz2 run-strip-test3.sh run-allfcts.sh \
+ run-line2addr.sh testfile14.bz2 \
+ run-strip-test4.sh run-strip-test5.sh run-strip-test6.sh \
+ testfile15.bz2 testfile15.debug.bz2 \
+ testfile16.bz2 testfile16.debug.bz2 \
+ testfile17.bz2 testfile17.debug.bz2
@MUDFLAP_FALSE@libdw = ../libdw/libdw.so
@MUDFLAP_TRUE@libdw = ../libdw/libdw.a
@@ -334,39 +351,43 @@ EXTRA_DIST = run-arextract.sh run-arsymtest.sh \
@MUDFLAP_TRUE@libelf = ../libelf/libelf.a
@MUDFLAP_FALSE@libasm = ../libasm/libasm.so
@MUDFLAP_TRUE@libasm = ../libasm/libasm.a
+@MUDFLAP_TRUE@libmudflap = -lmudflap
libebl = ../libebl/libebl.a
-arextract_LDADD = $(libelf)
-arsymtest_LDADD = $(libelf)
-newfile_LDADD = $(libelf)
-saridx_LDADD = $(libelf)
-scnnames_LDADD = $(libelf)
-sectiondump_LDADD = $(libelf)
-showptable_LDADD = $(libelf)
-hash_LDADD = $(libelf)
-test_nlist_LDADD = $(libelf)
-msg_tst_LDADD = $(libelf)
-newscn_LDADD = $(libelf)
-ecp_LDADD = $(libelf)
-update1_LDADD = $(libelf)
-update2_LDADD = $(libelf)
-update3_LDADD = $(libebl) $(libelf)
-update4_LDADD = $(libebl) $(libelf)
-show_die_info_LDADD = $(libdw) $(libelf)
-get_pubnames_LDADD = $(libdw) $(libelf)
-show_abbrev_LDADD = $(libdw) $(libelf)
-get_lines_LDADD = $(libdw) $(libelf)
-get_files_LDADD = $(libdw) $(libelf)
-get_aranges_LDADD = $(libdw) $(libelf)
-#show_ciefde_LDADD = ../libdwarf/libdwarf.so $(libelf)
-asm_tst1_LDADD = $(libasm) $(libebl) $(libelf)
-asm_tst2_LDADD = $(libasm) $(libebl) $(libelf)
-asm_tst3_LDADD = $(libasm) $(libebl) $(libelf)
-asm_tst4_LDADD = $(libasm) $(libebl) $(libelf)
-asm_tst5_LDADD = $(libasm) $(libebl) $(libelf)
-asm_tst6_LDADD = $(libasm) $(libebl) $(libelf)
-asm_tst7_LDADD = $(libasm) $(libebl) $(libelf)
-asm_tst8_LDADD = $(libasm) $(libebl) $(libelf)
-asm_tst9_LDADD = $(libasm) $(libebl) $(libelf)
+arextract_LDADD = $(libelf) $(libmudflap)
+arsymtest_LDADD = $(libelf) $(libmudflap)
+newfile_LDADD = $(libelf) $(libmudflap)
+saridx_LDADD = $(libelf) $(libmudflap)
+scnnames_LDADD = $(libelf) $(libmudflap)
+sectiondump_LDADD = $(libelf) $(libmudflap)
+showptable_LDADD = $(libelf) $(libmudflap)
+hash_LDADD = $(libelf) $(libmudflap)
+test_nlist_LDADD = $(libelf) $(libmudflap)
+msg_tst_LDADD = $(libelf) $(libmudflap)
+newscn_LDADD = $(libelf) $(libmudflap)
+ecp_LDADD = $(libelf) $(libmudflap)
+update1_LDADD = $(libelf) $(libmudflap)
+update2_LDADD = $(libelf) $(libmudflap)
+update3_LDADD = $(libebl) $(libelf) $(libmudflap)
+update4_LDADD = $(libebl) $(libelf) $(libmudflap)
+show_die_info_LDADD = $(libdw) $(libelf) $(libmudflap)
+get_pubnames_LDADD = $(libdw) $(libelf) $(libmudflap)
+show_abbrev_LDADD = $(libdw) $(libelf) $(libmudflap)
+get_lines_LDADD = $(libdw) $(libelf) $(libmudflap)
+get_files_LDADD = $(libdw) $(libelf) $(libmudflap)
+get_aranges_LDADD = $(libdw) $(libelf) $(libmudflap)
+allfcts_LDADD = $(libdw) $(libelf) $(libmudflap)
+line2addr_no_Wformat = yes
+line2addr_LDADD = $(libdw) $(libelf) $(libmudflap)
+#show_ciefde_LDADD = ../libdwarf/libdwarf.so $(libelf) $(libmudflap)
+asm_tst1_LDADD = $(libasm) $(libebl) $(libelf) $(libmudflap)
+asm_tst2_LDADD = $(libasm) $(libebl) $(libelf) $(libmudflap)
+asm_tst3_LDADD = $(libasm) $(libebl) $(libelf) $(libmudflap)
+asm_tst4_LDADD = $(libasm) $(libebl) $(libelf) $(libmudflap)
+asm_tst5_LDADD = $(libasm) $(libebl) $(libelf) $(libmudflap)
+asm_tst6_LDADD = $(libasm) $(libebl) $(libelf) $(libmudflap)
+asm_tst7_LDADD = $(libasm) $(libebl) $(libelf) $(libmudflap)
+asm_tst8_LDADD = $(libasm) $(libebl) $(libelf) $(libmudflap)
+asm_tst9_LDADD = $(libasm) $(libebl) $(libelf) $(libmudflap)
CLEANFILES = xxx
all: all-am
@@ -404,6 +425,9 @@ $(ACLOCAL_M4): $(am__aclocal_m4_deps)
clean-noinstPROGRAMS:
-test -z "$(noinst_PROGRAMS)" || rm -f $(noinst_PROGRAMS)
+allfcts$(EXEEXT): $(allfcts_OBJECTS) $(allfcts_DEPENDENCIES)
+ @rm -f allfcts$(EXEEXT)
+ $(LINK) $(allfcts_LDFLAGS) $(allfcts_OBJECTS) $(allfcts_LDADD) $(LIBS)
arextract$(EXEEXT): $(arextract_OBJECTS) $(arextract_DEPENDENCIES)
@rm -f arextract$(EXEEXT)
$(LINK) $(arextract_LDFLAGS) $(arextract_OBJECTS) $(arextract_LDADD) $(LIBS)
@@ -455,6 +479,9 @@ get-pubnames$(EXEEXT): $(get_pubnames_OBJECTS) $(get_pubnames_DEPENDENCIES)
hash$(EXEEXT): $(hash_OBJECTS) $(hash_DEPENDENCIES)
@rm -f hash$(EXEEXT)
$(LINK) $(hash_LDFLAGS) $(hash_OBJECTS) $(hash_LDADD) $(LIBS)
+line2addr$(EXEEXT): $(line2addr_OBJECTS) $(line2addr_DEPENDENCIES)
+ @rm -f line2addr$(EXEEXT)
+ $(LINK) $(line2addr_LDFLAGS) $(line2addr_OBJECTS) $(line2addr_LDADD) $(LIBS)
msg_tst$(EXEEXT): $(msg_tst_OBJECTS) $(msg_tst_DEPENDENCIES)
@rm -f msg_tst$(EXEEXT)
$(LINK) $(msg_tst_LDFLAGS) $(msg_tst_OBJECTS) $(msg_tst_LDADD) $(LIBS)
@@ -504,6 +531,7 @@ mostlyclean-compile:
distclean-compile:
-rm -f *.tab.c
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/allfcts.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/arextract.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/arsymtest.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/asm-tst1.Po@am__quote@
@@ -521,6 +549,7 @@ distclean-compile:
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/get-lines.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/get-pubnames.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/hash.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/line2addr.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/msg_tst.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/newfile.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/newscn.Po@am__quote@
diff --git a/elfutils/tests/allfcts.c b/elfutils/tests/allfcts.c
new file mode 100644
index 00000000..147ebc2c
--- /dev/null
+++ b/elfutils/tests/allfcts.c
@@ -0,0 +1,50 @@
+#include <fcntl.h>
+#include <libdw.h>
+#include <stdio.h>
+#include <unistd.h>
+
+
+static int
+cb (Dwarf_Func *func, void *arg __attribute__ ((unused)))
+{
+ const char *file = dwarf_func_file (func);
+ int line = -1;
+ dwarf_func_line (func, &line);
+ const char *fct = dwarf_func_name (func);
+
+ printf ("%s:%d:%s\n", file, line, fct);
+
+ return DWARF_CB_OK;
+}
+
+
+int
+main (int argc, char *argv[])
+{
+ for (int i = 1; i < argc; ++i)
+ {
+ int fd = open (argv[i], O_RDONLY);
+
+ Dwarf *dbg = dwarf_begin (fd, DWARF_C_READ);
+ if (dbg != NULL)
+ {
+ Dwarf_Off off = 0;
+ size_t cuhl;
+ Dwarf_Off noff;
+
+ while (dwarf_nextcu (dbg, off, &noff, &cuhl, NULL, NULL, NULL) == 0)
+ {
+ Dwarf_Die die_mem;
+ Dwarf_Die *die = dwarf_offdie (dbg, off + cuhl, &die_mem);
+
+ (void) dwarf_getfuncs (die, cb, NULL, 0);
+
+ off = noff;
+ }
+
+ dwarf_end (dbg);
+ }
+
+ close (fd);
+ }
+}
diff --git a/elfutils/tests/line2addr.c b/elfutils/tests/line2addr.c
new file mode 100644
index 00000000..d2017fba
--- /dev/null
+++ b/elfutils/tests/line2addr.c
@@ -0,0 +1,65 @@
+#include <fcntl.h>
+#include <inttypes.h>
+#include <libdw.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <unistd.h>
+
+
+int
+main (int argc, char *argv[])
+{
+ for (int cnt = 1; cnt < argc; ++cnt)
+ {
+ char *fname;
+ char *file;
+ int line;
+
+ switch (sscanf (argv[cnt], "%a[^:]:%a[^:]:%d",
+ &fname, &file, &line))
+ {
+ default:
+ case 0:
+ case 1:
+ printf ("ignored %s\n", argv[cnt]);
+ continue;
+ case 2:
+ line = 0;
+ break;
+ case 3:
+ break;
+ }
+
+ int fd = open (fname, O_RDONLY);
+ if (fd == -1)
+ continue;
+
+ Dwarf *dbg = dwarf_begin (fd, DWARF_C_READ);
+ if (dbg != NULL)
+ {
+ Dwarf_Line **lines = NULL;
+ size_t nlines = 0;
+
+ if (dwarf_getsrc_file (dbg, file, line, 0, &lines, &nlines) == 0)
+ {
+ for (size_t inner = 0; inner < nlines; ++inner)
+ {
+ Dwarf_Addr addr;
+ if (dwarf_lineaddr (lines[inner], &addr) == 0)
+ printf ("%s -> %#" PRIxMAX "\n",
+ argv[cnt], (uintmax_t) addr);
+ }
+
+ free (lines);
+ }
+
+ dwarf_end (dbg);
+ }
+
+ close (fd);
+ free (fname);
+ free (file);
+ }
+
+ return 0;
+}
diff --git a/elfutils/tests/run-allfcts.sh b/elfutils/tests/run-allfcts.sh
new file mode 100755
index 00000000..51fe75ce
--- /dev/null
+++ b/elfutils/tests/run-allfcts.sh
@@ -0,0 +1,46 @@
+#! /bin/sh
+# Copyright (C) 2005 Red Hat, Inc.
+# Written by Ulrich Drepper <drepper@redhat.com>, 2005.
+#
+# This program is Open Source software; you can redistribute it and/or
+# modify it under the terms of the Open Software License version 1.0 as
+# published by the Open Source Initiative.
+#
+# You should have received a copy of the Open Software License along
+# with this program; if not, you may obtain a copy of the Open Software
+# License version 1.0 from http://www.opensource.org/licenses/osl.php or
+# by writing the Open Source Initiative c/o Lawrence Rosen, Esq.,
+# 3001 King Ranch Road, Ukiah, CA 95482.
+set -e
+
+# Don't fail if we cannot decompress the file.
+bunzip2 -c $srcdir/testfile.bz2 > testfile 2>/dev/null || exit 0
+
+# Don't fail if we cannot decompress the file.
+bunzip2 -c $srcdir/testfile2.bz2 > testfile2 2>/dev/null || exit 0
+
+# Don't fail if we cannot decompress the file.
+bunzip2 -c $srcdir/testfile8.bz2 > testfile8 2>/dev/null || exit 0
+
+./allfcts testfile testfile2 testfile8 > allfcts.out
+
+diff -u allfcts.out - <<"EOF"
+/home/drepper/gnu/new-bu/build/ttt/m.c:5:main
+/home/drepper/gnu/new-bu/build/ttt/b.c:4:bar
+/home/drepper/gnu/new-bu/build/ttt/f.c:3:foo
+/shoggoth/drepper/b.c:4:bar
+/shoggoth/drepper/f.c:3:foo
+/shoggoth/drepper/m.c:5:main
+/home/drepper/gnu/elfutils/build/src/../../src/strip.c:107:main
+/home/drepper/gnu/elfutils/build/src/../../src/strip.c:159:print_version
+/home/drepper/gnu/elfutils/build/src/../../src/strip.c:173:parse_opt
+/home/drepper/gnu/elfutils/build/src/../../src/strip.c:201:more_help
+/home/drepper/gnu/elfutils/build/src/../../src/strip.c:217:process_file
+/usr/include/sys/stat.h:375:stat64
+/home/drepper/gnu/elfutils/build/src/../../src/strip.c:291:crc32_file
+/home/drepper/gnu/elfutils/build/src/../../src/strip.c:313:handle_elf
+EOF
+
+rm -f testfile testfile2 testfile8 allfcts.out
+
+exit 0
diff --git a/elfutils/tests/run-arextract.sh b/elfutils/tests/run-arextract.sh
index 839a6792..69ac0bca 100755
--- a/elfutils/tests/run-arextract.sh
+++ b/elfutils/tests/run-arextract.sh
@@ -1,5 +1,5 @@
#! /bin/sh
-# Copyright (C) 1999, 2000, 2002 Red Hat, Inc.
+# Copyright (C) 1999, 2000, 2002, 2005 Red Hat, Inc.
# Written by Ulrich Drepper <drepper@redhat.com>, 1999.
#
# This program is Open Source software; you can redistribute it and/or
@@ -12,8 +12,7 @@
# by writing the Open Source Initiative c/o Lawrence Rosen, Esq.,
# 3001 King Ranch Road, Ukiah, CA 95482.
-archive=../libelf/.libs/libelf.a
-test -f $archive || archive=../libelf/libelf.a
+archive=../libelf/libelf.a
if test -f $archive; then
# The file is really available (i.e., no shared-only built).
echo -n "Extracting symbols... $ac_c"
diff --git a/elfutils/tests/run-line2addr.sh b/elfutils/tests/run-line2addr.sh
new file mode 100755
index 00000000..c46c8fda
--- /dev/null
+++ b/elfutils/tests/run-line2addr.sh
@@ -0,0 +1,44 @@
+#! /bin/sh
+# Copyright (C) 2005 Red Hat, Inc.
+# Written by Ulrich Drepper <drepper@redhat.com>, 2005.
+#
+# This program is Open Source software; you can redistribute it and/or
+# modify it under the terms of the Open Software License version 1.0 as
+# published by the Open Source Initiative.
+#
+# You should have received a copy of the Open Software License along
+# with this program; if not, you may obtain a copy of the Open Software
+# License version 1.0 from http://www.opensource.org/licenses/osl.php or
+# by writing the Open Source Initiative c/o Lawrence Rosen, Esq.,
+# 3001 King Ranch Road, Ukiah, CA 95482.
+set -e
+
+# Don't fail if we cannot decompress the file.
+bunzip2 -c $srcdir/testfile.bz2 > testfile 2>/dev/null || exit 0
+
+# Don't fail if we cannot decompress the file.
+bunzip2 -c $srcdir/testfile2.bz2 > testfile2 2>/dev/null || exit 0
+
+# Don't fail if we cannot decompress the file.
+bunzip2 -c $srcdir/testfile8.bz2 > testfile8 2>/dev/null || exit 0
+
+# Don't fail if we cannot decompress the file.
+bunzip2 -c $srcdir/testfile14.bz2 > testfile14 2>/dev/null || exit 0
+
+./line2addr testfile:f.c:4 testfile:f.c:8 testfile2:m.c:6 testfile2:b.c:1 testfile8:strip.c:953 testfile8:strip.c:365 testfile14:v.c:6 > line2addr.out
+
+diff -u line2addr.out - <<"EOF"
+testfile:f.c:4 -> 0x804846b
+testfile2:m.c:6 -> 0x100004cc
+testfile2:b.c:1 -> 0x10000470
+testfile8:strip.c:953 -> 0x169f
+testfile8:strip.c:953 -> 0x16aa
+testfile8:strip.c:365 -> 0x278b
+testfile8:strip.c:365 -> 0x2797
+testfile14:v.c:6 -> 0x400468
+testfile14:v.c:6 -> 0x400487
+EOF
+
+rm -f testfile testfile2 testfile8 testfile14 line2addr.out
+
+exit 0
diff --git a/elfutils/tests/run-strip-test.sh b/elfutils/tests/run-strip-test.sh
index aab37f48..526eb091 100755
--- a/elfutils/tests/run-strip-test.sh
+++ b/elfutils/tests/run-strip-test.sh
@@ -1,5 +1,5 @@
#! /bin/sh
-# Copyright (C) 1999, 2000, 2002, 2003 Red Hat, Inc.
+# Copyright (C) 1999, 2000, 2002, 2003, 2005 Red Hat, Inc.
# Written by Ulrich Drepper <drepper@redhat.com>, 1999.
#
# This program is Open Source software; you can redistribute it and/or
@@ -13,21 +13,39 @@
# 3001 King Ranch Road, Ukiah, CA 95482.
set -e
+original=${original:-testfile11}
+stripped=${stripped:-testfile7}
+debugout=${debugfile:+-f testfile.debug.temp -F $debugfile}
+
+# Don't fail if we cannot decompress the file.
+bunzip2 -c $srcdir/$original.bz2 > $original 2>/dev/null || exit 0
+
# Don't fail if we cannot decompress the file.
-bunzip2 -c $srcdir/testfile11.bz2 > testfile11 2>/dev/null || exit 0
+bunzip2 -c $srcdir/$stripped.bz2 > $stripped 2>/dev/null || exit 0
# Don't fail if we cannot decompress the file.
-bunzip2 -c $srcdir/testfile7.bz2 > testfile7 2>/dev/null || exit 0
+test -z "$debugfile" ||
+bunzip2 -c $srcdir/$debugfile.bz2 > $debugfile 2>/dev/null || exit 0
LD_LIBRARY_PATH=../libebl:../libelf${LD_LIBRARY_PATH:+:}$LD_LIBRARY_PATH \
- ../src/strip -o testfile.temp testfile11
+ ../src/strip -o testfile.temp $debugout $original
-cmp testfile7 testfile.temp
+cmp $stripped testfile.temp
# Check elflint and the expected result.
LD_LIBRARY_PATH=../libebl:../libelf${LD_LIBRARY_PATH:+:}$LD_LIBRARY_PATH \
../src/elflint -q testfile.temp
-rm -f testfile11 testfile7 testfile.temp
+test -z "$debugfile" || {
+cmp $debugfile testfile.debug.temp
+
+# Check elflint and the expected result.
+LD_LIBRARY_PATH=../libebl:../libelf${LD_LIBRARY_PATH:+:}$LD_LIBRARY_PATH \
+ ../src/elflint -q -d testfile.debug.temp
+
+rm -f "$debugfile"
+}
+
+rm -f $original $stripped testfile.temp testfile.debug.temp
exit 0
diff --git a/elfutils/tests/run-strip-test2.sh b/elfutils/tests/run-strip-test2.sh
index f385a865..824361c6 100755
--- a/elfutils/tests/run-strip-test2.sh
+++ b/elfutils/tests/run-strip-test2.sh
@@ -1,5 +1,5 @@
#! /bin/sh
-# Copyright (C) 1999, 2000, 2002 Red Hat, Inc.
+# Copyright (C) 1999, 2000, 2002, 2005 Red Hat, Inc.
# Written by Ulrich Drepper <drepper@redhat.com>, 1999.
#
# This program is Open Source software; you can redistribute it and/or
@@ -11,23 +11,7 @@
# License version 1.0 from http://www.opensource.org/licenses/osl.php or
# by writing the Open Source Initiative c/o Lawrence Rosen, Esq.,
# 3001 King Ranch Road, Ukiah, CA 95482.
-set -e
-# Don't fail if we cannot decompress the file.
-bunzip2 -c $srcdir/testfile8.bz2 > testfile8 2>/dev/null || exit 0
-
-# Don't fail if we cannot decompress the file.
-bunzip2 -c $srcdir/testfile9.bz2 > testfile9 2>/dev/null || exit 0
-
-LD_LIBRARY_PATH=../libebl:../libelf${LD_LIBRARY_PATH:+:}$LD_LIBRARY_PATH \
- ../src/strip -o testfile.temp testfile8
-
-cmp testfile9 testfile.temp
-
-# Check elflint and the expected result.
-LD_LIBRARY_PATH=../libebl:../libelf${LD_LIBRARY_PATH:+:}$LD_LIBRARY_PATH \
- ../src/elflint -q testfile.temp
-
-rm -f testfile8 testfile9 testfile.temp
-
-exit 0
+original=testfile8
+stripped=testfile9
+. $srcdir/run-strip-test.sh
diff --git a/elfutils/tests/run-strip-test3.sh b/elfutils/tests/run-strip-test3.sh
index 5ff4a5a9..3e8ac875 100755
--- a/elfutils/tests/run-strip-test3.sh
+++ b/elfutils/tests/run-strip-test3.sh
@@ -1,5 +1,5 @@
#! /bin/sh
-# Copyright (C) 1999, 2000, 2002, 2003 Red Hat, Inc.
+# Copyright (C) 1999, 2000, 2002, 2003, 2005 Red Hat, Inc.
# Written by Ulrich Drepper <drepper@redhat.com>, 1999.
#
# This program is Open Source software; you can redistribute it and/or
@@ -11,23 +11,7 @@
# License version 1.0 from http://www.opensource.org/licenses/osl.php or
# by writing the Open Source Initiative c/o Lawrence Rosen, Esq.,
# 3001 King Ranch Road, Ukiah, CA 95482.
-set -e
-# Don't fail if we cannot decompress the file.
-bunzip2 -c $srcdir/testfile12.bz2 > testfile12 2>/dev/null || exit 0
-
-# Don't fail if we cannot decompress the file.
-bunzip2 -c $srcdir/testfile13.bz2 > testfile13 2>/dev/null || exit 0
-
-LD_LIBRARY_PATH=../libebl:../libelf${LD_LIBRARY_PATH:+:}$LD_LIBRARY_PATH \
- ../src/strip -o testfile.temp testfile12
-
-cmp testfile13 testfile.temp
-
-# Check elflint and the expected result.
-LD_LIBRARY_PATH=../libebl:../libelf${LD_LIBRARY_PATH:+:}$LD_LIBRARY_PATH \
- ../src/elflint -q testfile.temp
-
-rm -f testfile12 testfile13 testfile.temp
-
-exit 0
+original=testfile12
+stripped=testfile13
+. $srcdir/run-strip-test.sh
diff --git a/elfutils/tests/run-strip-test4.sh b/elfutils/tests/run-strip-test4.sh
new file mode 100755
index 00000000..8e9be228
--- /dev/null
+++ b/elfutils/tests/run-strip-test4.sh
@@ -0,0 +1,5 @@
+original=testfile11
+stripped=testfile15
+debugfile=testfile15.debug
+
+. $srcdir/run-strip-test.sh
diff --git a/elfutils/tests/run-strip-test5.sh b/elfutils/tests/run-strip-test5.sh
new file mode 100755
index 00000000..9fa9ebef
--- /dev/null
+++ b/elfutils/tests/run-strip-test5.sh
@@ -0,0 +1,5 @@
+original=testfile8
+stripped=testfile16
+debugfile=testfile16.debug
+
+. $srcdir/run-strip-test.sh
diff --git a/elfutils/tests/run-strip-test6.sh b/elfutils/tests/run-strip-test6.sh
new file mode 100755
index 00000000..8ee5f02c
--- /dev/null
+++ b/elfutils/tests/run-strip-test6.sh
@@ -0,0 +1,5 @@
+original=testfile12
+stripped=testfile17
+debugfile=testfile17.debug
+
+. $srcdir/run-strip-test.sh
diff --git a/elfutils/tests/show-abbrev.c b/elfutils/tests/show-abbrev.c
index 7017932f..fba73759 100644
--- a/elfutils/tests/show-abbrev.c
+++ b/elfutils/tests/show-abbrev.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1998, 1999, 2000, 2001, 2002, 2004 Red Hat, Inc.
+/* Copyright (C) 1998, 1999, 2000, 2001, 2002, 2004, 2005 Red Hat, Inc.
Written by Ulrich Drepper <drepper@redhat.com>, 1998.
This program is Open Source software; you can redistribute it and/or
@@ -53,7 +53,7 @@ main (int argc, char *argv[])
{
size_t length;
Dwarf_Abbrev *abbrev = dwarf_getabbrev (&die, offset, &length);
- if (abbrev == NULL)
+ if (abbrev == NULL || abbrev == DWARF_END_ABBREV)
/* End of the list. */
break;
diff --git a/elfutils/tests/testfile14.bz2 b/elfutils/tests/testfile14.bz2
new file mode 100644
index 00000000..ac7c69e1
--- /dev/null
+++ b/elfutils/tests/testfile14.bz2
Binary files differ
diff --git a/elfutils/tests/testfile15.bz2 b/elfutils/tests/testfile15.bz2
new file mode 100644
index 00000000..e75f4575
--- /dev/null
+++ b/elfutils/tests/testfile15.bz2
Binary files differ
diff --git a/elfutils/tests/testfile15.debug.bz2 b/elfutils/tests/testfile15.debug.bz2
new file mode 100644
index 00000000..5c869001
--- /dev/null
+++ b/elfutils/tests/testfile15.debug.bz2
Binary files differ
diff --git a/elfutils/tests/testfile16.bz2 b/elfutils/tests/testfile16.bz2
new file mode 100644
index 00000000..909e2253
--- /dev/null
+++ b/elfutils/tests/testfile16.bz2
Binary files differ
diff --git a/elfutils/tests/testfile16.debug.bz2 b/elfutils/tests/testfile16.debug.bz2
new file mode 100644
index 00000000..48d651fb
--- /dev/null
+++ b/elfutils/tests/testfile16.debug.bz2
Binary files differ
diff --git a/elfutils/tests/testfile17.bz2 b/elfutils/tests/testfile17.bz2
new file mode 100644
index 00000000..5a123204
--- /dev/null
+++ b/elfutils/tests/testfile17.bz2
Binary files differ
diff --git a/elfutils/tests/testfile17.debug.bz2 b/elfutils/tests/testfile17.debug.bz2
new file mode 100644
index 00000000..86a76ab7
--- /dev/null
+++ b/elfutils/tests/testfile17.debug.bz2
Binary files differ
diff --git a/elfutils/tests/testfile9.bz2 b/elfutils/tests/testfile9.bz2
index 40454bce..40454bce 100755..100644
--- a/elfutils/tests/testfile9.bz2
+++ b/elfutils/tests/testfile9.bz2
Binary files differ