xref: /linux/lib/vdso/Makefile.include (revision 4f9786035f9e519db41375818e1d0b5f20da2f10)
1*127b0e05SThomas Weißschuh# SPDX-License-Identifier: GPL-2.0
2*127b0e05SThomas Weißschuh
3*127b0e05SThomas WeißschuhGENERIC_VDSO_MK_PATH := $(abspath $(lastword $(MAKEFILE_LIST)))
4*127b0e05SThomas WeißschuhGENERIC_VDSO_DIR := $(dir $(GENERIC_VDSO_MK_PATH))
5*127b0e05SThomas Weißschuh
6*127b0e05SThomas Weißschuhc-gettimeofday-$(CONFIG_GENERIC_GETTIMEOFDAY) := $(addprefix $(GENERIC_VDSO_DIR), gettimeofday.c)
7*127b0e05SThomas Weißschuhc-getrandom-$(CONFIG_VDSO_GETRANDOM) := $(addprefix $(GENERIC_VDSO_DIR), getrandom.c)
8*127b0e05SThomas Weißschuh
9*127b0e05SThomas Weißschuh# This cmd checks that the vdso library does not contain dynamic relocations.
10*127b0e05SThomas Weißschuh# It has to be called after the linking of the vdso library and requires it
11*127b0e05SThomas Weißschuh# as a parameter.
12*127b0e05SThomas Weißschuh#
13*127b0e05SThomas Weißschuh# As a workaround for some GNU ld ports which produce unneeded R_*_NONE
14*127b0e05SThomas Weißschuh# dynamic relocations, ignore R_*_NONE.
15*127b0e05SThomas Weißschuhquiet_cmd_vdso_check = VDSOCHK $@
16*127b0e05SThomas Weißschuh      cmd_vdso_check = if $(READELF) -rW $@ | grep -v _NONE | grep -q " R_\w*_"; \
17*127b0e05SThomas Weißschuh		       then (echo >&2 "$@: dynamic relocations are not supported"; \
18*127b0e05SThomas Weißschuh			     rm -f $@; /bin/false); fi
19