[Top][All Lists]

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

Re: [avr-gcc-list] Order of variables placed in .data and .bsssections

From: Raj Sharma
Subject: Re: [avr-gcc-list] Order of variables placed in .data and .bsssections
Date: Tue, 20 May 2008 13:16:44 -0700 (PDT)

Dear Eric,

Thanks for the reply. I am working on incremental compilation/linking. One of the requirements is to maintain maximum similarity between the old and new versions of the binary image.

----- Original Message ----
From: "Weddington, Eric" <address@hidden>
To: Raj Sharma <address@hidden>; Preston Wilson <address@hidden>; avr-gcc-list <address@hidden>
Sent: Tuesday, May 20, 2008 2:30:13 PM
Subject: RE: [avr-gcc-list] Order of variables placed in .data and .bsssections

> -----Original Message-----
> From:
> avr-gcc-list-bounces+eweddington=address@hidden
> [mailto:address@hidden
> org] On Behalf Of Raj Sharma
> Sent: Tuesday, May 20, 2008 12:51 PM
> To: Preston Wilson; avr-gcc-list
> Subject: Re: [avr-gcc-list] Order of variables placed in
> .data and .bsssections
> Dear Preston,
> Thanks for the suggestion. But I want the solution to work
> for program of any size, any number of global variables.

If you are looking for a general-purpose solution then I don't think
you'll find one. Even if you use -fdata-sections you will have to have a
custom linker script, per application. Using Preston's suggestion of
putting the variables in a structure is better than using
-fdata-sections as you don't need a custom linker script. (It's a good
suggestion, btw.)

For more information on -fdata-sections see the GCC User Manual. For
more information on writing linker scripts see the GNU ld manual which
is part of the GNU Binutils User Manual.

Again, why do you need to have these variables in a specific order
within memory? Most applications that I'm aware of don't need to have
such requirements.

reply via email to

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