Skip to content

Commit 971bd07

Browse files
committed
add CFI and size info
1 parent 43fdade commit 971bd07

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

cortex-m-rt/asm.s

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,13 @@
1+
.cfi_sections .debug_frame
2+
13
# LLD requires that the section flags are explicitly set here
24
.section .HardFaultTrampoline, "ax"
35
.global HardFaultTrampoline
46
# .type and .thumb_func are both required; otherwise its Thumb bit does not
57
# get set and an invalid vector table is generated
68
.type HardFaultTrampoline,%function
79
.thumb_func
10+
.cfi_startproc
811
HardFaultTrampoline:
912
# depending on the stack mode in EXC_RETURN, fetch stack pointer from
1013
# PSP or MSP
@@ -17,13 +20,16 @@ HardFaultTrampoline:
1720
0:
1821
mrs r0, PSP
1922
b HardFault
23+
.cfi_endproc
24+
.size HardFaultTrampoline, . - HardFaultTrampoline
2025

2126
.section .text.FpuTrampoline, "ax"
2227
.global FpuTrampoline
2328
# .type and .thumb_func are both required; otherwise its Thumb bit does not
2429
# get set and an invalid vector table is generated
2530
.type FpuTrampoline,%function
2631
.thumb_func
32+
.cfi_startproc
2733
# This enables the FPU and jumps to the main function.
2834
FpuTrampoline:
2935
# Address of SCB.CPACR.
@@ -40,6 +46,8 @@ FpuTrampoline:
4046
# Hand execution over to `main`.
4147
bl main
4248
# Note: `main` must not return. `bl` is used only because it has a wider range than `b`.
49+
.cfi_endproc
50+
.size FpuTrampoline, . - FpuTrampoline
4351

4452
# ARMv6-M leaves LR in an unknown state on Reset
4553
# this trampoline sets LR before it's pushed onto the stack by Reset
@@ -49,8 +57,11 @@ FpuTrampoline:
4957
# get set and an invalid vector table is generated
5058
.type PreResetTrampoline,%function
5159
.thumb_func
60+
.cfi_startproc
5261
PreResetTrampoline:
5362
# set LR to the initial value used by the ARMv7-M (0xFFFF_FFFF)
5463
ldr r0,=0xffffffff
5564
mov lr,r0
5665
b Reset
66+
.cfi_endproc
67+
.size PreResetTrampoline, . - PreResetTrampoline

0 commit comments

Comments
 (0)