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]
Other format: [Raw text]

Re: ARM thumb: why call_via_rX?


On Fri, 2002-01-25 at 13:35, Phil Blundell wrote:

> > Our CPU has an internal 8K static (fast) RAM, and external (slow) Flash.
> > So my collegue had the idea of copying the most time-consuming code into
> > the fast on chip RAM. So, of course, calls between non-copied and copied
> > code with bl (such as calling call_via_rX) fail horribly.
> 
> Ah, I see.  If this copying is done just once at startup and then the
> map stays fixed, you could write a custom linker script defining the
> right memory regions, and then PC-relative branches would "just work"
> (so long as the regions aren't too far apart, anyway).

Wouldn't work, I think, as (a) our Flash is mapped at 0x90000000 and the
SRAM at 0x0, and (b) at link time I don't know where in the Flash romfs
my binary is going to be. But for the simple case this would probably be
the best idea.

I thought about putting the SRAM routines in a special section, too, but
this falls flat in our case as we're using flat binaries which don't
know nuffin about sections.

greets from Zürich
-- vbi


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