summaryrefslogtreecommitdiffstats
path: root/layout.ld
diff options
context:
space:
mode:
authorTomasz Kramkowski <tk@the-tk.com>2016-11-24 21:53:23 +0000
committerTomasz Kramkowski <tk@the-tk.com>2016-11-24 21:53:23 +0000
commitc6419bba0cafa16e925b8bc5e028dba138c853b9 (patch)
treea5adcda31100cb6daa7363fb069cd61fdf5de297 /layout.ld
parente927fb70d4f46dd686d8ad246cac587c219ddd9d (diff)
downloadfmk-c6419bba0cafa16e925b8bc5e028dba138c853b9.tar.gz
fmk-c6419bba0cafa16e925b8bc5e028dba138c853b9.tar.xz
fmk-c6419bba0cafa16e925b8bc5e028dba138c853b9.zip
simplify layout.ld
Diffstat (limited to 'layout.ld')
-rw-r--r--layout.ld36
1 files changed, 13 insertions, 23 deletions
diff --git a/layout.ld b/layout.ld
index 7431496..3be0978 100644
--- a/layout.ld
+++ b/layout.ld
@@ -1,10 +1,9 @@
MEMORY {
- FLASH (rx) : ORIGIN = 0x00000000, LENGTH = 256K
- RAM (rw!x) : ORIGIN = 0x1FFF8000, LENGTH = 64K
+ flash : ORIGIN = 0x00000000, LENGTH = 256K
+ ram : ORIGIN = 0x1FFF8000, LENGTH = 64K
}
SECTIONS {
- . = 0x00000000;
.text : {
KEEP(*(.vectors))
. = 0x400;
@@ -12,27 +11,18 @@ SECTIONS {
*(.startup*)
*(.text*)
*(.rodata*)
- . = ALIGN(4);
- } > FLASH
+ } >flash
- .data : {
- . = ALIGN(4);
- _sflashdata = LOADADDR(.data);
- _sdata = .;
- *(.fastrun*)
- *(.data*)
- . = ALIGN(4);
- _edata = .;
- } > RAM AT > FLASH
+ .data : { *(.data*) } >ram AT>flash
- .bss : {
- . = ALIGN(4);
- _sbss = .;
- *(.bss*)
- *(COMMON)
- . = ALIGN(4);
- _ebss = .;
- } > RAM
+ .bss : { *(.bss*) } >ram
- _estack = ORIGIN(RAM) + LENGTH(RAM);
+ _sdata = ADDR(.data);
+ _edata = ADDR(.data) + SIZEOF(.data);
+ _ldata = LOADADDR(.data);
+
+ _sbss = ADDR(.bss);
+ _ebss = ADDR(.bss) + SIZEOF(.bss);
+
+ _estack = ORIGIN(ram) + LENGTH(ram);
}