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: Philip Blundell <philb at gnu dot org>
- Date: Mon, 10 Sep 2001 19:25:41 +0100
- Cc: "gcc at gcc dot gnu dot org" <gcc at gcc dot gnu dot org>
- References: <3B9CE4CE.FFA6497@tid.es>
> 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