0.156-4 - Add elfutils-0.156-et_dyn-kernels.patch.

Fixes an issue on ppc64 with systemtap kernel address placement.
This commit is contained in:
Mark Wielaard 2013-08-26 16:40:11 +02:00
parent 48d457f42b
commit d0217a5719
2 changed files with 56 additions and 1 deletions

View File

@ -0,0 +1,47 @@
commit 16fa414aff02365534b7bbeab281c731b9c4497d
Author: Mark Wielaard <mjw@redhat.com>
Date: Thu Aug 22 13:45:16 2013 +0200
libdwfl/linux-kernel-modules.c (report_kernel): Pass add_p_vaddr as true.
On some architectures (e.g. x86_64) the vmlinux is ET_EXEC, while on
others (e.g. ppc64) it is ET_DYN. In both cases the phdr p_vaddr will
be non-zero. We want the image to be placed as if it was ET_DYN, so
pass true for add_p_vaddr which will do the right thing (in combination
with a zero base) in either case.
Signed-off-by: Mark Wielaard <mjw@redhat.com>
diff --git a/libdwfl/ChangeLog b/libdwfl/ChangeLog
index 88bdfc6..90ba686 100644
--- a/libdwfl/ChangeLog
+++ b/libdwfl/ChangeLog
@@ -1,3 +1,8 @@
+2013-08-25 Mark Wielaard <mjw@redhat.com>
+
+ * linux-kernel-modules.c (report_kernel): Pass add_p_vaddr as true
+ to dwfl_report_elf.
+
2013-07-25 Jan Kratochvil <jan.kratochvil@redhat.com>
* dwfl_segment_report_module.c (dwfl_segment_report_module): Check for
diff --git a/libdwfl/linux-kernel-modules.c b/libdwfl/linux-kernel-modules.c
index dec1a59..fe01028 100644
--- a/libdwfl/linux-kernel-modules.c
+++ b/libdwfl/linux-kernel-modules.c
@@ -216,8 +216,14 @@ report_kernel (Dwfl *dwfl, const char **release,
if (report)
{
+ /* Note that on some architectures (e.g. x86_64) the vmlinux
+ is ET_EXEC, while on others (e.g. ppc64) it is ET_DYN.
+ In both cases the phdr p_vaddr load address will be non-zero.
+ We want the image to be placed as if it was ET_DYN, so
+ pass true for add_p_vaddr which will do the right thing
+ (in combination with a zero base) in either case. */
Dwfl_Module *mod = INTUSE(dwfl_report_elf) (dwfl, KERNEL_MODNAME,
- fname, fd, 0, false);
+ fname, fd, 0, true);
if (mod == NULL)
result = -1;
else

View File

@ -1,7 +1,7 @@
Name: elfutils
Summary: A collection of utilities and DSOs to handle compiled objects
Version: 0.156
%global baserelease 3
%global baserelease 4
URL: https://fedorahosted.org/elfutils/
%global source_url http://fedorahosted.org/releases/e/l/elfutils/%{version}/
License: GPLv3+ and (GPLv2+ or LGPLv3+)
@ -46,6 +46,8 @@ Source: %{?source_url}%{name}-%{version}.tar.bz2
Patch1: %{?source_url}elfutils-robustify.patch
Patch2: %{?source_url}elfutils-portability.patch
Patch3: elfutils-0.156-et_dyn-kernels.patch
%if !%{compat}
Release: %{baserelease}%{?dist}
%else
@ -209,6 +211,8 @@ sed -i.scanf-m -e 's/%m/%a/g' src/addr2line.c tests/line2addr.c
%endif
%endif
%patch3 -p1 -b .et_dyn-kernel
find . -name \*.sh ! -perm -0100 -print | xargs chmod +x
%build
@ -323,6 +327,10 @@ rm -rf ${RPM_BUILD_ROOT}
%{_libdir}/libelf.a
%changelog
* Mon Aug 26 2013 Mark Wielaard <mjw@redhat.com> 0.156-4
- Add elfutils-0.156-et_dyn-kernels.patch.
Fixes an issue on ppc64 with systemtap kernel address placement.
* Thu Aug 8 2013 Mark Wielaard <mjw@redhat.com> 0.156-3
- Make check can now also be ran in parallel.