From bf357fcb76baeb64a45fc2b6b355c913c63e6015 Mon Sep 17 00:00:00 2001 From: Denys Vlasenko Date: Tue, 12 Feb 2013 13:06:51 +0100 Subject: [PATCH] Remove hacks for old kernels for architectures which require new kernels * defs.h: Do not define TCB_WAITEXECVE for AARCH64. * util.c (change_syscall): For AARCH64 and X32, replace code with dummy "return 0" and a comment explaining why that is ok for these architectures. Signed-off-by: Denys Vlasenko --- defs.h | 2 +- util.c | 10 +++++++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/defs.h b/defs.h index 50620b3f..068ee3dc 100644 --- a/defs.h +++ b/defs.h @@ -442,7 +442,7 @@ struct tcb { || defined(HPPA) \ || defined(SH) || defined(SH64) \ || defined(S390) || defined(S390X) \ - || defined(ARM) || defined(AARCH64) \ + || defined(ARM) \ || defined(MIPS) /* This tracee has entered into execve syscall. Expect post-execve SIGTRAP * to happen. (When it is detected, tracee is continued and this bit is cleared.) diff --git a/util.c b/util.c index ae90c348..fa596041 100644 --- a/util.c +++ b/util.c @@ -1198,10 +1198,14 @@ change_syscall(struct tcb *tcp, arg_setup_state *state, int new) if (ptrace(PTRACE_POKEUSER, tcp->pid, (char*)(ORIG_EAX * 4), new) < 0) return -1; return 0; -#elif defined(X86_64) || defined(X32) +#elif defined(X86_64) if (ptrace(PTRACE_POKEUSER, tcp->pid, (char*)(ORIG_RAX * 8), new) < 0) return -1; return 0; +#elif defined(X32) + /* setbpt/clearbpt never used: */ + /* X32 is only supported since about linux-3.0.30 */ + return 0; #elif defined(POWERPC) if (ptrace(PTRACE_POKEUSER, tcp->pid, (char*)(sizeof(unsigned long)*PT_R0), new) < 0) @@ -1280,6 +1284,10 @@ change_syscall(struct tcb *tcp, arg_setup_state *state, int new) if (ptrace(PTRACE_SET_SYSCALL, tcp->pid, 0, new & 0xffff) != 0) return -1; return 0; +#elif defined(AARCH64) + /* setbpt/clearbpt never used: */ + /* AARCH64 is only supported since about linux-3.0.31 */ + return 0; #elif defined(TILE) /* setbpt/clearbpt never used: */ /* Tilera CPUs are only supported since about linux-2.6.34 */