[Top][All Lists]

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

Re: [avr-gcc-list] Maximum Object File Alignment

From: E. Weddington
Subject: Re: [avr-gcc-list] Maximum Object File Alignment
Date: Tue, 19 Nov 2002 09:25:15 -0700

On 19 Nov 2002 at 10:06, Robert Latham wrote:

> I am trying to create a global array in program memory (flash) to
> which I wish to write using spm.   The array needs to be aligned to
> the flash pages.   So I have a declaration as follows:
> __attribute__ ((progmem, aligned(128)))
> unsigned char gucArray[ARRAY_SIZE] =
> {
> <lots of bytes>
> };
> In response the compiler issues the warning:
> "Warning: alignment of `gucArray' is greater than maximum object file
> alignment. Using 1."

I tried it too and got the same thing.

An alternative solution, since you're putting the array in Flash, 
would be to give the variable a "section" attribute which puts the 
array in its own named section. Then in your linker flags you can 
relocate this named section to any address in the Flash.


> Bruce's post did suggest one way out - creating the array in
> assembler. 
>   However, I can't find any *comprehensive* documentation of the gcc
> in-line assembler, so whilst I've figured out how to create in-line
> assembler functions, I've no idea how to create and reference (from C
> or in-line assembler functions) a global variable defined in
> assembler.   Can anyone point me in the right direction please?

GNU Manuals Online:

At this site, look for:
gas = GNU Assembler
ld = GNU Linker
gcc = GNU Compiler

avr-gcc-list at http://avr1.org

reply via email to

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