Mark Wielaard [Sun, 29 Jul 2012 11:58:04 +0000 (13:58 +0200)]
Rewrite DWARF string functions using known-dwarf macros.
readelf and tests were using hard coded string tables to produce DWARF
string constants. Use the known-dwarf macros to redefine these and
reduce code. Technique comes from dwarf branch dwarfstrings.c.
Mark Wielaard [Fri, 22 Jun 2012 10:02:45 +0000 (12:02 +0200)]
libdw: Add support for DWZ multifile forms DW_FORM_GNU_ref_alt/strp_alt.
DWZ multifile forms http://www.dwarfstd.org/ShowIssue.php?issue=120604.1
DW_FORM_GNU_ref_alt and DW_FORM_GNU_strp_alt reference an alternative
debuginfo file. dwarf_begin and dwarf_begin_elf will try to use this
automatically. There are no user visible changes to the libdw interface.
dwarf_formref_die, dwarf_formstring and dwarf_formudata can now return
a Dwarf_Die which comes from a CU in the alternative Dwarf descriptor.
__libdw_read_offset was adjusted to take an alternative Dwarf descriptor
into account.
Mike Frysinger [Tue, 26 Jun 2012 16:07:44 +0000 (12:07 -0400)]
tests: only compile test programs when running test
The test binaries are only needed by make check, so change the PROGRAMS
category from noinst_ to check_ to speed up default `make && make install`.
If people want to run the tests, then the utilities will be compiled
automatically when they run `make check`, so the normal workflow should
be unchanged.
Signed-off-by: Mike Frysinger <vapier@gentoo.org> Signed-off-by: Mark Wielaard <mjw@redhat.com>
Mark Wielaard [Fri, 29 Jun 2012 21:38:09 +0000 (23:38 +0200)]
readelf: Add .gdb_index version 7 support.
Add version 7 support. Keep track of cu_nr. Print kind and static/global
flag for each symbol. When a symbol is in the TU list add 'T'. Add
testfilegdbindex test files.
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.