In article <81941@palm-dev-forum>, [EMAIL PROTECTED] says... > > At 8:53 PM +0100 2002/03/28, Aaron Ardiri wrote: > > i was getting crashes with codewarrior built resources.. why? dunno. > > but, it was crashing - and, this was the fix. the fix still applies > > for cw release 8. > > If memory serves... the first thing those extra instructions do is a push > onto the stack. So, if your stack pointer hasn't been set up, or your stack > is full, that would obviously cause it to explode. Does that sound like a > possibility in your situation? Just curious. > > Long ago, before we added a hardware abstraction layer to the Palm OS, we > devised a method of customizing the OS boot sequence by looking for additional > ROM code tokens and executing token's data as 68k code. Generating the token data > via CodeWarrior added extra stuff to the code resource starting with CW Pro 5 > (...I think, plus or minus a version number). This was not a problem, except for > the very first pre-RAM initialization token... because at that point in the boot > sequence there was no stack (yet). So, the code pushed, the device crashed, and > it sure wasn't fun debugging... nor was developing a code-resource-to-code-token > tool work-around! :oP
The __DummyStartup__ code at the beginning of code segments was added to allow the entry point for a segment to be located anywhere in the segment, not just at the start. The stack pushes you're seeing are the first half of a far jump, followed by the RTS that goes to the location. Since this lets you put the entry point/dispatch table in the middle of your shared library without having a linking problem, I doubt it will change, but the optimization to avoid the dummy if __Startup__ was going to be first anyway is one I'd like to make for V9. -- Ben Combee <[EMAIL PROTECTED]> CodeWarrior for Palm OS technical lead -- For information on using the Palm Developer Forums, or to unsubscribe, please see http://www.palmos.com/dev/support/forums/
