Skip to content

Commit 86b8783

Browse files
fvincenzowilldeacon
authored andcommitted
arm64: vdso: Add '-Bsymbolic' to ldflags
Commit 28b1a82 ("arm64: vdso: Substitute gettimeofday() with C implementation") introduced an unused 'VDSO_LDFLAGS' variable to the vdso Makefile, suggesting that we should be passing '-Bsymbolic' to the linker, as we do when linking the compat vDSO. Although it's not strictly necessary to pass this flag, it would be required if we were to add any internal references to the exported symbols. It's also consistent with how we link the compat vdso so, since there's no real downside from passing it, add '-Bsymbolic' to the ldflags for the native vDSO. Fixes: 28b1a82 ("arm64: vdso: Substitute gettimeofday() with C implementation") Reported-by: Geoff Levand <[email protected]> Signed-off-by: Vincenzo Frascino <[email protected]> Cc: Will Deacon <[email protected]> Cc: Catalin Marinas <[email protected]> Cc: Ard Biesheuvel <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Will Deacon <[email protected]>
1 parent 6a8b55e commit 86b8783

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

arch/arm64/kernel/vdso/Makefile

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,16 @@ 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+
# -Bsymbolic has been added for consistency with arm, the compat vDSO and
21+
# potential future proofing if we end up with internal calls to the exported
22+
# routines, as x86 does (see 6f121e548f83 ("x86, vdso: Reimplement vdso.so
23+
# preparation in build-time C")).
2024
ldflags-y := -shared -nostdlib -soname=linux-vdso.so.1 --hash-style=sysv \
21-
--build-id -n -T
25+
-Bsymbolic --build-id -n -T
2226

2327
ccflags-y := -fno-common -fno-builtin -fno-stack-protector -ffixed-x18
2428
ccflags-y += -DDISABLE_BRANCH_PROFILING
2529

26-
VDSO_LDFLAGS := -Bsymbolic
27-
2830
CFLAGS_REMOVE_vgettimeofday.o = $(CC_FLAGS_FTRACE) -Os
2931
KBUILD_CFLAGS += $(DISABLE_LTO)
3032
KASAN_SANITIZE := n

0 commit comments

Comments
 (0)