Index: /branches/ia32/lisp-kernel/x86-gc.c
===================================================================
--- /branches/ia32/lisp-kernel/x86-gc.c	(revision 9465)
+++ /branches/ia32/lisp-kernel/x86-gc.c	(revision 9466)
@@ -143,5 +143,5 @@
 #ifdef X8632
     {
-      LispObj fun;
+      LispObj fun = 0;
 
       if (*(unsigned char *)n == RECOVER_FN_OPCODE)
@@ -2078,5 +2078,7 @@
   pagelet = dnode >> 5;
   nbits = dnode & 0x1f;
-  near_bits = ((unsigned short *)GCdynamic_markbits)[dnode>>4];
+  /* On little-endian x86, we have to flip the low bit of dnode>>4 to
+     get the near_bits from the appropriate half-word. */
+  near_bits = ((unsigned short *)GCdynamic_markbits)[(dnode>>4)^1];
 
   if (nbits < 16) {
@@ -2480,4 +2482,20 @@
 }
 
+#ifdef X8632
+void
+update_self_references(LispObj *node)
+{
+  LispObj fn = fulltag_misc + (LispObj)node;
+  unsigned char *p = (unsigned char *)node;
+  natural i, offset;
+
+  i = ((unsigned short *)node)[2] - 2;
+  offset = node[i];
+  while (offset) {
+    *(LispObj *)(p + offset) = fn;
+    offset = node[--i];
+  }    
+}
+#endif
 
 /*
@@ -2547,4 +2565,5 @@
 #ifdef X8632
 	    int skip = *((unsigned short *)src);
+	    LispObj *f = dest;
 #else
 	    int skip = *((int *)src);
@@ -2555,4 +2574,5 @@
 	      *dest++ = *src++;
 	    }
+	    update_self_references(f);
 	    while(elements--) {
 	      *dest++ = node_forwarding_address(*src++);
