long-calls in ARM
Nick Clifton
nickc@cambridge.redhat.com
Mon Sep 10 09:49:00 GMT 2001
Hi Rafael,
> Would it be very difficult to allow gcc decide when does it have to
> do long-calls and when not?
It is impossible for gcc to automatically decide when it has to make
long calls, since it cannot know where the functions and their callers
are going to end up. (This decision is only made at link time),
The command line switch -mlong-calls however does exist and will tell
gcc to make every function call a long call. This is the safe thing
to do and probably the easiest solytion to your problem.
There is also an arm specific function attribute called "long_call"
which you can use to specifically label function which need to be
treated as long calls. This does mean however that you will have to
go through and individually annotate all of the long call functions'
prototypes.
(Alternatively you could use -mlong-calls and then annotate functions
which only need the short call sequence by using the function
attribute "short_call").
Cheers
Nick
More information about the Gcc
mailing list