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


>  Would it be very difficoult to allow gcc decide when does it have to
>do long-calls and when not?

Impossible, in fact.  The compiler doesn't know at the time it generates the 
code what the relative positions in memory will be of the caller and the 
callee.

It would be possible to add code to the linker to synthesize a long call stub if 
it turned out that a branch was out of range, similar to how glibc's dynamic 
linker handles R_ARM_PC24 branches between shared libraries.  There would be a 
run-time performance hit for this, so you'd need to judge whether you'd get better 
results than by just turning on -mlong-calls and taking the overall hit; 
obviously it depends on the mix of long and short calls in your application. 

p.


PGP signature


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