[PATCH] x86: Include thunk_$(BITS).o only if CONFIG_PREEMPTION=y
From: H.J. Lu
Date: Sun Dec 27 2020 - 22:33:44 EST
The newer GNU assembler may not generate a symbol table for the empty
object file. Since objtool doesn't like empty object files without
symbol table and thunk_$(BITS).o doesn't have a symbol table when
CONFIG_PREEMPTION isn't enabled, include thunk_$(BITS).o only if
CONFIG_PREEMPTION is enabled.
Signed-off-by: H.J. Lu <hjl.tools@xxxxxxxxx>
---
arch/x86/entry/Makefile | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/arch/x86/entry/Makefile b/arch/x86/entry/Makefile
index 08bf95dbc911..83c98dae74a6 100644
--- a/arch/x86/entry/Makefile
+++ b/arch/x86/entry/Makefile
@@ -21,12 +21,13 @@ CFLAGS_syscall_64.o += $(call cc-option,-Wno-override-init,)
CFLAGS_syscall_32.o += $(call cc-option,-Wno-override-init,)
CFLAGS_syscall_x32.o += $(call cc-option,-Wno-override-init,)
-obj-y := entry_$(BITS).o thunk_$(BITS).o syscall_$(BITS).o
+obj-y := entry_$(BITS).o syscall_$(BITS).o
obj-y += common.o
obj-y += vdso/
obj-y += vsyscall/
+obj-$(CONFIG_PREEMPTION) += thunk_$(BITS).o
obj-$(CONFIG_IA32_EMULATION) += entry_64_compat.o syscall_32.o
obj-$(CONFIG_X86_X32_ABI) += syscall_x32.o
--
2.29.2