summaryrefslogtreecommitdiff
path: root/ld_scripts
diff options
context:
space:
mode:
authorVegard Storheil Eriksen <zyp@jvnv.net>2021-01-07 11:26:54 +0100
committerVegard Storheil Eriksen <zyp@jvnv.net>2021-01-07 11:26:54 +0100
commitcf79d8f57747cb41fa9756263fe14470197c5c86 (patch)
tree0cb86cbeb6399e0eea63c0f76a83aa5bbbc2c5aa /ld_scripts
parentd4244f3d52f276337b44b0bab8c85094c985682f (diff)
build: Generate linker script.
Diffstat (limited to 'ld_scripts')
-rw-r--r--ld_scripts/SConscript3
-rw-r--r--ld_scripts/generated.ld.j27
2 files changed, 10 insertions, 0 deletions
diff --git a/ld_scripts/SConscript b/ld_scripts/SConscript
new file mode 100644
index 0000000..da5c551
--- /dev/null
+++ b/ld_scripts/SConscript
@@ -0,0 +1,3 @@
+Import('env')
+
+env.Jinja2('generated.ld', 'generated.ld.j2', mem = env['PLATFORM_SPEC']['mem'])
diff --git a/ld_scripts/generated.ld.j2 b/ld_scripts/generated.ld.j2
new file mode 100644
index 0000000..40a198a
--- /dev/null
+++ b/ld_scripts/generated.ld.j2
@@ -0,0 +1,7 @@
+MEMORY {
+ {% for name, m in mem.items() %}
+ {{ name }} ({{ 'rx' if name == 'flash' else 'rwx' }}) : org = {{ m.origin }}, len = {{ m.size }}
+ {% endfor %}
+}
+
+INCLUDE "arm_flash_ram.ld"