summaryrefslogtreecommitdiff
path: root/toolchain
diff options
context:
space:
mode:
authorWaldemar Brodkorb <wbx@openadk.org>2023-12-23 18:13:53 +0100
committerWaldemar Brodkorb <wbx@openadk.org>2023-12-23 18:14:03 +0100
commit6c7571d6e05335584eab6265c6bab30aabebf9d7 (patch)
treefc21f286f372eede55915a33bc5aec23254fafd0 /toolchain
parent210a8823a5b0e75f182760a18a5ba16d4809c445 (diff)
elf2flt: add missing h8300 patch
Diffstat (limited to 'toolchain')
-rw-r--r--toolchain/elf2flt/patches/v2023.09/0003-h8300.patch20
1 files changed, 20 insertions, 0 deletions
diff --git a/toolchain/elf2flt/patches/v2023.09/0003-h8300.patch b/toolchain/elf2flt/patches/v2023.09/0003-h8300.patch
new file mode 100644
index 000000000..2c7b73482
--- /dev/null
+++ b/toolchain/elf2flt/patches/v2023.09/0003-h8300.patch
@@ -0,0 +1,20 @@
+diff -Nur elf2flt-v2023.09.orig/flthdr.c elf2flt-v2023.09/flthdr.c
+--- elf2flt-v2023.09.orig/flthdr.c 2023-12-23 03:20:20.000000000 +0100
++++ elf2flt-v2023.09/flthdr.c 2023-12-23 17:11:22.699413170 +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);
+ }
+