> At 05:43 PM 4/14/2004, you wrote: > >My app passes the limit of 32K and I use smart model to overcome that limit. > >Anyway, for some reason, if I move one of the functions from one file to > >another file, the app crashes when that function is called. > >When I move it back, it works. This function is called when there is no > >global data, but it does not use global data at all. > > Calling a function in another section uses global data, as the intersection > jump table is stored with the global variables. >
Thanks, Ben. I would like to understand more : in the case of no global data available, how can a user-defined function calls another from the system library ? In that case, how would we explain about the jump table ?
Calls within a single segment are done by PC-relative addressing. Calls from one segment to another are done by jumping to an instruction in a jump table stored in the global variable region. Calls to the OS are done using TRAP instructions with specific values. A call to a system shared library is also done using a TRAP, invoking an unnamed OS function that calls to the correct library function using the library's dispatch table.
-- Ben Combee, senior DTS engineer, PalmSource, Inc. Read "Combee on Palm OS" at http://palmos.combee.net/
-- For information on using the Palm Developer Forums, or to unsubscribe, please see http://www.palmos.com/dev/support/forums/
