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
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
32 obj-y
+= vdso64_wrapper.o
34 CPPFLAGS_vdso64.lds
+= -P
-C
-U
$(ARCH
)
36 $(obj
)/vgettimeofday.o
: %.o
: %.c FORCE
38 # Force dependency (incbin is bad)
39 $(obj
)/vdso64_wrapper.o
: $(obj
)/vdso64.so.dbg
41 # link rule for the .so file, .lds has to be first
42 $(obj
)/vdso64.so.dbg
: $(src
)/vdso64.lds
$(obj-vdso64
) $(obj
)/vgettimeofday.o FORCE
43 $(call if_changed
,vdso64ld_and_check
)
45 # Generate VDSO offsets using helper script
46 gen-vdsosym
:= $(srctree
)/$(src
)/gen_vdso_offsets.sh
47 quiet_cmd_vdsosym
= VDSOSYM
$@
48 cmd_vdsosym
= $(NM
) $< |
$(gen-vdsosym
) | LC_ALL
=C
sort > $@
50 include/generated
/vdso64-offsets.h
: $(obj
)/vdso64.so.dbg FORCE
51 $(call if_changed
,vdsosym
)
53 # actual build commands
54 quiet_cmd_vdso64ld_and_check
= VDSO64L
$@
55 cmd_vdso64ld_and_check
= $(CC
) $(c_flags
) -o
$@
-Wl
,-T
$(filter %.lds
,$^
) $(filter %.o
,$^
); $(cmd_vdso_check
)