riscv: linker: fix PMP support on non-XIP system.
On non-XIP system, RAM region overlaps ROM region which cause PMP region overlapping. Padding RAM region by adding a output section to update the next free address of RAM region. Signed-off-by: Jim Shu <cwshu@andestech.com>
This commit is contained in:
parent
c1dc4a6f61
commit
8d8d6d9a6a
1 changed files with 7 additions and 1 deletions
|
@ -187,7 +187,6 @@ SECTIONS
|
|||
|
||||
#include <linker/cplusplus-rom.ld>
|
||||
__rodata_region_end = .;
|
||||
MPU_ALIGN(__rodata_region_end - __rom_region_start);
|
||||
|
||||
/* For non-XIP system, __rom_region_end symbol should be set to
|
||||
* the end of common ROMABLE_REGIONs (text and rodata) instead of
|
||||
|
@ -195,6 +194,13 @@ SECTIONS
|
|||
* RAMABLE_REGION in it.
|
||||
*/
|
||||
#ifndef CONFIG_XIP
|
||||
#ifdef CONFIG_RISCV_PMP
|
||||
SECTION_PROLOGUE(rom_mpu_padding,,)
|
||||
{
|
||||
MPU_ALIGN(__rodata_region_end - __rom_region_start);
|
||||
} GROUP_LINK_IN(ROMABLE_REGION)
|
||||
#endif /* CONFIG_RISCV_PMP */
|
||||
|
||||
__rom_region_end = .;
|
||||
__rom_region_size = __rom_region_end - __rom_region_start;
|
||||
#endif /* CONFIG_XIP */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue