提交 c906d2c7 编写于 作者: N Nicholas Piggin 提交者: Michael Ellerman

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: NNicholas Piggin <npiggin@gmail.com>
Signed-off-by: NMichael Ellerman <mpe@ellerman.id.au>
上级 7ef73cd3
...@@ -6,8 +6,11 @@ ...@@ -6,8 +6,11 @@
* Copyright 2018, Anton Blanchard, IBM Corp. * Copyright 2018, Anton Blanchard, IBM Corp.
*/ */
void _exit(int); #define _GNU_SOURCE
#include <unistd.h>
#include <sys/syscall.h>
void _start(void) void _start(void)
{ {
_exit(0); syscall(SYS_exit, 0);
} }
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册