# Add doc back when we have some real content.
SUBDIRS = config m4 lib libelf libebl libdwfl libdw libcpu libasm backends \
- src po tests
+ src po tests dwarflint
EXTRA_DIST = elfutils.spec GPG-KEY NOTES EXCEPTION
AC_CONFIG_FILES([backends/Makefile])
dnl Tools.
-AC_CONFIG_FILES([src/Makefile po/Makefile.in])
+AC_CONFIG_FILES([src/Makefile po/Makefile.in dwarflint/Makefile])
dnl Test suite.
AM_CONDITIONAL(STANDALONE, false)dnl Used in tests/Makefile.am, which see.
--- /dev/null
+## Process this file with automake to create Makefile.in
+##
+## Copyright (C) 1996-2010 Red Hat, Inc.
+## This file is part of Red Hat elfutils.
+##
+## Red Hat elfutils 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; version 2 of the License.
+##
+## Red Hat 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 Red Hat elfutils; if not, write to the Free Software Foundation,
+## Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301 USA.
+##
+## Red Hat elfutils is an included package of the Open Invention Network.
+## An included package of the Open Invention Network is a package for which
+## Open Invention Network licensees cross-license their patents. No patent
+## license is granted, either expressly or impliedly, by designation as an
+## included package. Should you wish to participate in the Open Invention
+## Network licensing program, please visit www.openinventionnetwork.com
+## <http://www.openinventionnetwork.com>.
+##
+include $(top_srcdir)/config/eu.am
+DEFS += $(YYDEBUG) -DDEBUGPRED=@DEBUGPRED@ \
+ -DSRCDIR=\"$(shell cd $(srcdir);pwd)\" -DOBJDIR=\"$(shell pwd)\"
+INCLUDES += -I$(srcdir)/../libelf -I$(srcdir)/../libebl \
+ -I$(srcdir)/../libdw -I$(srcdir)/../libdwfl \
+ -I$(srcdir)/../libasm
+
+AM_LDFLAGS = -Wl,-rpath-link,../libelf:../libdw
+
+no_mudflap.os = -fmudflap
+
+bin_PROGRAMS = dwarflint
+
+dwarflint_SOURCES = main.cc \
+ dwarflint.cc dwarflint.hh misc.h \
+ low.c low.h \
+ expected-at.cc expected.hh \
+ coverage.cc coverage.h \
+ readctx.c readctx.h \
+ pri.cc pri.hh \
+ messages.cc messages.h \
+ where.c where.h \
+ options.cc options.h \
+ addr-record.cc addr-record.h \
+ reloc.cc reloc.h \
+ tables.cc tables.hh tables.h \
+ all-dies-it.hh \
+ checks.hh \
+ sections.cc sections.hh sections.ii \
+ highlevel_check.cc highlevel_check.hh \
+ check_debug_abbrev.cc check_debug_abbrev.hh check_debug_abbrev.ii \
+ check_debug_info.cc check_debug_info.hh check_debug_info.ii \
+ check_debug_line.cc \
+ check_debug_pub.cc \
+ check_debug_loc_range.cc check_debug_loc_range.hh \
+ check_debug_aranges.cc check_debug_aranges.hh \
+ check_matching_ranges.cc \
+ check_range_out_of_scope.cc \
+ check_expected_trees.cc \
+ check_dups_abstract_origin.cc \
+ ../src/dwarfstrings.c
+
+if BUILD_STATIC
+libasm = ../libasm/libasm.a
+libdw = ../libdw/libdw.a $(zip_LIBS) $(libelf) $(libebl) -ldl
+libelf = ../libelf/libelf.a
+else
+libasm = ../libasm/libasm.so
+libdw = ../libdw/libdw.so
+libelf = ../libelf/libelf.so
+endif
+libebl = ../libebl/libebl.a
+libeu = ../lib/libeu.a
+
+# XXX later the C++ stuff will be in libdw.so directly
+libdwpp = ../libdw/libdwpp.a $(libdw)
+
+dwarflint_LDADD = $(libebl) $(libelf) $(libdwpp) $(libeu) $(libmudflap) -ldl
+
+installcheck-binPROGRAMS: $(bin_PROGRAMS)
+ bad=0; pid=$$$$; list="$(bin_PROGRAMS)"; for p in $$list; do \
+ case ' $(AM_INSTALLCHECK_STD_OPTIONS_EXEMPT) ' in \
+ *" $$p "* | *" $(srcdir)/$$p "*) continue;; \
+ esac; \
+ f=`echo "$$p" | \
+ sed 's,^.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \
+ for opt in --help --version; do \
+ if LD_LIBRARY_PATH=$(DESTDIR)$(libdir) \
+ $(DESTDIR)$(bindir)/$$f $$opt > c$${pid}_.out 2> c$${pid}_.err \
+ && test -n "`cat c$${pid}_.out`" \
+ && test -z "`cat c$${pid}_.err`"; then :; \
+ else echo "$$f does not support $$opt" 1>&2; bad=1; fi; \
+ done; \
+ done; rm -f c$${pid}_.???; exit $$bad
+
+CLEANFILES += *.gconv
+
+MAINTAINERCLEANFILES =
#include "messages.h"
#include "pri.hh"
-#include "config.h"
+#include "options.h"
#include "sections.hh"
#include "check_debug_loc_range.hh"
#include "check_debug_abbrev.hh"
#include <dwarf.h>
#include "../libdw/known-dwarf.h"
-#include "dwarfstrings.h"
+#include "../src/dwarfstrings.h"
#include <sstream>
#include "../libdw/dwarf.h"
#include "low.h"
-#include "config.h"
+#include "options.h"
#include "check_debug_loc_range.hh"
#include "check_debug_info.hh"
#include "sections.hh"
-#include "dwarf-opcodes.h"
+#include "../src/dwarf-opcodes.h"
#include "pri.hh"
namespace
#endif
#include "highlevel_check.hh"
-#include "dwarfstrings.h"
+#include "../src/dwarfstrings.h"
#include "all-dies-it.hh"
#include "pri.hh"
#include "messages.h"
#include "check_debug_info.hh"
#include "highlevel_check.hh"
#include "expected.hh"
-#include "dwarfstrings.h"
+#include "../src/dwarfstrings.h"
#include "../libdw/c++/dwarf-knowledge.cc"
#include "pri.hh"
#endif
#include "checks.hh"
-#include "config.h"
+#include "options.h"
#include "c++/dwarf"
#include "../libdwfl/libdwfl.h"
#include "../libdw/dwarf.h"
#include "../libebl/libebl.h"
-#include "dwarfstrings.h"
+#include "../src/dwarfstrings.h"
#include "low.h"
#include "readctx.h"
-#include "config.h"
+#include "options.h"
#include "tables.h"
#define PRI_CU "CU 0x%" PRIx64
#include <iostream>
#include "low.h"
-#include "config.h"
+#include "options.h"
#include "dwarflint.hh"
#include "readctx.h"
#include "checks.hh"
Network licensing program, please visit www.openinventionnetwork.com
<http://www.openinventionnetwork.com>. */
-#include "config.h"
+#include "options.h"
/* If true, we accept silently files without debuginfo. */
bool tolerate_nodebug = false;
--- /dev/null
+/* Pedantic checking of DWARF files
+ Copyright (C) 2008,2009,2010 Red Hat, Inc.
+ This file is part of Red Hat elfutils.
+
+ Red Hat elfutils 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; version 2 of the License.
+
+ Red Hat 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 Red Hat elfutils; if not, write to the Free Software Foundation,
+ Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301 USA.
+
+ Red Hat elfutils is an included package of the Open Invention Network.
+ An included package of the Open Invention Network is a package for which
+ Open Invention Network licensees cross-license their patents. No patent
+ license is granted, either expressly or impliedly, by designation as an
+ included package. Should you wish to participate in the Open Invention
+ Network licensing program, please visit www.openinventionnetwork.com
+ <http://www.openinventionnetwork.com>. */
+
+#include "../src/dwarfstrings.h"
+#include "pri.hh"
+#include <sstream>
+
+std::ostream &
+pri::operator << (std::ostream &os, pri::pribase const &obj)
+{
+ return os << obj.m_s;
+}
+
+pri::attr::attr (int attr_name)
+ : pribase (dwarf_attr_string (attr_name))
+{}
+
+pri::form::form (int attr_form)
+ : pribase (dwarf_form_string (attr_form))
+{}
+
+pri::tag::tag (int die_tag)
+ : pribase (dwarf_tag_string (die_tag))
+{}
+
+pri::locexpr_opcode::locexpr_opcode (int opcode)
+ : pribase (dwarf_locexpr_opcode_string (opcode))
+{}
+
+std::ostream &
+pri::operator << (std::ostream &os, pri::ref const &obj)
+{
+ std::stringstream ss;
+ ss << std::hex << "DIE " << obj.off;
+ return os << ss.str ();
+}
+
+std::ostream &
+pri::operator << (std::ostream &os, pri::hex const &obj)
+{
+ std::stringstream ss;
+ if (obj.pre)
+ ss << obj.pre << " ";
+ ss << std::hex << "0x" << obj.value;
+ return os << ss.str ();
+}
+
+std::ostream &
+pri::operator << (std::ostream &os, pri::range const &obj)
+{
+ return os << "[" << pri::addr (obj.start)
+ << ", " << pri::addr (obj.end) << ")";
+}
#include "sections.hh"
#include "messages.h"
#include "pri.hh"
-#include "config.h"
+#include "options.h"
namespace
{
+/* Pedantic checking of DWARF files
+ Copyright (C) 2008,2009,2010 Red Hat, Inc.
+ This file is part of Red Hat elfutils.
+
+ Red Hat elfutils 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; version 2 of the License.
+
+ Red Hat 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 Red Hat elfutils; if not, write to the Free Software Foundation,
+ Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301 USA.
+
+ Red Hat elfutils is an included package of the Open Invention Network.
+ An included package of the Open Invention Network is a package for which
+ Open Invention Network licensees cross-license their patents. No patent
+ license is granted, either expressly or impliedly, by designation as an
+ included package. Should you wish to participate in the Open Invention
+ Network licensing program, please visit www.openinventionnetwork.com
+ <http://www.openinventionnetwork.com>. */
+
#include "where.h"
-#include "config.h"
+#include "options.h"
#include <inttypes.h>
#include <assert.h>
bin_PROGRAMS = readelf nm size strip ld elflint findtextrel addr2line \
elfcmp objdump ranlib strings ar unstrip \
- dwarflint dwarfcmp
+ dwarfcmp
noinst_PROGRAMS = dwarfcmp-test
dwarfcmp_test_SOURCES = $(dwarfcmp_SOURCES)
dwarfcmp_test_LDADD = $(dwarfcmp_LDADD)
-dwarflint_SOURCES = dwarfstrings.c \
- dwarflint/main.cc \
- dwarflint/dwarflint.cc dwarflint/dwarflint.hh dwarflint/misc.h \
- dwarflint/low.c dwarflint/low.h \
- dwarflint/expected-at.cc dwarflint/expected.hh \
- dwarflint/coverage.cc dwarflint/coverage.h \
- dwarflint/readctx.c dwarflint/readctx.h \
- dwarflint/pri.cc dwarflint/pri.hh \
- dwarflint/messages.cc dwarflint/messages.h \
- dwarflint/where.c dwarflint/where.h \
- dwarflint/config.cc dwarflint/config.h \
- dwarflint/addr-record.cc dwarflint/addr-record.h \
- dwarflint/reloc.cc dwarflint/reloc.h \
- dwarflint/tables.cc dwarflint/tables.hh dwarflint/tables.h \
- dwarflint/all-dies-it.hh \
- dwarflint/checks.hh \
- dwarflint/sections.cc dwarflint/sections.hh dwarflint/sections.ii \
- dwarflint/highlevel_check.cc dwarflint/highlevel_check.hh \
- dwarflint/check_debug_abbrev.cc dwarflint/check_debug_abbrev.hh dwarflint/check_debug_abbrev.ii \
- dwarflint/check_debug_info.cc dwarflint/check_debug_info.hh dwarflint/check_debug_info.ii \
- dwarflint/check_debug_line.cc \
- dwarflint/check_debug_pub.cc \
- dwarflint/check_debug_loc_range.cc dwarflint/check_debug_loc_range.hh \
- dwarflint/check_debug_aranges.cc dwarflint/check_debug_aranges.hh \
- dwarflint/check_matching_ranges.cc \
- dwarflint/check_range_out_of_scope.cc \
- dwarflint/check_expected_trees.cc \
- dwarflint/check_dups_abstract_origin.cc
-
readelf_SOURCES = readelf.c dwarfstrings.c
noinst_HEADERS = ld.h symbolhash.h sectionhash.h versionhash.h \
ar_LDADD = libar.a $(libelf) $(libeu) $(libmudflap)
unstrip_LDADD = $(libebl) $(libelf) $(libdw) $(libeu) $(libmudflap) -ldl
dwarfcmp_LDADD = $(libdwpp) $(libmudflap) -ldl
-dwarflint_LDADD = $(libebl) $(libelf) $(libdwpp) $(libeu) $(libmudflap) -ldl
ldlex.o: ldscript.c
ldlex_no_Werror = yes
+++ /dev/null
-#include "dwarfstrings.h"
-#include "pri.hh"
-#include <sstream>
-
-std::ostream &
-pri::operator << (std::ostream &os, pri::pribase const &obj)
-{
- return os << obj.m_s;
-}
-
-pri::attr::attr (int attr_name)
- : pribase (dwarf_attr_string (attr_name))
-{}
-
-pri::form::form (int attr_form)
- : pribase (dwarf_form_string (attr_form))
-{}
-
-pri::tag::tag (int die_tag)
- : pribase (dwarf_tag_string (die_tag))
-{}
-
-pri::locexpr_opcode::locexpr_opcode (int opcode)
- : pribase (dwarf_locexpr_opcode_string (opcode))
-{}
-
-std::ostream &
-pri::operator << (std::ostream &os, pri::ref const &obj)
-{
- std::stringstream ss;
- ss << std::hex << "DIE " << obj.off;
- return os << ss.str ();
-}
-
-std::ostream &
-pri::operator << (std::ostream &os, pri::hex const &obj)
-{
- std::stringstream ss;
- if (obj.pre)
- ss << obj.pre << " ";
- ss << std::hex << "0x" << obj.value;
- return os << ss.str ();
-}
-
-std::ostream &
-pri::operator << (std::ostream &os, pri::range const &obj)
-{
- return os << "[" << pri::addr (obj.start)
- << ", " << pri::addr (obj.end) << ")";
-}