scripts: Add align for empty _app_smem region
When _app_smem region is empty, alignment is also needed. If there is no alignment, the _app_smem_start used by arm mpu can be lower than __rodata_region_end, and this two regions can overlap. The Armv8-R aarch64 MPU does not allow overlapped regions. Signed-off-by: Jaxson Han <jaxson.han@arm.com>
This commit is contained in:
parent
b7734d2ba0
commit
f079e6638f
2 changed files with 13 additions and 0 deletions
|
@ -218,6 +218,16 @@ SECTIONS
|
||||||
#define APP_SHARED_ALIGN . = ALIGN(_region_min_align);
|
#define APP_SHARED_ALIGN . = ALIGN(_region_min_align);
|
||||||
#define SMEM_PARTITION_ALIGN(size) MMU_ALIGN
|
#define SMEM_PARTITION_ALIGN(size) MMU_ALIGN
|
||||||
|
|
||||||
|
#if defined(CONFIG_ARM_MPU)
|
||||||
|
/*
|
||||||
|
* When _app_smem region is empty, alignment is also needed. If there
|
||||||
|
* is no alignment, the _app_smem_start used by arm mpu can be lower
|
||||||
|
* than __rodata_region_end, and this two regions can overlap.
|
||||||
|
* The Armv8-R aarch64 MPU does not allow overlapped regions.
|
||||||
|
*/
|
||||||
|
#define EMPTY_APP_SHARED_ALIGN APP_SHARED_ALIGN
|
||||||
|
#endif
|
||||||
|
|
||||||
#include <app_smem.ld>
|
#include <app_smem.ld>
|
||||||
|
|
||||||
_app_smem_size = _app_smem_end - _app_smem_start;
|
_app_smem_size = _app_smem_end - _app_smem_start;
|
||||||
|
|
|
@ -90,6 +90,9 @@ linker_end_seq = """
|
||||||
empty_app_smem = """
|
empty_app_smem = """
|
||||||
SECTION_PROLOGUE(_APP_SMEM{1}_SECTION_NAME,,)
|
SECTION_PROLOGUE(_APP_SMEM{1}_SECTION_NAME,,)
|
||||||
{{
|
{{
|
||||||
|
#ifdef EMPTY_APP_SHARED_ALIGN
|
||||||
|
EMPTY_APP_SHARED_ALIGN;
|
||||||
|
#endif
|
||||||
_app_smem{0}_start = .;
|
_app_smem{0}_start = .;
|
||||||
_app_smem{0}_end = .;
|
_app_smem{0}_end = .;
|
||||||
}} GROUP_DATA_LINK_IN(RAMABLE_REGION, ROMABLE_REGION)
|
}} GROUP_DATA_LINK_IN(RAMABLE_REGION, ROMABLE_REGION)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue