Commit a850958c authored by Kees Cook's avatar Kees Cook Committed by Ingo Molnar
Browse files

x86/asm: Avoid generating unused kprobe sections



When !CONFIG_KPROBES, do not generate kprobe sections. This makes
sure there are no unexpected sections encountered by the linker scripts.

Signed-off-by: default avatarKees Cook <keescook@chromium.org>
Signed-off-by: default avatarIngo Molnar <mingo@kernel.org>
Link: https://lore.kernel.org/r/20200821194310.3089815-23-keescook@chromium.org
parent 7e8c4ed2
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -138,11 +138,15 @@
# define _ASM_EXTABLE_FAULT(from, to)				\
	_ASM_EXTABLE_HANDLE(from, to, ex_handler_fault)

# ifdef CONFIG_KPROBES
#  define _ASM_NOKPROBE(entry)					\
	.pushsection "_kprobe_blacklist","aw" ;			\
	_ASM_ALIGN ;						\
	_ASM_PTR (entry);					\
	.popsection
# else
#  define _ASM_NOKPROBE(entry)
# endif

#else /* ! __ASSEMBLY__ */
# define _EXPAND_EXTABLE_HANDLE(x) #x