summaryrefslogtreecommitdiffstats
path: root/script.ld
diff options
context:
space:
mode:
authorSadeep Madurange <sadeep@asciimx.com>2024-09-09 20:18:14 +0800
committerSadeep Madurange <sadeep@asciimx.com>2024-09-09 20:18:14 +0800
commita2cff11cb50dca70fb4869e6ed7188504a398e27 (patch)
treee26877a65d4223b487c6d521f1b8d1c3e6f0c908 /script.ld
parentccbba4c08477e8944aa8e64abfe8c8cfd6b7c5c9 (diff)
downloadbare-metal-arduino-due-a2cff11cb50dca70fb4869e6ed7188504a398e27.tar.gz
Linker script and a bunch of important fixes.
Diffstat (limited to 'script.ld')
-rw-r--r--script.ld35
1 files changed, 35 insertions, 0 deletions
diff --git a/script.ld b/script.ld
new file mode 100644
index 0000000..e8b0bb1
--- /dev/null
+++ b/script.ld
@@ -0,0 +1,35 @@
+MEMORY
+{
+ rom (rx) : ORIGIN = 0x00080000, LENGTH = 0x00080000
+ ram (rwx) : ORIGIN = 0x20000000, LENGTH = 0x00010000
+}
+
+SECTIONS
+{
+ . = ALIGN(4);
+ .text :
+ {
+ KEEP(*(.vectors .vectors.*))
+ *(.text*)
+ *(.rodata*)
+ } > rom
+
+ . = ALIGN(4);
+ .data :
+ {
+ *(.data*);
+ } > ram AT >rom
+
+ . = ALIGN(4);
+ .bss (NOLOAD) :
+ {
+ __bss_start__ = . ;
+ *(.bss*)
+ *(COMMON)
+ __bss_end__ = . ;
+ } > ram
+
+ _end = . ;
+ __end__ = _end ;
+ end = _end;
+}