Commit ae666623 authored by Philippe Gerum's avatar Philippe Gerum
Browse files

arm64/ipipe: do not override default builtin_return_address()

The standard ones provided by recent GCC toolchains are mostly ok (*),
barring zero values for level(1) in some occasions. The current
replacement is broken, with frequently wrong values both for levels
(0) and (1).

(*) aarch64-linux-gnu-gcc (Linaro GCC 4.9-2015.01-3) 4.9.3 20150113
parent b75d5a59
......@@ -27,18 +27,6 @@
#ifdef CONFIG_IPIPE
#define BROKEN_BUILTIN_RETURN_ADDRESS
#undef __BUILTIN_RETURN_ADDRESS0
#undef __BUILTIN_RETURN_ADDRESS1
#ifdef CONFIG_FRAME_POINTER
#define __BUILTIN_RETURN_ADDRESS0 arm64_return_addr(0)
#define __BUILTIN_RETURN_ADDRESS1 arm64_return_addr(1)
extern unsigned long arm64_return_addr(int level);
#else
#define __BUILTIN_RETURN_ADDRESS0 ((unsigned long)__builtin_return_address(0))
#define __BUILTIN_RETURN_ADDRESS1 (0)
#endif
#include <linux/jump_label.h>
#include <linux/ipipe_trace.h>
#include <linux/ipipe_debug.h>
......
......@@ -797,32 +797,6 @@ ENTRY(sys_rt_sigreturn_wrapper)
b sys_rt_sigreturn
ENDPROC(sys_rt_sigreturn_wrapper)
/*
* I-pipe tracer helper functions
*/
#if defined(CONFIG_FRAME_POINTER) && (CONFIG_IPIPE_TRACE)
.text
.align 3
.type arm64_return_addr %function
.global arm64_return_addr
arm64_return_addr:
mov x16, x0
ldr x0, [x29]
3:
cmp x0, #0
beq 1f // frame list hit end, bail
cmp x16, #0
beq 2f // reached desired frame
ldr x0, [x0] // else continue, get next fp
sub x16, x16, #1
b 3b
2:
add x0, x0, #8 // get target return address (LR)
1:
ret
ENDPROC(arm64_return_addr)
#endif
#ifdef CONFIG_IPIPE_TRACE_MCOUNT
.text
.align 3
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment