Skip to content

Commit 4a5de9b

Browse files
jpoimboePeter Zijlstra
authored andcommitted
objtool: Enable unreachable warnings for CLANG LTO
With IBT support in, objtool is now fully capable of following vmlinux code flow in LTO mode. Start reporting unreachable warnings for Clang LTO as well. Fixes: ed53a0d ("x86/alternative: Use .ibt_endbr_seal to seal indirect calls") Signed-off-by: Josh Poimboeuf <[email protected]> Signed-off-by: Peter Zijlstra (Intel) <[email protected]> Link: https://lkml.kernel.org/r/7b12df54bceeb0761fe9fc8269ea0c00501214a9.1650300597.git.jpoimboe@redhat.com
1 parent d66e9d5 commit 4a5de9b

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

scripts/Makefile.build

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,7 @@ objtool_args = \
231231
$(if $(part-of-module), --module) \
232232
$(if $(CONFIG_X86_KERNEL_IBT), --lto --ibt) \
233233
$(if $(CONFIG_FRAME_POINTER),, --no-fp) \
234-
$(if $(CONFIG_GCOV_KERNEL)$(CONFIG_LTO_CLANG), --no-unreachable)\
234+
$(if $(CONFIG_GCOV_KERNEL), --no-unreachable) \
235235
$(if $(CONFIG_RETPOLINE), --retpoline) \
236236
$(if $(CONFIG_X86_SMAP), --uaccess) \
237237
$(if $(CONFIG_FTRACE_MCOUNT_USE_OBJTOOL), --mcount) \

scripts/link-vmlinux.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ objtool_link()
140140
if ! is_enabled CONFIG_FRAME_POINTER; then
141141
objtoolopt="${objtoolopt} --no-fp"
142142
fi
143-
if is_enabled CONFIG_GCOV_KERNEL || is_enabled CONFIG_LTO_CLANG; then
143+
if is_enabled CONFIG_GCOV_KERNEL; then
144144
objtoolopt="${objtoolopt} --no-unreachable"
145145
fi
146146
if is_enabled CONFIG_RETPOLINE; then

0 commit comments

Comments
 (0)