llext: xtensa: fix relocations with multiple SLOT0_OP
Support for R_XTENSA_SLOT0_OP was implemented with a relocation table
test case, containing only one entry at offset 0. For multiple
entries .r_addend has to be taken into account.
Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
diff --git a/arch/xtensa/core/elf.c b/arch/xtensa/core/elf.c
index c7ea7e2..cd021b9 100644
--- a/arch/xtensa/core/elf.c
+++ b/arch/xtensa/core/elf.c
@@ -71,7 +71,7 @@
return;
uintptr_t link_addr = (uintptr_t)llext_loaded_sect_ptr(ldr, ext, rsym.st_shndx) +
- rsym.st_value;
+ rsym.st_value + rel->r_addend;
ssize_t value = (link_addr - (((uintptr_t)got_entry + 3) & ~3)) >> 2;