From 3f16fdefbf30d906f2999ad35104b757138c6c1b Mon Sep 17 00:00:00 2001 From: Jim Shu Date: Mon, 11 Jan 2021 03:20:47 +0800 Subject: [PATCH] riscv: linker: fix duplicate symbol when CONFIG_USERSPACE=y _image_ram_start symbol is duplicate in CONFIG_USERSPACE. This symbol should be at the start of app_smem in userspace, so remove another symbol in CONFIG_USERSPACE. Signed-off-by: Jim Shu --- include/arch/riscv/common/linker.ld | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/include/arch/riscv/common/linker.ld b/include/arch/riscv/common/linker.ld index 2d1b256fc5a..220ed1c2e03 100644 --- a/include/arch/riscv/common/linker.ld +++ b/include/arch/riscv/common/linker.ld @@ -60,7 +60,7 @@ #ifdef CONFIG_RISCV_PMP #define MPU_MIN_SIZE 4 - #define MPU_MIN_SIZE_ALIGN . = ALIGN(MPU_MIN_SIZE ); + #define MPU_MIN_SIZE_ALIGN . = ALIGN(MPU_MIN_SIZE); #if defined(CONFIG_MPU_REQUIRES_POWER_OF_TWO_ALIGNMENT) #define MPU_ALIGN(region_size) \ . = ALIGN(MPU_MIN_SIZE); \ @@ -228,7 +228,9 @@ SECTIONS */ . = ALIGN(4); __bss_start = .; +#if !defined(CONFIG_USERSPACE) _image_ram_start = .; +#endif /* CONFIG_USERSPACE */ __kernel_ram_start = .; *(.sbss) *(".sbss.*")