This is the mail archive of the
ecos-discuss@sourceware.org
mailing list for the eCos project.
Variable in uninitialized part of ram
- From: Robert Brusa <bob dot brusa at gmail dot com>
- To: MailingList:ecos-discuss <ecos-discuss at ecos dot sourceware dot org>;
- Cc: Bob dot Brusa at gmail dot com
- Date: Wed, 17 Dec 2008 21:05:21 +0100
- Subject: [ECOS] Variable in uninitialized part of ram
- Reply-to: Bob dot Brusa at gmail dot com
Hi
I am trying to put a variable into a separate segment of ram that will not
be initialized. I have tried a lot, but I always get errors from the
linker - errors I simply do not understand. Here is what I do:
In the source code I define the variable nvv of type nvv_t with the
statement:
nvv_t nvv __attribute__ ((section ("sticky"))); //non-volatile position
and mode/submode-info
In the linker file provided by eCOS I add two lines. The first one is:
sram (!IW): ORIGIN = 0x0020FF00, LENGTH = 0x00100
It goes between ram and rom-defining lines of the region definitions
(MEMORY)
and the line
.sticky ALIGN (0x4) : { *(.sticky) } > sram
goes into the SECTIONS - just following the .bss-line.
The linker then produces the following error-listing:
Building target: ifw
Invoking: GCC C Linker
arm-elf-gcc -nostartfiles -L/home/rwb/lw4/install/lib -Ttarget.ld
-mcpu=arm7tdmi -Wl,--gc-sections -Wl,-static -g -nostdlib -Xlinker -Map
-Xlinker ifw.map -o"ifw" ./Alignment.o ./EEProm.o ./Log.o ./RPC.o
./ictrl.o ./ihw.o ./link.o ./motoren.o ./myastro.o ./novas1.o ./novascon.o
./rtc.o ./solsys3.o ./sun.o ./trackdefs.o ./util.o
/opt/ecos/gnutools/arm-elf/bin/../lib/gcc-lib/arm-elf/3.2.1/../../../../arm-elf/bin/ld:
warning: no memory region specified for section `sticky'
/opt/ecos/gnutools/arm-elf/bin/../lib/gcc-lib/arm-elf/3.2.1/../../../../arm-elf/bin/ld:
address 0xc620 of ifw section .bss is not within region ram
collect2: ld returned 1 exit status
make: *** [ifw] Fehler 1
Please help.
Robert
--
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss