1 # SPDX-License-Identifier: GPL-2.0
2 # List of files in the vdso, has to be asm only for now
4 ARCH_REL_TYPE_ABS := R_PPC_JUMP_SLOT|R_PPC_GLOB_DAT|R_PPC_ADDR32|R_PPC_ADDR24|R_PPC_ADDR16|R_PPC_ADDR16_LO|R_PPC_ADDR16_HI|R_PPC_ADDR16_HA|R_PPC_ADDR14|R_PPC_ADDR14_BRTAKEN|R_PPC_ADDR14_BRNTAKEN|R_PPC_REL24
5 include $(srctree)/lib/vdso/Makefile
7 obj-vdso64 = sigtramp.o gettimeofday.o datapage.o cacheflush.o note.o getcpu.o
9 ifneq ($(c-gettimeofday-y),)
10 CFLAGS_vgettimeofday.o += -include $(c-gettimeofday-y)
11 CFLAGS_vgettimeofday.o += $(DISABLE_LATENT_ENTROPY_PLUGIN)
12 CFLAGS_vgettimeofday.o += $(call cc-option, -fno-stack-protector)
13 CFLAGS_vgettimeofday.o += -DDISABLE_BRANCH_PROFILING
14 CFLAGS_vgettimeofday.o += -ffreestanding -fasynchronous-unwind-tables
15 CFLAGS_REMOVE_vgettimeofday.o = $(CC_FLAGS_FTRACE)
20 targets := $(obj-vdso64) vdso64.so.dbg vgettimeofday.o
21 obj-vdso64 := $(addprefix $(obj)/, $(obj-vdso64))
28 ccflags-y := -shared -fno-common -fno-builtin -nostdlib \
29 -Wl,-soname=linux-vdso64.so.1 -Wl,--hash-style=both
30 asflags-y := -D__VDSO64__ -s
33 CPPFLAGS_vdso64.lds += -P -C -U$(ARCH)
35 # link rule for the .so file, .lds has to be first
36 $(obj)/vdso64.so.dbg: $(src)/vdso64.lds $(obj-vdso64) $(obj)/vgettimeofday.o FORCE
37 $(call if_changed,vdso64ld_and_check)
39 # Generate VDSO offsets using helper script
40 gen-vdsosym := $(srctree)/$(src)/gen_vdso_offsets.sh
41 quiet_cmd_vdsosym = VDSOSYM $@
42 cmd_vdsosym = $(NM) $< | $(gen-vdsosym) | LC_ALL=C sort > $@
44 include/generated/vdso64-offsets.h: $(obj)/vdso64.so.dbg FORCE
45 $(call if_changed,vdsosym)
47 # actual build commands
48 quiet_cmd_vdso64ld_and_check = VDSO64L $@
49 cmd_vdso64ld_and_check = $(CC) $(c_flags) -o $@ -Wl,-T$(filter %.lds,$^) $(filter %.o,$^); $(cmd_vdso_check)