[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

3.1 Size limitations for a single code resource

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:

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
Up to 64720 bytes, the maximum resource size supported by all versions of Palm OS to date.

-T text_64k_palmos3
Up to 65505 bytes, the maximum supported by Palm OS version 3.0 and higher.

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] [ ? ]

This document was generated by Stephen Zander on April, 18 2003 using texi2html