RE: Re: static initializer

"Liechty Ronald-RAT109" <[email protected]>
Newsgroups gmane.comp.hardware.motorola.microcontrollers
Message-ID <A100FEB1DF38CC4C9D0B6BFBDC134426022F132C@az33exm21.fsl.freescale.net>
For all,

This was posted on our forums for the answer.


You control the location of _ctors and _dtors in the linker command
file. For example, assume that a valid address would be 0x00400000, you
would do something like 

MEMORY { 
... 
start_of_ctors : org = 0x00400000 
} 

SECTIONS { 
... 
.ctors : {} > start_of_ctors 
.dtors : {} > start_of_ctors // .dtors will start at the end of .ctors 
} 

_ctors will be the first address in .ctors and _dtors will be the first
byte in .dtors. 


--  
Ron Liechty  
Ombudsman Freescale Developer Technology
[email protected] 




-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf
Of coles555
Sent: Thursday, October 20, 2005 4:33 PM
To: [email protected]
Subject: [MPC500] Re: static initializer

I think you are right about the PB board not having enough memory for 
C++ code. But it's wierd that only _ctors and _dtors are ones outside 
of memory range. Everything else seems to be within bound when I view 
the global variables address.

Lei

--- In [email protected], "murphynetuk" <murphynetuk@y...> wrote:
>
> > 
> > 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
> >
> 
> Commenting out the <iostream> stuff took it down to 2.2kb.
> Replacing it with printf took it back up to 16kb.
> 
> And there was I thinking that printf was bloated...
> 
> Ian
>







-----------------------------------------------------------
To learn more about Freescale Microcontrollers, please visit
http://www.freescale.com/mcu


 
Yahoo! Groups Links



 



------------------------ Yahoo! Groups Sponsor --------------------~--> 
Fair play? Video games influencing politics. Click and talk back!
http://us.click.yahoo.com/T8sf5C/tzNLAA/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/
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.