This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Placing section at end of memory region
- From: Johannes Bauer <dfnsonfsduifb at gmx dot de>
- To: binutils at sourceware dot org
- Date: Tue, 28 Aug 2012 15:12:46 +0200
- Subject: Placing section at end of memory region
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
The "__ramend" (absolute) definition is placed where I expect it to be.
However, __stacktop in my case is not at the end of SRAM, but right
after .bss (i.e. __bss_end__ == __stacktop and __stacktop + 256 ==
__stackend).
The statement ". = __ramend - 256;" doesn't seem to have the effect that
I'd expect it to have (i.e. advancing the current location to 256 bytes
before the end of the SRAM region). Results are exactly the same, no
matter if I have it in or comment it out.
Can you please give me clues on how to modify the script to do what I
want it to do?
Thanks in advance,
Best regards,
Johannes