Re: Align Data and RAM Gaps

"Thomas D. Dean" <[email protected]>
Newsgroups gmane.comp.hardware.avr.gcc
Message-ID <[email protected]>
On 08/09/14 01:18, Erik Christiansen wrote:

Thanks for the reply.  Interesting.

I think the solution I will use is to put the buffer between __bss_end 
and the stack.

Initializing in C:

extern unsigned int __bss_end;
...
buffer_base = (uint8_t *)(__bss_end & 0xff80) + 0x80
buf_head_ptr = spi_buffer_base
buf_tail_ptr = spi_buffer_base


etc.

I have a gap, but, it is on the order of 20 bytes.

The order of allocation of variables by ld is curious.  The ldscripts 
give order to the sections.  Moving variable declarations around seems 
to have little or no effect on the order I see from avr-nm.

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.