Skip to content

Commit 5e02a18

Browse files
brooniewilldeacon
authored andcommitted
arm64: vdso: Force the vDSO to be linked as BTI when built for BTI
When the kernel and hence vDSO are built with BTI enabled force the linker to link the vDSO as BTI. This will cause the linker to warn if any of the input files do not have the BTI annotation, ensuring that we don't silently fail to provide a vDSO that is built and annotated for BTI when the kernel is being built with BTI. Signed-off-by: Mark Brown <[email protected]> Reviewed-by: Catalin Marinas <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Will Deacon <[email protected]>
1 parent a6aadc2 commit 5e02a18

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

arch/arm64/kernel/vdso/Makefile

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,10 @@ obj-vdso := vgettimeofday.o note.o sigreturn.o
1717
targets := $(obj-vdso) vdso.so vdso.so.dbg
1818
obj-vdso := $(addprefix $(obj)/, $(obj-vdso))
1919

20+
btildflags-$(CONFIG_ARM64_BTI_KERNEL) += -z force-bti
21+
2022
ldflags-y := -shared -nostdlib -soname=linux-vdso.so.1 --hash-style=sysv \
21-
--build-id -n -T
23+
--build-id -n $(btildflags-y) -T
2224

2325
ccflags-y := -fno-common -fno-builtin -fno-stack-protector -ffixed-x18
2426
ccflags-y += -DDISABLE_BRANCH_PROFILING

0 commit comments

Comments
 (0)