Placing section at end of memory region
Erik Christiansen
dvalin@internode.on.net
Tue Aug 28 14:57:00 GMT 2012
On 28.08.12 15:12, Johannes Bauer wrote:
> Hello list,
>
> I'm currently stuggling with a linker script on arm-none-eabi with
> binutils 2.21.1. I'm trying to place an array at the end of a memory
> region, specifically I want to align the ".stack" section to the end of
> SRAM my target offers.
>
> The problem is "skipping" memory, which doesn't yield the results I
> expect it to yield. After my data and bss segment definitions, I have:
>
> __ramend = ORIGIN(SRAM) + LENGTH(SRAM);
> . = __ramend - 256;
> .stack (NOLOAD) : {
> __stacktop = .;
> . = ALIGN(4);
> *(.stack)
> . = ALIGN(4);*/
> __stack = .;
> } >SRAM
Have you tried placing the address expression where it explicitly sets
the output section's VMA?, i.e. delete line 2, and edit line 3:
.stack (__ramend - 256) (NOLOAD) : {
(See "3.6.3 Output Section Address", and "3.6.1 Output Section
Description" of "info ld")
Hacking the start address via location counter setting can be made to
work, but is inelegant. (And not as easy, either. ;-)
Erik
--
If what they've been doing hasn't solved the problem, tell them to
do something else.
- Gerald Weinberg, "The Secrets of Consulting"
More information about the Binutils
mailing list