This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: Placing section at end of memory region
- From: Erik Christiansen <dvalin at internode dot on dot net>
- To: binutils at sourceware dot org
- Date: Wed, 29 Aug 2012 00:15:59 +1000
- Subject: Re: Placing section at end of memory region
- References: <503CC3CE.2080305@gmx.de>
- Reply-to: dvalin at internode dot on dot net
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"