summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* Prevent premature @AR@ replacement in a sed expression.elfutils-0.160Josh Stone2014-08-252-1/+5
| | | | | | | | | | | | 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>
* Prepare 0.160 release.Mark Wielaard2014-08-2511-2729/+2895
| | | | Signed-off-by: Mark Wielaard <mjw@redhat.com>
* libdw: Add new function dwarf_cu_die.Mark Wielaard2014-08-157-3/+101
| | | | | | | | | | 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>
* libdw: Add new function dwarf_cu_getdwarf.Mark Wielaard2014-08-157-2/+75
| | | | | | | | | | | 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>
* libdwfl: Handle LZMA .ko.xz compressed kernel modules.Mark Wielaard2014-08-152-0/+7
| | | | | | | Linux kernel modules can not just be compressed with gz and bz2, but also with xz. Signed-off-by: Mark Wielaard <mjw@redhat.com>
* aarch64: use <sys/user.h> defined register structuresKyle McMartin2014-08-015-4/+39
| | | | | | | | | | | 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>
* Fix report_r_debug for prelinked librariesJan Kratochvil2014-07-282-3/+16
| | | | Signed-off-by: Jan Kratochvil <jan.kratochvil@redhat.com>
* m4: Handle cross-compile situations in biarch.m4 tests.Mark Wielaard2014-07-142-1/+6
| | | | | Reported-by: Leonard Crestez <lcrestez@ixiacom.com> Signed-off-by: Mark Wielaard <mjw@redhat.com>
* Add ppc64le ELFv2 abi support to backends and elflint.Mark Wielaard2014-07-046-2/+45
| | | | | | | | | | 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>
* Update elf.h from glibc.Mark Wielaard2014-07-042-1/+33
| | | | | | | 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>
* backends: aarch64_return_value_location should handle DW_ATE_boolean.Mark Wielaard2014-07-042-0/+6
| | | | | | | Found with run-native-test.sh om debian arm64. http://bugs.debian.org/753552 Signed-off-by: Mark Wielaard <mjw@redhat.com>
* Make the attach code build again on non-Linux hosts.Kurt Roeckx2014-06-252-0/+21
| | | | Signed-off-by: Kurt Roeckx <kurt@roeckx.be>
* dwarf.h: Remove non-existing DW_TAG_mutable_type.Mark Wielaard2014-06-224-4/+13
| | | | | | | | | | | | | | | 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>
* libebl: Add ebl_func_addr_mask plus ARM backend implementation.Mark Wielaard2014-06-2212-14/+70
| | | | | | | | | | | | | | 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>
* backends (*_return_value_location): call dwarf_peeled_die_typePetr Machata2014-06-2012-325/+208
| | | | | | ... instead of inlining equivalent code. Signed-off-by: Petr Machata <pmachata@redhat.com>
* tests/backtrace.c (frame_callback): Error on seeing more than 16 frames.Mark Wielaard2014-06-172-0/+11
| | | | | | Don't fill up the test logs with obviously bogus frames. Signed-off-by: Mark Wielaard <mjw@redhat.com>
* tests: backtrace.c accept __libc_do_syscall as first frame symname.Mark Wielaard2014-06-172-1/+7
| | | | | | | | 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>
* tests: backtrace-subr.sh add check_native_unsupported.Mark Wielaard2014-06-173-4/+18
| | | | | | | | 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>
* libdwfl: linux-core-attach.c handle possible unaligned data access.Mark Wielaard2014-06-172-11/+20
| | | | | | | | 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>
* libdwfl: Record dwfl_attach_state error and return it on failure.Mark Wielaard2014-06-117-35/+107
| | | | | | | | | | | 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>
* libdwfl: dwfl_standard_argp should not fail when not able to attach Dwfl.Mark Wielaard2014-06-112-8/+10
| | | | | | | | | | | | | | | | 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>
* readelf: Skip section if name is NULL in print_debug.Mark Wielaard2014-05-272-1/+7
| | | | | | | | 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>
* readelf: Don't print 'for section' when rela section sh_info is zero.Mark Wielaard2014-05-272-1/+20
| | | | | | This matches how handle_relocs_rel already printed the header. Signed-off-by: Mark Wielaard <mjw@redhat.com>
* unstrip: Allow prelinked, but non-split .bss section.Mark Wielaard2014-05-272-2/+8
| | | | | | | | 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>
* unstrip: Add --force to force combining files when ELF headers don't match.Mark Wielaard2014-05-274-16/+65
| | | | | | | | | | | | | | 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>
* Regenerate *.po files.elfutils-0.159Mark Wielaard2014-05-206-1110/+1114
| | | | Signed-off-by: Mark Wielaard <mjw@redhat.com>
* backends: Add ebl_check_reloc_target_type.Mark Wielaard2014-05-1913-8/+105
| | | | | | | | | 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>
* tests: Don't use static functions in testfile-backtrace-demangle.Mark Wielaard2014-05-184-2/+9
| | | | | | | | | 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>
* Prepare 0.159 release.Mark Wielaard2014-05-1811-3279/+3358
| | | | Signed-off-by: Mark Wielaard <mjw@redhat.com>
* libdwfl: Don't leak fd on error in linux-proc-maps.c (grovel_auxv).Mark Wielaard2014-05-152-1/+9
| | | | Signed-off-by: Mark Wielaard <mjw@redhat.com>
* Remove --enable-dwz. dwz alt debug is no longer experimental.Mark Wielaard2014-05-0310-32/+34
| | | | Signed-off-by: Mark Wielaard <mjw@redhat.com>
* libdwfl: Move dwz alt multi file searching to find_debuginfo callback.Mark Wielaard2014-05-0216-169/+461
| | | | | | | | | | Don't hard code the Dwarf dwz alt multi file search but allow the user to override it through the standard Dwfl_Callbacks. Also move ownership completely to the user of dwarf_setalt by removing free_alt from Dwarf and adding alt, fd and elf fields to Dwfl_Module. Add a relative .dwz file test case. Signed-off-by: Mark Wielaard <mjw@redhat.com>
* libdwelf: Add dwelf_elf_gnu_build_id.Mark Wielaard2014-05-0116-126/+333
| | | | | | | | | Move internal function __libdwfl_find_build_id to libdwelf and use it to add a public dwelf_elf_gnu_build_id function to extract the NT_GNU_BUILD_ID from an ELF file using either the shdrs or phdrs. Adjust internal callers and add a testcase. Signed-off-by: Mark Wielaard <mjw@redhat.com>
* Move .gnu_debugaltlink handling from libdw to libdwflFlorian Weimer2014-05-014-120/+135
| | | | | | | Also use dwelf_dwarf_gnu_debugaltlink to locate the alternate debugging information. Signed-off-by: Florian Weimer <fweimer@redhat.com>
* tests/allfcts.c: Install alternate debug informationFlorian Weimer2014-04-242-1/+40
| | | | | | This change also adds more error checking and reporting. Signed-off-by: Florian Weimer <fweimer@redhat.com>
* libdwelf: Add dwelf_dwarf_gnu_debugaltlinkFlorian Weimer2014-04-2411-4/+215
| | | | Signed-off-by: Florian Weimer <fweimer@redhat.com>
* libdw: Add dwarf_getalt, dwarf_setaltFlorian Weimer2014-04-247-1/+112
| | | | Signed-off-by: Florian Weimer <fweimer@redhat.com>
* dwarf_elf_begin: Add .gnu_debugaltlink to the sectiondata arrayFlorian Weimer2014-04-243-18/+24
| | | | | | And use it if DWZ mode is enabled. Signed-off-by: Florian Weimer <fweimer@redhat.com>
* libdwelf: New DWARF ELF Low-level Functions. Add dwelf_elf_gnu_debuglink.Mark Wielaard2014-04-2422-69/+408
| | | | | | | | New public header elfutils/libdwelf.h for low-level DWARF/ELF helper functions. The new function dwelf_elf_gnu_debuglink returns the name and crc as found in the .gnu_debuglink section of an ELF file. Signed-off-by: Mark Wielaard <mjw@redhat.com>
* readelf: handle_core_item make sure variable length array isn't zero size.Mark Wielaard2014-04-242-1/+6
| | | | | | | | The printed array should have at least space for the terminating zero char. Found by gcc -fsanitize=undefined while running run-readelf-vmcoreinfo.sh. runtime error: variable length array bound evaluates to non-positive value 0 Signed-off-by: Mark Wielaard <mjw@redhat.com>
* libdwfl: __libdwfl_frame_reg_[gs]et use uint64_t when checking bits.Mark Wielaard2014-04-242-2/+8
| | | | | | | Found by gcc -fsanitize=undefined while running the backtrace-core-ppc test. runtime error: shift exponent 45 is too large for 32-bit type 'unsigned int' Signed-off-by: Mark Wielaard <mjw@redhat.com>
* readelf.c (print_gdb_index_section): Use unsigned int for 31 bits left shift.Mark Wielaard2014-04-242-1/+6
| | | | | | | Found by gcc -fsanitize=undefined. left shift of 1 by 31 places cannot be represented in type 'int' Signed-off-by: Mark Wielaard <mjw@redhat.com>
* libdw (get_sleb128_step): Remove undefined behavior.Mark Wielaard2014-04-242-2/+7
| | | | | | | | As pointed out by gcc -fsanitize=undefined left shifting a negative value is undefined. Replace it with a multiplication of the signed value as suggested by Richard Henderson and Josh Stone. Signed-off-by: Mark Wielaard <mjw@redhat.com>
* tests: run-nm-self.sh use test = not == for string comparisons.Mark Wielaard2014-04-232-1/+5
| | | | Signed-off-by: Mark Wielaard <mjw@redhat.com>
* Unwinding is only supported on LinuxKurt Roeckx2014-04-2311-4/+152
| | | | Signed-off-by: Kurt Roeckx <kurt@roeckx.be>
* Remove mudflap build option.Mark Wielaard2014-04-1825-183/+138
| | | | | | | | | The --enable-mudflap configure build has been broken for 2 years without anybody apparently noticing. GCC 4.9 removed mudflap support. Before release we now run make distcheck with valgrind support. Removal of the mudflap configure option simplifies the build a little. Signed-off-by: Mark Wielaard <mjw@redhat.com>
* readelf: Read the decompressed data when processing .zdebug DWARF sections.Mark Wielaard2014-04-157-9/+575
| | | | | | | | | | | | | readelf uses libdw to open the Dwarf and read some of the DWARF data. But it also uses its own parsers to display some of the low-level unprocessed data. If the DWARF debug section was zlib compressed it should actually use the decompressed section data from libdw instead of the raw section data. Includes a testcase for those sections that couldn't be properly displayed when compressed before. Signed-off-by: Mark Wielaard <mjw@redhat.com>
* readelf: convert up to a target long in buf_read_ulong.Mark Wielaard2014-04-146-3/+78
| | | | | | | Add a i686 corefile test. Reported-by: Markus Engel <m_engel@cs.uni-kl.de> Signed-off-by: Mark Wielaard <mjw@redhat.com>
* backends: Add aarch64 native and core unwind support.Mark Wielaard2014-04-1410-2/+137
| | | | | | | | Add aarch64 backend functions frame_nregs and set_initial_registers_tid. Mark pc_register in aarch64 prstatus_regs as pc_register. Add backtrace-core-aarch64 testcase. Signed-off-by: Mark Wielaard <mjw@redhat.com>
* CVE-2014-0172 Check for overflow before calling malloc to uncompress data.Mark Wielaard2014-04-092-1/+12
| | | | | | | https://bugzilla.redhat.com/show_bug.cgi?id=1085663 Reported-by: Florian Weimer <fweimer@redhat.com> Signed-off-by: Mark Wielaard <mjw@redhat.com>