"Michael Glickman" <[EMAIL PROTECTED]> wrote in message
news:71623@palm-dev-forum...
>
>
> -----Original Message-----
> From: Ben Combee [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, 19 December 2001 3:47 AM
> To: Palm Developer Forum
> Subject: Re: Reference to function address
>
> > If MyFunc is in a different segment, the address is retrieved from
the
> > global jumptable, again using a constant offset, but now from the
global
> > register (usually A5).  The jumptable is structured as a series of
JMP
> > instructions, but the opcode can be skipped to get the actual
address.
>
> > You can get a relative value after compilation by looking at the
linker
> > map file, but that will only tell you how far into a segment the
> > function is.  You can't determine the true location until runtime,
> > because when your application isn't running, its segments are
unlocked
> > and may move around memory.
>
> Are you sure this applies to PRC tools.

No... I've not analysed the output of PRC tools.

> If you look at assembler code produced by GCC,
> you migh find that it makes long call straight
> away, without passing control to a jump table.
>
> This is how it appears to me, though like Max,
> I am much more confident with i386 assembler,

Are you looking at the output before or after link?  If its after link,
did you check to see that the target of the jump wasn't a stub using
some sort of jump table?  The problem with a direct jump is that it
would require the runtime library to physically modify the segments in
memory, which makes the code really hard to put into ROM or a storage
card.



-- 
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palmos.com/dev/tech/support/forums/

Reply via email to