__attribute__((naked)) doesn't bx lr
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
GNU Arm Embedded Toolchain |
Invalid
|
Undecided
|
Unassigned |
Bug Description
All was good wrt reg allocation, just missing the bx back at the end of the function. Result is it walks in to the next function (bad).
__attribute_
void myfunc()
{
static int x=1;
x++;
}
gcc version 5.3.1 20160307 (release) [ARM/embedded-
U Tools for ARM Embedded Processors)
arm-none-eabi-gcc -O2 -c minimal.c
arm-none-
minimal.o: file format elf32-littlearm
Disassembly of section .text:
00000000 <myfunc>:
0: e59f2008 ldr r2, [pc, #8] ; 10 <myfunc+0x10>
4: e5923000 ldr r3, [r2]
8: e2833001 add r3, r3, #1
c: e5823000 str r3, [r2]
10: 00000000 .word 0x00000000
tnx
Hedley
Changed in gcc-arm-embedded: | |
status: | New → Invalid |
Also, it was compiled on an ubuntu 16.04 LTS machine.
uname -r
4.4.0-22-generic