[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[avr-gcc-list] Data in .noinit isn't seen by linker
From: |
Andrew M. Cullen |
Subject: |
[avr-gcc-list] Data in .noinit isn't seen by linker |
Date: |
Wed, 26 Oct 2005 20:13:33 -0400 |
Hi,
I'm trying to put a structure into the ".noinit" space and I'm getting a
complaint from the linker. Here is my ".h" definition.
struct my_dsl_s {
unsigned char state;
...
};
struct my_dsl_s my_dsl __attribute__ ((section(".noinit")));
Compilation and linking is normal when I don't have the "attribute"
addition to the data-type definition, but with this addition I get numerous
complaints from the linker for each .c module that includes this .h file. It
says there are multiple definitions for the variable even though there are
preprocessor guards up for the .h file. For example
Linking: dsl_modem.elf
c:/cygwin/usr/local/bin/avr-gcc -mmcu=atmega32 -I. -gdwarf-2 -g3 -Os -funit-at-a
.....
dal.o: In function `dsl_init':
/home/reckless/Hades/dal.c:19: multiple definition of `my_dsl'
./main.o:/home/reckless/Hades/main.c:62: first defined here
dal.o: In function `dsl_init':
Do I need to inform the linker about this section? (noinit). From the
avr-libc docs it seems that this section is predefined but based on the
compiler output it seems it doesn't know what to do with this section.
Any help???
Thanks
Andrew
Re: [avr-gcc-list] assert.h not available!?, Dave Hansen, 2005/10/29