[PATCH 3/6] h8300 address space is 24bit.

Waldemar Brodkorb <[email protected]> Thu, 31 Dec 2015 00:55:45 +0100
Newsgroups gmane.linux.uclinux.devel
Message-ID <[email protected]>
From: Yoshinori Sato <[email protected]>

Signed-off-by: Yoshinori Sato <[email protected]>
Signed-off-by: Waldemar Brodkorb <[email protected]>
---
 flthdr.c |    8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/flthdr.c b/flthdr.c
index 8a8b97c..0401e20 100644
--- a/flthdr.c
+++ b/flthdr.c
@@ -167,8 +167,16 @@ process_file(const char *ifile, const char *ofile)
 				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);
 			}
 
-- 
1.7.10.4

_______________________________________________
uClinux-dev mailing list
[email protected]
http://mailman.uclinux.org/mailman/listinfo/uclinux-dev
This message was resent by [email protected]
To unsubscribe see:
http://mailman.uclinux.org/mailman/options/uclinux-dev