diff --git a/elfutils-0.182-s390-pid_memory_read.patch b/elfutils-0.182-s390-pid_memory_read.patch new file mode 100644 index 0000000..2c056cb --- /dev/null +++ b/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/elfutils.spec b/elfutils.spec index c27b90a..14349ab 100644 --- a/elfutils.spec +++ b/elfutils.spec @@ -1,6 +1,6 @@ Name: elfutils Version: 0.182 -%global baserelease 1 +%global baserelease 2 Release: %{baserelease}%{?dist} URL: http://elfutils.org/ %global source_url ftp://sourceware.org/pub/elfutils/%{version}/ @@ -60,6 +60,7 @@ BuildRequires: autoconf %endif # Patches +Patch1: elfutils-0.182-s390-pid_memory_read.patch %description Elfutils is a collection of utilities, including stack (to show @@ -229,6 +230,7 @@ such servers to download those files on demand. %setup -q # Apply patches +%patch1 -p1 autoreconf -f -v -i @@ -415,6 +417,9 @@ exit 0 %systemd_postun_with_restart debuginfod.service %changelog +* Thu Dec 17 2020 Mark Wielaard - 0.182-2 +- Add elfutils-0.182-s390-pid_memory_read.patch + * Sat Oct 31 2020 Mark Wielaard - 0.182-1 - Upgrade to upstream 0.182 - backends: Support for tilegx has been removed.