@@ -119,6 +119,7 @@ TOTAL_STACK_SIZE = MAIN_STACK_SIZE + PROCESS_STACK_SIZE;
119
119
{{ linkerscript_extern_zero | indent(8, first=True) }}
120
120
%% endif
121
121
__table_zero_extern_end = .;
122
+
122
123
__table_copy_extern_start = .;
123
124
%% if linkerscript_extern_copy
124
125
{{ linkerscript_extern_copy | indent(8, first=True) }}
@@ -139,17 +140,7 @@ TOTAL_STACK_SIZE = MAIN_STACK_SIZE + PROCESS_STACK_SIZE;
139
140
} >{{memory}}
140
141
%% endmacro
141
142
142
- %% macro section(memory, name, table_copy, sections=[])
143
- %% do table_copy.append(name)
144
- .{{name}} :
145
- {
146
- . = ALIGN(4);
147
- __{{name}}_load = LOADADDR(.{{name}});
148
- __{{name}}_start = .;
149
- *(.{{name}} .{{name}}.*)
150
- . = ALIGN(4);
151
- __{{name}}_end = .;
152
- } >{{memory}}
143
+ %% macro section_load(memory, table_copy, sections)
153
144
%% do table_copy.extend(sections)
154
145
%% for section in sections
155
146
%#
@@ -192,7 +183,7 @@ TOTAL_STACK_SIZE = MAIN_STACK_SIZE + PROCESS_STACK_SIZE;
192
183
%% for region in cont_region.contains
193
184
/* Sections in {{ region.name|upper }} */
194
185
%% if region.index
195
- {{ section (cont_region.cont_name|upper + " AT >FLASH", "data_"+region.name, table_copy ) }}
186
+ {{ section_load (cont_region.cont_name|upper + " AT >FLASH", table_copy, sections=[ "data_"+region.name] ) }}
196
187
%% do table_zero.append("bss_"+region.name)
197
188
%% endif
198
189
{{ section_heap(region.name|upper, "heap_"+region.name, cont_region.cont_name|upper,
@@ -281,7 +272,7 @@ TOTAL_STACK_SIZE = MAIN_STACK_SIZE + PROCESS_STACK_SIZE;
281
272
%% endmacro
282
273
283
274
284
- %% macro section_ram(memory, rom, table_copy, table_zero, sections_data=[], sections_bss=[])
275
+ %% macro section_ram(memory, rom, table_copy, table_zero, sections_data=[], sections_bss=[], sections_noinit=[] )
285
276
/* Read-write sections in {{memory}} */
286
277
%% do table_copy.append("data")
287
278
.data :
@@ -312,27 +303,30 @@ TOTAL_STACK_SIZE = MAIN_STACK_SIZE + PROCESS_STACK_SIZE;
312
303
__bss_start = . ;
313
304
*(.bss .bss.* .gnu.linkonce.b.*)
314
305
. = ALIGN(4);
315
- __bss_end = .;
316
- } >{{memory}}
317
- %% do table_zero.extend(sections_bss)
318
306
%% for section in sections_bss
307
+ } >{{memory}}
319
308
%#
320
309
.{{section}} (NOLOAD) :
321
310
{
322
311
__{{section}}_start = . ;
323
312
*(.{{section}} .{{section}}.*)
324
313
. = ALIGN(4);
325
314
__{{section}}_end = .;
326
- } >{{memory}}
327
315
%% endfor
316
+ __bss_end = .;
317
+ } >{{memory}}
328
318
%#
329
- .noinit (NOLOAD) :
319
+ %% do sections_noinit.insert(0, "noinit")
320
+ %% for section in sections_noinit
321
+ %#
322
+ .{{section}} (NOLOAD) :
330
323
{
331
- __noinit_start = .;
332
- *(.noinit .noinit .*)
324
+ __{{section}}_start = . ;
325
+ *(.{{section}} .{{section}} .*)
333
326
. = ALIGN(4);
334
- __noinit_end = .;
327
+ __{{section}}_end = .;
335
328
} >{{memory}}
329
+ %% endfor
336
330
%% endmacro
337
331
338
332
0 commit comments