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





_______________________________________________
AVR-GCC-list mailing list
[email protected]
http://lists.nongnu.org/mailman/listinfo/avr-gcc-list

Reply via email to