Skip to content

Commit 156ef05

Browse files
Gary-Hobsonxiaoxiang781216
authored andcommitted
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 <[email protected]>
1 parent e1e9ea2 commit 156ef05

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

libs/libc/machine/arm/arch_mcount.S

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -29,13 +29,14 @@
2929

3030
.type __gnu_mcount_nc, %function
3131
__gnu_mcount_nc:
32-
push {r0, r1, r2, r3, lr} /* Save registers */
33-
bic r1, lr, #1 /* R1 contains callee address, with thumb bit cleared */
34-
ldr r0, [sp, #20] /* R0 contains caller address */
35-
bic r0, r0, #1 /* Clear thumb bit */
36-
bl mcount_internal /* Jump to internal _mcount() implementation */
37-
pop {r0, r1, r2, r3, ip, lr} /* Restore saved registers */
38-
bx ip /* Return to callee */
32+
push {r0, r1, r2, r3, lr} /* Save registers */
33+
mov r1, lr
34+
bic r1, r1, #1 /* R1 contains callee address, with thumb bit cleared */
35+
ldr r0, [sp, #20] /* R0 contains caller address */
36+
bic r0, r0, #1 /* Clear thumb bit */
37+
bl mcount_internal /* Jump to internal _mcount() implementation */
38+
pop {r0, r1, r2, r3, ip, lr} /* Restore saved registers */
39+
bx ip /* Return to callee */
3940

4041
.size __gnu_mcount_nc, .-__gnu_mcount_nc
4142
.end

0 commit comments

Comments
 (0)