Skip to content

Commit 95b648c

Browse files
lyakhkv2019i
authored andcommitted
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 <guennadi.liakhovetski@linux.intel.com>
1 parent de6d625 commit 95b648c

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

scripts/llext_link_helper.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -144,8 +144,7 @@ def main():
144144
# critical functions in a .cold ELF section, read-only data in a
145145
# .coldrodata ELF section, etc. When compiling and linking such
146146
# functions, an additional .cold.literal section is automatically
147-
# created. Note, that for some reason the compiler also marks .cold as
148-
# executable.
147+
# created.
149148
# This script links those sections at address 0. We could hard-code
150149
# section names, but so far we choose to only link .text the "original"
151150
# way and all other executable sections we link at 0. For data sections
@@ -168,6 +167,8 @@ def main():
168167

169168
dram_addr += section.header['sh_size']
170169

170+
dram_addr = align_up(dram_addr, 0x1000)
171+
171172
for section in readonly_dram:
172173
s_alignment = section.header['sh_addralign']
173174
s_name = section.name

0 commit comments

Comments
 (0)