@@ -368,11 +368,7 @@ pub fn exception(args: TokenStream, input: TokenStream) -> TokenStream {
368
368
#( #cfgs) *
369
369
#( #attrs) *
370
370
#[ 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" ]
376
372
pub unsafe extern "C" fn #tramp_ident( frame: & :: cortex_m_rt:: ExceptionFrame ) {
377
373
#ident( frame)
378
374
}
@@ -384,23 +380,23 @@ pub fn exception(args: TokenStream, input: TokenStream) -> TokenStream {
384
380
// Depending on the stack mode in EXC_RETURN, fetches stack from either MSP or PSP.
385
381
core:: arch:: global_asm!(
386
382
".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
390
386
.thumb_func
391
387
.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
399
395
0:
400
- mrs r0, PSP
401
- b HardFault " ,
396
+ mrs r0, PSP
397
+ b HardFaultUser " ,
402
398
".cfi_endproc
403
- .size HardFaultTrampoline , . - HardFaultTrampoline " ,
399
+ .size HardFault , . - HardFault " ,
404
400
) ;
405
401
)
406
402
} else {
0 commit comments