Arm Community
Site
Search
User
Site
Search
User
Support forums
Arm Development Studio forum
What is different of the function call and return manner between ARM Linux kernel and ARM applications?
Jump...
Cancel
Locked
Locked
Replies
4 replies
Subscribers
119 subscribers
Views
3417 views
Users
0 members are here
Options
Share
More actions
Cancel
Related
How was your experience today?
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
What is different of the function call and return manner between ARM Linux kernel and ARM applications?
Heron Zhang
over 12 years ago
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
Martin Weidmann
over 12 years ago
Note: This was originally posted on 29th August 2012 at
http://forums.arm.com
I think it may just be the functions you looked at.
There are several ways to return from a function in ARM/Thumb. The most common (at least in my experience) are "BX lr" and "LDM sp!, {...., sp}". Although the second one often gets written as "PUSH {....., pc}" depends on which tools you are using. I suspect if you kept looking long enough you would find examples of each in both the kernel and the app.
The "B ..." is a little more interesting. I suspect that this is a compiler optimization called "tail calling" - again there is no reason why you this couldn't be present in both the kernel and the app.
http://en.wikipedia.org/wiki/Tail_call
Cancel
Vote up
0
Vote down
Cancel
Reply
Martin Weidmann
over 12 years ago
Note: This was originally posted on 29th August 2012 at
http://forums.arm.com
I think it may just be the functions you looked at.
There are several ways to return from a function in ARM/Thumb. The most common (at least in my experience) are "BX lr" and "LDM sp!, {...., sp}". Although the second one often gets written as "PUSH {....., pc}" depends on which tools you are using. I suspect if you kept looking long enough you would find examples of each in both the kernel and the app.
The "B ..." is a little more interesting. I suspect that this is a compiler optimization called "tail calling" - again there is no reason why you this couldn't be present in both the kernel and the app.
http://en.wikipedia.org/wiki/Tail_call
Cancel
Vote up
0
Vote down
Cancel
Children
No data