From a17179a6086beb3eb89529336f030d5b6503ed1c Mon Sep 17 00:00:00 2001 From: rin Date: Tue, 29 Jun 2021 23:29:12 +0000 Subject: Align sp to 8-byte boundary as required by EABI. IIUC, this change only affects libc compiled for ``Thumb-mode userland'', which we've not officially supported yet. --- lib/libc/arch/arm/gen/swapcontext.S | 6 ++++-- lib/libc/arch/arm/sys/__clone.S | 4 +++- 2 files changed, 7 insertions(+), 3 deletions(-) (limited to 'lib') diff --git a/lib/libc/arch/arm/gen/swapcontext.S b/lib/libc/arch/arm/gen/swapcontext.S index 8437df2d804..438b4220555 100644 --- a/lib/libc/arch/arm/gen/swapcontext.S +++ b/lib/libc/arch/arm/gen/swapcontext.S @@ -1,4 +1,4 @@ -/* $NetBSD: swapcontext.S,v 1.15 2018/11/21 21:01:41 skrll Exp $ */ +/* $NetBSD: swapcontext.S,v 1.16 2021/06/29 23:29:12 rin Exp $ */ /*- * Copyright (c) 2001 The NetBSD Foundation, Inc. @@ -33,7 +33,7 @@ #include "assym.h" #if defined(LIBC_SCCS) && !defined(lint) - RCSID("$NetBSD: swapcontext.S,v 1.15 2018/11/21 21:01:41 skrll Exp $") + RCSID("$NetBSD: swapcontext.S,v 1.16 2021/06/29 23:29:12 rin Exp $") #endif /* LIBC_SCCS && !lint */ ENTRY(swapcontext) @@ -85,7 +85,9 @@ ENTRY(swapcontext) b PLT_SYM(_C_LABEL(setcontext)) #else push {lr} + sub sp, #4 bl PLT_SYM(_C_LABEL(setcontext)) + add sp, #4 pop {pc} #endif #if defined(__ARM_EABI__) && defined(__UNWIND_TABLES__) diff --git a/lib/libc/arch/arm/sys/__clone.S b/lib/libc/arch/arm/sys/__clone.S index df9a6cbfa0b..51a9f225aec 100644 --- a/lib/libc/arch/arm/sys/__clone.S +++ b/lib/libc/arch/arm/sys/__clone.S @@ -1,4 +1,4 @@ -/* $NetBSD: __clone.S,v 1.9 2013/11/30 20:20:42 joerg Exp $ */ +/* $NetBSD: __clone.S,v 1.10 2021/06/29 23:29:12 rin Exp $ */ /* * Copyright (c) 2001 Christopher Gilbert @@ -122,7 +122,9 @@ ENTRY(__clone) #else .Lcerror: push {lr} + sub sp, #4 bl CERROR + add sp, #4 pop {pc} #endif END(__clone) -- cgit