Re: arch/x86/kernel/ftrace_64.o: warning: objtool: .entry.text+0x0: unreachable instruction

From: Josh Poimboeuf
Date: Sat Jan 27 2018 - 21:21:59 EST


On Sat, Jan 27, 2018 at 05:13:04PM +0100, Borislav Petkov wrote:
> Hey,
>
> seen this already?
>
> This is Linus' tree from now + tip/master also from now.

Yeah, Steven reported it a few days ago but I was in backport lala land.
It's a simple fix:

From: Josh Poimboeuf <jpoimboe@xxxxxxxxxx>
Subject: [PATCH] x86/ftrace: Add one more ENDPROC annotation

When I added ORC support for the ftrace_64.S code, I missed an ENDPROC
for function_hook(). This fixes the following warning:

arch/x86/kernel/ftrace_64.o: warning: objtool: .entry.text+0x0: unreachable instruction

Reported-by: Steven Rostedt <rostedt@xxxxxxxxxxx>
Reported-by: Borislav Petkov <bp@xxxxxxxxx>
Fixes: e2ac83d74a4d ("x86/ftrace: Fix ORC unwinding from ftrace handlers")
Signed-off-by: Josh Poimboeuf <jpoimboe@xxxxxxxxxx>
---
arch/x86/kernel/ftrace_64.S | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/x86/kernel/ftrace_64.S b/arch/x86/kernel/ftrace_64.S
index ef61f540cf0a..91b2cff4b79a 100644
--- a/arch/x86/kernel/ftrace_64.S
+++ b/arch/x86/kernel/ftrace_64.S
@@ -295,7 +295,7 @@ trace:
restore_mcount_regs

jmp fgraph_trace
-END(function_hook)
+ENDPROC(function_hook)
#endif /* CONFIG_DYNAMIC_FTRACE */

#ifdef CONFIG_FUNCTION_GRAPH_TRACER
--
2.14.3