diff -ur uc-origs/uClinux-2.4.27-uc1/fs/binfmt_flat.c uClinux-2.4.27-uc1/fs/binfmt_flat.c
--- uc-origs/uClinux-2.4.27-uc1/fs/binfmt_flat.c	2004-12-12 21:48:48.000000000 +0100
+++ uClinux-2.4.27-uc1/fs/binfmt_flat.c	2005-01-21 17:26:35.000000000 +0100
@@ -971,34 +971,15 @@
 		{
 			for (i=0; i < relocs; i++) 
 			{
-				unsigned long addr, relval;
+				unsigned long relval;
 
-				/* Get the address of the pointer to be
-				   relocated (of course, the address has to be
-				   relocated first).  */
 				relval = ntohl(reloc[i]);
-				addr = flat_get_relocate_addr(relval);
-				rp = (unsigned long *) calc_reloc(addr, libinfo, id, 1);
-				if (rp == (unsigned long *)RELOC_FAILED)
-					return -ENOEXEC;
-
-				/* Get the pointer's value.  */
-				addr = flat_get_addr_from_rp(rp, relval, flags);
-				if (addr != 0) 
-				{
-					/*
-					 * Do the relocation.  PIC relocs in 
-					 * the data section are already in 
-					 * target order
-					 */
-					if ((flags & FLAT_FLAG_GOTPIC) == 0)
-						addr = ntohl(addr);
-					addr = calc_reloc(addr, libinfo, id, 0);
-					if (addr == RELOC_FAILED)
-						return -ENOEXEC;
+				rp = (unsigned long *) calc_reloc(relval, libinfo, id, 1);
 
-					/* Write back the relocated pointer.  */
-					flat_put_addr_at_rp(rp, addr, relval);
+				if (*rp != 0) 
+				{
+					relval = *rp;
+					*rp = calc_reloc(relval, libinfo, id, 0);
 				}
 			}
 		}

