This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Prevent to generate "BX LR"

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"?

Parents
  • The goal with C/C++ is that the programmer should not be in control of generated machine code instructions.

    I do not mean to change the compiler or rewrite it!!, I only want to know how we can prevent the compiler to generate a ARM/Thumb code when we want it to produce the code for ARM_only target!
    return or not-return from a function is not my concern at all. I only want to tell the compiler not to generate the BX command. this is all the story!

Reply
  • The goal with C/C++ is that the programmer should not be in control of generated machine code instructions.

    I do not mean to change the compiler or rewrite it!!, I only want to know how we can prevent the compiler to generate a ARM/Thumb code when we want it to produce the code for ARM_only target!
    return or not-return from a function is not my concern at all. I only want to tell the compiler not to generate the BX command. this is all the story!

Children