summaryrefslogtreecommitdiff
path: root/toolchain/elf2flt/patches/7e33f28df198c46764021ed14408bd262751e148/0003-h8300.patch
blob: c2117ede4d201e0b61e509a70fdc57b46b9248e8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
diff -Nur elf2flt-7e33f28df198c46764021ed14408bd262751e148.orig/flthdr.c elf2flt-7e33f28df198c46764021ed14408bd262751e148/flthdr.c
--- elf2flt-7e33f28df198c46764021ed14408bd262751e148.orig/flthdr.c	2019-09-30 22:07:49.000000000 +0200
+++ elf2flt-7e33f28df198c46764021ed14408bd262751e148/flthdr.c	2020-03-09 14:41:48.348042903 +0100
@@ -164,8 +164,16 @@
 				r = ntohl(relocs[i]);
 				raddr = flat_get_relocate_addr(r);
 				printf("    %u\t0x%08lx (0x%08"PRIx32")\t", i, r, raddr);
+#if defined(TARGET_h8300)
+				raddr &= ~0x00000001;
+#endif
 				fseek_stream(&ifp, sizeof(old_hdr) + raddr, SEEK_SET);
 				fread_stream(&addr, sizeof(addr), 1, &ifp);
+#if defined(TARGET_h8300)
+				addr = ntohl(addr);
+				if (r & 1)
+					addr &= 0x00ffffff;
+#endif
 				printf("%"PRIx32"\n", addr);
 			}