This sounds like the same problem I ran into many years ago. You should not have to rearrange your code segments and functions to get things to work, as that's what a multisegmented app is supposed circumvent the need for.
Sometimes, GCC's linker would incorrectly fail complaining of 16-bit jumps that were out of range when in fact a dump of the assembly showed that the lines it complained about were just fine. It seemed to get confused, I recall, because the jumps used a symbol that was not PC-relative (the symbol was in the data segment) but the linker treating the label as if it were in the code segment. Originally, I used a text filter to replace the calculated offsets in the assembly with a few lines that explicitly added the module table offsets in a register before dereferencing them, but later I found multilink, which replaces the GCC linker and gets everything working in one easy step: http://www.djw.org/product/palm/multilink/ -V -- For information on using the PalmSource Developer Forums, or to unsubscribe, please see http://www.palmos.com/dev/support/forums/
