aboutsummaryrefslogtreecommitdiffstats
path: root/scripts/romload/sections.ld
diff options
context:
space:
mode:
authorGuy Hutchison <guy@dryv.io>2018-10-18 20:51:40 +0000
committerGuy Hutchison <guy@dryv.io>2018-10-18 20:51:40 +0000
commit5c0e13779210983fb20d908085df4f43037ec132 (patch)
treeaff8a998f0a9fefd87ead8c652b6dfcd78253a3f /scripts/romload/sections.ld
parent73318eaeabccfd90db6343c6a14280a3585a9853 (diff)
downloadpicorv32-5c0e13779210983fb20d908085df4f43037ec132.tar.gz
picorv32-5c0e13779210983fb20d908085df4f43037ec132.zip
Removed dead code and cleanup before pull request
Diffstat (limited to 'scripts/romload/sections.ld')
-rw-r--r--scripts/romload/sections.ld45
1 files changed, 45 insertions, 0 deletions
diff --git a/scripts/romload/sections.ld b/scripts/romload/sections.ld
new file mode 100644
index 0000000..2ec3954
--- /dev/null
+++ b/scripts/romload/sections.ld
@@ -0,0 +1,45 @@
+/*
+This is free and unencumbered software released into the public domain.
+
+Anyone is free to copy, modify, publish, use, compile, sell, or
+distribute this software, either in source code form or as a compiled
+binary, for any purpose, commercial or non-commercial, and by any
+means.
+*/
+
+/* starting address needs to be > 0 due to known bug in RISCV/GNU linker */
+MEMORY {
+ rom(rwx) : ORIGIN = 0x00000100, LENGTH = 63k
+ ram(rwx) : ORIGIN = 0x00020000, LENGTH = 16k
+}
+
+ENTRY(_pvstart);
+
+SECTIONS {
+ .rom : {
+ _pvstart*(.text);
+ start*(.text);
+ . = 0x100;
+ . = ALIGN(4);
+ *(.text);
+ } > rom
+
+ .data : {
+ _data_lma = LOADADDR(.data);
+ _data = .;
+ __global_pointer$ = . ;
+ *(.data .data.* )
+ *(.sdata .sdata.*)
+ . = ALIGN(4);
+ _edata = .;
+ } >ram AT>rom
+
+ .bss : {
+ _bss_start = .;
+ *(.bss .bss.*)
+ . = ALIGN(4);
+ _bss_end = .;
+ _end = .;
+ } >ram
+
+}