0006-elf2flt-xtensa-fix-text-relocations.patch 727 B

12345678910111213141516171819202122232425
  1. diff -Nur elf2flt-v2021.08.orig/elf2flt.c elf2flt-v2021.08/elf2flt.c
  2. --- elf2flt-v2021.08.orig/elf2flt.c 2023-01-09 11:08:28.637676113 +0100
  3. +++ elf2flt-v2021.08/elf2flt.c 2023-01-09 11:09:04.502804007 +0100
  4. @@ -835,7 +835,20 @@
  5. continue;
  6. case R_XTENSA_32:
  7. case R_XTENSA_PLT:
  8. - goto good_32bit_resolved_reloc;
  9. + if (bfd_big_endian (abs_bfd))
  10. + sym_addr =
  11. + (r_mem[0] << 24)
  12. + + (r_mem[1] << 16)
  13. + + (r_mem[2] << 8)
  14. + + r_mem[3];
  15. + else
  16. + sym_addr =
  17. + r_mem[0]
  18. + + (r_mem[1] << 8)
  19. + + (r_mem[2] << 16)
  20. + + (r_mem[3] << 24);
  21. + relocation_needed = 1;
  22. + break;
  23. default:
  24. goto bad_resolved_reloc;
  25. #elif defined(TARGET_riscv64)