This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: long-calls in ARM
- To: Rafael Rodríguez Velilla <rrv at tid dot es>
- Subject: Re: long-calls in ARM
- From: Nick Clifton <nickc at cambridge dot redhat dot com>
- Date: 10 Sep 2001 17:48:06 +0100
- Cc: "gcc at gcc dot gnu dot org" <gcc at gcc dot gnu dot org>
- References: <3B9CE4CE.FFA6497@tid.es>
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