On 2014-12-08, Nicholas Clifton <ni...@redhat.com> wrote:
> Hi Peter,
>> Nick: Are you saying that the linker scripts are changing so that a global
>> variable definition like this:
>> int myvar = 43;
>> will result in myvar being stored in RAM, and no initialization of it so
>> the value of myvar when main starts is not 43?
> No.  I am saying that myvar will be stored in the .data section of the
> executable image and that its value in this image, will be set to 43. 
> In addition the section header for the .data section will be set to an 
> address in RAM, so that when the executable is loaded into the MCU's 
> memory the correctly initialised variable will be ready to be used.

That makes no sense.  Code is is flash.  On startup, where is that 43
going be?  If it's not in flash, where?

> What has changed is the presumption of where the executable is stored
> before it starts executing.
> Previously there was an implicit assumption that the executable would
> be stored in the ROM of the system and that at program startup there
> would have to be an explicit copying of data from the ROM image into
> RAM.

That's how embedded microprocessors that run from flash _work_.

> With the current linker scripts there is an assumption that the
> executable is stored externally, and it is brought into system memory
> before execution begins.

So you're assuming that an MSP430 with a few KB of flash and a few
hundred bytes of RAM is running some sort of OS that's going to load
the program from disk into RAM and run it?

> With this scenario there is no need to copy data between ROM and RAM
> as the data is just loaded directly into RAM.

By _WHAT_?

Grant Edwards               grant.b.edwards        Yow! Life is a POPULARITY
                                  at               CONTEST!  I'm REFRESHINGLY
                              gmail.com            CANDID!!

Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
from Actuate! Instantly Supercharge Your Business Reports and Dashboards
with Interactivity, Sharing, Native Excel Exports, App Integration & more
Get technology previously reserved for billion-dollar corporations, FREE
Mspgcc-users mailing list

Reply via email to