From: Kees Cook Date: Fri, 21 Aug 2020 19:43:03 +0000 (-0700) Subject: x86/asm: Avoid generating unused kprobe sections X-Git-Tag: microblaze-v5.11~203^2~10 X-Git-Url: http://git.monstr.eu/?a=commitdiff_plain;h=a850958c072404f75dd41782cb4ff34b8625b47d;p=linux-2.6-microblaze.git 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: Kees Cook Signed-off-by: Ingo Molnar Link: https://lore.kernel.org/r/20200821194310.3089815-23-keescook@chromium.org --- diff --git a/arch/x86/include/asm/asm.h b/arch/x86/include/asm/asm.h index 5c15f95b1ba7..4712206c4325 100644 --- a/arch/x86/include/asm/asm.h +++ b/arch/x86/include/asm/asm.h @@ -138,11 +138,15 @@ # define _ASM_EXTABLE_FAULT(from, to) \ _ASM_EXTABLE_HANDLE(from, to, ex_handler_fault) -# define _ASM_NOKPROBE(entry) \ +# 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