Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions src/library_manager/llext_manager.c
Original file line number Diff line number Diff line change
Expand Up @@ -955,6 +955,16 @@ static int llext_manager_add_mod_domain(struct lib_manager_module *mctx, struct
goto e_data;
mctx->segment[LIB_MANAGER_COLD].addr = (uintptr_t)text_addr + text_offset;
mctx->segment[LIB_MANAGER_COLD].size = shdr_cold.sh_size;
} else {
/*
* No .cold section: make sure the descriptor is empty so that
* llext_manager_rm_mod_domain() doesn't later try to remove a
* partition that was never added. The module context is
* allocated with rmalloc() and these fields are otherwise left
* uninitialised.
*/
mctx->segment[LIB_MANAGER_COLD].addr = 0;
mctx->segment[LIB_MANAGER_COLD].size = 0;
}

if (rodata) {
Expand All @@ -967,6 +977,10 @@ static int llext_manager_add_mod_domain(struct lib_manager_module *mctx, struct
goto e_cold;
mctx->segment[LIB_MANAGER_COLDRODATA].addr = (uintptr_t)rodata_addr + rodata_offset;
mctx->segment[LIB_MANAGER_COLDRODATA].size = shdr_coldrodata.sh_size;
} else {
/* No .coldrodata section, see the comment above */
mctx->segment[LIB_MANAGER_COLDRODATA].addr = 0;
mctx->segment[LIB_MANAGER_COLDRODATA].size = 0;
}

return 0;
Expand Down
Loading