Allow the flash and ram memory region sizes to be specified in the default FT32 linke...
authorNick Clifton <nickc@redhat.com>
Mon, 4 Jul 2016 14:44:10 +0000 (15:44 +0100)
committerNick Clifton <nickc@redhat.com>
Mon, 4 Jul 2016 14:44:10 +0000 (15:44 +0100)
* 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.

ld/ChangeLog
ld/scripttempl/ft32.sc

index 1dc221d824e829fec44ca4fe92802c0cd4709013..248e66eb6300d433684ab9caae8b26ab9a69872c 100644 (file)
@@ -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.
index bc55d1032f9d0b63860d631baf05810f8afe30c3..15f8335c5cd43d4192370ca98865f93ba9d97366 100644 (file)
@@ -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 :
This page took 0.049913 seconds and 4 git commands to generate.