Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

objtool: Add a comment for the unreachable annotation macros

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>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Link: http://lkml.kernel.org/r/1570e48d9f87e0fc6f0126c32e7e1de6e109cb67.1509974104.git.jpoimboe@redhat.com
Signed-off-by: Ingo Molnar <mingo@kernel.org>

authored by

Josh Poimboeuf and committed by
Ingo Molnar
d0c2e691 783711f0

+5
+5
include/linux/compiler.h
··· 187 187 188 188 /* Unreachable code */ 189 189 #ifdef CONFIG_STACK_VALIDATION 190 + /* 191 + * These macros help objtool understand GCC code flow for unreachable code. 192 + * The __COUNTER__ based labels are a hack to make each instance of the macros 193 + * unique, to convince GCC not to merge duplicate inline asm statements. 194 + */ 190 195 #define annotate_reachable() ({ \ 191 196 asm("%c0:\n\t" \ 192 197 ".pushsection .discard.reachable\n\t" \