Skip to content

Commit 0cffa6b

Browse files
committed
Sort .text section to reduce fill on nRF
1 parent cd5acae commit 0cffa6b

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

ports/nrf/boards/common.template.ld

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,8 @@ SECTIONS
6262
.text :
6363
{
6464
. = ALIGN(4);
65-
*(.text) /* .text sections (code) */
66-
*(.text*) /* .text* sections (code) */
65+
*SORT_BY_ALIGNMENT(SORT_BY_NAME(.text)) /* .text sections (code) */
66+
*SORT_BY_ALIGNMENT(SORT_BY_NAME(.text*)) /* .text* sections (code) */
6767
*(.rodata) /* .rodata sections (constants, strings, etc.) */
6868
*(.rodata*) /* .rodata* sections (constants, strings, etc.) */
6969
/* *(.glue_7) */ /* glue arm to thumb code */
@@ -85,8 +85,8 @@ SECTIONS
8585
. = ALIGN(4);
8686
_sdata = .; /* create a global symbol at data start; used by startup code in order to initialise the .data section in RAM */
8787
_ram_start = .; /* create a global symbol at ram start for garbage collector */
88-
*(.data) /* .data sections */
89-
*(.data*) /* .data* sections */
88+
*SORT_BY_ALIGNMENT(SORT_BY_NAME(.data)) /* .data sections */
89+
*SORT_BY_ALIGNMENT(SORT_BY_NAME(.data*)) /* .data* sections */
9090

9191
. = ALIGN(4);
9292
_edata = .; /* define a global symbol at data end; used by startup code in order to initialise the .data section in RAM */
@@ -97,8 +97,8 @@ SECTIONS
9797
{
9898
. = ALIGN(4);
9999
_sbss = .; /* define a global symbol at bss start; used by startup code */
100-
*(.bss)
101-
*(.bss*)
100+
*SORT_BY_ALIGNMENT(SORT_BY_NAME(.bss))
101+
*SORT_BY_ALIGNMENT(SORT_BY_NAME(.bss*))
102102
*(COMMON)
103103

104104
. = ALIGN(4);

0 commit comments

Comments
 (0)