0002-h8300.patch 670 B

1234567891011121314151617181920
  1. diff -Nur elf2flt-v2023.09.orig/flthdr.c elf2flt-v2023.09/flthdr.c
  2. --- elf2flt-v2023.09.orig/flthdr.c 2023-12-23 03:20:20.000000000 +0100
  3. +++ elf2flt-v2023.09/flthdr.c 2023-12-23 17:11:22.699413170 +0100
  4. @@ -164,8 +164,16 @@
  5. r = ntohl(relocs[i]);
  6. raddr = flat_get_relocate_addr(r);
  7. printf(" %u\t0x%08lx (0x%08"PRIx32")\t", i, r, raddr);
  8. +#if defined(TARGET_h8300)
  9. + raddr &= ~0x00000001;
  10. +#endif
  11. fseek_stream(&ifp, sizeof(old_hdr) + raddr, SEEK_SET);
  12. fread_stream(&addr, sizeof(addr), 1, &ifp);
  13. +#if defined(TARGET_h8300)
  14. + addr = ntohl(addr);
  15. + if (r & 1)
  16. + addr &= 0x00ffffff;
  17. +#endif
  18. printf("%"PRIx32"\n", addr);
  19. }