summaryrefslogtreecommitdiff
path: root/toolchain/elf2flt
diff options
context:
space:
mode:
authorWaldemar Brodkorb <wbx@openadk.org>2020-03-10 14:25:51 +0100
committerWaldemar Brodkorb <wbx@openadk.org>2020-03-10 14:25:51 +0100
commitfdc87895f7d5b791898fe46ee16f2e87b32c2aae (patch)
tree440270ea04e295bee87385109690becc9b6f5059 /toolchain/elf2flt
parent324041ff7451feafead1937685caf11a3df43e60 (diff)
elf2flt: use upstream for h8300 with a small patch
Diffstat (limited to 'toolchain/elf2flt')
-rw-r--r--toolchain/elf2flt/Makefile.inc6
-rw-r--r--toolchain/elf2flt/patches/7e33f28df198c46764021ed14408bd262751e148/0003-h8300.patch20
2 files changed, 20 insertions, 6 deletions
diff --git a/toolchain/elf2flt/Makefile.inc b/toolchain/elf2flt/Makefile.inc
index 30a3cebfe..574b345cf 100644
--- a/toolchain/elf2flt/Makefile.inc
+++ b/toolchain/elf2flt/Makefile.inc
@@ -6,9 +6,3 @@ PKG_VERSION:= 7e33f28df198c46764021ed14408bd262751e148
PKG_GIT:= hash
PKG_RELEASE:= 1
PKG_SITES:= https://github.com/uclinux-dev/elf2flt.git
-ifeq ($(ADK_TARGET_ARCH_H8300),y)
-PKG_VERSION:= h8300
-PKG_GIT:= branch
-PKG_RELEASE:= 1
-PKG_SITES:= git://git.osdn.net/gitroot/uclinux-h8/elf2flt.git
-endif
diff --git a/toolchain/elf2flt/patches/7e33f28df198c46764021ed14408bd262751e148/0003-h8300.patch b/toolchain/elf2flt/patches/7e33f28df198c46764021ed14408bd262751e148/0003-h8300.patch
new file mode 100644
index 000000000..c2117ede4
--- /dev/null
+++ b/toolchain/elf2flt/patches/7e33f28df198c46764021ed14408bd262751e148/0003-h8300.patch
@@ -0,0 +1,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);
+ }
+