riscv: explicitly use symbol offsets for VDSO
authorSaleem Abdulrasool <abdulras@google.com>
Wed, 4 Aug 2021 17:32:14 +0000 (17:32 +0000)
committerPalmer Dabbelt <palmerdabbelt@google.com>
Wed, 25 Aug 2021 04:45:47 +0000 (21:45 -0700)
commitfde9c59aebafb91caeed816cc510b56f14aa63ae
tree748dc2b57f1805edf486bed2a5d998d6f2f6450e
parent8341dcfbd8dda98a3b2836a421016f7d88e35b1c
riscv: explicitly use symbol offsets for VDSO

The current implementation of the `__rt_sigaction` reference computed an
absolute offset relative to the mapped base of the VDSO.  While this can
be handled in the medlow model, the medany model cannot handle this as
it is meant to be position independent.  The current implementation
relied on the BFD linker relaxing the PC-relative relocation into an
absolute relocation as it was a near-zero address allowing it to be
referenced relative to `zero`.

We now extract the offsets and create a generated header allowing the
build with LLVM and lld to succeed as we no longer depend on the linker
rewriting address references near zero.  This change was largely
modelled after the ARM64 target which does something similar.

Signed-off-by: Saleem Abdulrasool <abdulras@google.com>
Tested-by: Nathan Chancellor <nathan@kernel.org>
Signed-off-by: Palmer Dabbelt <palmerdabbelt@google.com>
arch/riscv/Makefile
arch/riscv/include/asm/vdso.h
arch/riscv/kernel/vdso/Makefile
arch/riscv/kernel/vdso/gen_vdso_offsets.sh [new file with mode: 0755]
arch/riscv/kernel/vdso/so2s.sh [deleted file]