Add a config option for when objtool reverse engineers the control flow
graph of every function.
No functional change.
Signed-off-by: Josh Poimboeuf <jpoimboe@kernel.org>
---
lib/Kconfig.debug | 6 ++++++
lib/Kconfig.ubsan | 2 +-
2 files changed, 7 insertions(+), 1 deletion(-)
diff --git a/lib/Kconfig.debug b/lib/Kconfig.debug
index 55732323dc16e..798a10ded19fd 100644
--- a/lib/Kconfig.debug
+++ b/lib/Kconfig.debug
@@ -577,6 +577,12 @@ config OBJTOOL_DEFERRED
depends on OBJTOOL
depends on LTO_CLANG || X86_KERNEL_IBT || KLP_BUILD
+# Objtool reverse-engineers the control flow graph
+config OBJTOOL_CONTROL_FLOW
+ def_bool y
+ depends on OBJTOOL
+ depends on UNWINDER_ORC || STACK_VALIDATION || HAVE_UACCESS_VALIDATION
+
config STACK_VALIDATION
bool "Compile-time stack metadata validation"
depends on HAVE_STACK_VALIDATION && UNWINDER_FRAME_POINTER
diff --git a/lib/Kconfig.ubsan b/lib/Kconfig.ubsan
index 1ecaae7064d2a..61e8c86ef63be 100644
--- a/lib/Kconfig.ubsan
+++ b/lib/Kconfig.ubsan
@@ -110,7 +110,7 @@ config UBSAN_UNREACHABLE
bool "Perform checking for unreachable code"
# objtool already handles unreachable checking and gets angry about
# seeing UBSan instrumentation located in unreachable places.
- depends on !(OBJTOOL && (STACK_VALIDATION || UNWINDER_ORC || HAVE_UACCESS_VALIDATION))
+ depends on !OBJTOOL_CONTROL_FLOW
depends on $(cc-option,-fsanitize=unreachable)
help
This option enables -fsanitize=unreachable which checks for control
--
2.55.0