From 0cffa6be81636565750f31714efbf7727768db86 Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Tue, 31 Aug 2021 19:33:44 -0700 Subject: [PATCH] Sort .text section to reduce fill on nRF --- ports/nrf/boards/common.template.ld | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/ports/nrf/boards/common.template.ld b/ports/nrf/boards/common.template.ld index 855d8522fc..3591f23976 100644 --- a/ports/nrf/boards/common.template.ld +++ b/ports/nrf/boards/common.template.ld @@ -62,8 +62,8 @@ SECTIONS .text : { . = ALIGN(4); - *(.text) /* .text sections (code) */ - *(.text*) /* .text* sections (code) */ + *SORT_BY_ALIGNMENT(SORT_BY_NAME(.text)) /* .text sections (code) */ + *SORT_BY_ALIGNMENT(SORT_BY_NAME(.text*)) /* .text* sections (code) */ *(.rodata) /* .rodata sections (constants, strings, etc.) */ *(.rodata*) /* .rodata* sections (constants, strings, etc.) */ /* *(.glue_7) */ /* glue arm to thumb code */ @@ -85,8 +85,8 @@ SECTIONS . = ALIGN(4); _sdata = .; /* create a global symbol at data start; used by startup code in order to initialise the .data section in RAM */ _ram_start = .; /* create a global symbol at ram start for garbage collector */ - *(.data) /* .data sections */ - *(.data*) /* .data* sections */ + *SORT_BY_ALIGNMENT(SORT_BY_NAME(.data)) /* .data sections */ + *SORT_BY_ALIGNMENT(SORT_BY_NAME(.data*)) /* .data* sections */ . = ALIGN(4); _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 { . = ALIGN(4); _sbss = .; /* define a global symbol at bss start; used by startup code */ - *(.bss) - *(.bss*) + *SORT_BY_ALIGNMENT(SORT_BY_NAME(.bss)) + *SORT_BY_ALIGNMENT(SORT_BY_NAME(.bss*)) *(COMMON) . = ALIGN(4);