@@ -285,33 +285,7 @@ SECTIONS
285285 _app_smem_rom_start = LOADADDR (_APP_SMEM_SECTION_NAME);
286286#endif /* CONFIG_USERSPACE */
287287
288- SECTION_DATA_PROLOGUE (_BSS_SECTION_NAME,(NOLOAD), BSS_ALIGN)
289- {
290- /*
291- * For performance, BSS section is assumed to be 4 byte aligned and
292- * a multiple of 4 bytes
293- */
294- . = ALIGN (4 );
295- __bss_start = .;
296- __kernel_ram_start = .;
297-
298- *(.bss )
299- *(" .bss.*" )
300- *(COMMON)
301- *(" .kernel_bss.*" )
302-
303- #ifdef CONFIG_CODE_DATA_RELOCATION
304- #include < linker_sram_bss_relocate.ld>
305- #endif
306-
307- /*
308- * As memory is cleared in words only, it is simpler to ensure the BSS
309- * section ends on a 4 byte boundary. This wastes a maximum of 3 bytes.
310- */
311- __bss_end = ALIGN (4 );
312- } GROUP_DATA_LINK_IN (RAMABLE_REGION, RAMABLE_REGION)
313-
314- #include < zephyr/linker/common-noinit.ld>
288+ __kernel_ram_start = .;
315289
316290 SECTION_DATA_PROLOGUE (_DATA_SECTION_NAME,,)
317291 {
@@ -348,12 +322,6 @@ SECTIONS
348322
349323 __data_region_end = .;
350324
351-
352- /* Define linker symbols */
353-
354- __kernel_ram_end = RAM_ADDR + RAM_SIZE;
355- __kernel_ram_size = __kernel_ram_end - __kernel_ram_start;
356-
357325#if DT_NODE_HAS_STATUS(DT_CHOSEN(zephyr_ocm), okay)
358326GROUP_START (OCM)
359327
@@ -385,12 +353,6 @@ GROUP_END(OCM)
385353 */
386354#include < snippets-sections.ld>
387355
388- #define LAST_RAM_ALIGN . = ALIGN (_region_min_align);
389-
390- #include < zephyr/linker/ram-end.ld>
391-
392- GROUP_END (RAMABLE_REGION)
393-
394356#include < zephyr/linker/debug-sections.ld>
395357
396358 SECTION_PROLOGUE (.ARM .attributes , 0 ,)
@@ -416,4 +378,42 @@ GROUP_END(OCM)
416378 * calculate this value here. */
417379 _flash_used = LOADADDR (.last_section ) + SIZEOF (.last_section ) - __rom_region_start;
418380
381+ SECTION_DATA_PROLOGUE (_BSS_SECTION_NAME,(NOLOAD), BSS_ALIGN)
382+ {
383+ /*
384+ * For performance, BSS section is assumed to be 4 byte aligned and
385+ * a multiple of 4 bytes
386+ */
387+ . = ALIGN (4 );
388+ __bss_start = .;
389+
390+ *(.bss )
391+ *(" .bss.*" )
392+ *(COMMON)
393+ *(" .kernel_bss.*" )
394+
395+ #ifdef CONFIG_CODE_DATA_RELOCATION
396+ #include < linker_sram_bss_relocate.ld>
397+ #endif
398+
399+ /*
400+ * As memory is cleared in words only, it is simpler to ensure the BSS
401+ * section ends on a 4 byte boundary. This wastes a maximum of 3 bytes.
402+ */
403+ __bss_end = ALIGN (4 );
404+ } GROUP_DATA_LINK_IN (RAMABLE_REGION, RAMABLE_REGION)
405+
406+ #include < zephyr/linker/common-noinit.ld>
407+
408+ /* Define linker symbols */
409+
410+ __kernel_ram_end = RAM_ADDR + RAM_SIZE;
411+ __kernel_ram_size = __kernel_ram_end - __kernel_ram_start;
412+
413+ #define LAST_RAM_ALIGN . = ALIGN (_region_min_align);
414+
415+ #include < zephyr/linker/ram-end.ld>
416+
417+ GROUP_END (RAMABLE_REGION)
418+
419419}
0 commit comments