From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1035) id 20A743858C27; Tue, 10 Jan 2023 16:49:45 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 20A743858C27 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1673369385; bh=M+uHt05FYhM++dmCLalK854nr+IRAP3WcgD1HUMJAT8=; h=From:To:Subject:Date:From; b=N1E/qtaVmPyw3H4PNvBa0QyfDhuaiyVMWvnXMsqxNNc0nQm1R3l7ZA57Ho0VE0KfG cy369b/d/XqqPab6XGqY2e7krxkhJBmaditc80tCr+xHVyNlmCxY/6qYBsgMVahavw n61Mk4yxFOfKuKdWvBdsmyt58+QX9NniPM7PicJY= Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable From: Richard Earnshaw To: newlib-cvs@sourceware.org Subject: [newlib-cygwin] newlib: libc: aeabi_memmove M-profile PACBTI-enablement X-Act-Checkin: newlib-cygwin X-Git-Author: Victor L. Do Nascimento X-Git-Refname: refs/heads/master X-Git-Oldrev: 60a50c2846f9ad259631598604a7410bee502c70 X-Git-Newrev: bddfd64ec2e94973d6372f90fe9a8a7b0f882e69 Message-Id: <20230110164945.20A743858C27@sourceware.org> Date: Tue, 10 Jan 2023 16:49:45 +0000 (GMT) List-Id: https://sourceware.org/git/gitweb.cgi?p=3Dnewlib-cygwin.git;h=3Dbddfd64ec2e= 94973d6372f90fe9a8a7b0f882e69 commit bddfd64ec2e94973d6372f90fe9a8a7b0f882e69 Author: Victor L. Do Nascimento Date: Wed Dec 21 11:27:01 2022 +0000 newlib: libc: aeabi_memmove M-profile PACBTI-enablement =20 Add function prologue/epilogue to conditionally add BTI landing pads and/or PAC code generation & authentication instructions depending on compilation flags. Diff: --- newlib/libc/machine/arm/aeabi_memmove-thumb2.S | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/newlib/libc/machine/arm/aeabi_memmove-thumb2.S b/newlib/libc/m= achine/arm/aeabi_memmove-thumb2.S index e9504437b..20ca993e5 100644 --- a/newlib/libc/machine/arm/aeabi_memmove-thumb2.S +++ b/newlib/libc/machine/arm/aeabi_memmove-thumb2.S @@ -26,6 +26,8 @@ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ =20 +#include "arm_asm.h" + .thumb .syntax unified .global __aeabi_memmove @@ -33,8 +35,10 @@ ASM_ALIAS __aeabi_memmove4 __aeabi_memmove ASM_ALIAS __aeabi_memmove8 __aeabi_memmove __aeabi_memmove: + .fnstart + .cfi_startproc + prologue 4 cmp r0, r1 - push {r4} bls 3f adds r3, r1, r2 cmp r0, r3 @@ -48,9 +52,10 @@ __aeabi_memmove: strb r4, [r1, #-1]! bne 1b 2: - pop {r4} - bx lr + .cfi_remember_state + epilogue 4 3: + .cfi_restore_state cmp r2, #0 beq 2b add r2, r2, r1 @@ -60,6 +65,8 @@ __aeabi_memmove: cmp r2, r1 strb r4, [r3, #1]! bne 4b - pop {r4} - bx lr + epilogue 4 + .cfi_endproc + .cantunwind + .fnend .size __aeabi_memmove, . - __aeabi_memmove