summaryrefslogtreecommitdiff
path: root/linker.ld
diff options
context:
space:
mode:
authorJosh Rahm <joshuarahm@gmail.com>2024-12-18 00:30:51 -0700
committerJosh Rahm <joshuarahm@gmail.com>2024-12-18 00:30:51 -0700
commit40575cafe477df2ed3779789174a13eae5da187e (patch)
tree44564b9e8abe7c7ed254d97ad9edaaced3e716f5 /linker.ld
downloadarduino-zig-lights-40575cafe477df2ed3779789174a13eae5da187e.tar.gz
arduino-zig-lights-40575cafe477df2ed3779789174a13eae5da187e.tar.bz2
arduino-zig-lights-40575cafe477df2ed3779789174a13eae5da187e.zip
Initial commit for programming an arduino in Zig.HEADmain
This is a simple collatz blinker program.
Diffstat (limited to 'linker.ld')
-rw-r--r--linker.ld33
1 files changed, 33 insertions, 0 deletions
diff --git a/linker.ld b/linker.ld
new file mode 100644
index 0000000..ef5e46b
--- /dev/null
+++ b/linker.ld
@@ -0,0 +1,33 @@
+MEMORY
+{
+ flash (rx) : ORIGIN = 0, LENGTH = 32K
+ ram (rw!x) : ORIGIN = 0x100, LENGTH = 2K
+}
+
+SECTIONS
+{
+ .text :
+ {
+ KEEP(*(.vectors))
+
+ *(.text*)
+ } > flash
+
+ .data :
+ {
+ __data_start = .;
+ *(.rodata*)
+ *(.data*)
+ __data_end = .;
+ } > ram AT> flash
+
+ .bss (NOLOAD) :
+ {
+ __bss_start = .;
+ *(.bss*)
+ __bss_end = .;
+ } > ram
+ RAMEND = ORIGIN(ram) + LENGTH(ram);
+
+ __data_load_start = LOADADDR(.data);
+}