<rant>
Unfortunately the multisegmenting gods have not answered my prayers.  I
ended up adding another segment besides the one I was having problems with.
This new segment has no problems and reduces the size of my main segment
enough that I could add the code in the problem segment back into the main
segment and still be ok on size.  With no change to the problem segment
code, just adding it back to the main segment, it now runs great.

I traced the fatal error in the problem segment down to a call I was making
to a function that was located back in the main segment.  Funny thing was, I
had made a call to the same main-segment function earlier in the current
new-segment function and returned with no errors.  Also, after taking out
the problem function call, I could then call into a different function in
the problem segment and it would run about halfway and then fatal error when
calling a different function back in the main segment.

Unanswered questions:
- Why do I blow up in the new segment when calling functions back in the
main segment?  Could this still be a size related issue even though
everything compiles and links correctly?
- Other than with other launch codes, are there any problems accessing
globals declared in one segment (main or added) from a different segement?
I am doing this but I never saw any documentation that says it is ok or not
ok to do so.  ie: do all program globals have to be declared in the main
segment and then externed in other segments where they are used?

So for now I am running ok after taking out the problem segment and using a
new segment that doesn't have problems.  I don't like not knowing why the
other way doesn't work though.  If anyone actually reads all of this and has
some insight please drop me a line.
</rant>

Thanks

"trevor" <[EMAIL PROTECTED]> wrote in message
news:37784@palm-dev-forum...
>
> I've been trying to break up a large application into multiple segments
with
> the PRC tools.  I created a .def file, added the section attribute to
> function declarations, used multigen to create assembly stub and linker
> script, linked everything together.  Wahoo, after working out some kinks
> everything linked happily.
>
> HOWEVER, now when I run the app it fatal errors immediately:
>     MemoryMgrNew.c, Line:4128, Invalid handle.
> The actual code has not changed, just the added segment.
>
> So I still must be missing something in the process.  I tried to use the
> debugger to determine where the blowup occurs, but it seems to happen
before
> I even hit PilotMain().
>
> Any hints from those of you more experienced in this area are greatly
> appreciated.
>
>
>
>



-- 
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