1
+ .cfi_sections .debug_frame
2
+
1
3
# LLD requires th at the section flags are explicitly set here
2
4
. section .HardFaultTrampoline , "ax"
3
5
. global HardFaultTrampoline
4
6
# .type and .thumb_func are both required ; otherwise its Thumb bit does not
5
7
# get set and an invalid vector table is generated
6
8
.type HardFaultTrampoline , %function
7
9
.thumb_func
10
+ .cfi_startproc
8
11
HardFaultTrampoline:
9
12
# depending on the stack mode in EXC_RETURN , fetch stack pointer from
10
13
# PSP or MSP
@@ -17,13 +20,16 @@ HardFaultTrampoline:
17
20
0 :
18
21
mrs r0 , PSP
19
22
b HardFault
23
+ .cfi_endproc
24
+ .size HardFaultTrampoline , . - HardFaultTrampoline
20
25
21
26
. section .text.FpuTrampoline , "ax"
22
27
. global FpuTrampoline
23
28
# .type and .thumb_func are both required ; otherwise its Thumb bit does not
24
29
# get set and an invalid vector table is generated
25
30
.type FpuTrampoline , %function
26
31
.thumb_func
32
+ .cfi_startproc
27
33
# This enables the FPU and jumps to the main function.
28
34
FpuTrampoline:
29
35
# Address of SCB.CPACR.
@@ -40,6 +46,8 @@ FpuTrampoline:
40
46
# Hand execution over to `main`.
41
47
bl main
42
48
# Note: `main` must not return. ` bl ` is used only because it has a wider range than `b`.
49
+ .cfi_endproc
50
+ .size FpuTrampoline , . - FpuTrampoline
43
51
44
52
# ARMv6 - M leaves LR in an unknown state on Reset
45
53
# this trampoline sets LR before it's pushed onto the stack by Reset
@@ -49,8 +57,11 @@ FpuTrampoline:
49
57
# get set and an invalid vector table is generated
50
58
.type PreResetTrampoline , %function
51
59
.thumb_func
60
+ .cfi_startproc
52
61
PreResetTrampoline:
53
62
# set LR to the initial value used by the ARMv7 - M (0xFFFF_FFFF)
54
63
ldr r0 , = 0xffffffff
55
64
mov lr , r0
56
65
b Reset
66
+ .cfi_endproc
67
+ .size PreResetTrampoline , . - PreResetTrampoline
0 commit comments