Incorrect epilogue code in __attribute__((cmse_nonsecure_entry)) function
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
GNU Arm Embedded Toolchain |
New
|
Undecided
|
Unassigned |
Bug Description
Pertinent bug report info:
- GCC version: 9-2020-q2
- CPU: Arm Cortex-M23
- Optimization level: Os
---------
Checking the following non-secure callable (NSC) function with Os,
```C
int __attribute_
foo(int a)
{
return a + 1;
}
```
Compiled assembly code:
```ASM
0x000004E8 3001 ADDS r0,#1
0x000004EA 0001 MOVS r1,r0
0x000004EC 0002 MOVS r2,r0
0x000004EE 0003 MOVS r3,r0
0x000004F0 4680 MOV r8,r0
0x000004F2 4681 MOV r9,r0
0x000004F4 4682 MOV r10,r0
0x000004F6 4683 MOV r11,r0
0x000004F8 4684 MOV r12,r0
0x000004FA F38E8800 MSR APSR_nzcvq,lr ; formerly CPSR_f
0x000004FE 4774 BXNS lr
```
According to Arm's "ARMv8-M Security Extensions: Requirements on Development Tools", on return from an entry function, restore all callee-saved registers (here r8~r12) as mandated by [AAPCS], rather than clear them.
Ich bin bis 09.11. nicht im Haus und kann Ihre Nachricht daher leider nicht bearbeiten. In dringenden Fällen wenden Sie sich bitte an <email address hidden> bzw. für technische Fragen an <email address hidden>.
I am out of office until November 9th and won't be able to read your message. In urgent cases, please refer to <email address hidden> or for technical questions to <email address hidden>.
Mit freundlichen Grüßen / Best regards
Steffen Wolfer
--
Dipl.-Inform. Steffen Wolfer
Software Engineer Embedded Systems
WEISS ROBOTICS GmbH & Co. KG Käferle- Str. 8
Karl-Heinrich-
D-71640 Ludwigsburg, Germany
Phone: +49 7141 94702-22 www.weiss- robotics. com
Fax: +49 7141 94702-99
http://
Sitz der Gesellschaft: Ludwigsburg
Registergericht Stuttgart, HRA725006
Pers. haftende Gesellschafterin:
Weiss Robotics Verwaltungs-GmbH, Sitz Ludwigsburg
Registergericht Stuttgart, HRB73310
Geschäftsführer: Dr. Karsten Weiß
Public bug reported:
Pertinent bug report info:
- GCC version: 9-2020-q2
- CPU: Arm Cortex-M23
- Optimization level: Os
---------
Checking the following non-secure callable (NSC) function with Os,
```C _((cmse_ nonsecure_ entry))
int __attribute_
foo(int a)
{
return a + 1;
}
```
Compiled assembly code:
```ASM
foo:
0x000004E8 3001 ADDS r0,#1
0x000004EA 0001 MOVS r1,r0
0x000004EC 0002 MOVS r2,r0
0x000004EE 0003 MOVS r3,r0
0x000004F0 4680 MOV r8,r0
0x000004F2 4681 MOV r9,r0
0x000004F4 4682 MOV r10,r0
0x000004F6 4683 MOV r11,r0
0x000004F8 4684 MOV r12,r0
0x000004FA F38E8800 MSR APSR_nzcvq,lr ; formerly CPSR_f
0x000004FE 4774 BXNS lr
```
According to Arm's "ARMv8-M Security Extensions: Requirements on
Development Tools", on return from an entry function, restore all
callee-saved registers (here r8~r12) as mandated by [AAPCS], rather than
clear them.
** Affects: gcc-arm-embedded
Importance: Undecided
Status: New
-- /bugs.launchpad .net/bugs/ 1903018
You received this bug notification because you are subscribed to GNU Arm
Embedded Toolchain.
Matching subscriptions: Älles
https:/
Title: _((cmse_ nonsecure_ entry))
Incorrect epilogue code in __attribute_
function
Status in GNU Arm Embedded Toolchain:
New
Bug description:
Pertinent bug report info:
- GCC version: 9-2020-q2
- CPU: Arm Cortex-M23
- Optimization level: Os
---------
Checking the following non-secure callable (NSC) function with Os,
```C _((cmse_ nonsecure_ entry))
int __attribute_
foo(int a)
{
return a + 1;
}
```
Compiled assembly code:
```ASM
foo:
0x000004E8 3001 ADDS r0,#1
0x000004EA 0001 MOVS r1,r0
0x000004EC 0002 MOVS r2,r0
0x000004EE 0003 MOVS r3,r0
0x000004F0 4680 MOV r8,r0
0x000004F2 4681 MOV r9,r0
0x000004F4 4682 MOV r10,r0
0x000004F6 4683 MOV r11,r0
0x000004F8 4684 MOV r12,r0
0x000004FA F38E8800 MSR APSR_nzcvq,lr ; formerly CPSR_f
0x000004FE 4774 BXNS lr
```
According to Arm's "ARMv8-M Security Extensions: Requirements on
Develop...