llext: use data size from Zephyr

Some image formats, notably relocatable objects, don't create ELF
segments. To work around this use the object data size, calculated by
Zephyr.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
This commit is contained in:
Guennadi Liakhovetski 2024-04-10 15:13:36 +02:00 committed by Liam Girdwood
parent f9c22377a0
commit 9dca9832d8
1 changed files with 1 additions and 2 deletions

View File

@ -200,8 +200,7 @@ static int llext_manager_link(struct sof_man_fw_desc *desc, struct sof_man_modul
mod->segment[SOF_MAN_SEGMENT_RODATA].file_offset = mod->segment[SOF_MAN_SEGMENT_RODATA].file_offset =
(uintptr_t)md->llext->mem[LLEXT_MEM_RODATA] - (uintptr_t)md->llext->mem[LLEXT_MEM_RODATA] -
(uintptr_t)desc + SOF_MAN_ELF_TEXT_OFFSET; (uintptr_t)desc + SOF_MAN_ELF_TEXT_OFFSET;
ctx->segment_size[SOF_MAN_SEGMENT_RODATA] = mod_size - ctx->segment_size[SOF_MAN_SEGMENT_RODATA] = ebl.loader.prog_data_size;
ebl.loader.sects[LLEXT_MEM_TEXT].sh_size;
tr_dbg(&lib_manager_tr, ".data: start: %#x size %#x offset %#x", tr_dbg(&lib_manager_tr, ".data: start: %#x size %#x offset %#x",
mod->segment[SOF_MAN_SEGMENT_RODATA].v_base_addr, mod->segment[SOF_MAN_SEGMENT_RODATA].v_base_addr,