Dear All How can I force the compiler to not generate the "BX LR" for the return function. I also set the option --ARM_only(in compiler + assembler + linker) but this is not useful and I have this code at last in axf file. my target in Keil is set to ARM7TDMI (I can not set my target to ARM7 or any other target without Thumb) so what can we do to prevent generate "BX LR"?
"but I want to solve it with the compiler options and not delete the return from the code!"
Why? Either way you must rebuild the code.
I don't think you can suppressed the generation of BX LR. Are you seriously suggesting that the compiler does not generate that instruction even if the programmer inserted a "return" at the end of the function, only because of a compiler switch?
What are you looking to have instead of the BX LR ?
Ok, we can have "MOV PC,LR" instead of "BX LD" or we can have "BL" , I want to have pure ARM instructions not ARM/Thumb instructions.