Adam Markey [Tue, 9 Oct 2012 09:05:53 +0000 (11:05 +0200)]
Handle partial read or write.
Ran into a situation where pread was returning less data than requested for
remote files on a networked filesystem. This patch modifies the IO wrappers
to request the remaining data as long as no real errors occured.
Signed-off-by: Adam Markey <adam@etinternational.com> Signed-off-by: Mark Wielaard <mjw@redhat.com>
Jan Kratochvil [Mon, 8 Oct 2012 21:34:35 +0000 (23:34 +0200)]
libdw/
fde.c (__libdw_find_fde): Change <fde != NULL> to likely. Return
DWARF_E_NO_MATCH if .eh_frame_hdr points to FDE which is too short for searched
PC.
Signed-off-by: Jan Kratochvil <jan.kratochvil@redhat.com>
Jan Kratochvil [Mon, 8 Oct 2012 21:08:01 +0000 (23:08 +0200)]
dwarf_getlocation.c (__libdw_intern_expression) <cfap>: Make new loclist
element DW_OP_call_frame_cfa before decoding the opcodes. Remove the later
DW_OP_call_frame_cfa push to RESULT.
Signed-off-by: Jan Kratochvil <jan.kratochvil@redhat.com>
Petr Machata [Mon, 24 Sep 2012 14:46:52 +0000 (16:46 +0200)]
Test elfutils output of a mixed core note.
This is a test for previous commit. The core file was snipped so that only
headers and note contents are left. NT_ARM_VFP is the note that exercises
the code.
Petr Machata [Wed, 19 Sep 2012 14:52:07 +0000 (16:52 +0200)]
In mixed core notes, don't let handle_core_item repeat.
If a core note contains both registers and items, descsz is 0 to express
that we don't wish to repeat the items. If there is only one item in
such note, a special block of code hits that passes &size to
handle_core_item, which will decrease that size by the amount consumed by
the item. But because size is 0, it underflows and wraps, and the loop
following this block, which handles the common case, overruns the core
note buffer.
Mark Wielaard [Fri, 24 Aug 2012 11:54:52 +0000 (13:54 +0200)]
Don't include dwz support by default.
By default the dwz multi file support is not included. This means any
DW_FORM_GNU_ref_alt or DW_FORM_GNU_strp_alt encountered in libdw will
just produce an error message. A new configure option --enable-dwz is
needed to include it for those we wish to test it. The dwz test is also
disabled by default.
Mark Wielaard [Thu, 16 Aug 2012 22:35:03 +0000 (00:35 +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.