From 7fad3fa72c174c7070ce990b38f1d3109f72ce22 Mon Sep 17 00:00:00 2001 From: DJ Delorie Date: Mon, 8 Feb 2021 15:12:55 -0500 Subject: [PATCH] Support ppc64le SCV syscall insn If the kernel supports it AND glibc supports it, the ppc64le syscalls may use the SCV variant instead of the SC variant. The registers we care about have the same use so little change is required. Reference: RHEL BZ 1922305 --- ltrace-0.7.91-ppc64le-scv.patch | 20 ++++++++++++++++++++ ltrace.spec | 9 ++++++++- 2 files changed, 28 insertions(+), 1 deletion(-) create mode 100644 ltrace-0.7.91-ppc64le-scv.patch diff --git a/ltrace-0.7.91-ppc64le-scv.patch b/ltrace-0.7.91-ppc64le-scv.patch new file mode 100644 index 0000000..2feec6d --- /dev/null +++ b/ltrace-0.7.91-ppc64le-scv.patch @@ -0,0 +1,20 @@ +diff -rup a/sysdeps/linux-gnu/ppc/trace.c b/sysdeps/linux-gnu/ppc/trace.c +--- a/sysdeps/linux-gnu/ppc/trace.c 2021-02-08 14:35:16.876494095 -0500 ++++ b/sysdeps/linux-gnu/ppc/trace.c 2021-02-08 15:05:59.468107311 -0500 +@@ -57,6 +57,7 @@ get_arch_dep(struct process *proc) + } + + #define SYSCALL_INSN 0x44000002 ++#define SYSCALL2_INSN 0x44000001 + + /* Returns 1 if syscall, 2 if sysret, 0 otherwise. */ + int +@@ -75,7 +76,7 @@ syscall_p(struct process *proc, int stat + 0); + #endif + +- if (insn == SYSCALL_INSN) { ++ if (insn == SYSCALL_INSN || insn == SYSCALL2_INSN) { + *sysnum = + (int)ptrace(PTRACE_PEEKUSER, proc->pid, + sizeof(long) * PT_R0, 0); diff --git a/ltrace.spec b/ltrace.spec index 979ab79..7602f71 100644 --- a/ltrace.spec +++ b/ltrace.spec @@ -1,7 +1,7 @@ Summary: Tracks runtime library calls from dynamically linked executables Name: ltrace Version: 0.7.91 -Release: 40%{?dist} +Release: 41%{?dist} # In coordination with Juan Céspedes, upstream is now officially on gitlab. # We are going to being sending all of our Fedora patches upstream to gitlab. URL: https://gitlab.com/cespedes/ltrace @@ -129,6 +129,9 @@ Patch34: ltrace-0.7.91-XDG_CONFIG_DIRS.patch # GCC erroneously warns about uninitialized values Patch35: ltrace-0.7.91-rh1799619.patch +# Support for both SC and SCV sycall insns +Patch36: ltrace-0.7.91-ppc64le-scv.patch + %description Ltrace is a debugging program which runs a specified command until the command exits. While the command is executing, ltrace intercepts and @@ -176,6 +179,7 @@ execution of processes. %patch33 -p1 %patch34 -p1 %patch35 -p1 +%patch36 -p1 %build autoreconf -i @@ -203,6 +207,9 @@ echo ====================TESTING END===================== %{_datadir}/ltrace %changelog +* Mon Feb 8 2021 DJ Delorie - 0.7.91-41 +- Add support for SCV syscall insn for ppc64le + * Tue Jan 26 2021 Fedora Release Engineering - 0.7.91-40 - Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild