--- busybox-1.00/modutils/insmod.c	2004-09-03 01:03:25.000000000 +0200
+++ busybox-1.00.reloc-hack/modutils/insmod.c	2005-07-10 14:59:18.000000000 +0200
@@ -835,16 +835,20 @@
 
 #if defined(__arm__)
 		case R_ARM_NONE:
+fprintf(stderr, "-R_ARM_NONE-");
 			break;
 
 		case R_ARM_ABS32:
+fprintf(stderr, "-R_ARM_ABS32-");
 			*loc += v;
 			break;
 
 		case R_ARM_GOT32:
+fprintf(stderr, "-R_ARM_GOT32-");
 			goto bb_use_got;
 
 		case R_ARM_GOTPC:
+fprintf(stderr, "-R_ARM_GOTPC-");
 			/* relative reloc, always to _GLOBAL_OFFSET_TABLE_
 			 * (which is .got) similar to branch,
 			 * but is full 32 bits relative */
@@ -855,9 +859,11 @@
 
 		case R_ARM_PC24:
 		case R_ARM_PLT32:
+fprintf(stderr, "-R_ARM_PC24/R_ARM_PLT32-");
 			goto bb_use_plt;
 
 		case R_ARM_GOTOFF: /* address relative to the got */
+fprintf(stderr, "-R_ARM_GOTOFF-");
 			assert(got);
 			*loc += v - got;
 			break;
@@ -1330,64 +1336,30 @@
 
 				/* generate some machine code */
 
-#if defined(__arm__)
 				ip[0] = 0xe51ff004;			/* ldr pc,[pc,#-4] */
 				ip[1] = v;				/* sym@ */
-#endif
-#if defined(__powerpc__)
-				ip[0] = 0x3d600000 + ((v + 0x8000) >> 16);  /* lis r11,sym@ha */
-				ip[1] = 0x396b0000 + (v & 0xffff);	      /* addi r11,r11,sym@l */
-				ip[2] = 0x7d6903a6;			      /* mtctr r11 */
-				ip[3] = 0x4e800420;			      /* bctr */
-#endif
-#if defined (__v850e__)
-				/* We have to trash a register, so we assume that any control
-				   transfer more than 21-bits away must be a function call
-				   (so we can use a call-clobbered register).  */
-				ip[0] = 0x0621 + ((v & 0xffff) << 16);   /* mov sym, r1 ... */
-				ip[1] = ((v >> 16) & 0xffff) + 0x610000; /* ...; jmp r1 */
-#endif
+
 				pe->inited = 1;
 			}
 
 			/* relative distance to target */
 			v -= dot;
 			/* if the target is too far away.... */
-#if defined (__arm__) || defined (__powerpc__)
 			if ((int)v < -0x02000000 || (int)v >= 0x02000000)
-#elif defined (__v850e__)
-				if ((Elf32_Sword)v > 0x1fffff || (Elf32_Sword)v < (Elf32_Sword)-0x200000)
-#endif
 					/* go via the plt */
 					v = plt + pe->offset - dot;
 
-#if defined (__v850e__)
-			if (v & 1)
-#else
 				if (v & 3)
-#endif
 					ret = obj_reloc_dangerous;
 
 			/* merge the offset into the instruction. */
-#if defined(__arm__)
 			/* Convert to words. */
 			v >>= 2;
 
+fprintf(stderr, "\n*loc at %08x: %08x", loc, *loc);
 			*loc = (*loc & ~0x00ffffff) | ((v + *loc) & 0x00ffffff);
-#endif
-#if defined(__powerpc__)
-			*loc = (*loc & ~0x03fffffc) | (v & 0x03fffffc);
-#endif
-#if defined (__v850e__)
-			/* We write two shorts instead of a long because even 32-bit insns
-			   only need half-word alignment, but the 32-bit data write needs
-			   to be long-word aligned.  */
-			((unsigned short *)loc)[0] =
-				(*(unsigned short *)loc & 0xffc0) /* opcode + reg */
-				| ((v >> 16) & 0x3f);             /* offs high part */
-			((unsigned short *)loc)[1] =
-				(v & 0xffff);                    /* offs low part */
-#endif
+fprintf(stderr, " -> %08x\n", *loc);
+
 			break;
 #endif /* CONFIG_USE_PLT_ENTRIES */
 
@@ -2868,6 +2840,8 @@
 	int i, n = f->header.e_shnum;
 	int ret = 1;
 
+fprintf(stderr, "In obj_relocate()...\n");
+
 	/* Finalize the addresses of the sections.  */
 
 	f->baseaddr = base;
@@ -2936,9 +2910,11 @@
 #endif
 
 			/* Do it! */
+fprintf(stderr, "Doing relocation...");
 			switch (arch_apply_relocation
 					(f, targsec, symsec, intsym, rel, value)) {
 				case obj_reloc_ok:
+fprintf(stderr, "...okay!\n");
 					break;
 
 				case obj_reloc_overflow:

