avr-gcc-list
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [avr-gcc-list] gcc: putting a variable in a certain section


From: Torsten Mohr
Subject: Re: [avr-gcc-list] gcc: putting a variable in a certain section
Date: Fri, 25 Apr 2003 22:03:11 +0200
User-agent: KMail/1.4.3

Hi,

> >But i still wonder:
> >
> >int __attribute__((section("ramsection"))) ramvalue = 0xdead;
> >                                                      ^^^^^^
> >
> >"ramvalue" is located in RAM, but where is the "0xdead"?
>
> Where you requested it to be: in section "mysection" of your ELF
> file.  It's your responsibility to extract it from there.

hmm, this is not yet what i'd expect.  Maybe i'm wrong, but:
When i put a variable WITH initial value into RAM:

int abc = 0x1234;

Then there should be TWO sections involved, one in RAM where
2 bytes for the int are reserved and another section in ROM
somewhere, where the initial value is stored (also two bytes).
The startup code should then copy this section into RAM, so
all values WITH initial values get their initial values.

But how is this done, if i place a variable WITH initial
value in an own section?


Best regards,
Torsten.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]