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
This commit is contained in:
DJ Delorie 2021-02-08 15:12:55 -05:00 committed by DJ Delorie
parent 5ec9ca7d89
commit 7fad3fa72c
2 changed files with 28 additions and 1 deletions

View File

@ -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);

View File

@ -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 <dj@redhat.com> - 0.7.91-41
- Add support for SCV syscall insn for ppc64le
* Tue Jan 26 2021 Fedora Release Engineering <releng@fedoraproject.org> - 0.7.91-40
- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild