I'm currently working on a fairly large C++ application in CW that uses the POL library. Our application was working fine in the emulator; however when testing on a real device, we got a fatal exception when installing.
I reinstalled the app in the emulator and did a soft reset and verified that the application throws a fatal exception when any "non-standard" launch code is fired. I rechecked that my segment 1 contains all the necessary components (i.e., runtime library, CApp, all classes called from PilotMain, etc.). The debugger showed a stack trace that was random in that sometimes it said the crash occurred in ClassA::methodA while other times it said ClassA::methodB or ClassB::methodA. Based on these findings, I suspect my PRC file is corrupt (more specifically my Segment 1 is greater than 64 KB even though the link map says otherwise). I tried to take more control over linking by disabling the option 'Merge compiler glue into Segment 1' in the 68k Linker panel. Of course, I received many link errors, but what concerns me now is that it looks like all the glue code is placed in a virtual segment right after the ones defined in CW. For example, if I have 6 segments defined in CW then it looks like a segment 7 is created to contain things like PilotMain, startup routines, etc. (i.e., the stuff that usually makes it into Segment 1). My problem is that I have other segments defined in the project using: #define GNU_SEGMENT So in my example, the linker is putting this glue code into a segment just after the ones defined in CW but it's also placing my #define GNU_SEGMENT into this same segment too causing the segment to be larger than 64 KB. Now my questions:-) 1. Any [other] ideas why an app would launch fine with sysAppLaunchCmdNormalLaunch but throw a fatal exception when launched with other launch codes (i.e., sysAppLaunchCmdSyncNotify, etc.)? 2. What exactly happens when disabling the 'Merge compiler glue into Segment 1' option? The Targeting "Targeting_Palm_OS.pdf" document mentions this option, but doesn't really explain all the details. 3. After disabling the 'Merge compiler glue into Segment 1' option, how can I force which segment this glue code gets placed into? For reference I'm using the latest release of CW9 (all patches applied). Thanks, -Mark -- For information on using the Palm Developer Forums, or to unsubscribe, please see http://www.palmos.com/dev/support/forums/
