head-y := head.o
extra-y += $(head-y) vmlinux.lds
-# Check that the vDSO symbol offsets header file is up to date and re-generate
-# it if necessary.
-$(objtree)/include/generated/vdso-offsets.h: FORCE
- $(Q)$(MAKE) $(build)=$(obj)/vdso $@
+# vDSO - this must be built first to generate the symbol offsets
+$(call objectify,$(arm64-obj-y)): $(obj)/vdso/vdso-offsets.h
+$(obj)/vdso/vdso-offsets.h: $(obj)/vdso
ccflags-y += -Wl,-shared
obj-y += vdso.o
-extra-y += vdso.lds
+extra-y += vdso.lds vdso-offsets.h
CPPFLAGS_vdso.lds += -P -C -U$(ARCH)
# Force dependency (incbin is bad)
gen-vdsosym := $(srctree)/$(src)/gen_vdso_offsets.sh
quiet_cmd_vdsosym = VDSOSYM $@
define cmd_vdsosym
- $(NM) $< | $(gen-vdsosym) | LC_ALL=C sort > $@
+ $(NM) $< | $(gen-vdsosym) | LC_ALL=C sort > $@ && \
+ cp $@ include/generated/
endef
-$(objtree)/include/generated/vdso-offsets.h: $(obj)/vdso.so.dbg FORCE
+$(obj)/vdso-offsets.h: $(obj)/vdso.so.dbg FORCE
$(call if_changed,vdsosym)
# Assembly rules for the .S files