At 02:37 PM 6/18/2000, Alfred Salton wrote:
>We have reached a size limit beyond which our code will no longer compile,
>apparently when the code resource is ~32k. We are using GCC/PRC Tools. Can
>anyone provide me with an example of creating multiple code resources, or
>any other advise on the problem?
If you carefully arrange your code, it should be possible to continue to use a single
segment without exceeding the 32K jump limit. Functions which use long math will need
to be within 32K of the long math routines at the start of the segment. Indexing into
arrays of structs will often use long math. You can avoid this by using an array of
pointers. You'll also need to make sure any function you write isn't called by another
function that's more than 32K away.
Eventually, this gets to be a pain, or you reach the 64K segment limit, at which point
you have to choice but to switch to multi-segment. The knowledge base is a good place
to start for that. The tricky part is making sure all the code that has to be in the
first segment actually is there. If you miss something, the error you get isn't very
informative. There are some neat tricks for verifying that you got all the code in the
right place.
--
Peter Epstein
Palm Inc. Developer
--
For information on using the Palm Developer Forums, or to unsubscribe, please see
http://www.palmos.com/dev/tech/support/forums/