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

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

[avr-gcc-list] Allocation sequence of eeprom variables


From: Juergen Harms
Subject: [avr-gcc-list] Allocation sequence of eeprom variables
Date: Mon, 20 Aug 2012 16:18:31 +0200
User-agent: Mozilla/5.0 (X11; Linux i686; rv:10.0.6esrpre) Gecko/20120717 Thunderbird/10.0.6

I am presently switching from a rather obsolete version of avr-gcc (1.6.1, downloaded as a tarball) to a much newer one (4.6.2, available in an rpm package on my Mageia distribution),

I am having a lot of small-fry but work-intensive problems (risk of editing new bugs into my code) - such as the need to declare progmem variables with "const"- and some annoyance with "-Wuninitialized" warning messages when declaring external variables wich have been perfectly correctly defined and initialised in their target module.

My question here is a problem which I have not solved yet: the old version of gcc (1.6.1) allocates eeprom variables in the sequence they appear in the source code to increasing addresses. The new one does the allocation in the opposite order (within each object-code module): the first wariable goes to the last address of the module within the .eeprom section etc.

Since I use eeprom to preserve data between different executions, that creates serious problems if - between two runs - I reload the executable code - once generated by my old gcc, once generated by my new one, eeprom variables being compiled into different locations.

Any advice how to deal with this problem? Thanks!



reply via email to

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