Mark Wielaard [Wed, 6 Jun 2012 10:26:07 +0000 (12:26 +0200)]
Update dwarf branch name, license and contributor policy.
* Change name from "Red Hat elfutils" to "elfutils".
* Update license of standalone tools and test from GPLv2 to GPLv3+.
* Change license of libraries from GPLv2+exception to GPLv2/LGPLv3+.
* Add Developer Certificate of Origin based contributor policy.
dwarflint:
- All files updated to GPLv3+.
libdw/c++:
- All files updated to GPLv2/LGPLv3+.
src:
- All files updated to GPLv3+. Except dwarf-opcodes.h, dwarfstrings.c
and dwarfstrings.h, which were meant as library files and have been
updated to GPLv2/LGPLv3+.
tests:
- All files updated to GPLv3+. Except for the test bz2 data files.
Signed-off-by: Richard Fontana <rfontana@redhat.com> Signed-off-by: Mark Wielaard <mjw@redhat.com>
Mark Wielaard [Tue, 5 Jun 2012 15:15:16 +0000 (17:15 +0200)]
Update name, license and contributor policy.
* Change name from "Red Hat elfutils" to "elfutils".
* Update license of standalone tools and test from GPLv2 to GPLv3+.
* Change license of libraries from GPLv2+exception to GPLv2/LGPLv3+.
* Add Developer Certificate of Origin based contributor policy.
top-level:
- COPYING: Upgraded from GPLv2 to GPLv3.
- CONTRIBUTING, COPYING-GPLv2, COPYING-LGPLv3: New files.
- NEWS: Added note about new contribution and license policy.
- Makefile.am: Updated to GPLv3, added new files to EXTRA_DIST.
- configure.ac: Update to GPLv3, changed AC_INIT name to 'elfutils'.
- All files updated to GPLv2/LGPLv3+. Except some very small files
(<5 lines) which didn't have any headers at all before, the linker
.maps files and the libcpu/defs files which only contain data and
libelf/elf.h which comes from glibc and is under LGPLv2+.
config:
- elfutils.spec.in: Add new License: headers and new %doc files.
- Update all license headers to GPLv2/LGPLv3+ for files used by libs.
src, tests:
- All files updated to GPLv3+. Except for the test bz2 data files, the
linker maps and script files and some very small files (<5 lines)
that don't have any headers.
Signed-off-by: Richard Fontana <rfontana@redhat.com> Signed-off-by: Mark Wielaard <mjw@redhat.com>
Mark Wielaard [Mon, 2 Apr 2012 15:11:25 +0000 (17:11 +0200)]
elf32_offscn.c: Do not match SHT_NOBITS sections at OFFSET.
readelf -d doesn't work if a SHT_NOBITS section is right before the actual
.dynamic section at the same offset. elflint also fails on such binaries.
So skip SHT_NOBITS sections at the same offset in [g]elf[32|64]_offscn().
Tom Tromey [Wed, 21 Mar 2012 14:54:32 +0000 (08:54 -0600)]
Fix bug using dwarf_next_unit to iterate over .debug_types
* libdw_findcu.c (findcu_cb): Move earlier.
(__libdw_intern_next_unit): Add new CU to search tree here...
(__libdw_findcu): ... not here.
* typeiter.c: New file.
* run-typeiter.sh: New file.
* testfile59.bz2: New file.
* Makefile.am (noinst_PROGRAMS): Add typeiter.
(TESTS): Add run-typeiter.sh.
(EXTRA_DIST): Add run-typeiter.sh, testfile59.bz2.
(typeiter_LDADD): New variable.
If you call dwarf_next_unit to iterate over .debug_types, then call
dwarf_offdie_types, you can see a failure if some earlier call
happened to call __libdw_intern_next_unit via dwarf_formref_die.
What happens is that __libdw_intern_next_unit updates the Dwarf's
next_tu_offset, but does not add the TU to the TU search tree. So,
the call to dwarf_offdie_types does not find the TU in the tree, and
will not search any more, causing a failure.
This fix changes __libdw_intern_next_unit to add the TU to the search
tree, rather than relying on __libdw_findcu to do it.
Mark Wielaard [Mon, 31 Oct 2011 22:17:06 +0000 (23:17 +0100)]
Use index of first global symbol to speed up dwfl_module_addrsym search.
Cache the index of the first global symbol in the module's symbol table,
or -1 when unknown. All symbols with local binding come first in the
symbol table before the global symbols. Use this information to speed
up dwfl_module_addrsym search.
Ulrich Drepper [Mon, 3 Oct 2011 11:23:07 +0000 (07:23 -0400)]
Improve nm output for BSD and POSIX format
The binutils version showed more information since it distinguished
unique symbols, symbols in read-only and bss sections. The format
is now the same. In addition handle TLS symbols correctly but
differently from binutils nm since the latter drops information.
Instead use a @ suffix to indicate TLS similar to * to indicate
weak.
Mark Wielaard [Tue, 26 Apr 2011 15:15:28 +0000 (17:15 +0200)]
libdw: Sanity check end of section against cu_data () of die->cu.
A Dwarf_CU can come from either the debug_info compile unit or a
debug_type type unit section. Use the correct one for sanity checking
whether we have a truncated section.
Petr Machata [Tue, 19 Apr 2011 15:29:41 +0000 (17:29 +0200)]
dwarflint: Revamp location reporting
- Drop struct where, introduce class locus, which is an abstract interface
that the real locus classes implement. Locus classes are still used as
values, no heap allocation was necessary, although if polymorphism is
necessary, loci can simply be new'ed and put in a vector etc.
- Formatting of most loci was kept the way it was, but some formats have
been improved. For example, DIE and abbrev loci now use attribute
name directly to point to the attribute in question.
- Low-level allocation helpers (mostly WIPE) were dropped and replaced
with constructors on those structures. Placement new has to be used
in a couple places to initialize data where REALLOC is still used.
- Functions that used to take struct where * now take locus const &. The
code was updated throughout.
- Values not corresponding to sections were removed from enum section_id.
Part was dropped outright, because they were there just to support WHEREs,
rel_* was moved to new class rel_target.
- Convert addr_recort, ref_record to classes inheriting off std::vector.
ref_record in fact became ref_record_T and is now parametrized by
locus type.
Same as find (), but if the attribute name isn't found,
but there is is an abstract_origin or specification
attribute, then will try to find_integrate () the name
from that reference.
check_linkage_external_die.is_external () now uses it.
Mark Wielaard [Mon, 11 Apr 2011 15:24:16 +0000 (17:24 +0200)]
Fix libdwfl compile issue in case none of the compression libraries are there.
* linux-kernel-modules.c (vmlinux_suffixes): Guard definition
by check for zlib, bzlib or lzma defines to check it isn't empty.
(try_kernel_name): Use same guard for use of vmlinux_suffixes.
Mark Wielaard [Mon, 11 Apr 2011 11:55:58 +0000 (13:55 +0200)]
dwarflint: Don't assert in check_debug_info can trigger an assert.
Instead of asserting a form must exist, let form_class () return
max_dw_class, like ambiguous_class () does. max_dw_class is already
used as sentinel in read_die_chain () in case the attribute is unknown.
This lets things work out for the low level check_debug_info check and
then makes the higher-level checks complain about the unexpected form
instead. Added an example binary and test dwarflint/tests/run-upper.sh.
Mark Wielaard [Fri, 8 Apr 2011 09:30:58 +0000 (11:30 +0200)]
dwarflint: check_linkage_external_die keep symbol table and double check.
We pull the symbol table from the dwarf file and check when a linkage_name
is set that the symbol table contains that name and is marked not marked
local, with the following exceptions:
- No symbol in table, OK, if not a defining or const object.
Or GNU extension, anonymous structs can have a linkage_name.
- Symbol in table marked local, OK if not a defining object
and marked external. Which means it comes from some external
symbol table.