At 08:59 AM 9/9/2005, you wrote:
Hi,

I'm trying to understand how .dtors and .ctors are handled in 68k code
so that i can try to apply the process to ARM (which seems to not support
global object construtors), but the MAP file don't contain them.

In CW 68K files,

1) all of the constructors from a source file are called from a single block of code that's output as an "__InitCode__" symbol. 2) the linker combines all of these into one long function called __InitCode__ which gets called by the runtime. 3) as constructors are called by __InitCode__, references to the destructors of objects are passed to __register_global_object, which will let the routine __destroy_global_chain call destructors in reverse order at application exit.

Look in PalmOS_GlobalDestructors.c and PalmOS_Startup.cpp for details, especially the comment before __InitCode__.

GCC's method for startup has little resemblance to CodeWarrior.

-- Ben Combee, Senior Software Engineer, Palm, Inc.
   "Combee on Palm OS" weblog: http://palmos.combee.net/
   Developer Forum Archives:   http://news.palmos.com/read/all_forums/


--
For information on using the PalmSource Developer Forums, or to unsubscribe, 
please see http://www.palmos.com/dev/support/forums/

Reply via email to