File tree Expand file tree Collapse file tree 1 file changed +9
-5
lines changed Expand file tree Collapse file tree 1 file changed +9
-5
lines changed Original file line number Diff line number Diff line change @@ -27,8 +27,12 @@ SECTIONS
27
27
. = ALIGN (4);
28
28
_sfixed = .;
29
29
KEEP(*(.vectors)) /* isr vector table */
30
- *(.text) /* .text sections (code) */
31
- *(.text*) /* .text* sections (code) */
30
+
31
+ /* Sort text sections so that they have fewer *fill* bytes needed. */
32
+ *SORT_BY_ALIGNMENT(SORT_BY_NAME(.text)) /* .text sections (code) */
33
+ *SORT_BY_ALIGNMENT(SORT_BY_NAME(.text*)) /* .text* sections (code) */
34
+
35
+ /* Don't sort rodata because it impacts codegen size. */
32
36
*(.rodata) /* .rodata sections (constants, strings, etc.) */
33
37
*(.rodata*) /* .rodata* sections (constants, strings, etc.) */
34
38
@@ -62,8 +66,8 @@ SECTIONS
62
66
_srelocate = .; /* create a global symbol at data start; used by startup code in order to initialize the .data section in RAM */
63
67
*(.ramfunc)
64
68
*(.ramfunc*)
65
- *( .data) /* .data sections */
66
- *( .data*) /* .data* sections */
69
+ *SORT_BY_ALIGNMENT(SORT_BY_NAME( .data) ) /* .data sections */
70
+ *SORT_BY_ALIGNMENT(SORT_BY_NAME( .data*) ) /* .data* sections */
67
71
68
72
. = ALIGN (4);
69
73
_erelocate = .; /* define a global symbol at data end; used by startup code in order to initialize the .data section in RAM */
@@ -76,7 +80,7 @@ SECTIONS
76
80
_sbss = .;
77
81
_szero = .; /* define a global symbol at bss start; used by startup code */
78
82
*(.bss)
79
- *( .bss*)
83
+ *SORT_BY_ALIGNMENT(SORT_BY_NAME( .bss*) )
80
84
*(COMMON)
81
85
82
86
. = ALIGN (4);
You can’t perform that action at this time.
0 commit comments