Skip to content

Commit

Permalink
core: arm,pager: make __vcore_init_ro_start follows __vcore_init_rx_end
Browse files Browse the repository at this point in the history
This concerns configurations with CFG_WITH_PAGER=y. Until this patch,
even if __vcore_init_ro_size (VCORE_INIT_RO_SZ) is 0 for
CFG_CORE_RODATA_NOEXEC=n, __vcore_init_ro_start was using some value
smaller than __vcore_init_rx_end. To simplify code trying to find the
end of VCORE_INIT_RX and VCORE_INIT_RO parts of the binary, make sure
that __vcore_init_ro_start follows right after __vcore_init_ro_end.

Signed-off-by: Jens Wiklander <[email protected]>
  • Loading branch information
jenswi-linaro committed Sep 14, 2024
1 parent 9648c4a commit 3a19565
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion core/arch/arm/kernel/kern.ld.S
Original file line number Diff line number Diff line change
Expand Up @@ -480,16 +480,19 @@ __vcore_nex_rw_end = __vcore_nex_rw_start + __vcore_nex_rw_size;
#ifdef CFG_WITH_PAGER
/* Paged/init read-only memories */
__vcore_init_rx_start = __flatmap_init_rx_start;
__vcore_init_ro_start = __flatmap_init_ro_start;
#ifdef CFG_CORE_RODATA_NOEXEC
__vcore_init_rx_size = __flatmap_init_rx_size;
__vcore_init_ro_start = __flatmap_init_ro_start;
__vcore_init_ro_size = __flatmap_init_ro_size;
#else
__vcore_init_rx_size = __flatmap_init_rx_size + __flatmap_init_ro_size;
__vcore_init_ro_start = __vcore_init_rx_end;
__vcore_init_ro_size = 0;
#endif /* CFG_CORE_RODATA_NOEXEC */
__vcore_init_rx_end = __vcore_init_rx_start + __vcore_init_rx_size;
__vcore_init_ro_end = __vcore_init_ro_start + __vcore_init_ro_size;
ASSERT(__vcore_init_ro_start == __vcore_init_ro_end,
"__vcore_init_ro_start should follow __vcore_init_ro_end")
#endif /* CFG_WITH_PAGER */

#ifdef CFG_CORE_SANITIZE_KADDRESS
Expand Down

0 comments on commit 3a19565

Please sign in to comment.