Align Data and RAM Gaps

"Thomas D. Dean" <[email protected]>
Newsgroups gmane.comp.hardware.avr.gcc
Message-ID <[email protected]>
I have a combined C and AS application.  I have to use AS because of the 
time restraints.

I have a 256 byte buffer that is accessed with two pointers, head and tail.

In the AS code, I want to only save the low order byte of the pointer. 
This is do-able, if the buffer is aligned at 0x0100.

In the C file,
char buf[256] __attribute__ ((aligned (256)));
In the AS file,
.global buf

Looking at the map file, I see

   0x0000000000800100                tx_buf_head_ptr
   0x0000000000800200                buf
   0x0000000000800300                rx_buf_tail_ptr
   0x0000000000800302                tx_buf_tail_ptr

There is a gap of 254 bytes.

How do I avoid this gap?  What determines the linker allocation order?

Tom Dean
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.