Skip to content

Commit de979c8

Browse files
Andrea RighiIngo Molnar
authored andcommitted
x86/entry: Build thunk_$(BITS) only if CONFIG_PREEMPTION=y
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: 320100a ("x86/entry: Remove the TRACE_IRQS cruft") Signed-off-by: Andrea Righi <[email protected]> Signed-off-by: Ingo Molnar <[email protected]> Link: https://lore.kernel.org/r/Ys/Ke7EWjcX+ZlXO@arighi-desktop
1 parent 625395c commit de979c8

File tree

4 files changed

+4
-8
lines changed

4 files changed

+4
-8
lines changed

arch/x86/entry/Makefile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,13 @@ CFLAGS_REMOVE_common.o = $(CC_FLAGS_FTRACE)
1111

1212
CFLAGS_common.o += -fno-stack-protector
1313

14-
obj-y := entry.o entry_$(BITS).o thunk_$(BITS).o syscall_$(BITS).o
14+
obj-y := entry.o entry_$(BITS).o syscall_$(BITS).o
1515
obj-y += common.o
1616

1717
obj-y += vdso/
1818
obj-y += vsyscall/
1919

20+
obj-$(CONFIG_PREEMPTION) += thunk_$(BITS).o
2021
obj-$(CONFIG_IA32_EMULATION) += entry_64_compat.o syscall_32.o
2122
obj-$(CONFIG_X86_X32_ABI) += syscall_x32.o
2223

arch/x86/entry/thunk_32.S

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,8 @@ SYM_CODE_START_NOALIGN(\name)
2929
SYM_CODE_END(\name)
3030
.endm
3131

32-
#ifdef CONFIG_PREEMPTION
3332
THUNK preempt_schedule_thunk, preempt_schedule
3433
THUNK preempt_schedule_notrace_thunk, preempt_schedule_notrace
3534
EXPORT_SYMBOL(preempt_schedule_thunk)
3635
EXPORT_SYMBOL(preempt_schedule_notrace_thunk)
37-
#endif
3836

arch/x86/entry/thunk_64.S

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,14 +31,11 @@ SYM_FUNC_END(\name)
3131
_ASM_NOKPROBE(\name)
3232
.endm
3333

34-
#ifdef CONFIG_PREEMPTION
3534
THUNK preempt_schedule_thunk, preempt_schedule
3635
THUNK preempt_schedule_notrace_thunk, preempt_schedule_notrace
3736
EXPORT_SYMBOL(preempt_schedule_thunk)
3837
EXPORT_SYMBOL(preempt_schedule_notrace_thunk)
39-
#endif
4038

41-
#ifdef CONFIG_PREEMPTION
4239
SYM_CODE_START_LOCAL_NOALIGN(__thunk_restore)
4340
popq %r11
4441
popq %r10
@@ -53,4 +50,3 @@ SYM_CODE_START_LOCAL_NOALIGN(__thunk_restore)
5350
RET
5451
_ASM_NOKPROBE(__thunk_restore)
5552
SYM_CODE_END(__thunk_restore)
56-
#endif

arch/x86/um/Makefile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,8 @@ else
2828

2929
obj-y += syscalls_64.o vdso/
3030

31-
subarch-y = ../lib/csum-partial_64.o ../lib/memcpy_64.o ../entry/thunk_64.o
31+
subarch-y = ../lib/csum-partial_64.o ../lib/memcpy_64.o
32+
subarch-$(CONFIG_PREEMPTION) += ../entry/thunk_64.o
3233

3334
endif
3435

0 commit comments

Comments
 (0)