diff mbox series

arm64: Build vDSO with -ffixed-x18

Message ID 20181107003913.19061-1-pcc@google.com (mailing list archive)
State New, archived
Headers show
Series arm64: Build vDSO with -ffixed-x18 | expand

Commit Message

Peter Collingbourne Nov. 7, 2018, 12:39 a.m. UTC
The vDSO needs to be build with x18 reserved in order to accommodate
userspace platform ABIs built on top of Linux that use the register
to carry inter-procedural state, as provided for by the AAPCS.
An example of such a platform ABI is the one that will be used by an
upcoming version of Android.

Although this change is currently a no-op due to the fact that the vDSO
is currently implemented in pure assembly on arm64, it is necessary
in order to prepare for another change [1] that will add C code to
the vDSO.

[1] https://patchwork.kernel.org/patch/10044501/

Signed-off-by: Peter Collingbourne <pcc@google.com>
Cc: Mark Salyzyn <salyzyn@google.com>
Cc: Will Deacon <will.deacon@arm.com>
Cc: linux-arm-kernel@lists.infradead.org
---
 arch/arm64/kernel/vdso/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Catalin Marinas Nov. 8, 2018, 6 p.m. UTC | #1
On Tue, Nov 06, 2018 at 04:39:13PM -0800, Peter Collingbourne wrote:
> The vDSO needs to be build with x18 reserved in order to accommodate
> userspace platform ABIs built on top of Linux that use the register
> to carry inter-procedural state, as provided for by the AAPCS.
> An example of such a platform ABI is the one that will be used by an
> upcoming version of Android.
> 
> Although this change is currently a no-op due to the fact that the vDSO
> is currently implemented in pure assembly on arm64, it is necessary
> in order to prepare for another change [1] that will add C code to
> the vDSO.

Since this is a no-op for the current kernel, I guess Vincenzo (cc'ed)
will pick it up as he's planning to post an update to the vDSO in C
series soon.
diff mbox series

Patch

diff --git a/arch/arm64/kernel/vdso/Makefile b/arch/arm64/kernel/vdso/Makefile
index b215c712d897..8cd4707f832a 100644
--- a/arch/arm64/kernel/vdso/Makefile
+++ b/arch/arm64/kernel/vdso/Makefile
@@ -12,7 +12,7 @@  obj-vdso := gettimeofday.o note.o sigreturn.o
 targets := $(obj-vdso) vdso.so vdso.so.dbg
 obj-vdso := $(addprefix $(obj)/, $(obj-vdso))
 
-ccflags-y := -shared -fno-common -fno-builtin
+ccflags-y := -shared -fno-common -fno-builtin -ffixed-x18
 ccflags-y += -nostdlib -Wl,-soname=linux-vdso.so.1 \
 		$(call cc-ldoption, -Wl$(comma)--hash-style=sysv)