What is different of the function call and return manner between  ARM Linux kernel and ARM applications?

Note: This was originally posted on 29th August 2012 at http://forums.arm.com

Hi,

When I disassamble the ARM Linux kernel for ARMv7(tegra 2),I found that a lot of function return using ldm command,just like   ldm sp,  {fp, sp, pc},but in the applications ( SPECCPU2006 for arm),the function return mostly using bx or b.Why that happened? Is the kernel Makefile used some gcc arguments that can lead the compiler to optimize the kernel?
Parents
  • Note: This was originally posted on 29th August 2012 at http://forums.arm.com

    One note....
    The rules changed in v7. Per-v7 data processing instructions couldn't cause a state (ARM/Thumb) change. So "mov pc, lr" couldn't return you a function in a different instruction set. From v7 onwards, any data processing instruction with the pc as the destination CAN change state. So  it now doesn't matter.
Reply
  • Note: This was originally posted on 29th August 2012 at http://forums.arm.com

    One note....
    The rules changed in v7. Per-v7 data processing instructions couldn't cause a state (ARM/Thumb) change. So "mov pc, lr" couldn't return you a function in a different instruction set. From v7 onwards, any data processing instruction with the pc as the destination CAN change state. So  it now doesn't matter.
Children
No data
More questions in this forum