Skip to contentSkip to conversation

H8/300 support update (4/4)

PATCH New Yoshinori Sato 1 participant 1 message May 2, 2003 exec and binfmt

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 H8/300 support update (4/4)

include

o binfmt_flat h8300 support.

Signature · 2 lines
Yoshinori Sato
<[email protected]>

Index: fs/binfmt_flat.c
===================================================================
RCS file: /var/lib/cvs/linux-2.5/fs/binfmt_flat.c,v retrieving revision 1.1.1.1
retrieving revision 1.2

binfmt_flat.c +17 -2
diff -u -r1.1.1.1 -r1.2
@@ -42,7 +42,7 @@
 #include <asm/unaligned.h>
 #include <asm/cacheflush.h>
 
-#undef DEBUG
+#define DEBUG
 #ifdef DEBUG
 #define	DBG_FLT(a...)	printk(##a)
 #else
@@ -291,9 +291,12 @@
 #ifdef DEBUG
 	char *segment[] = { "TEXT", "DATA", "BSS", "*UNKNOWN*" };
 #endif
+#if !defined(__H8300H__) && !defined(__H8300S__)
 	flat_v2_reloc_t	r;
+#endif
 	unsigned long *ptr;
 	
+#if !defined(__H8300H__) && !defined(__H8300S__)
 	r.value = rl;
 #if defined(CONFIG_COLDFIRE)
 	ptr = (unsigned long *) (current->mm->start_code + r.reloc.offset);
@@ -325,6 +328,14 @@
 #ifdef DEBUG
 	printk("Relocation became %x\n", (int)*ptr);
 #endif
+#else
+	ptr = (unsigned long *)(current->mm->start_code+rl);
+	if (ptr >= current->mm->end_code)
+		ptr += 1;
+	*ptr += current->mm->start_code;
+	if ((*ptr & 0x00ffffff) >= current->mm->end_code)
+		*ptr += sizeof(unsigned long);
+#endif
 }		
 
 
@@ -389,7 +400,11 @@
 	 * fix up the flags for the older format,  there were all kinds
 	 * of endian hacks,  this only works for the simple cases
 	 */
-	if (rev == OLD_FLAT_VERSION && flags)
+	if (rev == OLD_FLAT_VERSION
+#if !defined(__H8300H__) && !defined(__H8300S__)
+			&& flags
+#endif
+			)
 		flags = FLAT_FLAG_RAM;
 
 #ifndef CONFIG_BINFMT_ZFLAT