0001-sh2.patch 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. diff -Nur elf2flt-v2023.09.orig/elf2flt.c elf2flt-v2023.09/elf2flt.c
  2. --- elf2flt-v2023.09.orig/elf2flt.c 2023-12-22 10:44:11.000000000 +0100
  3. +++ elf2flt-v2023.09/elf2flt.c 2023-12-23 02:26:06.323239781 +0100
  4. @@ -73,7 +73,7 @@
  5. #define FLAT_NIOS2_R_HIADJ_LO 2
  6. #define FLAT_NIOS2_R_CALL26 4
  7. #include <elf/nios2.h>
  8. -#elif defined(TARGET_sh)
  9. +#elif defined(TARGET_sh2) || defined(TARGET_sh2eb)
  10. #include <elf/sh.h>
  11. #elif defined(TARGET_sparc)
  12. #include <elf/sparc.h>
  13. @@ -109,8 +109,10 @@
  14. #define ARCH "sparc"
  15. #elif defined(TARGET_v850)
  16. #define ARCH "v850"
  17. -#elif defined(TARGET_sh)
  18. -#define ARCH "sh"
  19. +#elif defined(TARGET_sh2)
  20. +#define ARCH "sh2"
  21. +#elif defined(TARGET_sh2eb)
  22. +#define ARCH "sh2"
  23. #elif defined(TARGET_h8300)
  24. #define ARCH "h8300"
  25. #elif defined(TARGET_microblaze)
  26. @@ -1289,7 +1291,7 @@
  27. #endif /* TARGET_sparc */
  28. -#ifdef TARGET_sh
  29. +#if defined(TARGET_sh2) || defined(TARGET_sh2eb)
  30. case R_SH_DIR32:
  31. relocation_needed = 1;
  32. sym_vma = elf2flt_bfd_section_vma(sym_section);
  33. @@ -1300,7 +1302,7 @@
  34. sym_addr += sym_vma + q->addend;
  35. sym_addr -= q->address;
  36. break;
  37. -#endif /* TARGET_sh */
  38. +#endif /* TARGET_sh2 / TARGET_sh2eb */
  39. #ifdef TARGET_e1
  40. #define htoe1l(x) htonl(x)