Therefore elfutils now incorrectly matches on-disk file without build-id to an
in-core (in-memory) file with build-id.
In fact due to its known FIXME:
This verification gives false positive if in-core ELF had
build-id but on-disk ELF does not have any. But we cannot
reliably find ELF header and/or the ELF build id just from
the link map (and checking core segments is also not
reliable). */
So it probably should not be so ignorable as I did, one may want to analyze
build-id core files on CentOS-5, not sure. In fact it can be fixed, when we
find in dwfl_segment_report_module a module with build-id with conflicts in
its address range with existing non-build-id dwfl_link_map_report module we
should prefer the build-id module instead.
The problem is that once Dwfl_Module is added to Dwfl it cannot be easily
removed.
Originally elfutils called dwfl_segment_report_module first and then
dwfl_link_map_report.
Currently the order is dwfl_link_map_report and then
dwfl_segment_report_module only for modules missing from dwfl_link_map_report.
Patch below unfortunately needs bidirectional negotiation between the two
functions, therefore dwfl_link_map_report now no longer adds Dwfl_Modules to
Dwfl but it only stores information about them to r_debug_info_module.
This information is filtered then by dwfl_segment_report_module and only
filtered r_debug_info_module entries get finally added to Dwfl
(in dwfl_core_file_report).
NT_FILE would make all this magic easy but it is true that on CentOS-5 it
definitely does not exist.
libdwfl/
2013-07-23 Jan Kratochvil <jan.kratochvil@redhat.com>
* core-file.c (clear_r_debug_info): Close also ELF and FD.
(dwfl_core_file_report): Call __libdwfl_report_elf for
R_DEBUG_INFO.MODULE.
* dwfl_report_elf.c (__libdwfl_elf_address_range): New function from
code of ...
(__libdwfl_report_elf): ... this function. Call it.
* dwfl_segment_report_module.c: Include unistd.h.
(dwfl_segment_report_module): Use basename for MODULE->NAME.
Clear MODULE if it has no build-id and we have segment with build-id.
Ignore this segment only if MODULE still contains valid ELF.
* libdwflP.h (__libdwfl_elf_address_range): New declaration.
(struct r_debug_info_module): New fields fd, elf, l_addr, start, end
and disk_file_has_build_id.
(dwfl_link_map_report): Extend the comment.
* link_map.c (report_r_debug): Extend the comment. Always fill in new
r_debug_info_module. Initialize also the new r_debug_info_module
fields. Remove one FIXME comment. Call __libdwfl_elf_address_range
instead of __libdwfl_report_elf when R_DEBUG_INFO is not NULL.
tests/
2013-07-23 Jan Kratochvil <jan.kratochvil@redhat.com>
* run-unstrip-n.sh (test-core.*): Ignore libc.so.6 entry and order of
the entries.
Signed-off-by: Jan Kratochvil <jan.kratochvil@redhat.com>
Mark Wielaard [Tue, 9 Jul 2013 21:09:38 +0000 (23:09 +0200)]
readelf: print actual DIE offsets of DW_OP_GNU_<type> ops.
Like DW_OP_GNU_parameter_ref the DW_OP_GNU type conversion ops
DW_OP_GNU_const_type, DW_OP_GNU_regval_type, DW_OP_GNU_deref_type,
DW_OP_GNU_convert and DW_OP_GNU_reinterpret take a CU relative offset
to a DIE (in these cases a DW_TAG_base_type). So handle the DIE offsets
just like in the DW_OP_GNU_parameter_ref case by adding the cu->start
if known (and -U hasn't been given). For DW_OP_GNU_convert and
DW_OP_GNU_reinterpret handle zero specially since it means to "untype"
the result and so isn't an actual DIE reference.
Mark Wielaard [Fri, 5 Jul 2013 14:44:47 +0000 (16:44 +0200)]
readelf: print actual DW_OP_GNU_parameter_ref DIE offset.
DW_OP_GNU_parameter_ref takes as argument a CU relative offset to
a DW_TAG_formal_parameter DIE. Printing just that relative offset
makes it hard to find the actual DIE in the output. Now print the
actual DIE offset instead (unless -U is given). We already passed
around the base address of the CU. Now we pass around the actual
CU so we can use it to find both the base address and the CU offset.
Mark Wielaard [Tue, 2 Jul 2013 14:36:16 +0000 (16:36 +0200)]
libdw. Don't blow up stack in dwarf_getsrclines with lots of lines.
When a CU has a really large number of lines dwarf_getsrclines could blow
up the stack because it uses alloca for temporary storage. Use malloc and
free if the number of lines gets too big.
Mark Wielaard [Tue, 2 Jul 2013 11:35:29 +0000 (13:35 +0200)]
Don't assert on mod->e_type in __libdwfl_relocate_value.
When setting up the module and searching for an ELF file with a correct
build_id __libdwfl_relocate_value will be called for an ET_REL file in
__libdwfl_find_elf_build_id but mod->e_type is not yet setup in that case
because the Dwfl_Module isn't yet complete (the build-id could mismatch).
This can happen when using the dwfl_linux_kernel_find_elf callback when
it searches for the ELF file matching a kernel module.
Mark Wielaard [Tue, 2 Jul 2013 09:22:35 +0000 (11:22 +0200)]
getcfi_scn_eh_frame: Don't crash and burn when .eh_frame bits aren't there.
Trying to read non-existing bits sometimes works and normally a sanity
check will fail. But it could also lead to an unexpected crash much later
when trying to use the non-existing data.
Mark Wielaard [Wed, 26 Jun 2013 15:42:52 +0000 (11:42 -0400)]
libdw_visit_scopes: Don't recurse into imported unit children.
There were two issues with __libdw_visit_scopes. First it returned an
error whenever called with a root DIE that didn't have any children.
However a DIE abbrev can have DW_CHILDREN_yes set and still have an
empty child list. It is inefficient and should be fixed in the DWARF
producer, but it is legal DWARF. Also the function shouldn't hide real
DWARF errors found by dwarf_child () or dwarf_siblingof (). Secondly
__libdw_visit_scopes would recurse into an imported unit and then
forget about the rest of the children of the root DIE. For an imported
unit the children of that unit DIE should be treated as if they were
logical children of the root DIE and not increase the recursion depth.
Both issues were shown by a systemtap bug using dwarf_getscopes () on
a CU that had various partial units imported through dwz.
See http://sourceware.org/bugzilla/show_bug.cgi?id=15671
If the buffer isn't released after getting a valid build-id from the
memory_callback the first run-unstrip-n.sh testcase will fail on systems
where there is a matching librt.so file for which dwfl_addrsegment returns
a valid segment index in the Dwfl (but where the build-id doesn't match).
Jan Kratochvil [Thu, 30 May 2013 11:21:20 +0000 (13:21 +0200)]
Use DT_DEBUG library search first.
libdwfl/
2013-05-30 Jan Kratochvil <jan.kratochvil@redhat.com>
* argp-std.c (parse_opt) <ARGP_KEY_SUCCESS> <opt->core> <opt->e>: Set
executable_for_core before calling dwfl_core_file_report.
* core-file.c (clear_r_debug_info): New function.
(dwfl_core_file_report): Move raw segments reporting lower. New
variable r_debug_info, pass it to dwfl_segment_report_module. Call
clear_r_debug_info in the end. Return sum of LISTED and SNIFFED.
* dwfl_module_build_id.c (check_notes): Move into
__libdwfl_find_elf_build_id.
(__libdwfl_find_build_id): Rename to ...
(__libdwfl_find_elf_build_id): ... here. Add parameters build_id_bits,
build_id_elfaddr and build_id_len. Verify MOD vs. ELF.
(__libdwfl_find_elf_build_id) (check_notes): Remove parameters mod and
set, rename data_vaddr to data_elfaddr. Do not call found_build_id.
(__libdwfl_find_elf_build_id): Update the check_notes caller, do not
adjust its data_elfaddr parameter.
(__libdwfl_find_build_id): New wrapper of __libdwfl_find_elf_build_id.
* dwfl_segment_report_module.c (dwfl_segment_report_module): New
parameter r_debug_info. New variable name_is_final. Adjust addresses
according to R_DEBUG_INFO->MODULE. Check conflicts against DWFL.
Do not overwrite NAME by SONAME if NAME_IS_FINAL.
* libdwflP.h (__libdwfl_find_elf_build_id): New declaration.
(struct r_debug_info_module, struct r_debug_info): New definitions.
(dwfl_segment_report_module, dwfl_link_map_report): Add parameter
r_debug_info.
* link_map.c: Include fcntl.h.
(report_r_debug): Add parameter r_debug_info, describe it in the
function comment. Delete dwfl_addrmodule call and its dependent code.
Verify build-id before calling dwfl_report_elf, also supply
executable_for_core to it. Store r_debug_info->module info when
appropriate.
(dwfl_link_map_report): Add parameter r_debug_info. New variable
in_ok. Try to read IN from EXECUTABLE_FOR_CORE. Update report_r_debug
caller parameters.
tests/
2013-05-30 Jan Kratochvil <jan.kratochvil@redhat.com>
* Makefile.am (EXTRA_DIST): Add test-core-lib.so.bz2,
test-core.core.bz2 and test-core.exec.bz2.
* run-addrname-test.sh: New test for these files.
* run-unstrip-n.sh: Update expected output. New test for these files.
* test-core-lib.so.bz2: New file.
* test-core.core.bz2: New file.
* test-core.exec.bz2: New file.
Signed-off-by: Jan Kratochvil <jan.kratochvil@redhat.com>
Mark Wielaard [Fri, 3 May 2013 09:28:49 +0000 (11:28 +0200)]
libdw: dwarf_getsrclines don't set end_sequence when there are no lines.
Some CUs might only have a file list, but no actual source lines in their
statement list. Only set end_sequence at the end of the source lines list
if there are actually lines.
Jan Kratochvil [Tue, 30 Apr 2013 12:27:16 +0000 (14:27 +0200)]
Add parameter add_p_vaddr to dwfl_report_elf.
libdwfl/
* dwfl_report_elf.c (__libdwfl_report_elf): Add parameter add_p_vaddr.
Set it to true for ET_EXEC and ET_CORE. Provide alternative
setup of START and BIAS if !ADD_P_VADDR. Set END from BIAS, not BASE.
(dwfl_report_elf): Add parameter add_p_vaddr. Pass it down. Add
NEW_VERSION.
(_compat_without_add_p_vaddr_dwfl_report_elf) <SHARED>: New, with
COMPAT_VERSION.
* libdwfl.h (dwfl_report_elf): Add parameter add_p_vaddr. Describe it.
* libdwflP.h (__libdwfl_report_elf): Add parameter add_p_vaddr.
* link_map.c (report_r_debug): Use true add_p_vaddr for dwfl_report_elf.
* linux-kernel-modules.c (report_kernel): Use false add_p_vaddr for
dwfl_report_elf.
* offline.c (process_elf): Use true add_p_vaddr for dwfl_report_elf.
tests/
* dwfl-report-elf-align.c: Use false add_p_vaddr for dwfl_report_elf.
Signed-off-by: Jan Kratochvil <jan.kratochvil@redhat.com>
Mark Wielaard [Sat, 27 Apr 2013 21:15:44 +0000 (23:15 +0200)]
tests: Tests that override EXIT (0) trap need to cleanup themselves.
Since trap handlers don't nest tests that install their own EXIT (0) trap
handler need to cleanup themselves. Add an exit_cleanup helper function
to test-subr.sh that can be used by run-native-test.sh to exit cleanly.
Mark Wielaard [Sat, 27 Apr 2013 22:54:17 +0000 (00:54 +0200)]
tests: All update tests should use unique temporary file names and cleanup.
All update tests used the same temporary file name xxx. And only update4
would clean up this file. Now that tests can run in parallel make sure
all temporary names are unique and every test cleans up their own files.
Mark Wielaard [Fri, 26 Apr 2013 19:21:56 +0000 (21:21 +0200)]
tests: Add various files to tempfiles so they are always cleaned up.
Various tests tried to rm their own temporary files. That could mean those
files weren't properly cleaned up if the testcase unexpectedly failed. Add
them to tempfiles to make sure they are always cleaned up by test-subr.sh.
Mark Wielaard [Fri, 26 Apr 2013 21:44:25 +0000 (23:44 +0200)]
Enable automake parallel-tests for make check.
The parallel-tests option was introduced in automake 1.11 and is the
default since automake 1.13. All tests can now be ran in parallel with
make check -j. To enable this all tests are ran in their own temporary
directory so they don't stomp on each others input or output files.
On my machine (4 cores) make check takes ~20 seconds, but now with
make check -j8 takes only ~4 seconds.
* Makefile.am (installed_TESTS_ENVIRONMENT): Export environment,
remove wrapper.
(TESTS_ENVIRONMENT): Likewise.
(installed_LOG_COMPILER): New variable defining wrapper.
(LOG_COMPILER): Likewise.
* run-*.sh: Fixup location of input and output files.
* test-subr.sh: Create test_dir, pushd to execute test in.
(trap): Remove test_dir.
(testfiles): Use abs_srcdir.
(installed_testrun): Match on abs_builddir or abs_top_builddir.
(self_test_files): Adjust path.
Mark Wielaard [Thu, 25 Apr 2013 20:50:11 +0000 (16:50 -0400)]
Updates for Automake 1.13.
autoreconf will install config/test-driver, ignore it.
Update gettext m4 and po files to version 0.18.2.
Use AM_CPPFLAGS instead of INCLUDES.
All changes are backward compatible with Automake 1.11.
Mark Wielaard [Mon, 25 Mar 2013 16:07:21 +0000 (17:07 +0100)]
libdw: dwarf_getsrclines mark highest address as end_sequence.
Make sure the highest address for the CU is marked as end_sequence.
This is required by the DWARF spec, but some compilers forget and
dwfl_module_getsrc depends on it. We could reject it as bad DWARF
but the DWARF .debug_lines spec is much stricter than what compilers
seem to output in practice.
Mark Wielaard [Tue, 12 Mar 2013 11:02:51 +0000 (12:02 +0100)]
libdw and libdwfl srcfiles and srclines fixes for partial_units.
dwfl_getsrclines would always fail, even when lines were found.
dwarf_decl_file, and other functions relying on srcfiles or srclines would
fail for DIEs in partial_units because stmt_lists on partial_units
were ignored.
Note that dwz contained a bug which makes things fail in __libdw_formptr
for DW_AT_stmt_list with a bogus DW_FORM even with these fixes.
https://bugzilla.redhat.com/show_bug.cgi?id=919755
Mark Wielaard [Fri, 1 Mar 2013 10:51:58 +0000 (11:51 +0100)]
Fix two memory leaks in findtextrel and strip.
The findtextrel leak is real, when processing lots of files without text
relocations the files and memory wouldn't be released. The strip leak is
minor since it can only happen when using -f which only allows one file
as argument. But it is nice to see valgrind say:
"All heap blocks were freed -- no leaks are possible".
Mark Wielaard [Fri, 22 Feb 2013 22:42:59 +0000 (23:42 +0100)]
libdwfl: Try opening files all installed compression libraries.
rhbz #909481. When a compression library wasn't installed libdwfl would
not try the next compression library for opening a file. Retry with the
next available compression library if a previous one isn't installed. Also
disable tests that depend on a particular compression library
(run-readelf-s.sh and run-dwflsyms.sh) if that library isn't installed.
Mark Wielaard [Sun, 10 Feb 2013 14:07:33 +0000 (15:07 +0100)]
libdwfl: Use actual file names in parse_opt failure cases.
When handling ARGP_KEY_SUCCESS the failure handling code would use 'arg'
as failure string. But 'arg' would be NULL in such cases leading to failure
messages like: "cannot open '(null)': No such file or directory".
Use opt->e and opt->core explicitly to show file names that caused failure.
Mark Wielaard [Wed, 6 Feb 2013 15:20:17 +0000 (16:20 +0100)]
elflint: Add two more symbols to gnuld list of allowed bad values.
Add __bss_start and __TMC_END__ to the list of symbols allowed to have
out of section values because of the following GNU ld bug:
http://sourceware.org/bugzilla/show_bug.cgi?id=13621.
Allow them to appear in either .symtab or .dynsym, but only when they
are zero sized. It is impossible to define a general rule for this bug,
but this should catch most common issues that are mostly harmless
because the symbols signify the removed section was empty to being with.
This catches at least all symbols often flagged in the tests.
Mark Wielaard [Wed, 6 Feb 2013 12:15:10 +0000 (13:15 +0100)]
backends: Check type DIE exists before calling dwarf_tag ().
dwarf_attr () or dwarf_form () functions leave typedie NULL when they fail
because of missing attribute or unexpected form. In such cases first check
the DIE exists and return error instead of calling dwarf_tag () and crashing.
This also happens in the testsuite with native tests when elfutils is build
without DWZ support on a distro that uses DWZ DWARF compression on system
libraries. Only the backends used dwarf_tag () directly without checking,
all other uses in elfutils already checked whether the given DIE was NULL.
Mark Wielaard [Fri, 18 Jan 2013 21:19:08 +0000 (22:19 +0100)]
readelf: Add base to offsets in format_dwarf_addr for debug_loc/ranges.
Collect the base address of the CU while creating the listptr_tables
and use them when printing debug ranges and location entries with
format_dwarf_addr ().
Jan Kratochvil [Wed, 10 Oct 2012 17:32:05 +0000 (19:32 +0200)]
backends/
* Makefile.am (s390_SRCS): Add s390_corenote.c and s390x_corenote.c.
* linux-core-note.c (ALIGN_PR_REG): New definitions.
(struct EBLHOOK(prstatus)): Change field pr_reg to anonymous struct with
ALIGN_PR_REG.
(EXTRA_ITEMS): New macro.
* s390_corenote.c: New file.
* s390_init.c (s390x_core_note): New declaration.
(s390_init): Install s390x_core_note and s390_core_note.
* s390x_corenote.c: New file.
tests/
* run-readelf-mixed-corenote.sh: New testcase for readelf -n of s390
and s390x core notes.
* testfile67.bz2: New file.
* testfile68.bz2: New file.
* Makefile.am (EXTRA_DIST): Add testfile67.bz2 and testfile68.bz2 .
Signed-off-by: Jan Kratochvil <jan.kratochvil@redhat.com>
Mark Wielaard [Wed, 16 Jan 2013 14:19:32 +0000 (15:19 +0100)]
libdwfl: Add minisymtab support.
Add an auxiliary symbol table dwfl_file aux_sym to Dwfl_Module if all we
have is the dynsym table. The main file might contain a .gnu_debugdata
section. The .gnu_debugdata section is a compressed embedded ELF file
that contains the text (code) section symbols from the symtab table
that are not in the main file dynsym table. dwfl_module_getsymtab (),
dwfl_module_addrsym () and dwfl_module_getsym () will use the auxiliary
symbol table when available (and no full symtab is available from the
debug file).
* libdwflP.h (struct Dwfl_Module): Add aux_sym, aux_symdata,
aux_syments, aux_symstrdata, aux_symxndxdata and aux_first_global.
(dwfl_adjusted_aux_sym_addr): New function.
(dwfl_deadjust_aux_sym_addr): Likewise.
(dwfl_adjusted_st_value): Take and check symfile argument.
(dwfl_deadjust_st_value): Likewise.
* dwfl_module_getdwarf.c (find_prelink_address_sync): Take and
use dwfl_file as argument to set address_sync.
(find_debuginfo): Call find_prelink_address_sync with debug file.
(find_aux_sym): New function.
(find_symtab): Use find_aux_sym if all we have is the dynsym table
and fill in aux DwflModule fields.
(dwfl_module_getsymtab): Return syments plus aux_syments.
(load_symtab): Always set first_global.
* dwfl_module_addrsym.c (dwfl_module_addrsym): Check symfile
when using same_section. Calculate first_global based on both
mod->first_global and mod->aux_first_global.
* dwfl_module.c (__libdwfl_module_free): Free aux_sym.
* dwfl_module_getsym.c (dwfl_module_getsym): Use auxsym table
to retrieve symbol and name if necessary, making sure all locals
from any table come before any globals.
* dwfl_module_info.c (dwfl_module_info): Call dwfl_adjusted_st_value
with symfile.
* relocate.c (resolve_symbol): Likewise.
Mark Wielaard [Wed, 16 Jan 2013 14:19:20 +0000 (15:19 +0100)]
readelf: Add --elf-section input option to inspect an embedded ELF file.
Some binaries might have (compressed) embedded ELF files inside a section.
The default section name for this is .gnu_debugdata. This normally
consists of just those sections needed to provide an auxiluary symbol
table. But can theoretically contain other (debug) sections. The new
--elf-section arguments makes it possible to easily inspect it as if it
is a normal ELF file. libdwfl takes care of automatically decompressing
any data in the section if necessary.
Mark Wielaard [Fri, 21 Dec 2012 21:11:44 +0000 (22:11 +0100)]
readelf: Adjust initial FDE address if pcrel before printing.
The FDE initial_location is printed as start address with format_dwarf_addr.
Which does the right thing for .debug_frame addresses, but in .eh_frame
this is encoded as DW_EH_PE_pcrel and so needs to be adjusted before
formatting.
Mark Wielaard [Mon, 3 Dec 2012 16:01:09 +0000 (17:01 +0100)]
Run valgrind tests with --run-libc-freeres=no.
By default valgrind tries to free up glibc memory at exit by running
__libc_freeres (). Unfortunately some older glibc versions have bugs
that either crash the test or make valgrind report errors. Since we
aren't interested in tracking memory leaks in glibc anyway, just
disable it.
Jan Kratochvil [Wed, 17 Oct 2012 22:11:30 +0000 (00:11 +0200)]
libdwfl/
* argp-std.c: Update Copyright year.
(offline_find_elf): New function.
(offline_callbacks): Use it for find_elf.
(struct parse_opt): New.
(parse_opt): New key ARGP_KEY_INIT. In other make hook struct
parse_opt pointer from former Dwfl pointer. Delay 'e and OPT_COREFILE
processing till ARGP_KEY_SUCCESS. Initialize state->input already from
ARGP_KEY_SUCCESS. Modify the cleanup in ARGP_KEY_ERROR. Make the
final state->input initialization optional.
* dwfl_end.c: Update Copyright year.
(dwfl_end): Free executable_for_core.
* libdwflP.h: Update Copyright year.
(struct Dwfl): New field executable_for_core.
tests/
* run-addrname-test.sh: New test for PIE relocation.
* testfile70.core.bz2: New file.
* testfile70.exec.bz2: New file.
* Makefile.am (EXTRA_DIST): Add testfile70.core.bz2 and
testfile70.exec.bz2 .
Signed-off-by: Jan Kratochvil <jan.kratochvil@redhat.com>
Mark Wielaard [Fri, 16 Nov 2012 11:25:04 +0000 (12:25 +0100)]
readelf.c (print_ops): Ajust DW_OP_skip and DW_OP_bra targets calculation.
The 2-byte constant is the number of bytes of the DWARF expression to skip
forward or backward from the current operation, beginning after the 2-byte
constant.
Jan Kratochvil [Wed, 10 Oct 2012 20:27:58 +0000 (22:27 +0200)]
src/
2012-10-12 Jan Kratochvil <jan.kratochvil@redhat.com>
* readelf.c (ITEM_WRAP_COLUMN, REGISTER_WRAP_COLUMN): Merge to ...
(WRAP_COLUMN): ... here.
(print_core_item): Remove parameter format_max. Update function
comment. Replace FORMAT_MAX by the real output width.
(handle_core_item): Remove the FORMAT_MAX values in TYPES, DO_TYPE,
calls of print_core_item, remove variable maxfmt, change
ITEM_WRAP_COLUMN to WRAP_COLUMN.
(handle_core_register): Remove the FORMAT_MAX values in TYPES, BITS,
calls of print_core_item, change REGISTER_WRAP_COLUMN to WRAP_COLUMN.
backends/
2012-10-12 Jan Kratochvil <jan.kratochvil@redhat.com>
* linux-core-note.c (prstatus_items): Rename groups of sigpend and
sighold to signal2 and signal3.
Signed-off-by: Jan Kratochvil <jan.kratochvil@redhat.com>
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.