diff --git a/SOURCES/elfutils-0.182-s390-pid_memory_read.patch b/SOURCES/elfutils-0.182-s390-pid_memory_read.patch new file mode 100644 index 0000000..2c056cb --- /dev/null +++ b/SOURCES/elfutils-0.182-s390-pid_memory_read.patch @@ -0,0 +1,39 @@ +commit e4d985a3c1c873f77d20fa0cd421458cc2824996 +Author: Andreas Krebbel +Date: Thu Nov 19 20:32:24 2020 +0100 + + IBM Z: Fix endianess problem in pid_memory_read + + The cached reads lack the big endian adjustments done in the fallback + path. + + Signed-off-by: Andreas Krebbel + +diff --git a/libdwfl/linux-pid-attach.c b/libdwfl/linux-pid-attach.c +index 3a6af997..b23139d9 100644 +--- a/libdwfl/linux-pid-attach.c ++++ b/libdwfl/linux-pid-attach.c +@@ -193,14 +193,22 @@ pid_memory_read (Dwfl *dwfl, Dwarf_Addr addr, Dwarf_Word *result, void *arg) + { + struct __libdwfl_pid_arg *pid_arg = arg; + pid_t tid = pid_arg->tid_attached; ++ Dwfl_Process *process = dwfl->process; + assert (tid > 0); + + #ifdef HAVE_PROCESS_VM_READV + if (read_cached_memory (pid_arg, addr, result)) ++ { ++#if SIZEOF_LONG == 8 ++# if BYTE_ORDER == BIG_ENDIAN ++ if (ebl_get_elfclass (process->ebl) == ELFCLASS32) ++ *result >>= 32; ++# endif ++#endif + return true; ++ } + #endif + +- Dwfl_Process *process = dwfl->process; + if (ebl_get_elfclass (process->ebl) == ELFCLASS64) + { + #if SIZEOF_LONG == 8 diff --git a/SPECS/elfutils.spec b/SPECS/elfutils.spec index a545e9f..df8247c 100644 --- a/SPECS/elfutils.spec +++ b/SPECS/elfutils.spec @@ -1,6 +1,6 @@ Name: elfutils Version: 0.182 -%global baserelease 2 +%global baserelease 3 Release: %{baserelease}%{?dist} URL: http://elfutils.org/ %global source_url ftp://sourceware.org/pub/elfutils/%{version}/ @@ -57,8 +57,8 @@ BuildRequires: curl %endif # Patches - Patch1: elfutils-0.182-debuginfod-test-fix.patch +Patch2: elfutils-0.182-s390-pid_memory_read.patch %description Elfutils is a collection of utilities, including stack (to show @@ -250,8 +250,8 @@ such servers to download those files on demand. %setup -q # Apply patches - %patch1 -p1 -b .debuginfod_test_fix +%patch2 -p1 # In case the above patches added any new test scripts, make sure they # are executable. @@ -433,6 +433,9 @@ exit 0 %systemd_postun_with_restart debuginfod.service %changelog +* Thu Dec 17 2020 Mark Wielaard - 0.182-3 +- Add elfutils-0.182-s390-pid_memory_read.patch + * Mon Nov 2 2020 Mark Wielaard - 0.182-2 - Add elfutils-0.182-debuginfod-test-fix.patch.