File tree Expand file tree Collapse file tree 1 file changed +5
-11
lines changed Expand file tree Collapse file tree 1 file changed +5
-11
lines changed Original file line number Diff line number Diff line change @@ -499,12 +499,10 @@ macro_rules! cfg_global_asm {
499
499
// Finally jumps to the user main function.
500
500
#[ cfg( cortex_m) ]
501
501
cfg_global_asm ! {
502
- ".cfi_sections .debug_frame
503
- .section .Reset, \" ax\"
502
+ ".section .Reset, \" ax\"
504
503
.global Reset
505
504
.type Reset,%function
506
- .thumb_func" ,
507
- ".cfi_startproc
505
+ .thumb_func
508
506
Reset:" ,
509
507
510
508
// Ensure LR is loaded with 0xFFFF_FFFF at startup to help debuggers find the first call frame.
@@ -572,20 +570,16 @@ cfg_global_asm! {
572
570
dsb
573
571
isb" ,
574
572
575
- // Push `lr` to the stack for debuggers, to prevent them unwinding past Reset.
576
- // See https://sourceware.org/binutils/docs/as/CFI-directives.html.
577
- ".cfi_def_cfa sp, 0
578
- push {{lr}}
579
- .cfi_offset lr, 0" ,
573
+ // Put the stack pointer in r7 so the next callee-saved frame pointer (i.e. main's) is correct
574
+ "mov r7, sp" ,
580
575
581
576
// Jump to user main function.
582
577
// `bl` is used for the extended range, but the user main function should not return,
583
578
// so trap on any unexpected return.
584
579
"bl main
585
580
udf #0" ,
586
581
587
- ".cfi_endproc
588
- .size Reset, . - Reset" ,
582
+ ".size Reset, . - Reset" ,
589
583
}
590
584
591
585
/// Attribute to declare an interrupt (AKA device-specific exception) handler
You can’t perform that action at this time.
0 commit comments