Skip to content

Commit 3bd46e5

Browse files
committed
Changed some names around so everything should be called correctly
1 parent 540d1de commit 3bd46e5

File tree

1 file changed

+14
-18
lines changed

1 file changed

+14
-18
lines changed

cortex-m-rt/macros/src/lib.rs

Lines changed: 14 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -368,11 +368,7 @@ pub fn exception(args: TokenStream, input: TokenStream) -> TokenStream {
368368
#(#cfgs)*
369369
#(#attrs)*
370370
#[doc(hidden)]
371-
#[export_name = "HardFault"]
372-
// Only emit link_section when building for embedded targets,
373-
// because some hosted platforms (used to check the build)
374-
// cannot handle the long link section names.
375-
#[cfg_attr(target_os = "none", link_section = ".HardFault.user")]
371+
#[export_name = "HardFaultUser"]
376372
pub unsafe extern "C" fn #tramp_ident(frame: &::cortex_m_rt::ExceptionFrame) {
377373
#ident(frame)
378374
}
@@ -384,23 +380,23 @@ pub fn exception(args: TokenStream, input: TokenStream) -> TokenStream {
384380
// Depending on the stack mode in EXC_RETURN, fetches stack from either MSP or PSP.
385381
core::arch::global_asm!(
386382
".cfi_sections .debug_frame
387-
.section .HardFaultTrampoline, \"ax\"
388-
.global HardFaultTrampline
389-
.type HardFaultTrampline,%function
383+
.section .HardFault.user, \"ax\"
384+
.global HardFault
385+
.type HardFault,%function
390386
.thumb_func
391387
.cfi_startproc
392-
HardFaultTrampoline:",
393-
"mov r0, lr
394-
movs r1, #4
395-
tst r0, r1
396-
bne 0f
397-
mrs r0, MSP
398-
b HardFault
388+
HardFault:",
389+
"mov r0, lr
390+
movs r1, #4
391+
tst r0, r1
392+
bne 0f
393+
mrs r0, MSP
394+
b HardFaultUser
399395
0:
400-
mrs r0, PSP
401-
b HardFault",
396+
mrs r0, PSP
397+
b HardFaultUser",
402398
".cfi_endproc
403-
.size HardFaultTrampoline, . - HardFaultTrampoline",
399+
.size HardFault, . - HardFault",
404400
);
405401
)
406402
} else {

0 commit comments

Comments
 (0)