lkml.org 
[lkml]   [2017]   [Nov]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 1/2] objtool: Add a comment for the unreachable annotation macros
Date
Add a comment for the unreachable annotation macros to explain their
purpose and the '__COUNTER__' label hack.

Suggested-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Josh Poimboeuf <jpoimboe@redhat.com>
---
include/linux/compiler.h | 5 +++++
1 file changed, 5 insertions(+)

diff --git a/include/linux/compiler.h b/include/linux/compiler.h
index 3672353a0acd..b863e5ad91a3 100644
--- a/include/linux/compiler.h
+++ b/include/linux/compiler.h
@@ -88,6 +88,11 @@ void ftrace_likely_update(struct ftrace_likely_data *f, int val,

/* Unreachable code */
#ifdef CONFIG_STACK_VALIDATION
+/*
+ * These macros help objtool understand GCC code flow for unreachable code.
+ * The __COUNTER__ based labels are a hack to make each instance of the macros
+ * unique, to convince GCC not to merge duplicate inline asm statements.
+ */
#define annotate_reachable() ({ \
asm("%c0:\n\t" \
".pushsection .discard.reachable\n\t" \
--
2.13.6
\
 
 \ /
  Last update: 2017-11-06 14:18    [W:0.038 / U:0.096 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site