[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [avr-gcc-list] Data in .noinit isn't seen by linker

From: Andrew M. Cullen
Subject: Re: [avr-gcc-list] Data in .noinit isn't seen by linker
Date: Wed, 26 Oct 2005 21:40:38 -0400

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".


----- Original Message ----- From: "Erik Christiansen" <address@hidden>
To: "Andrew M. Cullen" <address@hidden>
Cc: <address@hidden>
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

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. ;)


_,-_|\    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

reply via email to

[Prev in Thread] Current Thread [Next in Thread]