Skip to content

Commit dd4aacb

Browse files
authored
fix linker script bug using ALL of RAM (#1872)
1 parent d639292 commit dd4aacb

File tree

7 files changed

+21
-28
lines changed

7 files changed

+21
-28
lines changed

src/rp2_common/pico_crt0/rp2040/memmap_blocked_ram.ld

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -213,11 +213,10 @@ SECTIONS
213213
__end__ = .;
214214
end = __end__;
215215
KEEP(*(.heap*))
216-
/* historically on GCC sbrk was growing past __HeapLimit to __StackLimit, however
217-
to be more compatible, we now set __HeapLimit explicitly to where the end of the heap is */
218-
. = ORIGIN(RAM) + LENGTH(RAM);
219-
__HeapLimit = .;
220216
} > RAM
217+
/* historically on GCC sbrk was growing past __HeapLimit to __StackLimit, however
218+
to be more compatible, we now set __HeapLimit explicitly to where the end of the heap is */
219+
__HeapLimit = ORIGIN(RAM) + LENGTH(RAM);
221220
222221
/* Start and end symbols must be word-aligned */
223222
.scratch_x : {

src/rp2_common/pico_crt0/rp2040/memmap_copy_to_ram.ld

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -214,11 +214,10 @@ SECTIONS
214214
__end__ = .;
215215
end = __end__;
216216
KEEP(*(.heap*))
217-
/* historically on GCC sbrk was growing past __HeapLimit to __StackLimit, however
218-
to be more compatible, we now set __HeapLimit explicitly to where the end of the heap is */
219-
. = ORIGIN(RAM) + LENGTH(RAM);
220-
__HeapLimit = .;
221217
} > RAM
218+
/* historically on GCC sbrk was growing past __HeapLimit to __StackLimit, however
219+
to be more compatible, we now set __HeapLimit explicitly to where the end of the heap is */
220+
__HeapLimit = ORIGIN(RAM) + LENGTH(RAM);
222221
223222
/* Start and end symbols must be word-aligned */
224223
.scratch_x : {

src/rp2_common/pico_crt0/rp2040/memmap_default.ld

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -213,11 +213,10 @@ SECTIONS
213213
__end__ = .;
214214
end = __end__;
215215
KEEP(*(.heap*))
216-
/* historically on GCC sbrk was growing past __HeapLimit to __StackLimit, however
217-
to be more compatible, we now set __HeapLimit explicitly to where the end of the heap is */
218-
. = ORIGIN(RAM) + LENGTH(RAM);
219-
__HeapLimit = .;
220216
} > RAM
217+
/* historically on GCC sbrk was growing past __HeapLimit to __StackLimit, however
218+
to be more compatible, we now set __HeapLimit explicitly to where the end of the heap is */
219+
__HeapLimit = ORIGIN(RAM) + LENGTH(RAM);
221220
222221
/* Start and end symbols must be word-aligned */
223222
.scratch_x : {

src/rp2_common/pico_crt0/rp2040/memmap_no_flash.ld

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -181,11 +181,10 @@ SECTIONS
181181
__end__ = .;
182182
end = __end__;
183183
KEEP(*(.heap*))
184-
/* historically on GCC sbrk was growing past __HeapLimit to __StackLimit, however
185-
to be more compatible, we now set __HeapLimit explicitly to where the end of the heap is */
186-
. = ORIGIN(RAM) + LENGTH(RAM);
187-
__HeapLimit = .;
188184
} > RAM
185+
/* historically on GCC sbrk was growing past __HeapLimit to __StackLimit, however
186+
to be more compatible, we now set __HeapLimit explicitly to where the end of the heap is */
187+
__HeapLimit = ORIGIN(RAM) + LENGTH(RAM);
189188

190189
/* Start and end symbols must be word-aligned */
191190
.scratch_x : {

src/rp2_common/pico_crt0/rp2350/memmap_copy_to_ram.ld

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -234,11 +234,10 @@ SECTIONS
234234
__end__ = .;
235235
end = __end__;
236236
KEEP(*(.heap*))
237-
/* historically on GCC sbrk was growing past __HeapLimit to __StackLimit, however
238-
to be more compatible, we now set __HeapLimit explicitly to where the end of the heap is */
239-
. = ORIGIN(RAM) + LENGTH(RAM);
240-
__HeapLimit = .;
241237
} > RAM
238+
/* historically on GCC sbrk was growing past __HeapLimit to __StackLimit, however
239+
to be more compatible, we now set __HeapLimit explicitly to where the end of the heap is */
240+
__HeapLimit = ORIGIN(RAM) + LENGTH(RAM);
242241
243242
/* Start and end symbols must be word-aligned */
244243
.scratch_x : {

src/rp2_common/pico_crt0/rp2350/memmap_default.ld

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -227,11 +227,10 @@ SECTIONS
227227
__end__ = .;
228228
end = __end__;
229229
KEEP(*(.heap*))
230-
/* historically on GCC sbrk was growing past __HeapLimit to __StackLimit, however
231-
to be more compatible, we now set __HeapLimit explicitly to where the end of the heap is */
232-
. = ORIGIN(RAM) + LENGTH(RAM);
233-
__HeapLimit = .;
234230
} > RAM
231+
/* historically on GCC sbrk was growing past __HeapLimit to __StackLimit, however
232+
to be more compatible, we now set __HeapLimit explicitly to where the end of the heap is */
233+
__HeapLimit = ORIGIN(RAM) + LENGTH(RAM);
235234
236235
/* Start and end symbols must be word-aligned */
237236
.scratch_x : {

src/rp2_common/pico_crt0/rp2350/memmap_no_flash.ld

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -186,11 +186,10 @@ SECTIONS
186186
__end__ = .;
187187
end = __end__;
188188
KEEP(*(.heap*))
189-
/* historically on GCC sbrk was growing past __HeapLimit to __StackLimit, however
190-
to be more compatible, we now set __HeapLimit explicitly to where the end of the heap is */
191-
. = ORIGIN(RAM) + LENGTH(RAM);
192-
__HeapLimit = .;
193189
} > RAM
190+
/* historically on GCC sbrk was growing past __HeapLimit to __StackLimit, however
191+
to be more compatible, we now set __HeapLimit explicitly to where the end of the heap is */
192+
__HeapLimit = ORIGIN(RAM) + LENGTH(RAM);
194193

195194
/* Start and end symbols must be word-aligned */
196195
.scratch_x : {

0 commit comments

Comments
 (0)