From dd4aacbd1c42346c9437a0c4b682a67a45577f01 Mon Sep 17 00:00:00 2001 From: Graham Sanderson Date: Tue, 27 Aug 2024 11:13:28 -0500 Subject: [PATCH] fix linker script bug using ALL of RAM (#1872) --- src/rp2_common/pico_crt0/rp2040/memmap_blocked_ram.ld | 7 +++---- src/rp2_common/pico_crt0/rp2040/memmap_copy_to_ram.ld | 7 +++---- src/rp2_common/pico_crt0/rp2040/memmap_default.ld | 7 +++---- src/rp2_common/pico_crt0/rp2040/memmap_no_flash.ld | 7 +++---- src/rp2_common/pico_crt0/rp2350/memmap_copy_to_ram.ld | 7 +++---- src/rp2_common/pico_crt0/rp2350/memmap_default.ld | 7 +++---- src/rp2_common/pico_crt0/rp2350/memmap_no_flash.ld | 7 +++---- 7 files changed, 21 insertions(+), 28 deletions(-) diff --git a/src/rp2_common/pico_crt0/rp2040/memmap_blocked_ram.ld b/src/rp2_common/pico_crt0/rp2040/memmap_blocked_ram.ld index 175312ff9..6f5000566 100644 --- a/src/rp2_common/pico_crt0/rp2040/memmap_blocked_ram.ld +++ b/src/rp2_common/pico_crt0/rp2040/memmap_blocked_ram.ld @@ -213,11 +213,10 @@ SECTIONS __end__ = .; end = __end__; KEEP(*(.heap*)) - /* historically on GCC sbrk was growing past __HeapLimit to __StackLimit, however - to be more compatible, we now set __HeapLimit explicitly to where the end of the heap is */ - . = ORIGIN(RAM) + LENGTH(RAM); - __HeapLimit = .; } > RAM + /* historically on GCC sbrk was growing past __HeapLimit to __StackLimit, however + to be more compatible, we now set __HeapLimit explicitly to where the end of the heap is */ + __HeapLimit = ORIGIN(RAM) + LENGTH(RAM); /* Start and end symbols must be word-aligned */ .scratch_x : { diff --git a/src/rp2_common/pico_crt0/rp2040/memmap_copy_to_ram.ld b/src/rp2_common/pico_crt0/rp2040/memmap_copy_to_ram.ld index 78b8a1f2b..842ebfd3c 100644 --- a/src/rp2_common/pico_crt0/rp2040/memmap_copy_to_ram.ld +++ b/src/rp2_common/pico_crt0/rp2040/memmap_copy_to_ram.ld @@ -214,11 +214,10 @@ SECTIONS __end__ = .; end = __end__; KEEP(*(.heap*)) - /* historically on GCC sbrk was growing past __HeapLimit to __StackLimit, however - to be more compatible, we now set __HeapLimit explicitly to where the end of the heap is */ - . = ORIGIN(RAM) + LENGTH(RAM); - __HeapLimit = .; } > RAM + /* historically on GCC sbrk was growing past __HeapLimit to __StackLimit, however + to be more compatible, we now set __HeapLimit explicitly to where the end of the heap is */ + __HeapLimit = ORIGIN(RAM) + LENGTH(RAM); /* Start and end symbols must be word-aligned */ .scratch_x : { diff --git a/src/rp2_common/pico_crt0/rp2040/memmap_default.ld b/src/rp2_common/pico_crt0/rp2040/memmap_default.ld index aea712a53..51254012d 100644 --- a/src/rp2_common/pico_crt0/rp2040/memmap_default.ld +++ b/src/rp2_common/pico_crt0/rp2040/memmap_default.ld @@ -213,11 +213,10 @@ SECTIONS __end__ = .; end = __end__; KEEP(*(.heap*)) - /* historically on GCC sbrk was growing past __HeapLimit to __StackLimit, however - to be more compatible, we now set __HeapLimit explicitly to where the end of the heap is */ - . = ORIGIN(RAM) + LENGTH(RAM); - __HeapLimit = .; } > RAM + /* historically on GCC sbrk was growing past __HeapLimit to __StackLimit, however + to be more compatible, we now set __HeapLimit explicitly to where the end of the heap is */ + __HeapLimit = ORIGIN(RAM) + LENGTH(RAM); /* Start and end symbols must be word-aligned */ .scratch_x : { diff --git a/src/rp2_common/pico_crt0/rp2040/memmap_no_flash.ld b/src/rp2_common/pico_crt0/rp2040/memmap_no_flash.ld index b9d3c3763..dbf006a8c 100644 --- a/src/rp2_common/pico_crt0/rp2040/memmap_no_flash.ld +++ b/src/rp2_common/pico_crt0/rp2040/memmap_no_flash.ld @@ -181,11 +181,10 @@ SECTIONS __end__ = .; end = __end__; KEEP(*(.heap*)) - /* historically on GCC sbrk was growing past __HeapLimit to __StackLimit, however - to be more compatible, we now set __HeapLimit explicitly to where the end of the heap is */ - . = ORIGIN(RAM) + LENGTH(RAM); - __HeapLimit = .; } > RAM + /* historically on GCC sbrk was growing past __HeapLimit to __StackLimit, however + to be more compatible, we now set __HeapLimit explicitly to where the end of the heap is */ + __HeapLimit = ORIGIN(RAM) + LENGTH(RAM); /* Start and end symbols must be word-aligned */ .scratch_x : { diff --git a/src/rp2_common/pico_crt0/rp2350/memmap_copy_to_ram.ld b/src/rp2_common/pico_crt0/rp2350/memmap_copy_to_ram.ld index f365682b3..89d63a9f0 100644 --- a/src/rp2_common/pico_crt0/rp2350/memmap_copy_to_ram.ld +++ b/src/rp2_common/pico_crt0/rp2350/memmap_copy_to_ram.ld @@ -234,11 +234,10 @@ SECTIONS __end__ = .; end = __end__; KEEP(*(.heap*)) - /* historically on GCC sbrk was growing past __HeapLimit to __StackLimit, however - to be more compatible, we now set __HeapLimit explicitly to where the end of the heap is */ - . = ORIGIN(RAM) + LENGTH(RAM); - __HeapLimit = .; } > RAM + /* historically on GCC sbrk was growing past __HeapLimit to __StackLimit, however + to be more compatible, we now set __HeapLimit explicitly to where the end of the heap is */ + __HeapLimit = ORIGIN(RAM) + LENGTH(RAM); /* Start and end symbols must be word-aligned */ .scratch_x : { diff --git a/src/rp2_common/pico_crt0/rp2350/memmap_default.ld b/src/rp2_common/pico_crt0/rp2350/memmap_default.ld index ba8a113e2..bce316d14 100644 --- a/src/rp2_common/pico_crt0/rp2350/memmap_default.ld +++ b/src/rp2_common/pico_crt0/rp2350/memmap_default.ld @@ -227,11 +227,10 @@ SECTIONS __end__ = .; end = __end__; KEEP(*(.heap*)) - /* historically on GCC sbrk was growing past __HeapLimit to __StackLimit, however - to be more compatible, we now set __HeapLimit explicitly to where the end of the heap is */ - . = ORIGIN(RAM) + LENGTH(RAM); - __HeapLimit = .; } > RAM + /* historically on GCC sbrk was growing past __HeapLimit to __StackLimit, however + to be more compatible, we now set __HeapLimit explicitly to where the end of the heap is */ + __HeapLimit = ORIGIN(RAM) + LENGTH(RAM); /* Start and end symbols must be word-aligned */ .scratch_x : { diff --git a/src/rp2_common/pico_crt0/rp2350/memmap_no_flash.ld b/src/rp2_common/pico_crt0/rp2350/memmap_no_flash.ld index 2febe5299..98088cdfc 100644 --- a/src/rp2_common/pico_crt0/rp2350/memmap_no_flash.ld +++ b/src/rp2_common/pico_crt0/rp2350/memmap_no_flash.ld @@ -186,11 +186,10 @@ SECTIONS __end__ = .; end = __end__; KEEP(*(.heap*)) - /* historically on GCC sbrk was growing past __HeapLimit to __StackLimit, however - to be more compatible, we now set __HeapLimit explicitly to where the end of the heap is */ - . = ORIGIN(RAM) + LENGTH(RAM); - __HeapLimit = .; } > RAM + /* historically on GCC sbrk was growing past __HeapLimit to __StackLimit, however + to be more compatible, we now set __HeapLimit explicitly to where the end of the heap is */ + __HeapLimit = ORIGIN(RAM) + LENGTH(RAM); /* Start and end symbols must be word-aligned */ .scratch_x : {