|
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 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!
[Prev in Thread] | Current Thread | [Next in Thread] |