RE: Re: static initializer
"Randall" <[email protected]>
| Newsgroups | gmane.comp.hardware.motorola.microcontrollers |
|---|---|
| Message-ID | <[email protected]> |
murphynetuk wrote : > I just created the 'Hello World' default C++ project from the MPC555 > stationary. I normally use C. > It compiles to 86kb. The MPC555 only has 26kb of RAM. > > Wow, I never realised C++ was so memory intensive... Yup, it's pretty fluffy. > --- In [email protected], "coles555" <coles555@y...> wrote: I apparently missed the original for this post. > > I have modified the initialization > > files so that the code/variables would be located within the MPC555 > > memory space. However, for some reason the _ctors and _dtors > doesn't > > go inside the code/variable memory range I have specified. Is there > > something special about the _ctors and _dtors variable? Again I'm not a C++/CW expert, but I would guess that they are put in a special segment. You probably told your linker where to put the text, data, etc. segments but not whatever segment holds _ctors and _dtors. > I don't > > understand why all the other variables are within the memory range > I have specified but those are not. I'd say the problem is that you're trying to put 10 pounds of stuff in a 5 pound bag. If you stomp it down in one place, it is going to poke up in another. The linker doesn't create memory holes on it's own ... if _ctors wound up that high in memory, then there is other stuff in there too and it simply won't all fit in the space you have. As Ian is implying, converting to C instead of C++ may be your only hope ... but you can try things like removing formatter and stream library calls from your code (which are implicit with C++ rather than explicit with C). Randall ------------------------ Yahoo! Groups Sponsor --------------------~--> Get Bzzzy! (real tools to help you find a job). Welcome to the Sweet Life. http://us.click.yahoo.com/A77XvD/vlQLAA/TtwFAA/dN_tlB/TM --------------------------------------------------------------------~-> ----------------------------------------------------------- To learn more about Freescale Microcontrollers, please visit http://www.freescale.com/mcu Yahoo! Groups Links <*> To visit your group on the web, go to: http://groups.yahoo.com/group/MPC500/ <*> To unsubscribe from this group, send an email to: [email protected] <*> Your use of Yahoo! Groups is subject to: http://docs.yahoo.com/info/terms/