platform/upstream/elfutils.git
9 years agoreadelf: Report invalid data if action table doesn't follow call site table.
Mark Wielaard [Mon, 8 Dec 2014 09:11:43 +0000 (10:11 +0100)]
readelf: Report invalid data if action table doesn't follow call site table.

Don't assert.

Signed-off-by: Mark Wielaard <mjw@redhat.com>
9 years agolibdw: save startp/endp boundaries in Dwarf_CU
Josh Stone [Thu, 11 Dec 2014 02:41:43 +0000 (18:41 -0800)]
libdw: save startp/endp boundaries in Dwarf_CU

Rather than looking up section data every time, we can simply save the
range of each CU as pointers in Dwarf_CU.

Signed-off-by: Josh Stone <jistone@redhat.com>
9 years agolibdw: optimize dwarf_hasattr to just look at abbrev
Josh Stone [Thu, 11 Dec 2014 02:33:34 +0000 (18:33 -0800)]
libdw: optimize dwarf_hasattr to just look at abbrev

To just check the presence of an attribute, we only need to look at the
abbreviation data.  This optimization avoids reading over die data at all,
except possibly just to get the abbrev code.

Signed-off-by: Josh Stone <jistone@redhat.com>
9 years agolibdw: unify die->abbrev lookups
Josh Stone [Thu, 11 Dec 2014 02:28:04 +0000 (18:28 -0800)]
libdw: unify die->abbrev lookups

Add a new internal function, __libdw_dieabbrev, which deals with checking
a die for an abbrev, and setting it as needed.

Signed-off-by: Josh Stone <jistone@redhat.com>
9 years agoaddr2line: Always prefer linkage_name over plain names
Josh Stone [Wed, 10 Dec 2014 19:14:40 +0000 (11:14 -0800)]
addr2line: Always prefer linkage_name over plain names

Signed-off-by: Josh Stone <jistone@redhat.com>
9 years agoaddr2line: Iterate scopes for inline's parent function
Josh Stone [Wed, 10 Dec 2014 19:06:52 +0000 (11:06 -0800)]
addr2line: Iterate scopes for inline's parent function

The function which contains an inline might not be the immediate next
die scope.  For instance, there may be a lexical scope in between.
Instead, iterate the remaining scopes until an appropriate tag is found.

Signed-off-by: Josh Stone <jistone@redhat.com>
9 years agoreadelf: maximum operations per instruction cannot be zero in .debug_line.
Mark Wielaard [Sun, 7 Dec 2014 22:40:12 +0000 (23:40 +0100)]
readelf: maximum operations per instruction cannot be zero in .debug_line.

Signed-off-by: Mark Wielaard <mjw@redhat.com>
9 years agoreadelf: DW_OP_call_ref and DW_OP_GNU_implicit_pointer are invalid for CFA.
Mark Wielaard [Sun, 7 Dec 2014 21:45:28 +0000 (22:45 +0100)]
readelf: DW_OP_call_ref and DW_OP_GNU_implicit_pointer are invalid for CFA.

print_cfa_program might call print_ops with zero offset size. We don't
need (and don't know) the DWARF offset size in that case. DW_OP_call_ref
and DW_OP_GNU_implicit_pointer need to know the offset size because they
reference a DIE. But they are invalid when used from CFA.

Signed-off-by: Mark Wielaard <mjw@redhat.com>
9 years agolibdwfl: Check actually used ehsize, shentsize and phentsize in relocate.c
Mark Wielaard [Sun, 7 Dec 2014 19:48:43 +0000 (20:48 +0100)]
libdwfl: Check actually used ehsize, shentsize and phentsize in relocate.c

In relocate_section we check relocation sections don't overlap any of the
ELF headers. We should check against the actually used ehsize, shentsize
and phentsize. Not the possibly bogus values in the file ehdr itself.

Signed-off-by: Mark Wielaard <mjw@redhat.com>
9 years agolibdwfl: Never relocate value against section zero (load address).
Mark Wielaard [Sun, 7 Dec 2014 19:26:56 +0000 (20:26 +0100)]
libdwfl: Never relocate value against section zero (load address).

This really is just a robustify patch in case section zero got the
wrong section flags set. In that case __libdwfl_relocate_value might
call dwfl_offline_section_address which might assert (because it isn't
prepared to handle section zero). elf_nextscn will never see section zero.
So be explicit in dwfl_offline_section_address and immediately assert
when shndx is zero. And handle section zero immediately by not relocating
the value in __libdwfl_relocate_value.

Signed-off-by: Mark Wielaard <mjw@redhat.com>
9 years agolibdw: Add overflow checking to __libdw_form_val_len.
Mark Wielaard [Thu, 4 Dec 2014 20:43:44 +0000 (21:43 +0100)]
libdw: Add overflow checking to __libdw_form_val_len.

Pass endp as argument to __libdw_form_val_len and check we don't read
beyond the end of expected data and don't return lengths that would
overflow.

Signed-off-by: Mark Wielaard <mjw@redhat.com>
9 years agoChange calling convention of dwarf_getmacros to allow opcode 0xff
Petr Machata [Tue, 2 Dec 2014 20:22:14 +0000 (21:22 +0100)]
Change calling convention of dwarf_getmacros to allow opcode 0xff

We now require callers to pass DWARF_GETMACROS_START to start the
iteration.  0 is still accepted, but signals to libdw that the
iteration request comes from an old-style caller, and that opcode 0xff
should be rejected when iterating .debug_macro, to avoid confusion.

Signed-off-by: Petr Machata <pmachata@redhat.com>
9 years agoobjdump: Add various sanity checks to guard against corrupted data.
Mark Wielaard [Thu, 4 Dec 2014 16:01:20 +0000 (17:01 +0100)]
objdump: Add various sanity checks to guard against corrupted data.

Reported-by: Alexander Cherepanov <cherepan@mccme.ru>
Signed-off-by: Mark Wielaard <mjw@redhat.com>
9 years agoreadelf: Fix overflow check in handle_sysv_hash64.
Mark Wielaard [Sun, 30 Nov 2014 20:03:57 +0000 (21:03 +0100)]
readelf: Fix overflow check in handle_sysv_hash64.

Since all values are 64bit, not 32bit as in other hashes, we need to
explicitly check for overflow.

Signed-off-by: Mark Wielaard <mjw@redhat.com>
9 years agolibdwfl: Check relocations don't overlap ELF ehdr, shdrs or phdrs.
Mark Wielaard [Sat, 29 Nov 2014 19:23:30 +0000 (20:23 +0100)]
libdwfl: Check relocations don't overlap ELF ehdr, shdrs or phdrs.

If either the section that needs the relocation applied, or the
section that the relocations come from overlap one of the ehdrs,
shdrs or phdrs data then refuse to do the relocations.  We update
both section data. It isn't illegal for ELF section data to overlap
the header data, but updating the (relocation) data might corrupt
the in-memory libelf headers causing strange corruptions or errors.

Also check offset + size of a relocation doesn't overflow.

Signed-off-by: Mark Wielaard <mjw@redhat.com>
9 years agoreadelf: Don't trash destshdr for STT_SECTION in handle_relocs_rel[a].
Mark Wielaard [Fri, 28 Nov 2014 21:22:16 +0000 (22:22 +0100)]
readelf: Don't trash destshdr for STT_SECTION in handle_relocs_rel[a].

We might need the original destshdr for handling other relocations.

Signed-off-by: Mark Wielaard <mjw@redhat.com>
9 years agoAdd configure --disable-textrelcheck option to enable CC=afl-fuzz on 32bit.
Mark Wielaard [Thu, 27 Nov 2014 22:53:30 +0000 (23:53 +0100)]
Add configure --disable-textrelcheck option to enable CC=afl-fuzz on 32bit.

Using american fuzzy lop has found a lot of issues. It would be nice to
make using it a bit easier. Our build files make sure that no shared
library uses text relocations, but afl-gcc will insert some on i686.
http://www.akkadia.org/drepper/textrelocs.html

Now CC=afl-gcc ./configure --disable-textrelcheck will allow them so
that afl can instrument the libraries.

Don't try to use or install them except with afl-fuzz. When selinux is
enabled it might prevent loading the libraries with DT_TEXTREL set.

Signed-off-by: Mark Wielaard <mjw@redhat.com>
9 years agolibdw: Initialize variables in getcfi_gnu_eh_frame.
Mark Wielaard [Thu, 27 Nov 2014 22:41:57 +0000 (23:41 +0100)]
libdw: Initialize variables in getcfi_gnu_eh_frame.

Some older GCCs are not clever enough to realize that when search_table
is NULL not only are search_table_entries and search_table_encoding not
initialized, they are also not used. Giving "may be used uninitialized"
errors.

Signed-off-by: Mark Wielaard <mjw@redhat.com>
9 years agotests: vdsosyms call dwfl_linux_proc_attach.
Mark Wielaard [Thu, 27 Nov 2014 22:19:47 +0000 (23:19 +0100)]
tests: vdsosyms call dwfl_linux_proc_attach.

Older kernels won't let us get at the vdso otherwise.

Signed-off-by: Mark Wielaard <mjw@redhat.com>
9 years agoreadelf: Cast Dwarf_Word length to ptrdiff_t for comparison.
Mark Wielaard [Wed, 26 Nov 2014 23:12:32 +0000 (00:12 +0100)]
readelf: Cast Dwarf_Word length to ptrdiff_t for comparison.

Avoids comparison between signed and unsigned integer expressions warning.

Signed-off-by: Mark Wielaard <mjw@redhat.com>
9 years agoreadelf, libdw: Guard against divide by zero line_range in .debug_line.
Mark Wielaard [Mon, 24 Nov 2014 20:54:42 +0000 (21:54 +0100)]
readelf, libdw: Guard against divide by zero line_range in .debug_line.

For DW_LNS_const_add_pc and special opcodes don't accept line_range
being zero.

Signed-off-by: Mark Wielaard <mjw@redhat.com>
9 years agolibdw: Always check __libdw_find_attr return value.
Mark Wielaard [Sun, 23 Nov 2014 22:21:05 +0000 (23:21 +0100)]
libdw: Always check __libdw_find_attr return value.

__libdw_find_attr will return NULL and might not set code or form.
Only use code or form if the returned address is not NULL.

Signed-off-by: Mark Wielaard <mjw@redhat.com>
9 years agolibdw: Don't assert in __libdw_getabbrev when seeing bad DWARF.
Mark Wielaard [Sun, 23 Nov 2014 22:13:55 +0000 (23:13 +0100)]
libdw: Don't assert in __libdw_getabbrev when seeing bad DWARF.

Signed-off-by: Mark Wielaard <mjw@redhat.com>
9 years agolibelf: Change signed overflow check to unsigned in elf_getdata_rawchunk.
Mark Wielaard [Sun, 23 Nov 2014 20:54:51 +0000 (21:54 +0100)]
libelf: Change signed overflow check to unsigned in elf_getdata_rawchunk.

Arithmetic of signed values that overflow causes undefined behaviour
Change to explicit unsigned arithmetic overflow check.

Signed-off-by: Mark Wielaard <mjw@redhat.com>
9 years agoreadelf: Check length for nexthdr overflow in print_debug_aranges_section.
Mark Wielaard [Sun, 23 Nov 2014 17:26:16 +0000 (18:26 +0100)]
readelf: Check length for nexthdr overflow in print_debug_aranges_section.

Signed-off-by: Mark Wielaard <mjw@redhat.com>
9 years agolibelf: Copy over any leftover data from src to dest in elf_cvt_note.
Mark Wielaard [Sun, 23 Nov 2014 14:27:23 +0000 (15:27 +0100)]
libelf: Copy over any leftover data from src to dest in elf_cvt_note.

If any data is left then the data is likely part of the truncated note
name/desc. This probably means the note is corrupted, but it is better
to have the actual data in dest instead of random uninitialized memory.

Signed-off-by: Mark Wielaard <mjw@redhat.com>
9 years agoreadelf: print_attributes (-A) robustify and handle non-gnu attributes.
Mark Wielaard [Fri, 21 Nov 2014 22:26:35 +0000 (23:26 +0100)]
readelf: print_attributes (-A) robustify and handle non-gnu attributes.

print_attributes wasn't robust against empty or broken attribute sections.
It also only handled GNU attributes. But the arm backend contains some
none-GNU attributes. The difference is in how to handle the tag arguments.

Adds a new test run-readelf-A.sh for both gnu (ppc32) and non-gnu (arm)
attributes.

Signed-off-by: Mark Wielaard <mjw@redhat.com>
9 years agoUse elf_getphdrnum instead of accessing ehdr->e_phnum directly.
Mark Wielaard [Sat, 22 Nov 2014 22:08:48 +0000 (23:08 +0100)]
Use elf_getphdrnum instead of accessing ehdr->e_phnum directly.

Using elf_getphdrnum lets us handle ELF files that use more than PN_XNUM
phdrs. And guards against some corrupt files.

Signed-off-by: Mark Wielaard <mjw@redhat.com>
9 years agolibelf: elf_getphdrnum sanity check the returned phnum result.
Mark Wielaard [Sat, 22 Nov 2014 16:33:05 +0000 (17:33 +0100)]
libelf: elf_getphdrnum sanity check the returned phnum result.

The internal __elf_getphdrnum_rdlock might return an inconsistent phnum.
Return a sanitized value, or return an error to users that rely on phnum
to be consistent. That way iterating over all phdrs using elf_getphdr
will return consistent results.

Signed-off-by: Mark Wielaard <mjw@redhat.com>
9 years agodwarf.h: Add DW_LANG_C11, DW_LANG_C_plus_plus_11 and DW_LANG_C_plus_plus_14.
Mark Wielaard [Mon, 24 Nov 2014 21:17:51 +0000 (22:17 +0100)]
dwarf.h: Add DW_LANG_C11, DW_LANG_C_plus_plus_11 and DW_LANG_C_plus_plus_14.

The following patch is needed to recognize the new DW_LANG constants
that GCC 5 might emit as implemented by this GCC patch:
https://gcc.gnu.org/ml/gcc-patches/2014-11/msg02852.html

Also added to https://fedorahosted.org/elfutils/wiki/DwarfExtensions

GCC 5 can emit these new DWARFv5 draft language constants. Handle them in
dwarf_aggregate_size and dwarf_getfuncs. Also handle DW_LANG_Go in
dwarf_aggregate_size (lower bound for array is zero for Go).

Signed-off-by: Mark Wielaard <mjw@redhat.com>
9 years agodwarf.h: Add DW_AT_noreturn.
Mark Wielaard [Wed, 26 Nov 2014 16:51:28 +0000 (17:51 +0100)]
dwarf.h: Add DW_AT_noreturn.

DW_AT_noreturn is added by GCC5 for functions that don't return to their
caller. It is set on a DW_TAG_subprogram for the traditional GNU noreturn
attribute, the C11 _Noreturn keyword or C++11 [[noreturn]] attribute. It
is a new DWARF5 extension. This is a constant only addition to dwarf.h.
No other part of elfutils currently depends on this attribute.
Also added to https://fedorahosted.org/elfutils/wiki/DwarfExtensions

Signed-off-by: Mark Wielaard <mjw@redhat.com>
9 years agolibdwfl: Sanity check the symbol table before use.
Mark Wielaard [Tue, 18 Nov 2014 09:07:10 +0000 (10:07 +0100)]
libdwfl: Sanity check the symbol table before use.

Make sure the number of symbols reported and the first global fit the data.

Signed-off-by: Mark Wielaard <mjw@redhat.com>
9 years agoreadelf: Fix sanity check of DW_FORM_block length in print_cfa_program
Mark Wielaard [Tue, 18 Nov 2014 09:01:48 +0000 (10:01 +0100)]
readelf: Fix sanity check of DW_FORM_block length in print_cfa_program

We were checking the reg nr, not the length of the block.

Signed-off-by: Mark Wielaard <mjw@redhat.com>
9 years agolibelf: Check for overflow in version_xlate elf_cvt_Verdef and elf_cvt_Verneed.
Mark Wielaard [Tue, 18 Nov 2014 08:56:01 +0000 (09:56 +0100)]
libelf: Check for overflow in version_xlate elf_cvt_Verdef and elf_cvt_Verneed.

Signed-off-by: Mark Wielaard <mjw@redhat.com>
9 years agoreadelf: When the version chain ends, stop processing the entries.
Mark Wielaard [Mon, 17 Nov 2014 22:35:28 +0000 (23:35 +0100)]
readelf: When the version chain ends, stop processing the entries.

The version definition, auxiliary version, version dependency and needed
version sections chain information together through "next" fields. When
the "next" field is zero there are no more information entries. Stop
processing when we see zero instead of repeatedly processing the same
entry (at offset zero from the current one).

Signed-off-by: Mark Wielaard <mjw@redhat.com>
9 years agoCheck elf_strptr didn't fail getting section name.
Mark Wielaard [Mon, 17 Nov 2014 22:15:45 +0000 (23:15 +0100)]
Check elf_strptr didn't fail getting section name.

Since elf_strptr can fail and return NULL we should always check the result
before usage. Debug sections are only handled by section name, so make sure
the name actually exists.

Signed-off-by: Mark Wielaard <mjw@redhat.com>
9 years agoreadelf: Warn if ptr_size is not 4 or 8 bytes.
Mark Wielaard [Mon, 17 Nov 2014 22:01:34 +0000 (23:01 +0100)]
readelf: Warn if ptr_size is not 4 or 8 bytes.

Just warn and don't call print_cfa_program in that case. Bad things will
happen and the result is mostly bogus.

Signed-off-by: Mark Wielaard <mjw@redhat.com>
9 years agolibelf: elf_getshdrstrndx cannot use SHN_XINDEX without section headers.
Mark Wielaard [Sun, 16 Nov 2014 23:42:53 +0000 (00:42 +0100)]
libelf: elf_getshdrstrndx cannot use SHN_XINDEX without section headers.

Signed-off-by: Mark Wielaard <mjw@redhat.com>
9 years agolibelf: Fix handling of (extended) phnum.
Mark Wielaard [Sun, 16 Nov 2014 23:33:36 +0000 (00:33 +0100)]
libelf: Fix handling of (extended) phnum.

If there is no e_phoff e_phnum cannot be trusted. Extended phnum can only
be gotten if we have an actual section table and a shdr for section zero,
Extended phnum can be too large to fit in the file (or a size_t).

Signed-off-by: Mark Wielaard <mjw@redhat.com>
9 years agoreadelf: Robustify print_cfa_program.
Mark Wielaard [Sun, 16 Nov 2014 10:40:08 +0000 (11:40 +0100)]
readelf: Robustify print_cfa_program.

Check block len before calling print_ops.

Signed-off-by: Mark Wielaard <mjw@redhat.com>
9 years agogelf_getnote: Check padding overflow.
Mark Wielaard [Sun, 16 Nov 2014 10:30:51 +0000 (11:30 +0100)]
gelf_getnote: Check padding overflow.

Since ELF notes need to be properly aligned they can include padding.
Make sure the padding itself and the padding calculation doesn't overflow.

Signed-off-by: Mark Wielaard <mjw@redhat.com>
9 years agolibelf: getdata check 64bit values correctly on 32bit arch.
Mark Wielaard [Sun, 16 Nov 2014 10:19:29 +0000 (11:19 +0100)]
libelf: getdata check 64bit values correctly on 32bit arch.

On 32bit arches size_t is too small to do size and overflow checks
of 64bit ELF files. Use the actual Elf64 types to make sure checks
on 64bit ELF files are done correctly on 32bit arches.

Signed-off-by: Mark Wielaard <mjw@redhat.com>
9 years agoreadelf: Sanity check CIE unit_length and augmentationlen in debug_frame.
Mark Wielaard [Fri, 14 Nov 2014 20:42:47 +0000 (21:42 +0100)]
readelf: Sanity check CIE unit_length and augmentationlen in debug_frame.

Signed-off-by: Mark Wielaard <mjw@redhat.com>
9 years agolibelf: gelf_getnote check for offset overflow.
Mark Wielaard [Fri, 14 Nov 2014 16:05:08 +0000 (17:05 +0100)]
libelf: gelf_getnote check for offset overflow.

Signed-off-by: Mark Wielaard <mjw@redhat.com>
9 years agolibdwelf: Check the d_buf actually exists in dwelf_elf_gnu_debuglink.
Mark Wielaard [Fri, 14 Nov 2014 15:58:36 +0000 (16:58 +0100)]
libdwelf: Check the d_buf actually exists in dwelf_elf_gnu_debuglink.

Signed-off-by: Mark Wielaard <mjw@redhat.com>
9 years agolibdwfl: dwfl_module_getdwarf.c don't use symtab with bogus sh_entsize.
Mark Wielaard [Fri, 14 Nov 2014 11:38:12 +0000 (12:38 +0100)]
libdwfl: dwfl_module_getdwarf.c don't use symtab with bogus sh_entsize.

Signed-off-by: Mark Wielaard <mjw@redhat.com>
9 years agoreadelf: Check def == NULL before use in handle_versym.
Mark Wielaard [Fri, 14 Nov 2014 11:24:28 +0000 (12:24 +0100)]
readelf: Check def == NULL before use in handle_versym.

Signed-off-by: Mark Wielaard <mjw@redhat.com>
9 years agolibdwfl: find_dynsym don't assume dynamic linker has adjusted DYNAMIC entries.
Mark Wielaard [Mon, 10 Nov 2014 13:49:20 +0000 (14:49 +0100)]
libdwfl: find_dynsym don't assume dynamic linker has adjusted DYNAMIC entries.

commit 037505 "Fix resolving ELF symbols for live PIDs with deleted files"
changed find_dynsym to assume the PT_DYNAMIC entries had been adjusted by
the dynamic linker. That is often a correct assumption when the ELF image
comes from remote memory. But we cannot rely on that. In the case of the
vdso image the DYNAMIC segment has not been adjusted for example.

There is no good way to determine whether the DYNAMIC segment has or
hasn't been adjusted already to the load address by the dynamic linker.
So we just try twice. Once without and if the fails again with assuming
adjustments being applied.

Includes a new vdsosyms testcase that fails on i686 before and succeeds
after the fix.

Signed-off-by: Mark Wielaard <mjw@redhat.com>
9 years agolibelf: Fix unsigned overflow check in elf_getdata.
Mark Wielaard [Thu, 13 Nov 2014 14:43:02 +0000 (15:43 +0100)]
libelf: Fix unsigned overflow check in elf_getdata.

9 years agolibelf: Use mempcpy not __mempcpy.
Mark Wielaard [Sat, 8 Nov 2014 15:18:34 +0000 (16:18 +0100)]
libelf: Use mempcpy not __mempcpy.

We were using mempcpy everywhere else, only __libelf_next_arhdr_wrlock used
__mempcpy.

Signed-off-by: Mark Wielaard <mjw@redhat.com>
9 years agolibdw: Fix dwarf_getsrclines.c 32bit compile error.
Mark Wielaard [Tue, 11 Nov 2014 13:10:04 +0000 (14:10 +0100)]
libdw: Fix dwarf_getsrclines.c 32bit compile error.

__libdw_getsrclines should have been marked as internal_function in
both libdwP.h and dwarf_getsrclines.c. Do address_size comparison as
uint8_t to avoid signedness warning.

Signed-off-by: Mark Wielaard <mjw@redhat.com>
9 years agoTest cases for .debug_macro support
Petr Machata [Fri, 17 Oct 2014 00:47:15 +0000 (02:47 +0200)]
Test cases for .debug_macro support

Signed-off-by: Petr Machata <pmachata@redhat.com>
9 years agoSupport .debug_macro
Petr Machata [Fri, 17 Oct 2014 00:47:03 +0000 (02:47 +0200)]
Support .debug_macro

- This code is based on the following proposal:
    http://www.dwarfstd.org/ShowIssue.php?issue=110722.1

- dwarf_getmacros serves either of .debug_macinfo or .debug_macro
  transparently, but if the latter uses opcode 0xff, it bails out with
  an error.  The reason is that in .debug_macro, 0xff is a custom code
  that can mean anything, while in .debug_macinfo there's fixed
  semantics associated with 0xff.

- dwarf_getmacros_off is a new interface used for requesting iteration
  through transparently included units.

- dwarf_macro_getparamcnt and dwarf_macro_param are new interfaces
  used for requesting number of parameters of an opcode and individual
  parameters.  dwarf_macro_getsrcfiles is a new interface used for
  requesting a file part of .debug_line unit associated with macro
  unit that the opcode comes from.

- The existing interfaces dwarf_macro_opcode, dwarf_macro_param1 and
  dwarf_macro_param2 remain operational for old- as well as new-style
  Dwarf macro sections, if applicable.

- dwarf_getsrclines was made into a light wrapper around a worker
  function that loads line unit given its offset.  The worker also
  caches loaded units in an offset-keyed search tree, so that we don't
  end up re-reading units even though they were read in a different
  domain (e.g. a macro unit request can prime cache for later CU
  lookup).  dwarf_macro_getsrcfiles calls the worker function under
  covers.

Signed-off-by: Petr Machata <pmachata@redhat.com>
9 years agoreadelf.c (handle_versym): Initialize vername and filename array elements.
Mark Wielaard [Sat, 8 Nov 2014 13:04:27 +0000 (14:04 +0100)]
readelf.c (handle_versym): Initialize vername and filename array elements.

We check whether the elements are set before printing their contents,
but didn't make sure they were initialized.

Reported-by: Hanno Böck <hanno@hboeck.de>
Signed-off-by: Mark Wielaard <mjw@redhat.com>
9 years agoreadelf: Sanity check hash section contents before processing.
Mark Wielaard [Fri, 7 Nov 2014 11:54:02 +0000 (12:54 +0100)]
readelf: Sanity check hash section contents before processing.

Reported by: Hanno Böck <hanno@hboeck.de>
Signed-off-by: Mark Wielaard <mjw@redhat.com>
9 years agolibelf: Correct shdr size check for (raw) getdata.
Mark Wielaard [Fri, 7 Nov 2014 11:47:16 +0000 (12:47 +0100)]
libelf: Correct shdr size check for (raw) getdata.

Reported-by: Hanno Böck <hanno@hboeck.de>
Signed-off-by: Mark Wielaard <mjw@redhat.com>
9 years agolibdw: Add dwarf_peel_type. Use it in dwarf_aggregate_size.
Mark Wielaard [Mon, 6 Oct 2014 20:00:16 +0000 (22:00 +0200)]
libdw: Add dwarf_peel_type. Use it in dwarf_aggregate_size.

Add new function dwarf_peel_type. Some type annotations in DWARF are
specified by modifier tag type wrappers instead of attributes.
For type aliases (typedef) and qualifiers (const, volatile, restrict)
tags dwarf_peel_type follows the DW_AT_type attributes till it finds
a base, user-defined, reference or pointer type DIE.

Use this new function in the backends for return type DIEs (replacing
the existing dwarf_peel_type there) and in dwarf_aggregate_size so
it can provide the sizes for qualified types too. Add a new version
and testcase for the new dwarf_aggregate_size functionality.

Signed-off-by: Mark Wielaard <mjw@redhat.com>
9 years agoDrop unused field struct Dwarf_Files_s.cu
Petr Machata [Wed, 15 Oct 2014 17:28:08 +0000 (19:28 +0200)]
Drop unused field struct Dwarf_Files_s.cu

Signed-off-by: Petr Machata <pmachata@redhat.com>
9 years agodwarf.h: Add DW_AT_GNU_deleted.
Mark Wielaard [Sun, 5 Oct 2014 15:12:41 +0000 (17:12 +0200)]
dwarf.h: Add DW_AT_GNU_deleted.

DW_AT_GNU_deleted is added by G++ for C++11 deleted special member
functions (= delete;). This is a constant only addition to dwarf.h.
No other part of elfutils currently depends on this attribute.
Also added to https://fedorahosted.org/elfutils/wiki/DwarfExtensions

Signed-off-by: Mark Wielaard <mjw@redhat.com>
9 years agotests: run-deleted.sh unset VALGRIND_CMD before running deleted.
Mark Wielaard [Thu, 2 Oct 2014 20:53:44 +0000 (22:53 +0200)]
tests: run-deleted.sh unset VALGRIND_CMD before running deleted.

We don't want to run the deleted test process under valgrind then
eu-stack will see the valgrind process backtrace.

Signed-off-by: Mark Wielaard <mjw@redhat.com>
9 years agolibdw: dwarf_aggregate_size return CU address_size for sizeless pointer/refs.
Mark Wielaard [Thu, 2 Oct 2014 12:00:47 +0000 (14:00 +0200)]
libdw: dwarf_aggregate_size return CU address_size for sizeless pointer/refs.

Tested-by: Conrad Meyer <cse.cem@gmail.com>
Signed-off-by: Mark Wielaard <mjw@redhat.com>
9 years agoSupport note NT_FILE for locating files.
Jan Kratochvil [Fri, 26 Sep 2014 20:42:19 +0000 (22:42 +0200)]
Support note NT_FILE for locating files.

Martin Milata:
------------------------------------------------------------------------------
RFE: dwfl_core_file_report: use NT_FILE core note if the link_map chain is broken
https://bugzilla.redhat.com/show_bug.cgi?id=1129777

The dwfl_core_file_report function follows dynamic linker's link_map chain in
order to determine the shared libraries used by the executable. As this data
structure is located in writable memory it can be overwritten by garbage, which
is sometimes the case.
https://github.com/abrt/satyr/issues/127#issuecomment-46957546

Since version 3.7 (commit 2aa362c49), Linux kernel adds NT_FILE note to core
files which contains the files mapped by the process, including shared
libraries.
------------------------------------------------------------------------------

dwfl_core_file_report now tries to fall back on NT_FILE if the link_map chain
is broken.

elfutils would already find the appropriate binary file from
/usr/lib/debug/.build-id/ symbolic links.  But those symbolic links do not have
to be present on the system while NT_FILE still points to the correct binaries.

Filenames from the note NT_FILE are used only if link_map filenames failed to
locate matching binaries.

tests/test-core.core.bz2 had to have its NT_FILE disabled as run-unstrip-n.sh
otherwise FAILs:
FAIL: 0x7f67f2aaf000+0x202000 - . - /home/jkratoch/redhat/elfutils-libregr/test-core-lib.so
PASS: 0x7f67f2aaf000+0x202000 - . - test-core-lib.so
As test-core-lib.so is found in link_map but it is not present on the disk
elfutils now chooses the more reliable filename from NT_FILE (although that
filename is also not found on the disk).  Updating the expected text would be
also sufficient.

libdwfl/
2014-09-26  Jan Kratochvil  <jan.kratochvil@redhat.com>

Support NT_FILE for locating files.
* core-file.c (dwfl_core_file_report): New variables note_file and
note_file_size, set them and pass them to dwfl_segment_report_module.
* dwfl_segment_report_module.c: Include common.h and fcntl.h.
(buf_has_data, buf_read_ulong, handle_file_note): New functions.
(invalid_elf): New function from code of dwfl_segment_report_module.
(dwfl_segment_report_module): Add parameters note_file and
note_file_size.  New variables elf and fd, clean them up in finish.
Move some code to invalid_elf.  Call handle_file_note, if it found
a name verify the file by invalid_elf.  Protect elf and fd against
cleanup by finish if we found the file for new Dwfl_Module.
* libdwflP.h (dwfl_segment_report_module): Add parameters note_file and
note_file_size.

tests/
2014-09-26  Jan Kratochvil  <jan.kratochvil@redhat.com>

Support NT_FILE for locating files.
* Makefile.am (TESTS): Add run-linkmap-cut.sh.
(EXTRA_DIST): Add run-linkmap-cut.sh, linkmap-cut-lib.so.bz2,
linkmap-cut.bz2 and linkmap-cut.core.bz2 .
* linkmap-cut-lib.so.bz2: New file.
* linkmap-cut.bz2: New file.
* linkmap-cut.core.bz2: New file.
* run-linkmap-cut.sh: New file.
* run-unstrip-n.sh: Update its expected output.

Signed-off-by: Jan Kratochvil <jan.kratochvil@redhat.com>
9 years agolibdwfl: dwfl_segment_report_module use ei_class, ei_data and e_type.
Mark Wielaard [Tue, 23 Sep 2014 19:31:42 +0000 (21:31 +0200)]
libdwfl: dwfl_segment_report_module use ei_class, ei_data and e_type.

To make it easier to see that the code is using the correct fields of
the ehdr e32/e64 union extract ei_class, ei_data and e_type early and
use them directly.

Signed-off-by: Mark Wielaard <mjw@redhat.com>
9 years agoreadelf: Fix typo in a check in handle_relocs_rela
Petr Machata [Sat, 13 Sep 2014 22:47:42 +0000 (00:47 +0200)]
readelf: Fix typo in a check in handle_relocs_rela

- Testing shdr makes no sense, that pointer was dereferenced several
  times throughout the section.  destshdr on the other hand is not
  tested at all.

Signed-off-by: Petr Machata <pmachata@redhat.com>
9 years agoAdd is_executable to Dwfl_Module.
Jan Kratochvil [Tue, 9 Sep 2014 20:58:26 +0000 (22:58 +0200)]
Add is_executable to Dwfl_Module.

Next patch will find module names from NT_FILE note so that main executable
will no longer necessarily have the name "[exe]" or "[pie]".
-e|--executable still should be able to override such module.

libdwfl/
2014-09-18  Jan Kratochvil  <jan.kratochvil@redhat.com>

* dwfl_build_id_find_elf.c (dwfl_build_id_find_elf): Use IS_EXECUTABLE.
* dwfl_segment_report_module.c (dwfl_segment_report_module): Set
IS_EXECUTABLE.
* libdwflP.h (struct Dwfl_Module): New field is_executable.

Signed-off-by: Jan Kratochvil <jan.kratochvil@redhat.com>
9 years agoRename read_ubyte_unaligned_inc to read_addr_unaligned_inc
Petr Machata [Fri, 12 Sep 2014 17:03:33 +0000 (19:03 +0200)]
Rename read_ubyte_unaligned_inc to read_addr_unaligned_inc

- The behavior of this function has been changed to read only
  address-sized quantities, i.e. the size of 2 is no longer allowed.
  (Size of 1 never was.)  The two outstanding uses, both in readelf.c,
  which actually do use this call to read address-sized units, were
  updated, rejecting fields that indicate weird address sizes.

- The three related calls, read_sbyte_unaligned_inc,
  read_ubyte_unaligned and read_sbyte_unaligned were dropped.  There
  are currently no uses for these calls.

Signed-off-by: Petr Machata <pmachata@redhat.com>
9 years agoAccept DW_AT_GNU_call_site_* as attributes that hold location expressions
Petr Machata [Wed, 10 Sep 2014 20:26:28 +0000 (22:26 +0200)]
Accept DW_AT_GNU_call_site_* as attributes that hold location expressions

- These are extension attributes that correspond in behavior to
  attributes described in this proposal:
http://www.dwarfstd.org/ShowIssue.php?issue=100909.2

- N.B.: DW_AT_call_site_data_location doesn't have a DW_AT_GNU_*
  counterpart.

Signed-off-by: Petr Machata <pmachata@redhat.com>
9 years agoelf_begin sets elf_errno for cases that the file is completely unreadable
Petr Machata [Wed, 10 Sep 2014 20:25:35 +0000 (22:25 +0200)]
elf_begin sets elf_errno for cases that the file is completely unreadable

- The problem this is trying to solve can be seen for example thus:
$ eu-readelf -a /
eu-readelf: failed reading '/': (null)

  With the fix we see a proper error number and get a reasonable error
  message:

$ eu-readelf -a /
eu-readelf: failed reading '/': invalid file descriptor

Signed-off-by: Petr Machata <pmachata@redhat.com>
9 years agoFix resolving ELF symbols for live PIDs with deleted files
Jan Kratochvil [Sun, 17 Aug 2014 16:49:36 +0000 (18:49 +0200)]
Fix resolving ELF symbols for live PIDs with deleted files

For deleted shared library files the offsets to the symbol table were
calculated wrongly from the phdrs because the main_bias wasn't taken into
account.

Formerly shared libraries did not get resolved properly:
#2  0x00007fc4d86c56d6
#3  0x0000000000400938 main

Fixed elfutils produce:
#2  0x00007f61094876d6 libfunc
#3  0x0000000000400938 main

Signed-off-by: Jan Kratochvil <jan.kratochvil@redhat.com>
9 years agoPrevent premature @AR@ replacement in a sed expression. elfutils-0.160
Josh Stone [Mon, 25 Aug 2014 21:40:35 +0000 (14:40 -0700)]
Prevent premature @AR@ replacement in a sed expression.

The Makefile rule for make-debug-archive has a sed expression to replace
@AR@ will the installed name, but this was itself getting replaced when
the Makefile was configured, for a pattern like "s,ar,/path/prefix-,g".
Havoc ensued in the resulting make-debug-archive.

The fix matches it using a regex bracket expression, "[@]AR[@]", so sed
will still match it, but it's immune to configure's replacement.

Signed-off-by: Josh Stone <jistone@redhat.com>
9 years agoPrepare 0.160 release.
Mark Wielaard [Mon, 25 Aug 2014 20:13:57 +0000 (22:13 +0200)]
Prepare 0.160 release.

Signed-off-by: Mark Wielaard <mjw@redhat.com>
9 years agolibdw: Add new function dwarf_cu_die.
Mark Wielaard [Fri, 15 Aug 2014 14:03:21 +0000 (16:03 +0200)]
libdw: Add new function dwarf_cu_die.

Given a Dwarf_Die or Dwarf_Attribute it is often convenient to get at the
CU DIE and the CU header information. There is dwarf_diecu but that doesn't
provide all information from the header and it doesn't work for attributes.
Add a new dwarf_cu_die function that provides all information given a
Dwarf_CU, which both Dwarf_Die and Dwarf_Attribute reference.

Signed-off-by: Mark Wielaard <mjw@redhat.com>
9 years agolibdw: Add new function dwarf_cu_getdwarf.
Mark Wielaard [Fri, 15 Aug 2014 11:08:24 +0000 (13:08 +0200)]
libdw: Add new function dwarf_cu_getdwarf.

In both systemtap and libabigail there is a need to get the actual Dwarf
underlying an Dwarf_Die or Dwarf_Attribute. Following a DIE reference
might end up in an alternate Dwarf since the addition of DWZ multifile
forms. Both Dwarf_Die and Dwarf_Attribute already contain a Dwarf_CU
handle. Add a function dwarf_cu_getdwarf to retrieve the underlying
Dwarf using the Dwarf_CU.

Signed-off-by: Mark Wielaard <mjw@redhat.com>
9 years agolibdwfl: Handle LZMA .ko.xz compressed kernel modules.
Mark Wielaard [Thu, 14 Aug 2014 20:07:44 +0000 (22:07 +0200)]
libdwfl: Handle LZMA .ko.xz compressed kernel modules.

Linux kernel modules can not just be compressed with gz and bz2, but also
with xz.

Signed-off-by: Mark Wielaard <mjw@redhat.com>
10 years agoaarch64: use <sys/user.h> defined register structures
Kyle McMartin [Mon, 9 Jun 2014 19:06:26 +0000 (21:06 +0200)]
aarch64: use <sys/user.h> defined register structures

glibc now supplies these (compatible) structs instead of including the
kernel's <asm/ptrace.h> header, so let's use them. Annoyingly this will
cause new elfutils to FTBFS on old glibc, and vice versa. So include a
new configure check for the new struct names and use the old ones if
they are not avilable.

Signed-off-by: Kyle McMartin <kyle@redhat.com>
Signed-off-by: Mark Wielaard <mjw@redhat.com>
10 years agoFix report_r_debug for prelinked libraries
Jan Kratochvil [Thu, 24 Jul 2014 18:47:17 +0000 (20:47 +0200)]
Fix report_r_debug for prelinked libraries

Signed-off-by: Jan Kratochvil <jan.kratochvil@redhat.com>
10 years agom4: Handle cross-compile situations in biarch.m4 tests.
Mark Wielaard [Mon, 14 Jul 2014 12:34:15 +0000 (14:34 +0200)]
m4: Handle cross-compile situations in biarch.m4 tests.

Reported-by: Leonard Crestez <lcrestez@ixiacom.com>
Signed-off-by: Mark Wielaard <mjw@redhat.com>
10 years agoAdd ppc64le ELFv2 abi support to backends and elflint.
Mark Wielaard [Fri, 4 Jul 2014 12:30:48 +0000 (14:30 +0200)]
Add ppc64le ELFv2 abi support to backends and elflint.

The big endian vs little endian changes are already handled by detecting
the EI_DATA data encoding. And the function descriptors are already not
used when we see there is no .opd section. This change adds new checks
for st_other bits, new relocations and recognizes DT_PPC64_OPT.

Signed-off-by: Menanteau Guy <menantea@linux.vnet.ibm.com>
Signed-off-by: Mark Wielaard <mjw@redhat.com>
10 years agoUpdate elf.h from glibc.
Mark Wielaard [Fri, 4 Jul 2014 11:39:18 +0000 (13:39 +0200)]
Update elf.h from glibc.

Includes new bits needed for ppc64le ELFv2 abi.
https://bugzilla.redhat.com/show_bug.cgi?id=1110249

Signed-off-by: Mark Wielaard <mjw@redhat.com>
10 years agobackends: aarch64_return_value_location should handle DW_ATE_boolean.
Mark Wielaard [Fri, 4 Jul 2014 11:26:12 +0000 (13:26 +0200)]
backends: aarch64_return_value_location should handle DW_ATE_boolean.

Found with run-native-test.sh om debian arm64.
http://bugs.debian.org/753552

Signed-off-by: Mark Wielaard <mjw@redhat.com>
10 years agoMake the attach code build again on non-Linux hosts.
Kurt Roeckx [Tue, 24 Jun 2014 20:08:36 +0000 (22:08 +0200)]
Make the attach code build again on non-Linux hosts.

Signed-off-by: Kurt Roeckx <kurt@roeckx.be>
10 years agodwarf.h: Remove non-existing DW_TAG_mutable_type.
Mark Wielaard [Wed, 18 Jun 2014 08:57:58 +0000 (10:57 +0200)]
dwarf.h: Remove non-existing DW_TAG_mutable_type.

The DW_TAG_mutable_type was only mentioned in an early draft of DWARFv3.
But was removed because there are no C++ mutable qualified types. It was
replaced by a new attribute DW_AT_mutable on DW_TAG_member DIEs. The new
attribute is available in dwarf.h.
http://dwarfstd.org/ShowIssue.php?issue=050223.1

DW_TAG_mutable_type was only used internally in some backends (which
just ignored it anyway).  dwarves did use it to turn it into a string
value, libabigail used it and ignored it (patches to remove sent).
GCC, GDB and binutils don't use nor define it.

Signed-off-by: Mark Wielaard <mjw@redhat.com>
10 years agolibebl: Add ebl_func_addr_mask plus ARM backend implementation.
Mark Wielaard [Sat, 14 Jun 2014 15:15:37 +0000 (17:15 +0200)]
libebl: Add ebl_func_addr_mask plus ARM backend implementation.

The ARM EABI says that the zero bit of function symbol st_value indicates
whether the symbol points to a THUMB or ARM function. Also the return
value address in an unwind will contain the same extra bit to indicate
whether to return to a regular ARM or THUMB function. Add a new ebl
function to mask off such bits and turn a function value into a function
address so that we get the actual value that a function symbol or return
address points to. It isn't easily possible to reuse the existing
ebl_resolve_sym_value for this purpose, so we end up with another hook
that can be used from dwfl_module_getsym, handle_cfi and elflint.

Signed-off-by: Mark Wielaard <mjw@redhat.com>
10 years agobackends (*_return_value_location): call dwarf_peeled_die_type
Petr Machata [Fri, 20 Jun 2014 20:59:43 +0000 (22:59 +0200)]
backends (*_return_value_location): call dwarf_peeled_die_type

... instead of inlining equivalent code.

Signed-off-by: Petr Machata <pmachata@redhat.com>
10 years agotests/backtrace.c (frame_callback): Error on seeing more than 16 frames.
Mark Wielaard [Sun, 15 Jun 2014 09:35:50 +0000 (11:35 +0200)]
tests/backtrace.c (frame_callback): Error on seeing more than 16 frames.

Don't fill up the test logs with obviously bogus frames.

Signed-off-by: Mark Wielaard <mjw@redhat.com>
10 years agotests: backtrace.c accept __libc_do_syscall as first frame symname.
Mark Wielaard [Fri, 13 Jun 2014 23:09:17 +0000 (01:09 +0200)]
tests: backtrace.c accept __libc_do_syscall as first frame symname.

On some architectures (Debian armhl) system calls go through
__libc_do_syscall instead of __kernel_vsyscall. Accept either of
these symbol names for the first backtrace frame.

Signed-off-by: Mark Wielaard <mjw@redhat.com>
10 years agotests: backtrace-subr.sh add check_native_unsupported.
Mark Wielaard [Fri, 13 Jun 2014 23:01:58 +0000 (01:01 +0200)]
tests: backtrace-subr.sh add check_native_unsupported.

The special arm check in check_unsupported should only trigger for native
tests, otherwise on arm various backtrace tests would be skipped that
should work just fine.

Signed-off-by: Mark Wielaard <mjw@redhat.com>
10 years agolibdwfl: linux-core-attach.c handle possible unaligned data access.
Mark Wielaard [Sun, 15 Jun 2014 20:14:04 +0000 (22:14 +0200)]
libdwfl: linux-core-attach.c handle possible unaligned data access.

Use libdw/memory-access.h macros read_4ubyte_unaligned_noncvt and
read_8ubyte_unaligned_noncvt to access possibly unaligned data in
core files.

Signed-off-by: Mark Wielaard <mjw@redhat.com>
10 years agolibdwfl: Record dwfl_attach_state error and return it on failure.
Mark Wielaard [Wed, 11 Jun 2014 13:14:23 +0000 (15:14 +0200)]
libdwfl: Record dwfl_attach_state error and return it on failure.

When dwfl_attach_state fails functions that need the process state should
return the error that caused the attach to fail. Use this in the backtrace
test to signal any attach failure. This makes sure that architectures that
don't provide unwinder support get properly detected (and the tests SKIPs)
Also don't assert when trying to attach a non-core ELF file, but return an
error to indicate failure.

Signed-off-by: Mark Wielaard <mjw@redhat.com>
10 years agolibdwfl: dwfl_standard_argp should not fail when not able to attach Dwfl.
Mark Wielaard [Tue, 10 Jun 2014 13:09:23 +0000 (15:09 +0200)]
libdwfl: dwfl_standard_argp should not fail when not able to attach Dwfl.

As pointed out in https://bugzilla.redhat.com/show_bug.cgi?id=1107654
commit 191080 introduced a thinko that caused dwfl_standard_argp
to fail if the Dwfl couldn't be attached. Instead of generating a warning
as the comment intended, the failure would be fatal. But even warning
about dwfl_core_file_attach () or dwfl_linux_proc_attach () failing
would be a mistake. The caller/user might not be interested in such
a non-fatal issue. So just ignore if the call failed for whatever reason.
If the caller is interested in warning up front about this issue, then
dwfl_pid () should be called to check the Dwfl is attached. Things should
work just fine for anything that doesn't call any of the dwfl_state related
functions.

Signed-off-by: Mark Wielaard <mjw@redhat.com>
10 years agoreadelf: Skip section if name is NULL in print_debug.
Mark Wielaard [Tue, 27 May 2014 08:25:27 +0000 (10:25 +0200)]
readelf: Skip section if name is NULL in print_debug.

Don't crash and burn when a section doesn't have a name (possibly invalid
ELF file string table). Just try the next section instead of calling strcmp
on NULL.

Signed-off-by: Mark Wielaard <mjw@redhat.com>
10 years agoreadelf: Don't print 'for section' when rela section sh_info is zero.
Mark Wielaard [Mon, 26 May 2014 20:54:38 +0000 (22:54 +0200)]
readelf: Don't print 'for section' when rela section sh_info is zero.

This matches how handle_relocs_rel already printed the header.

Signed-off-by: Mark Wielaard <mjw@redhat.com>
10 years agounstrip: Allow prelinked, but non-split .bss section.
Mark Wielaard [Mon, 26 May 2014 20:35:30 +0000 (22:35 +0200)]
unstrip: Allow prelinked, but non-split .bss section.

If the section sh_size of the original and undo section are equal then
match them and don't set split_bss. This is also what prelink's
undo_sections allows.

Signed-off-by: Mark Wielaard <mjw@redhat.com>
10 years agounstrip: Add --force to force combining files when ELF headers don't match.
Mark Wielaard [Mon, 26 May 2014 19:28:05 +0000 (21:28 +0200)]
unstrip: Add --force to force combining files when ELF headers don't match.

Older versions of GNU binutils strip would drop some ELF header flags.
Causing the main ELF file and the separate .debug file to have mismatched
ELF header fields. Unfortunately some distros are still shipping such files.
eu-unstrip doesn't want to recombine such files. Add a more explicit
explanation which fields don't match and provide a --force, -F flag to
force combining such files anyway (producing a warning).

https://bugzilla.redhat.com/show_bug.cgi?id=698005
https://bugzilla.redhat.com/show_bug.cgi?id=806474

Signed-off-by: Mark Wielaard <mjw@redhat.com>
10 years agoRegenerate *.po files. elfutils-0.159
Mark Wielaard [Tue, 20 May 2014 08:44:28 +0000 (10:44 +0200)]
Regenerate *.po files.

Signed-off-by: Mark Wielaard <mjw@redhat.com>
10 years agobackends: Add ebl_check_reloc_target_type.
Mark Wielaard [Mon, 19 May 2014 14:52:56 +0000 (16:52 +0200)]
backends: Add ebl_check_reloc_target_type.

And implement for arm and ia64. Both have special section types that
are valid targets for a reloc. Both refer to unwind data. elflint now
just calls ebl_check_reloc_target_type instead of hard coding the
expected section types.

Signed-off-by: Mark Wielaard <mjw@redhat.com>
10 years agotests: Don't use static functions in testfile-backtrace-demangle.
Mark Wielaard [Sun, 18 May 2014 20:41:19 +0000 (22:41 +0200)]
tests: Don't use static functions in testfile-backtrace-demangle.

Compilers and demanglers might treat local/static functions different
between versions. In particular g++ 4.1.2 and libstdc++ mangle and
demangle the static void cxxfunc (int i) function as _Z7cxxfunci.
While g++ 4.8.2 and libstdc++ mangle and demangle it as _ZL7cxxfunci.

Signed-off-by: Mark Wielaard <mjw@redhat.com>
10 years agoPrepare 0.159 release.
Mark Wielaard [Sat, 17 May 2014 22:28:26 +0000 (00:28 +0200)]
Prepare 0.159 release.

Signed-off-by: Mark Wielaard <mjw@redhat.com>
10 years agolibdwfl: Don't leak fd on error in linux-proc-maps.c (grovel_auxv).
Mark Wielaard [Thu, 15 May 2014 14:03:59 +0000 (16:03 +0200)]
libdwfl: Don't leak fd on error in linux-proc-maps.c (grovel_auxv).

Signed-off-by: Mark Wielaard <mjw@redhat.com>
10 years agoRemove --enable-dwz. dwz alt debug is no longer experimental.
Mark Wielaard [Fri, 2 May 2014 22:23:06 +0000 (00:23 +0200)]
Remove --enable-dwz. dwz alt debug is no longer experimental.

Signed-off-by: Mark Wielaard <mjw@redhat.com>