This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: long-calls in ARM


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]