> -----Original Message----- > From: > [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] > 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. _______________________________________________ AVR-GCC-list mailing list AVR-GCC-list@nongnu.org http://lists.nongnu.org/mailman/listinfo/avr-gcc-list