Skip to content

Commit 6518a87

Browse files
Move Newlib locale table to flash, save 320B RAM (#3267)
Newlib doesn't really support locale operations, so the global locale can be considered const. Move it to only live in flash, freeing up 360 bytes of RAM for apps.
1 parent 30aead9 commit 6518a87

File tree

3 files changed

+6
-0
lines changed

3 files changed

+6
-0
lines changed

lib/rp2040/memmap_default.ld

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,8 @@ SECTIONS
136136
. = ALIGN(4);
137137
*(SORT_BY_ALIGNMENT(SORT_BY_NAME(.flashdata*)))
138138
. = ALIGN(4);
139+
*libc_a-locale.o(.data)
140+
. = ALIGN(4);
139141
} > FLASH
140142
141143
.ARM.extab :

lib/rp2350-riscv/memmap_default.ld

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,8 @@ SECTIONS
149149
. = ALIGN(4);
150150
*(SORT_BY_ALIGNMENT(SORT_BY_NAME(.flashdata*)))
151151
. = ALIGN(4);
152+
*libc_a-locale.o(.data)
153+
. = ALIGN(4);
152154
} > FLASH
153155

154156
.ARM.extab :

lib/rp2350/memmap_default.ld

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,8 @@ SECTIONS
149149
. = ALIGN(4);
150150
*(SORT_BY_ALIGNMENT(SORT_BY_NAME(.flashdata*)))
151151
. = ALIGN(4);
152+
*libc_a-locale.o(.data)
153+
. = ALIGN(4);
152154
} > FLASH
153155

154156
.ARM.extab :

0 commit comments

Comments
 (0)