From abdb8785cb177577d3f7f9d308cf47fcf2c58352 Mon Sep 17 00:00:00 2001 From: Vitaly Gaiduk Date: Fri, 12 Oct 2018 15:14:07 +0300 Subject: [PATCH] linker: riscv: Disable creating ROM domain by config option. Patch is useful for RISCV platforms which can not provide ROM memory. Switching CONFIG_XIP to "n" disables allocating ROM region. Signed-off-by: Vitaly Gaiduk --- include/arch/riscv32/common/linker.ld | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/include/arch/riscv32/common/linker.ld b/include/arch/riscv32/common/linker.ld index a65a4fe9191..c1e154ed37d 100644 --- a/include/arch/riscv32/common/linker.ld +++ b/include/arch/riscv32/common/linker.ld @@ -35,7 +35,9 @@ MEMORY { +#ifdef CONFIG_XIP ROM (rx) : ORIGIN = CONFIG_RISCV_ROM_BASE_ADDR, LENGTH = CONFIG_RISCV_ROM_SIZE +#endif RAM (rwx) : ORIGIN = CONFIG_RISCV_RAM_BASE_ADDR, LENGTH = RISCV_RAM_SIZE /* Used by and documented in include/linker/intlist.ld */ IDT_LIST (wx) : ORIGIN = 0xFFFFF7FF, LENGTH = 2K @@ -62,18 +64,14 @@ SECTIONS *(.iplt) } - GROUP_START(ROM) + GROUP_START(ROMABLE_REGION) _image_rom_start = .; SECTION_PROLOGUE(_VECTOR_SECTION_NAME,,) { . = ALIGN(4); KEEP(*(.vectors.*)) - } GROUP_LINK_IN(ROM) - - GROUP_END(ROM) - - GROUP_START(ROMABLE_REGION) + } GROUP_LINK_IN(ROMABLE_REGION) SECTION_PROLOGUE(_RESET_SECTION_NAME,,) {