I will try the extern declarations and report back but I can tell you now that the following creates no errors

struct my_dsl_s my_dsl __attribute__ ((section(".foobar")));

This is why I was wondering if I needed to add section information to the linker command file for "noinit".

Andrew


----- Original Message ----- From: "Erik Christiansen" <[EMAIL PROTECTED]>
To: "Andrew M. Cullen" <[EMAIL PROTECTED]>
Cc: <[email protected]>
Sent: Wednesday, October 26, 2005 9:26 PM
Subject: Re: [avr-gcc-list] Data in .noinit isn't seen by linker


On Wed, Oct 26, 2005 at 08:13:33PM -0400, Andrew M. Cullen wrote:
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 my_dsl __attribute__ ((section(".noinit")));

Have you tried:

In one file:
struct my_dsl_s my_dsl __attribute__ ((section(".noinit")));

In all others:
extern struct my_dsl_s my_dsl __attribute__ ((section(".noinit")));

This works for me with the gnu toolchain in this situation, though
currently on another target, I'll admit. (And I'm not doing
-funit-at-a-time)


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.

Nope. If ld didn't know about .noinit, you'd see an error like:

error: no memory region specified for loadable section `.noinit'

(Try using __attribute__ ((section (".chook"))) , for example. ;)

hth,
Erik

--
_,-_|\    Erik Christiansen                    Phone: +61 3 9264 3416
/      \   Technology Group                       Fax: +61 3 9264 3438
\_,-.__/   Key Systems Development
     v    NEC Business Solutions Ltd.          www.necbs.com.au




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

Reply via email to