From d18f879566807317ecb1e5fa565176bdd057255c Mon Sep 17 00:00:00 2001 From: Duy Nguyen Date: Wed, 11 Jun 2025 13:24:45 +0700 Subject: [PATCH] include: arch: rx: Change data symbol name The RX linker is using the name "data" for .data region start which caused the application cannot use "data" for variable naming globally. This commit change the name to "__data_region_start" as expected in the linker_defs.h file Signed-off-by: Duy Nguyen --- arch/rx/core/reset.S | 8 ++++---- include/zephyr/arch/rx/linker.ld | 11 ++++++++--- 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/arch/rx/core/reset.S b/arch/rx/core/reset.S index 80246fe397e..6c2538da0c5 100644 --- a/arch/rx/core/reset.S +++ b/arch/rx/core/reset.S @@ -29,10 +29,10 @@ __start : /* load data section from ROM to RAM */ - mov #_mdata,r2 /* src ROM address of data section in R2 */ - mov #_data,r1 /* dest start RAM address of data section in R1 */ - mov #_edata,r3 /* end RAM address of data section in R3 */ - sub r1,r3 /* size of data section in R3 (R3=R3-R1) */ + mov #_image_ram_start,r2 /* src ROM address of data section in R2 */ + mov #__data_start,r1 /* dest start RAM address of data section in R1 */ + mov #__data_region_end,r3 /* end RAM address of data section in R3 */ + sub r1,r3 /* size of data section in R3 (R3=R3-R1) */ #ifdef __RX_ALLOW_STRING_INSNS__ smovf /* block copy R3 bytes from R2 to R1 */ #else diff --git a/include/zephyr/arch/rx/linker.ld b/include/zephyr/arch/rx/linker.ld index 07ed324371c..8ef4a0f6f5e 100644 --- a/include/zephyr/arch/rx/linker.ld +++ b/include/zephyr/arch/rx/linker.ld @@ -175,7 +175,6 @@ SECTIONS } GROUP_LINK_IN(ROMABLE_REGION) PLACE_SYMBOL_HERE(__rodata_region_end); - _mdata = .; GROUP_END(ROMABLE_REGION) GROUP_START(RAMABLE_REGION) @@ -212,7 +211,8 @@ SECTIONS SECTION_DATA_PROLOGUE(_DATA_SECTION_NAME,,) { - _data = .; + __data_region_start = .; + __data_start = .; *(.data) *(.data.*) *(D) @@ -234,17 +234,22 @@ SECTIONS */ #include - _edata = .; + __data_region_end = .; SECTION_PROLOGUE(_BSS_SECTION_NAME,,) { _bss = .; + __bss_start = .; *(.bss) *(.bss.**) *(COMMON) *(B) *(B_1) *(B_2) + _ebss = .; + __bss_end = .; + . = ALIGN(128); + _end = .; } GROUP_LINK_IN(RAMABLE_REGION) _ebss = . ;