This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
ld - access a memory address from linker script
- From: Martin Velek <martin dot velek at gmail dot com>
- To: binutils at sourceware dot org
- Date: Fri, 26 Jun 2015 14:16:34 +0200
- Subject: ld - access a memory address from linker script
- Authentication-results: sourceware.org; auth=none
Hello,
is it possible to get a value stored at some VMA in the linker script?
I am writing a small bootloader (about 8 KB max) for the LPC1788
microcontroller (Cortex M3) however the LPC1788 has a functionality
that if there is a predefined value at the address 0x2FC, the cpu will
block access to the JTAG. I would like to check the address in the
linker script to avoid generating elf if there is such value.
Something like ASSERT(0xXXX != VMA[0x2fc], "Wrong code....").
I have tried to reserve a space in the .text output section
/* Code Read Protect data */
/*. = 0x000002FC ;*/
KEEP(*(.crp))
but it means to calculate manually the function between 0 â 2FC. As
far as I know the linker cannot put a variable at a given address and
then place the code around automatically.
Regards
Martin Velek