aboutsummaryrefslogtreecommitdiffstats
path: root/support/ld/maple
diff options
context:
space:
mode:
authorMarti Bolivar <mbolivar@leaflabs.com>2011-09-13 03:23:03 -0400
committerMarti Bolivar <mbolivar@leaflabs.com>2011-09-13 04:44:02 -0400
commit514cc1c190300af2bdfd94a0ae1a37d416d3c125 (patch)
treeff94c10660658c4f7884d11d73683df2920a7fae /support/ld/maple
parentaf9c6c9f7143067fb48f5bb3eb1474003dcb5017 (diff)
downloadlibrambutan-514cc1c190300af2bdfd94a0ae1a37d416d3c125.tar.gz
librambutan-514cc1c190300af2bdfd94a0ae1a37d416d3c125.zip
[support/ld] Unify linker scripts.
Add new common.inc, which is common_rom.inc with some DEFINED(_FLASH_BUILD) usages thrown in to allow for RAM builds. It also uses a new REGION_RODATA region alias for read-only data. Move section .USER_FLASH to REGION_RODATA. This means it lives in RAM under RAM builds. Although this might be surprising, not doing so would make RAM builds useless. Modify the individual board linker scripts to properly set REGION_RODATA and _FLASH_BUILD before calling out to common.inc. Delete common_rom.inc, common_ram.inc, common_header.inc, in favor of common.inc. This should fix RAM builds on all boards.
Diffstat (limited to 'support/ld/maple')
-rw-r--r--support/ld/maple/flash.ld5
-rw-r--r--support/ld/maple/jtag.ld4
-rw-r--r--support/ld/maple/ram.ld3
3 files changed, 9 insertions, 3 deletions
diff --git a/support/ld/maple/flash.ld b/support/ld/maple/flash.ld
index e9ff4b4..8a179f7 100644
--- a/support/ld/maple/flash.ld
+++ b/support/ld/maple/flash.ld
@@ -19,8 +19,11 @@ GROUP(libcs3_stm32_med_density.a)
REGION_ALIAS("REGION_TEXT", rom);
REGION_ALIAS("REGION_DATA", ram);
REGION_ALIAS("REGION_BSS", ram);
+REGION_ALIAS("REGION_RODATA", rom);
/*
* Define the rest of the sections
*/
-INCLUDE common_rom.inc
+_FLASH_BUILD = 1;
+
+INCLUDE common.inc
diff --git a/support/ld/maple/jtag.ld b/support/ld/maple/jtag.ld
index ed8cc1c..365068f 100644
--- a/support/ld/maple/jtag.ld
+++ b/support/ld/maple/jtag.ld
@@ -20,8 +20,10 @@ GROUP(libcs3_stm32_med_density.a)
REGION_ALIAS("REGION_TEXT", rom);
REGION_ALIAS("REGION_DATA", ram);
REGION_ALIAS("REGION_BSS", ram);
+REGION_ALIAS("REGION_RODATA", rom);
/*
* Define the rest of the sections
*/
-INCLUDE common_rom.inc
+_FLASH_BUILD = 1;
+INCLUDE common.inc
diff --git a/support/ld/maple/ram.ld b/support/ld/maple/ram.ld
index 09bcb33..6f237c3 100644
--- a/support/ld/maple/ram.ld
+++ b/support/ld/maple/ram.ld
@@ -19,8 +19,9 @@ GROUP(libcs3_stm32_med_density.a)
REGION_ALIAS("REGION_TEXT", ram);
REGION_ALIAS("REGION_DATA", ram);
REGION_ALIAS("REGION_BSS", ram);
+REGION_ALIAS("REGION_RODATA", ram);
/*
* Define the rest of the sections
*/
-INCLUDE common_ram.inc
+INCLUDE common.inc