summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorPeter Zijlstra <peterz@infradead.org>2024-11-28 10:39:04 +0100
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2025-03-07 18:25:35 +0100
commit2cfd0e5084e389ffd4e4fb73eec9c1cd5b2f7284 (patch)
tree49e3bd134693ec8b3cc9a1e00bfba2bbe357a9a0 /include
parent8cc451444cfd569746d2e32cd87da0600d73ed2b (diff)
downloadlinux-2cfd0e5084e389ffd4e4fb73eec9c1cd5b2f7284.tar.gz
linux-2cfd0e5084e389ffd4e4fb73eec9c1cd5b2f7284.tar.bz2
linux-2cfd0e5084e389ffd4e4fb73eec9c1cd5b2f7284.zip
objtool: Remove annotate_{,un}reachable()
[ Upstream commit 06e24745985c8dd0da18337503afcf2f2fdbdff1 ] There are no users of annotate_reachable() left. And the annotate_unreachable() usage in unreachable() is plain wrong; it will hide dangerous fall-through code-gen. Remove both. Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org> Acked-by: Josh Poimboeuf <jpoimboe@kernel.org> Link: https://lore.kernel.org/r/20241128094312.235637588@infradead.org Stable-dep-of: 73cfc53cc3b6 ("objtool: Fix C jump table annotations for Clang") Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'include')
-rw-r--r--include/linux/compiler.h27
1 files changed, 0 insertions, 27 deletions
diff --git a/include/linux/compiler.h b/include/linux/compiler.h
index 0d10d75218f5..75a83394824c 100644
--- a/include/linux/compiler.h
+++ b/include/linux/compiler.h
@@ -109,35 +109,9 @@ void ftrace_likely_update(struct ftrace_likely_data *f, int val,
/* Unreachable code */
#ifdef CONFIG_OBJTOOL
-/*
- * 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 __stringify_label(n) #n
-
-#define __annotate_reachable(c) ({ \
- asm volatile(__stringify_label(c) ":\n\t" \
- ".pushsection .discard.reachable\n\t" \
- ".long " __stringify_label(c) "b - .\n\t" \
- ".popsection\n\t"); \
-})
-#define annotate_reachable() __annotate_reachable(__COUNTER__)
-
-#define __annotate_unreachable(c) ({ \
- asm volatile(__stringify_label(c) ":\n\t" \
- ".pushsection .discard.unreachable\n\t" \
- ".long " __stringify_label(c) "b - .\n\t" \
- ".popsection\n\t" : : "i" (c)); \
-})
-#define annotate_unreachable() __annotate_unreachable(__COUNTER__)
-
/* Annotate a C jump table to allow objtool to follow the code flow */
#define __annotate_jump_table __section(".rodata..c_jump_table,\"a\",@progbits #")
-
#else /* !CONFIG_OBJTOOL */
-#define annotate_reachable()
-#define annotate_unreachable()
#define __annotate_jump_table
#endif /* CONFIG_OBJTOOL */
@@ -147,7 +121,6 @@ void ftrace_likely_update(struct ftrace_likely_data *f, int val,
* control elsewhere.
*/
#define unreachable() do { \
- annotate_unreachable(); \
barrier_before_unreachable(); \
__builtin_unreachable(); \
} while (0)