[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
Even though the processor is unable to make a relative jump directly between the extremities of a code section larger than 32K, it is still possible to use such a code section if you are willing to indulge in manual heroics to help the compiler avoid needing to make such an extreme function call.
Note that a code section corresponds to a code
resource in your
project's final Palm OS database, and the maximum size for any kind of
resource is still limited to approximately 64K by the Palm OS memory manager
and the HotSync protocol.
Some of the heroic techniques are:
foo_aux()
that just call the real function foo()
with the same arguments and which can be placed anywhere, thus effectively
giving each such foo()
two entry points and loosening the constraints
on the arrangement problem. Or use the assembly language equivalent of a
proxy function, which can avoid remarshalling the arguments and really be
a jump.
The maximum size of the main code section is specified in the linker
script and enforced during linking (see section `Linker Scripts' in Using ld). You can override the default script's
32K size by using the -T script
linker option.
Two suitable linker scripts, which can be used as is or copied and modified,
are already provided, both allowing a .text
section of up to
approximately 64K:
-T text_64k
-T text_64k_palmos3
There is, of course, some risk in going right up to the maximum resource
size limits. In practice, the limit has typically been increasing with
each new version of Palm OS, and has never decreased. Nonetheless, it may
be wise to use text_64k
even if you plan to target only Palm OS 3.0
and higher devices.
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |