0.159-8 - Add elfutils-0.159-report_r_debug.patch (#1112610)

This commit is contained in:
Mark Wielaard 2014-07-28 23:50:58 +02:00
parent 7e31ec20e1
commit 424774223c
2 changed files with 56 additions and 1 deletions

View File

@ -0,0 +1,50 @@
commit 475849fdb25265706772905b856cd7028c566a71
Author: Jan Kratochvil <jan.kratochvil@redhat.com>
Date: Thu Jul 24 20:47:17 2014 +0200
Fix report_r_debug for prelinked libraries
Signed-off-by: Jan Kratochvil <jan.kratochvil@redhat.com>
diff --git a/libdwfl/link_map.c b/libdwfl/link_map.c
index 2913d9f..272f89b 100644
--- a/libdwfl/link_map.c
+++ b/libdwfl/link_map.c
@@ -321,7 +321,11 @@ report_r_debug (uint_fast8_t elfclass, uint_fast8_t elfdata,
if (read_addrs (next, 4))
return release_buffer (-1);
- GElf_Addr l_addr = addrs[0];
+ /* Unused: l_addr is the difference between the address in memory
+ and the ELF file when the core was created. We need to
+ recalculate the difference below because the ELF file we use
+ might be differently pre-linked. */
+ // GElf_Addr l_addr = addrs[0];
GElf_Addr l_name = addrs[1];
GElf_Addr l_ld = addrs[2];
next = addrs[3];
@@ -432,11 +436,14 @@ report_r_debug (uint_fast8_t elfclass, uint_fast8_t elfdata,
if (valid)
{
+ // It is like l_addr but it handles differently prelinked
+ // files at core dumping vs. core loading time.
+ GElf_Addr base = l_ld - elf_dynamic_vaddr;
if (r_debug_info_module == NULL)
{
// XXX hook for sysroot
mod = __libdwfl_report_elf (dwfl, basename (name),
- name, fd, elf, l_addr,
+ name, fd, elf, base,
true, true);
if (mod != NULL)
{
@@ -444,7 +451,7 @@ report_r_debug (uint_fast8_t elfclass, uint_fast8_t elfdata,
fd = -1;
}
}
- else if (__libdwfl_elf_address_range (elf, l_addr, true,
+ else if (__libdwfl_elf_address_range (elf, base, true,
true, NULL, NULL,
&r_debug_info_module->start,
&r_debug_info_module->end,

View File

@ -1,7 +1,7 @@
Name: elfutils
Summary: A collection of utilities and DSOs to handle compiled objects
Version: 0.159
%global baserelease 7
%global baserelease 8
URL: https://fedorahosted.org/elfutils/
%global source_url http://fedorahosted.org/releases/e/l/elfutils/%{version}/
License: GPLv3+ and (GPLv2+ or LGPLv3+)
@ -50,6 +50,7 @@ Patch3: elfutils-0.159-argp-attach.patch
Patch4: elfutils-0.159-aarch64-bool-ret.patch
Patch5: elfutils-0.159-elf-h.patch
Patch6: elfutils-0.159-ppc64le-elfv2-abi.patch
Patch7: elfutils-0.159-report_r_debug.patch
%if !%{compat}
Release: %{baserelease}%{?dist}
@ -217,6 +218,7 @@ sed -i.scanf-m -e 's/%m/%a/g' src/addr2line.c tests/line2addr.c
%patch4 -p1 -b .aarch64-ret-bool
%patch5 -p1 -b .elf-h
%patch6 -p1 -b .ppc64le-elfv2-abi
%patch7 -p1 -b .report_r_debug
find . -name \*.sh ! -perm -0100 -print | xargs chmod +x
@ -345,6 +347,9 @@ rm -rf ${RPM_BUILD_ROOT}
%{_libdir}/libelf.a
%changelog
* Mon Jul 28 2014 Mark Wielaard <mjw@redhat.com> - 0.159-8
- Add elfutils-0.159-report_r_debug.patch (#1112610)
* Fri Jul 18 2014 Mark Wielaard <mjw@redhat.com> - 0.159-7
- Add configure check to elfutils-aarch64-user_regs_struct.patch.