Skip to content

Commit a28830b

Browse files
tejlmandnashif
authored andcommitted
linker: align __itcm_load_start / __dtcm_data_load_start linker symbols
Cleanup and preparation commit for linker script generator. Zephyr linker scripts provides start and end symbols for each section, and sometimes even size and LMA start symbols. Generally, start and end symbols uses the following pattern, as: Section name: foo Section start symbol: __foo_start Section end symbol: __foo_end However, this pattern is not followed consistently. To allow for linker script generation and ensure consistent naming of symbols then the following pattern is introduced consistently to allow for cleaner linker script generation. Section name: foo Section start symbol: __foo_start Section end symbol: __foo_end Section size symbol: __foo_size Section LMA start symbol: __foo_load_start This commit aligns the symbols for __itcm_load_start and __dtcm_data_load_start to other symbols and in such a way they follow consistent pattern which allows for linker script and scatter file generation. The symbols are named according to the section name they describe. Section names are itcm and dtcm. The following symbols are aligned in this commit: - __itcm_rom_start -> __itcm_load_start - __dtcm_data_rom_start -> __dtcm_data_load_start Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
1 parent 3d82c7c commit a28830b

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

include/arch/arm/aarch32/cortex_m/scripts/linker.ld

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -398,7 +398,7 @@ GROUP_START(ITCM)
398398
} GROUP_LINK_IN(ITCM AT> ROMABLE_REGION)
399399

400400
__itcm_size = __itcm_end - __itcm_start;
401-
__itcm_rom_start = LOADADDR(_ITCM_SECTION_NAME);
401+
__itcm_load_start = LOADADDR(_ITCM_SECTION_NAME);
402402

403403
GROUP_END(ITCM)
404404
#endif
@@ -433,7 +433,7 @@ GROUP_START(DTCM)
433433

434434
__dtcm_end = .;
435435

436-
__dtcm_data_rom_start = LOADADDR(_DTCM_DATA_SECTION_NAME);
436+
__dtcm_data_load_start = LOADADDR(_DTCM_DATA_SECTION_NAME);
437437

438438
GROUP_END(DTCM)
439439
#endif

include/linker/linker-defs.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -291,7 +291,7 @@ extern char __ccm_end[];
291291
extern char __itcm_start[];
292292
extern char __itcm_end[];
293293
extern char __itcm_size[];
294-
extern char __itcm_rom_start[];
294+
extern char __itcm_load_start[];
295295
#endif
296296

297297
#if DT_NODE_HAS_STATUS(DT_CHOSEN(zephyr_dtcm), okay)
@@ -301,7 +301,7 @@ extern char __dtcm_bss_start[];
301301
extern char __dtcm_bss_end[];
302302
extern char __dtcm_noinit_start[];
303303
extern char __dtcm_noinit_end[];
304-
extern char __dtcm_data_rom_start[];
304+
extern char __dtcm_data_load_start[];
305305
extern char __dtcm_start[];
306306
extern char __dtcm_end[];
307307
#endif

kernel/xip.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,11 +36,11 @@ void z_data_copy(void)
3636
__ccm_data_end - __ccm_data_start);
3737
#endif
3838
#if DT_NODE_HAS_STATUS(DT_CHOSEN(zephyr_itcm), okay)
39-
(void)memcpy(&__itcm_start, &__itcm_rom_start,
39+
(void)memcpy(&__itcm_start, &__itcm_load_start,
4040
(uintptr_t) &__itcm_size);
4141
#endif
4242
#if DT_NODE_HAS_STATUS(DT_CHOSEN(zephyr_dtcm), okay)
43-
(void)memcpy(&__dtcm_data_start, &__dtcm_data_rom_start,
43+
(void)memcpy(&__dtcm_data_start, &__dtcm_data_load_start,
4444
__dtcm_data_end - __dtcm_data_start);
4545
#endif
4646
#ifdef CONFIG_CODE_DATA_RELOCATION

0 commit comments

Comments
 (0)