This is the mail archive of the binutils-cvs@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[binutils-gdb] Allow the flash and ram memory region sizes to be specified in the default FT32 linker script.


https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=1dc8bf195d2c4d382e0d6d371f16ebfe83573acc

commit 1dc8bf195d2c4d382e0d6d371f16ebfe83573acc
Author: Nick Clifton <nickc@redhat.com>
Date:   Mon Jul 4 15:44:10 2016 +0100

    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.

Diff:
---
 ld/ChangeLog           |  7 +++++++
 ld/scripttempl/ft32.sc | 11 +++++++----
 2 files changed, 14 insertions(+), 4 deletions(-)

diff --git a/ld/ChangeLog b/ld/ChangeLog
index 1dc221d..248e66e 100644
--- a/ld/ChangeLog
+++ b/ld/ChangeLog
@@ -1,3 +1,10 @@
+2016-07-04  Nick Clifton  <nickc@redhat.com>
+
+	* 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.
+
 2016-07-02  Maciej W. Rozycki  <macro@imgtec.com>
 
 	* testsuite/ld-mips-elf/branch-misc-2.d: New test.
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 :


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]