This is an automated email from the ASF dual-hosted git repository.

xiaoxiang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx.git


The following commit(s) were added to refs/heads/master by this push:
     new 156ef05205d libc/mcount: compatible with armv6m mcount implementation
156ef05205d is described below

commit 156ef05205d708a1b4b589a21af361cbcb7769f3
Author: yinshengkai <yinsheng...@xiaomi.com>
AuthorDate: Thu Jul 10 14:39:45 2025 +0800

    libc/mcount: compatible with armv6m mcount implementation
    
    mcount.S: Assembler messages:
    mcount.S:33: Error: cannot honor width suffix -- `bic r1,lr,#1'
    mcount.S:35: Error: cannot honor width suffix -- `bic r0,r0,#1'
    mcount.S:37: Error: cannot honor width suffix -- `pop {r0,r1,r2,r3,ip,lr}
    
    Signed-off-by: yinshengkai <yinsheng...@xiaomi.com>
---
 libs/libc/machine/arm/arch_mcount.S | 15 ++++++++-------
 1 file changed, 8 insertions(+), 7 deletions(-)

diff --git a/libs/libc/machine/arm/arch_mcount.S 
b/libs/libc/machine/arm/arch_mcount.S
index c747385b453..a792566cea1 100644
--- a/libs/libc/machine/arm/arch_mcount.S
+++ b/libs/libc/machine/arm/arch_mcount.S
@@ -29,13 +29,14 @@
 
        .type   __gnu_mcount_nc, %function
 __gnu_mcount_nc:
-       push    {r0, r1, r2, r3, lr}                    /* Save registers */
-       bic             r1, lr, #1                      /* R1 contains callee 
address, with thumb bit cleared */
-       ldr             r0, [sp, #20]                   /* R0 contains caller 
address */
-       bic             r0, r0, #1                      /* Clear thumb bit */
-       bl              mcount_internal                 /* Jump to internal 
_mcount() implementation */
-       pop             {r0, r1, r2, r3, ip, lr}        /* Restore saved 
registers */
-       bx              ip                              /* Return to callee */
+       push    {r0, r1, r2, r3, lr}            /* Save registers */
+       mov     r1, lr
+       bic     r1, r1, #1                      /* R1 contains callee address, 
with thumb bit cleared */
+       ldr     r0, [sp, #20]                   /* R0 contains caller address */
+       bic     r0, r0, #1                      /* Clear thumb bit */
+       bl      mcount_internal                 /* Jump to internal _mcount() 
implementation */
+       pop     {r0, r1, r2, r3, ip, lr}        /* Restore saved registers */
+       bx      ip                              /* Return to callee */
 
        .size   __gnu_mcount_nc, .-__gnu_mcount_nc
        .end

Reply via email to