From: Joey Gouly Date: Tue, 10 May 2022 09:58:32 +0000 (+0100) Subject: arm64: vdso: enable orphan handling for VDSO X-Git-Tag: v6.0-rc1~203^2~3^2~8 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=e0ab20b20a1bb53d61feedb1fd6c23cbbed11d18;p=thirdparty%2Flinux.git arm64: vdso: enable orphan handling for VDSO Like vmlinux, enable orphan-handling for the VDSO. This can catch subtle errors that might arise from unexpected sections being included. Signed-off-by: Joey Gouly Cc: Catalin Marinas Cc: Will Deacon Cc: Masahiro Yamada Cc: Vincenzo Frascino Cc: Kees Cook Reviewed-by: Kees Cook Reviewed-by: Vincenzo Frascino Link: https://lore.kernel.org/r/20220510095834.32394-3-joey.gouly@arm.com Signed-off-by: Will Deacon --- diff --git a/arch/arm64/kernel/vdso/Makefile b/arch/arm64/kernel/vdso/Makefile index f6e25d7c346ab..bafbf78fab772 100644 --- a/arch/arm64/kernel/vdso/Makefile +++ b/arch/arm64/kernel/vdso/Makefile @@ -24,7 +24,13 @@ btildflags-$(CONFIG_ARM64_BTI_KERNEL) += -z force-bti # routines, as x86 does (see 6f121e548f83 ("x86, vdso: Reimplement vdso.so # preparation in build-time C")). ldflags-y := -shared -soname=linux-vdso.so.1 --hash-style=sysv \ - -Bsymbolic --build-id=sha1 -n $(btildflags-y) -T + -Bsymbolic --build-id=sha1 -n $(btildflags-y) + +ifdef CONFIG_LD_ORPHAN_WARN + ldflags-y += --orphan-handling=warn +endif + +ldflags-y += -T ccflags-y := -fno-common -fno-builtin -fno-stack-protector -ffixed-x18 ccflags-y += -DDISABLE_BRANCH_PROFILING -DBUILD_VDSO