From: Nicholas Piggin Date: Sat, 12 May 2018 03:35:24 +0000 (+1000) Subject: selftests/powerpc: fix exec benchmark X-Git-Tag: v5.15~8686^2~189 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=c906d2c74e0bb9059fbf43e21f8a962986eb21e2;p=platform%2Fkernel%2Flinux-starfive.git selftests/powerpc: fix exec benchmark The exec_target binary could segfault calling _exit(2) because r13 is not set up properly (and libc looks at that when performing a syscall). Call SYS_exit using syscall(2) which doesn't seem to have this problem. Signed-off-by: Nicholas Piggin Signed-off-by: Michael Ellerman --- diff --git a/tools/testing/selftests/powerpc/benchmarks/exec_target.c b/tools/testing/selftests/powerpc/benchmarks/exec_target.c index 3c9c144..c14b0fc 100644 --- a/tools/testing/selftests/powerpc/benchmarks/exec_target.c +++ b/tools/testing/selftests/powerpc/benchmarks/exec_target.c @@ -6,8 +6,11 @@ * Copyright 2018, Anton Blanchard, IBM Corp. */ -void _exit(int); +#define _GNU_SOURCE +#include +#include + void _start(void) { - _exit(0); + syscall(SYS_exit, 0); }