|
|
|
@ -587,28 +587,29 @@ static int llext_copy_symbols(struct llext_loader *ldr, struct llext *ext,
@@ -587,28 +587,29 @@ static int llext_copy_symbols(struct llext_loader *ldr, struct llext *ext,
|
|
|
|
|
|
|
|
|
|
elf_shdr_t *shdr = ldr->sect_hdrs + shndx; |
|
|
|
|
uintptr_t section_addr = shdr->sh_addr; |
|
|
|
|
const void *base; |
|
|
|
|
|
|
|
|
|
base = llext_loaded_sect_ptr(ldr, ext, shndx); |
|
|
|
|
if (!base) { |
|
|
|
|
/* If the section is not mapped, try to peek.
|
|
|
|
|
* Be noisy about it, since this is addressing |
|
|
|
|
* data that was missed by llext_map_sections. |
|
|
|
|
*/ |
|
|
|
|
base = llext_peek(ldr, shdr->sh_offset); |
|
|
|
|
if (base) { |
|
|
|
|
LOG_DBG("section %d peeked at %p", shndx, base); |
|
|
|
|
} else { |
|
|
|
|
LOG_ERR("No data for section %d", shndx); |
|
|
|
|
return -ENOTSUP; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if (ldr_parm->pre_located && |
|
|
|
|
(!ldr_parm->section_detached || !ldr_parm->section_detached(shdr))) { |
|
|
|
|
sym_tab->syms[j].addr = (uint8_t *)sym.st_value + |
|
|
|
|
(ldr->hdr.e_type == ET_REL ? section_addr : 0); |
|
|
|
|
} else { |
|
|
|
|
const void *base; |
|
|
|
|
|
|
|
|
|
base = llext_loaded_sect_ptr(ldr, ext, shndx); |
|
|
|
|
if (!base) { |
|
|
|
|
/* If the section is not mapped, try to peek.
|
|
|
|
|
* Be noisy about it, since this is addressing |
|
|
|
|
* data that was missed by llext_map_sections. |
|
|
|
|
*/ |
|
|
|
|
base = llext_peek(ldr, shdr->sh_offset); |
|
|
|
|
if (base) { |
|
|
|
|
LOG_DBG("section %d peeked at %p", shndx, base); |
|
|
|
|
} else { |
|
|
|
|
LOG_ERR("No data for section %d", shndx); |
|
|
|
|
return -ENOTSUP; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
sym_tab->syms[j].addr = (uint8_t *)base + sym.st_value - |
|
|
|
|
(ldr->hdr.e_type == ET_REL ? 0 : section_addr); |
|
|
|
|
} |
|
|
|
|