From 4a27c70d9ffc5e61e99a563aac021e6a2574814a Mon Sep 17 00:00:00 2001 From: Guennadi Liakhovetski Date: Fri, 31 Jul 2026 14:35:38 +0200 Subject: [PATCH] llext: adjust for MMU flag application The .cold section contains executable code, while .coldrodata contains data. Therefore their MMU flags have to be different, particularly when mapping for userspace. Add a page-size alignment to account for such cases. Signed-off-by: Guennadi Liakhovetski --- scripts/llext_link_helper.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/scripts/llext_link_helper.py b/scripts/llext_link_helper.py index f10777c9918f..3b6c2d451e7c 100755 --- a/scripts/llext_link_helper.py +++ b/scripts/llext_link_helper.py @@ -144,8 +144,7 @@ def main(): # critical functions in a .cold ELF section, read-only data in a # .coldrodata ELF section, etc. When compiling and linking such # functions, an additional .cold.literal section is automatically - # created. Note, that for some reason the compiler also marks .cold as - # executable. + # created. # This script links those sections at address 0. We could hard-code # section names, but so far we choose to only link .text the "original" # way and all other executable sections we link at 0. For data sections @@ -168,6 +167,8 @@ def main(): dram_addr += section.header['sh_size'] + dram_addr = align_up(dram_addr, 0x1000) + for section in readonly_dram: s_alignment = section.header['sh_addralign'] s_name = section.name