0003-sh2.patch 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. diff -Nur elf2flt-26dfb54a59c8c0106418a0c46ccb4288d9e066fd.orig/elf2flt.c elf2flt-26dfb54a59c8c0106418a0c46ccb4288d9e066fd/elf2flt.c
  2. --- elf2flt-26dfb54a59c8c0106418a0c46ccb4288d9e066fd.orig/elf2flt.c 2023-09-08 08:49:00.529082893 +0200
  3. +++ elf2flt-26dfb54a59c8c0106418a0c46ccb4288d9e066fd/elf2flt.c 2023-09-08 08:51:08.117679134 +0200
  4. @@ -75,7 +75,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_sh2eb)
  10. #include <elf/sh.h>
  11. #elif defined(TARGET_sparc)
  12. #include <elf/sparc.h>
  13. @@ -111,7 +111,7 @@
  14. #define ARCH "sparc"
  15. #elif defined(TARGET_v850)
  16. #define ARCH "v850"
  17. -#elif defined(TARGET_sh)
  18. +#elif defined(TARGET_sh2eb)
  19. #define ARCH "sh"
  20. #elif defined(TARGET_h8300)
  21. #define ARCH "h8300"
  22. @@ -795,6 +795,12 @@
  23. flat_reloc_count++;
  24. break;
  25. +#elif defined (TARGET_sh2eb)
  26. + case R_SH_DIR32:
  27. + goto good_32bit_resolved_reloc;
  28. + case R_SH_REL32:
  29. + relocation_needed = 0;
  30. + continue;
  31. #elif defined (TARGET_h8300)
  32. case R_H8_DIR32:
  33. case R_H8_DIR32A16:
  34. @@ -1328,7 +1334,7 @@
  35. #endif /* TARGET_sparc */
  36. -#ifdef TARGET_sh
  37. +#ifdef TARGET_sh2eb
  38. case R_SH_DIR32:
  39. relocation_needed = 1;
  40. sym_vma = elf2flt_bfd_section_vma(sym_section);
  41. @@ -1339,7 +1345,7 @@
  42. sym_addr += sym_vma + q->addend;
  43. sym_addr -= q->address;
  44. break;
  45. -#endif /* TARGET_sh */
  46. +#endif /* TARGET_sh2eb */
  47. #ifdef TARGET_e1
  48. #define htoe1l(x) htonl(x)