From 981a13d5be3c923b4286e2f239fe2130c5e50daa Mon Sep 17 00:00:00 2001 From: Markus Reiter Date: Fri, 22 Apr 2022 14:21:09 +0200 Subject: [PATCH 1/2] Fix inline assembly. --- cortex-m-rt/src/lib.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/cortex-m-rt/src/lib.rs b/cortex-m-rt/src/lib.rs index 1e977c66..aa0ff340 100644 --- a/cortex-m-rt/src/lib.rs +++ b/cortex-m-rt/src/lib.rs @@ -548,7 +548,7 @@ cfg_global_asm! { ldr r1, =__edata ldr r2, =__sidata 2: - cmp r0, r0 + cmp r1, r0 beq 3f ldm r2!, {{r3}} stm r0!, {{r3}} @@ -569,7 +569,8 @@ cfg_global_asm! { // Push `lr` to the stack for debuggers, to prevent them unwinding past Reset. // See https://sourceware.org/binutils/docs/as/CFI-directives.html. - ".cfi_def_cfa sp, 0 + "4: + .cfi_def_cfa sp, 0 push {{lr}} .cfi_offset lr, 0", From 37f77f1456ad362c95a8a5aacf9afa1242f632e2 Mon Sep 17 00:00:00 2001 From: Markus Reiter Date: Sat, 23 Apr 2022 04:45:17 +0200 Subject: [PATCH 2/2] Remove unused `4:` label. --- cortex-m-rt/src/lib.rs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/cortex-m-rt/src/lib.rs b/cortex-m-rt/src/lib.rs index aa0ff340..97540e78 100644 --- a/cortex-m-rt/src/lib.rs +++ b/cortex-m-rt/src/lib.rs @@ -569,8 +569,7 @@ cfg_global_asm! { // Push `lr` to the stack for debuggers, to prevent them unwinding past Reset. // See https://sourceware.org/binutils/docs/as/CFI-directives.html. - "4: - .cfi_def_cfa sp, 0 + ".cfi_def_cfa sp, 0 push {{lr}} .cfi_offset lr, 0",