OSDN Git Service

arm64: vdso: work-around broken ELF toolchains in Makefile
authorWill Deacon <will.deacon@arm.com>
Fri, 19 Jun 2015 12:56:33 +0000 (13:56 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 21 Jul 2015 17:10:12 +0000 (10:10 -0700)
commitcae650932eea96a62ed180aeafcdf68a9cae4a7b
tree6a8b21f09c9a3e43dda4fa8e9bb6720b997bf542
parent7e6753abaef4bbe012124f66baee82edbda1adf5
arm64: vdso: work-around broken ELF toolchains in Makefile

commit 6f1a6ae87c0c60d7c462ef8fd071f291aa7a9abb upstream.

When building the kernel with a bare-metal (ELF) toolchain, the -shared
option may not be passed down to collect2, resulting in silent corruption
of the vDSO image (in particular, the DYNAMIC section is omitted).

The effect of this corruption is that the dynamic linker fails to find
the vDSO symbols and libc is instead used for the syscalls that we
intended to optimise (e.g. gettimeofday). Functionally, there is no
issue as the sigreturn trampoline is still intact and located by the
kernel.

This patch fixes the problem by explicitly passing -shared to the linker
when building the vDSO.

Reported-by: Szabolcs Nagy <Szabolcs.Nagy@arm.com>
Reported-by: James Greenlaigh <james.greenhalgh@arm.com>
Signed-off-by: Will Deacon <will.deacon@arm.com>
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
arch/arm64/kernel/vdso/Makefile