]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
x86/entry: Build thunk_$(BITS) only if CONFIG_PREEMPTION=y
authorAndrea Righi <andrea.righi@canonical.com>
Thu, 14 Jul 2022 07:49:15 +0000 (09:49 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 21 Aug 2022 13:16:13 +0000 (15:16 +0200)
[ Upstream commit de979c83574abf6e78f3fa65b716515c91b2613d ]

With CONFIG_PREEMPTION disabled, arch/x86/entry/thunk_$(BITS).o becomes
an empty object file.

With some old versions of binutils (i.e., 2.35.90.20210113-1ubuntu1) the
GNU assembler doesn't generate a symbol table for empty object files and
objtool fails with the following error when a valid symbol table cannot
be found:

  arch/x86/entry/thunk_64.o: warning: objtool: missing symbol table

To prevent this from happening, build thunk_$(BITS).o only if
CONFIG_PREEMPTION is enabled.

BugLink: https://bugs.launchpad.net/bugs/1911359
Fixes: 320100a5ffe5 ("x86/entry: Remove the TRACE_IRQS cruft")
Signed-off-by: Andrea Righi <andrea.righi@canonical.com>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Link: https://lore.kernel.org/r/Ys/Ke7EWjcX+ZlXO@arighi-desktop
Signed-off-by: Sasha Levin <sashal@kernel.org>
arch/x86/entry/Makefile
arch/x86/entry/thunk_32.S
arch/x86/entry/thunk_64.S
arch/x86/um/Makefile

index 58533752efab2cff539b8ae58d486ae4c6eae628..63dc4b1dfc9249d7a03785f6dc2998788e517a48 100644 (file)
@@ -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.o entry_$(BITS).o thunk_$(BITS).o syscall_$(BITS).o
+obj-y                          := entry.o 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
 
index 7591bab060f700a506571dccfa1adb8232995325..ff6e7003da9744a343895ff9a63a23076a7f21d2 100644 (file)
@@ -29,10 +29,8 @@ SYM_CODE_START_NOALIGN(\name)
 SYM_CODE_END(\name)
        .endm
 
-#ifdef CONFIG_PREEMPTION
        THUNK preempt_schedule_thunk, preempt_schedule
        THUNK preempt_schedule_notrace_thunk, preempt_schedule_notrace
        EXPORT_SYMBOL(preempt_schedule_thunk)
        EXPORT_SYMBOL(preempt_schedule_notrace_thunk)
-#endif
 
index 1b5044ad8cd0df31ede0c484b68bb5637e3f56df..14776163fbffc3a007b6ebb9b253ea7f5e7c2704 100644 (file)
@@ -36,14 +36,11 @@ SYM_FUNC_END(\name)
        _ASM_NOKPROBE(\name)
        .endm
 
-#ifdef CONFIG_PREEMPTION
        THUNK preempt_schedule_thunk, preempt_schedule
        THUNK preempt_schedule_notrace_thunk, preempt_schedule_notrace
        EXPORT_SYMBOL(preempt_schedule_thunk)
        EXPORT_SYMBOL(preempt_schedule_notrace_thunk)
-#endif
 
-#ifdef CONFIG_PREEMPTION
 SYM_CODE_START_LOCAL_NOALIGN(__thunk_restore)
        popq %r11
        popq %r10
@@ -58,4 +55,3 @@ SYM_CODE_START_LOCAL_NOALIGN(__thunk_restore)
        RET
        _ASM_NOKPROBE(__thunk_restore)
 SYM_CODE_END(__thunk_restore)
-#endif
index 77f70b969d1439a71c8b4f44c42083de46a40b0f..3113800da63ad9e8a05ba8b44a9001a03497b663 100644 (file)
@@ -27,7 +27,8 @@ else
 
 obj-y += syscalls_64.o vdso/
 
-subarch-y = ../lib/csum-partial_64.o ../lib/memcpy_64.o ../entry/thunk_64.o
+subarch-y = ../lib/csum-partial_64.o ../lib/memcpy_64.o
+subarch-$(CONFIG_PREEMPTION) += ../entry/thunk_64.o
 
 endif