diff options
author | Nick Clifton <nickc@redhat.com> | 2016-07-04 15:44:10 +0100 |
---|---|---|
committer | Nick Clifton <nickc@redhat.com> | 2016-07-04 15:44:10 +0100 |
commit | 1dc8bf195d2c4d382e0d6d371f16ebfe83573acc (patch) | |
tree | 17b55da152543a72792ed6e2b7f0240ef8c3fbd3 /ld/scripttempl | |
parent | bb44634d9be7833c3a2874070b434a0b4c6a7730 (diff) | |
download | gdb-1dc8bf195d2c4d382e0d6d371f16ebfe83573acc.zip gdb-1dc8bf195d2c4d382e0d6d371f16ebfe83573acc.tar.gz gdb-1dc8bf195d2c4d382e0d6d371f16ebfe83573acc.tar.bz2 |
Allow the flash and ram memory region sizes to be specified in the default FT32 linker script.
* scripttempl/ft32.sc (__PMSIZE_): If not defined, set to 256K.
(__RAMSIZE): If not defined, set to 64K.
(MEMORY): Set the flash region size to __PMSIZE and the ram region
size to __RAMSIZE.
Diffstat (limited to 'ld/scripttempl')
-rw-r--r-- | ld/scripttempl/ft32.sc | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/ld/scripttempl/ft32.sc b/ld/scripttempl/ft32.sc index bc55d10..15f8335 100644 --- a/ld/scripttempl/ft32.sc +++ b/ld/scripttempl/ft32.sc @@ -14,13 +14,16 @@ OUTPUT_FORMAT("${OUTPUT_FORMAT}") OUTPUT_ARCH(${ARCH}) ${LIB_SEARCH_DIRS} +/* Allow the command line to override the memory region sizes. */ +__PMSIZE_ = DEFINED(__PMSIZE) ? __PMSIZE : 256K; +__RAMSIZE = DEFINED(__RAMSIZE) ? __RAMSIZE : 64K; + MEMORY { - /* Note - we cannot use "PROVIDE(len)" ... "LENGTH = len" as - PROVIDE statements are not evaluated inside MEMORY blocks. */ - flash (rx) : ORIGIN = 0, LENGTH = 256K - ram (rw!x) : ORIGIN = 0x800000, LENGTH = 64K + flash (rx) : ORIGIN = 0, LENGTH = __PMSIZE + ram (rw!x) : ORIGIN = 0x800000, LENGTH = __RAMSIZE } + SECTIONS { .text : |