diff --git a/cpu/kinetis_common/ldscripts/kinetis-base.ld b/cpu/kinetis_common/ldscripts/kinetis-base.ld index 36d2af7ef2..fd5a488e1c 100644 --- a/cpu/kinetis_common/ldscripts/kinetis-base.ld +++ b/cpu/kinetis_common/ldscripts/kinetis-base.ld @@ -205,18 +205,6 @@ SECTIONS __end__ = .; PROVIDE(end = .); - . = ALIGN(4); - HEAP_SIZE = ORIGIN(sram_u) + LENGTH(sram_u) - STACK_SIZE - .; - - .heap (NOLOAD): - { - _heap_start = .; - PROVIDE(__heap_start = .); /*__heap_start = .; */ - . = . + HEAP_SIZE; - _heap_end = .; - PROVIDE(__heap_max = .); - } > sram_u - /* stack section */ .stack (NOLOAD): { @@ -227,6 +215,11 @@ SECTIONS _estack = .; } > sram_u + /* heap section */ + . = ALIGN(8); + _sheap = . ; + _eheap = ORIGIN(sram_u) + LENGTH(sram_u); + /* Any debugging sections */ /* Stabs debugging sections. */ .stab 0 : { *(.stab) } diff --git a/cpu/kinetis_common/ldscripts/kinetis-noramcode.ld b/cpu/kinetis_common/ldscripts/kinetis-noramcode.ld index a47c4db663..a043b0184f 100644 --- a/cpu/kinetis_common/ldscripts/kinetis-noramcode.ld +++ b/cpu/kinetis_common/ldscripts/kinetis-noramcode.ld @@ -189,27 +189,21 @@ SECTIONS __end__ = .; PROVIDE(end = .); - . = ALIGN(8); - HEAP_SIZE = ORIGIN(sram) + LENGTH(sram) - STACK_SIZE - .; - - .heap (NOLOAD): - { - _heap_start = .; - PROVIDE(__heap_start = .); - . = . + HEAP_SIZE; - _heap_end = .; - PROVIDE(__heap_max = .); - } > sram - /* stack section */ .stack (NOLOAD): { . = ALIGN(8); _sstack = .; . = . + STACK_SIZE; + . = ALIGN(8); _estack = .; } > sram + /* heap section */ + . = ALIGN(8); + _sheap = . ; + _eheap = ORIGIN(sram) + LENGTH(sram); + /* Any debugging sections */ /* Stabs debugging sections. */ .stab 0 : { *(.stab) }