Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 1a8e69ff authored by Vincenzo Frascino's avatar Vincenzo Frascino Committed by Lee Jones
Browse files

BACKPORT: arm64: vdso: Add '-Bsymbolic' to ldflags



Commit 28b1a824a4f44 ("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.

Bug: 254441685
Fixes: 28b1a824a4f44 ("arm64: vdso: Substitute gettimeofday() with C implementation")
Reported-by: default avatarGeoff Levand <geoff@infradead.org>
Signed-off-by: default avatarVincenzo Frascino <vincenzo.frascino@arm.com>
Cc: Will Deacon <will@kernel.org>
Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: Ard Biesheuvel <ardb@kernel.org>
Link: https://lore.kernel.org/r/20200428150854.33130-1-vincenzo.frascino@arm.com


Signed-off-by: default avatarWill Deacon <will@kernel.org>
(cherry picked from commit 86b8783701246a22a734824674cc3f87a5ed9f13)
Signed-off-by: default avatarLee Jones <joneslee@google.com>
Change-Id: I99010ff671c8b33bfbaa1c9da52a12a3dbc7bdf0
parent b8cf44f0
Loading
Loading
Loading
Loading
+6 −2
Original line number Diff line number Diff line
@@ -17,14 +17,18 @@ obj-vdso := vgettimeofday.o note.o sigreturn.o
targets := $(obj-vdso) vdso.so vdso.so.dbg
obj-vdso := $(addprefix $(obj)/, $(obj-vdso))

# -Bsymbolic has been added for consistency with arm, the compat vDSO and
# potential future proofing if we end up with internal calls to the exported
# routines, as x86 does (see 6f121e548f83 ("x86, vdso: Reimplement vdso.so
# preparation in build-time C")).
ldflags-y := -shared -nostdlib -soname=linux-vdso.so.1 --hash-style=sysv \
		--build-id -n -T
		-Bsymbolic --build-id -n -T

ccflags-y += $(DISABLE_LTO)

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

VDSO_LDFLAGS := -Bsymbolic

CFLAGS_REMOVE_vgettimeofday.o = $(CC_FLAGS_FTRACE) -Os $(CC_FLAGS_SCS)
KBUILD_CFLAGS			+= $(DISABLE_LTO)