Skip to content

Commit c47591c

Browse files
bors[bot]Tiwalun
andauthored
Merge #216
216: Add unwind information to external assembly r=jonas-schievink a=Tiwalun Add unwind information to the external assembly files, as discussed in #215. The `.debug_frame` section is now present: ``` cortex-m.o (ex bin/thumbv6m-none-eabi.a): section size addr .text 0x0 0x0 .data 0x0 0x0 .bss 0x0 0x0 .text.__bkpt 0x4 0x0 .text.__control_r 0x6 0x0 .text.__control_w 0x6 0x0 .text.__cpsid 0x4 0x0 .text.__cpsie 0x4 0x0 .text.__delay 0x8 0x0 .text.__dmb 0x6 0x0 .text.__dsb 0x6 0x0 .text.__isb 0x6 0x0 .text.__msp_r 0x6 0x0 .text.__msp_w 0x6 0x0 .text.__nop 0x2 0x0 .text.__primask 0x6 0x0 .text.__psp_r 0x6 0x0 .text.__psp_w 0x6 0x0 .text.__sev 0x4 0x0 .text.__udf 0x2 0x0 .text.__wfe 0x4 0x0 .text.__wfi 0x4 0x0 .debug_line 0x161 0x0 .debug_info 0x22 0x0 .debug_abbrev 0x12 0x0 .debug_aranges 0xb0 0x0 .debug_str 0x30 0x0 .debug_ranges 0xa8 0x0 .debug_frame 0x140 0x0 .ARM.attributes 0x1c 0x0 Total 0x4d9 ``` Co-authored-by: Dominik Boehi <dominik.boehi@gmail.com>
2 parents 7494435 + af3143c commit c47591c

12 files changed

+74
-1
lines changed

asm-cm7-r0p1.s

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
1+
.cfi_sections .debug_frame
2+
13
.section .text.__basepri_max_cm7_r0p1
24
.global __basepri_max_cm7_r0p1
35
.syntax unified
46
.thumb_func
7+
.cfi_startproc
58
__basepri_max_cm7_r0p1:
69
mrs r1, PRIMASK
710
cpsid i
@@ -11,12 +14,14 @@ __basepri_max_cm7_r0p1:
1114
bxne lr
1215
cpsie i
1316
bx lr
17+
.cfi_endproc
1418
.size __basepri_max_cm7_r0p1, . - __basepri_max_cm7_r0p1
1519

1620
.section .text.__basepri_w_cm7_r0p1
1721
.global __basepri_w_cm7_r0p1
1822
.syntax unified
1923
.thumb_func
24+
.cfi_startproc
2025
__basepri_w_cm7_r0p1:
2126
mrs r1, PRIMASK
2227
cpsid i
@@ -26,4 +31,5 @@ __basepri_w_cm7_r0p1:
2631
bxne lr
2732
cpsie i
2833
bx lr
34+
.cfi_endproc
2935
.size __basepri_w_cm7_r0p1, . - __basepri_w_cm7_r0p1

asm-v7.s

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,41 @@
1+
.cfi_sections .debug_frame
2+
13
.section .text.__basepri_max
24
.global __basepri_max
35
.thumb_func
6+
.cfi_startproc
47
__basepri_max:
58
msr BASEPRI_MAX, r0
69
bx lr
10+
.cfi_endproc
711
.size __basepri_max, . - __basepri_max
812

913
.section .text.__basepri_r
1014
.global __basepri_r
1115
.thumb_func
16+
.cfi_startproc
1217
__basepri_r:
1318
mrs r0, BASEPRI
1419
bx lr
20+
.cfi_endproc
1521
.size __basepri_r, . - __basepri_r
1622

1723
.section .text.__basepri_w
1824
.global __basepri_w
1925
.thumb_func
26+
.cfi_startproc
2027
__basepri_w:
2128
msr BASEPRI, r0
2229
bx lr
30+
.cfi_endproc
2331
.size __basepri_w, . - __basepri_w
2432

2533
.section .text.__faultmask
2634
.global __faultmask
2735
.thumb_func
36+
.cfi_startproc
2837
__faultmask:
2938
mrs r0, FAULTMASK
3039
bx lr
40+
.cfi_endproc
3141
.size __faultmask, . - __faultmask

asm-v8-main.s

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,43 @@
1+
2+
.cfi_sections .debug_frame
3+
14
.section .text.__msplim_r
25
.global __msplim_r
36
.thumb_func
7+
.cfi_startproc
48
__msplim_r:
59
mrs r0, MSPLIM
610
bx lr
11+
.cfi_endproc
712
.size __msplim_r, . - __msplim_r
813

914
.section .text.__msplim_w
1015
.global __msplim_w
1116
.thumb_func
17+
.cfi_startproc
1218
__msplim_w:
1319
msr MSPLIM, r0
1420
bx lr
21+
.cfi_endproc
1522
.size __msplim_w, . - __msplim_w
1623

1724
.section .text.__psplim_r
1825
.global __psplim_r
1926
.thumb_func
27+
.cfi_startproc
2028
__psplim_r:
2129
mrs r0, PSPLIM
2230
bx lr
31+
.cfi_endproc
2332
.size __psplim_r, . - __psplim_r
2433

2534
.section .text.__psplim_w
2635
.global __psplim_w
2736
.thumb_func
37+
.cfi_startproc
2838
__psplim_w:
2939
msr PSPLIM, r0
3040
bx lr
41+
.cfi_endproc
3142
.size __psplim_w, . - __psplim_w
3243

asm-v8.s

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,42 @@
1+
.cfi_sections .debug_frame
2+
13
.section .text.__tt
24
.global __tt
35
.thumb_func
6+
.cfi_startproc
47
__tt:
58
tt r0, r0
69
bx lr
10+
.cfi_endproc
711
.size __tt, . - __tt
812

913
.section .text.__ttt
1014
.global __ttt
1115
.thumb_func
16+
.cfi_startproc
1217
__ttt:
1318
ttt r0, r0
1419
bx lr
20+
.cfi_endproc
1521
.size __ttt, . - __ttt
1622

1723
.section .text.__tta
1824
.global __tta
1925
.thumb_func
26+
.cfi_startproc
2027
__tta:
2128
tta r0, r0
2229
bx lr
30+
.cfi_endproc
2331
.size __tta, . - __tta
2432

2533

2634
.section .text.__ttat
2735
.global __ttat
2836
.thumb_func
37+
.cfi_startproc
2938
__ttat:
3039
ttat r0, r0
3140
bx lr
41+
.cfi_endproc
3242
.size __ttat, . - __ttat

asm.s

Lines changed: 37 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,86 +1,108 @@
1+
.cfi_sections .debug_frame
2+
13
.section .text.__bkpt
24
.global __bkpt
35
.thumb_func
6+
.cfi_startproc
47
__bkpt:
58
bkpt
69
bx lr
10+
.cfi_endproc
711
.size __bkpt, . - __bkpt
812

913
.section .text.__control_r
1014
.global __control_r
1115
.thumb_func
16+
.cfi_startproc
1217
__control_r:
1318
mrs r0, CONTROL
1419
bx lr
20+
.cfi_endproc
1521
.size __control_r, . - __control_r
1622

1723
.section .text.__control_w
1824
.global __control_w
1925
.thumb_func
26+
.cfi_startproc
2027
__control_w:
2128
msr CONTROL, r0
2229
bx lr
30+
.cfi_endproc
2331
.size __control_w, . - __control_w
2432

2533

2634
.section .text.__cpsid
2735
.global __cpsid
2836
.thumb_func
37+
.cfi_startproc
2938
__cpsid:
3039
cpsid i
3140
bx lr
41+
.cfi_endproc
3242
.size __cpsid, . - __cpsid
3343

3444
.section .text.__cpsie
3545
.global __cpsie
3646
.thumb_func
47+
.cfi_startproc
3748
__cpsie:
3849
cpsie i
3950
bx lr
51+
.cfi_endproc
4052
.size __cpsie, . - __cpsie
4153

4254
.section .text.__delay
4355
.global __delay
4456
.syntax unified
4557
.thumb_func
58+
.cfi_startproc
4659
__delay:
4760
1:
4861
nop
4962
subs r0, #1
5063
bne 1b // Branch to 1 instead of __delay does not generate R_ARM_THM_JUMP8 relocation, which breaks linking on the thumbv6m-none-eabi target
5164
bx lr
65+
.cfi_endproc
5266
.size __delay, . - __delay
5367

5468
.section .text.__dmb
5569
.global __dmb
5670
.thumb_func
71+
.cfi_startproc
5772
__dmb:
5873
dmb 0xF
5974
bx lr
75+
.cfi_endproc
6076
.size __dmb, . - __dmb
6177

6278
.section .text.__dsb
6379
.global __dsb
6480
.thumb_func
81+
.cfi_startproc
6582
__dsb:
6683
dsb 0xF
6784
bx lr
85+
.cfi_endproc
6886
.size __dsb, . - __dsb
6987

7088
.section .text.__isb
7189
.global __isb
7290
.thumb_func
91+
.cfi_startproc
7392
__isb:
7493
isb 0xF
7594
bx lr
95+
.cfi_endproc
7696
.size __isb, . - __isb
7797

7898
.section .text.__msp_r
7999
.global __msp_r
80100
.thumb_func
101+
.cfi_startproc
81102
__msp_r:
82103
mrs r0, MSP
83104
bx lr
105+
.cfi_endproc
84106
.size __msp_r, . - __msp_r
85107

86108
.section .text.__msp_w
@@ -94,24 +116,30 @@ __msp_w:
94116
.section .text.__nop
95117
.global __nop
96118
.thumb_func
119+
.cfi_startproc
97120
__nop:
98121
bx lr
122+
.cfi_endproc
99123
.size __nop, . - __nop
100124

101125
.section .text.__primask
102126
.global __primask
103127
.thumb_func
128+
.cfi_startproc
104129
__primask:
105130
mrs r0, PRIMASK
106131
bx lr
132+
.cfi_endproc
107133
.size __primask, . - __primask
108134

109135
.section .text.__psp_r
110136
.global __psp_r
111137
.thumb_func
138+
.cfi_startproc
112139
__psp_r:
113140
mrs r0, PSP
114141
bx lr
142+
.cfi_endproc
115143
.size __psp_r, . - __psp_r
116144

117145
.section .text.__psp_w
@@ -125,32 +153,40 @@ __psp_w:
125153
.section .text.__sev
126154
.global __sev
127155
.thumb_func
156+
.cfi_startproc
128157
__sev:
129158
sev
130159
bx lr
160+
.cfi_endproc
131161
.size __sev, . - __sev
132162

133163

134164
.section .text.__udf
135165
.global __udf
136166
.thumb_func
167+
.cfi_startproc
137168
__udf:
138169
udf
170+
.cfi_endproc
139171
.size __udf, . - __udf
140172

141173
.section .text.__wfe
142174
.global __wfe
143175
.thumb_func
176+
.cfi_startproc
144177
__wfe:
145178
wfe
146179
bx lr
180+
.cfi_endproc
147181
.size __wfe, . - __wfe
148182

149183

150184
.section .text.__wfi
151185
.global __wfi
152186
.thumb_func
187+
.cfi_startproc
153188
__wfi:
154189
wfi
155-
.size __wfi, . - __wfi
156190
bx lr
191+
.cfi_endproc
192+
.size __wfi, . - __wfi

bin/thumbv6m-none-eabi.a

680 Bytes
Binary file not shown.

bin/thumbv7em-none-eabi.a

1.12 KB
Binary file not shown.

bin/thumbv7em-none-eabihf.a

1.12 KB
Binary file not shown.

bin/thumbv7m-none-eabi.a

948 Bytes
Binary file not shown.

bin/thumbv8m.base-none-eabi.a

944 Bytes
Binary file not shown.

bin/thumbv8m.main-none-eabi.a

1.43 KB
Binary file not shown.

bin/thumbv8m.main-none-eabihf.a

1.43 KB
Binary file not shown.

0 commit comments

Comments
 (0)