Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 8 additions & 7 deletions libs/libc/machine/arm/arch_mcount.S
Original file line number Diff line number Diff line change
Expand Up @@ -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
Loading