Skip to content

Commit

Permalink
llext: xtensa: fix relocations with multiple SLOT0_OP
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
lyakh committed Oct 15, 2024
1 parent 03959a2 commit a8ac72a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion arch/xtensa/core/elf.c
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ void arch_elf_relocate_local(struct llext_loader *ldr, struct llext *ext,
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;

Check notice on line 75 in arch/xtensa/core/elf.c

View workflow job for this annotation

GitHub Actions / Run compliance checks on patch series (PR)

You may want to run clang-format on this change

arch/xtensa/core/elf.c:75 - rsym.st_value + rel->r_addend; + rsym.st_value + rel->r_addend;
ssize_t value = (link_addr - (((uintptr_t)got_entry + 3) & ~3)) >> 2;

Expand Down

0 comments on commit a8ac72a

Please sign in to comment.