Skip to content

Commit 329b77b

Browse files
masahir0ybp3tk0v
authored andcommitted
x86/vdso: Simplify obj-y addition
Add objects to obj-y in a more straightforward way. CONFIG_X86_32 and CONFIG_IA32_EMULATION are not enabled simultaneously, but even if they are, Kbuild graciously deduplicates obj-y entries. Signed-off-by: Masahiro Yamada <masahiroy@kernel.org> Signed-off-by: Borislav Petkov (AMD) <bp@alien8.de> Link: https://lore.kernel.org/r/20231121235701.239606-3-masahiroy@kernel.org
1 parent 31a4ebe commit 329b77b

File tree

1 file changed

+4
-12
lines changed

1 file changed

+4
-12
lines changed

arch/x86/entry/vdso/Makefile

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,6 @@ OBJECT_FILES_NON_STANDARD := y
1818
# Prevents link failures: __sanitizer_cov_trace_pc() is not linked in.
1919
KCOV_INSTRUMENT := n
2020

21-
VDSO64-$(CONFIG_X86_64) := y
22-
VDSOX32-$(CONFIG_X86_X32_ABI) := y
23-
VDSO32-$(CONFIG_X86_32) := y
24-
VDSO32-$(CONFIG_IA32_EMULATION) := y
25-
2621
# files to link into the vdso
2722
vobjs-y := vdso-note.o vclock_gettime.o vgetcpu.o
2823
vobjs32-y := vdso32/note.o vdso32/system_call.o vdso32/sigreturn.o
@@ -38,11 +33,11 @@ OBJECT_FILES_NON_STANDARD_vma.o := n
3833
OBJECT_FILES_NON_STANDARD_extable.o := n
3934

4035
# vDSO images to build
41-
vdso_img-$(VDSO64-y) += 64
42-
vdso_img-$(VDSOX32-y) += x32
43-
vdso_img-$(VDSO32-y) += 32
36+
obj-$(CONFIG_X86_64) += vdso-image-64.o
37+
obj-$(CONFIG_X86_X32_ABI) += vdso-image-x32.o
38+
obj-$(CONFIG_X86_32) += vdso-image-32.o vdso32-setup.o
39+
obj-$(CONFIG_IA32_EMULATION) += vdso-image-32.o vdso32-setup.o
4440

45-
obj-$(VDSO32-y) += vdso32-setup.o
4641
OBJECT_FILES_NON_STANDARD_vdso32-setup.o := n
4742

4843
vobjs := $(foreach F,$(vobjs-y),$(obj)/$F)
@@ -53,9 +48,6 @@ $(obj)/vdso.o: $(obj)/vdso.so
5348
targets += vdso.lds $(vobjs-y)
5449
targets += vdso32/vdso32.lds $(vobjs32-y)
5550

56-
# Build the vDSO image C files and link them in.
57-
vdso_img_objs := $(vdso_img-y:%=vdso-image-%.o)
58-
obj-y += $(vdso_img_objs)
5951
targets += $(foreach x, 64 x32 32, vdso-image-$(x).c vdso$(x).so vdso$(x).so.dbg)
6052

6153
CPPFLAGS_vdso.lds += -P -C

0 commit comments

Comments
 (0)