MIPS updates.

diff --git a/include/arch/mips/klibc/archsetjmp.h b/include/arch/mips/klibc/archsetjmp.h
index 0a9448e..40e5be2 100644
--- a/include/arch/mips/klibc/archsetjmp.h
+++ b/include/arch/mips/klibc/archsetjmp.h
@@ -32,7 +32,7 @@
   unsigned long __f31;
   unsigned long __fcr31;
   unsigned long __unused;
-} __attribute__((align(8)));
+} __attribute__((aligned(8)));
 
 typedef struct __jmp_buf jmp_buf[1];
 
diff --git a/klibc/arch/arm/exits-arm.S b/klibc/arch/arm/exits-arm.S
deleted file mode 100644
index a923b48..0000000
--- a/klibc/arch/arm/exits-arm.S
+++ /dev/null
@@ -1,32 +0,0 @@
-#
-# exit and _exit get included in *every* program, and gcc generates
-# horrible code for them.  Yes, this only saves a few bytes, but
-# it does it in every program.
-#
-
-#include <asm/unistd.h>
-
-	.data
-	.align 4
-	.globl __exit_handler
-	.type __exit_handler,#object
-__exit_handler:
-	.long _exit
-	.size __exit_handler,4
-
-	.text
-	.align 4
-	.globl exit
-	.type exit,#function
-exit:
-	ldr	r3, =__exit_handler
-	ldr	r3, [r3, #0]
-	mov	pc, r3
-	.size exit,.-exit
-
-	/* No need to save any registers... we're exiting! */
-	.globl _exit
-	.type _exit,#function
-_exit:	swi	__NR_exit
-	b	_exit
-	.size _exit,.-exit
diff --git a/klibc/arch/arm/exits-thumb.S b/klibc/arch/arm/exits-thumb.S
deleted file mode 100644
index f1aa564..0000000
--- a/klibc/arch/arm/exits-thumb.S
+++ /dev/null
@@ -1,35 +0,0 @@
-#
-# exit and _exit get included in *every* program, and gcc generates
-# horrible code for them.  Yes, this only saves a few bytes, but
-# it does it in every program.
-#
-
-#include <asm/unistd.h>
-
-	.data
-	.align 4
-	.globl __exit_handler
-	.type __exit_handler,#object
-__exit_handler:
-	.long _exit
-	.size __exit_handler,4
-
-	.text
-	.align 4
-	.globl exit
-	.type exit,#function
-	.thumb_func
-exit:
-	ldr	r3, =__exit_handler
-	ldr	r3, [r3, #0]
-	mov	pc, r3
-	.size exit,.-exit
-
-	/* No need to save any registers... we're exiting! */
-	.globl _exit
-	.type _exit,#function
-	.thumb_func
-_exit:	mov	r7, #__NR_exit
-	swi	0
-	b	_exit
-	.size _exit,.-exit
diff --git a/klibc/arch/mips/MCONFIG b/klibc/arch/mips/MCONFIG
index cfda7a5..6794361 100644
--- a/klibc/arch/mips/MCONFIG
+++ b/klibc/arch/mips/MCONFIG
@@ -9,3 +9,9 @@
 
 OPTFLAGS = -Os -fomit-frame-pointer -fno-pic -mno-abicalls
 BITSIZE  = 32
+
+# Extra linkflags when building the shared version of the library
+# This address needs to be reachable using normal inter-module
+# calls, and work on the memory models for this architecture
+# 2 MB -- the normal starting point for text is 4 MB.
+SHAREDFLAGS	= -Ttext 0x00200000
diff --git a/klibc/arch/mips/crt0.S b/klibc/arch/mips/crt0.S
index 3ee66db..a3ce27e 100644
--- a/klibc/arch/mips/crt0.S
+++ b/klibc/arch/mips/crt0.S
@@ -15,8 +15,8 @@
 	sw	zero, 16(sp)
 
 	addiu	a0, sp, 32		# Pointer to ELF entry structure
+	move	a1, v0			# Kernel-provided atexit() pointer
 
 	jal	__libc_init
-	 move	a1, v0			# Kernel-provided atexit() pointer
 
 	END(__start)
diff --git a/klibc/arch/mips/include/klibc/archsetjmp.h b/klibc/arch/mips/include/klibc/archsetjmp.h
index 0a9448e..40e5be2 100644
--- a/klibc/arch/mips/include/klibc/archsetjmp.h
+++ b/klibc/arch/mips/include/klibc/archsetjmp.h
@@ -32,7 +32,7 @@
   unsigned long __f31;
   unsigned long __fcr31;
   unsigned long __unused;
-} __attribute__((align(8)));
+} __attribute__((aligned(8)));
 
 typedef struct __jmp_buf jmp_buf[1];
 
diff --git a/klibc/arch/mips/setjmp.S b/klibc/arch/mips/setjmp.S
index 3ad76b6..9902777 100644
--- a/klibc/arch/mips/setjmp.S
+++ b/klibc/arch/mips/setjmp.S
@@ -41,8 +41,8 @@
 	swc1	$f29,84(a0)
 	swc1	$f30,88(a0)
 	swc1	$f31,92(a0)
+	sw	t0,96(a0)
 	jr	ra
-	  sw	t0,96(a0)
 	
 	END(setjmp)
 
@@ -72,8 +72,8 @@
 	lwc1	$f29,84(a0)
 	lwc1	$f30,88(a0)
 	lwc1	$f31,92(a0)
+	ctc1	t0,$31
 	jr	ra
-	 ctc1	t0,$31
 
 	END(longjmp)
 	
diff --git a/klibc/arch/mips/vfork.S b/klibc/arch/mips/vfork.S
index 562149f..aca8083 100644
--- a/klibc/arch/mips/vfork.S
+++ b/klibc/arch/mips/vfork.S
@@ -6,7 +6,7 @@
 #define CLONE_VFORK	0x00004000
 #define SIGCHLD		18
 
-LEAF(pipe)
+LEAF(vfork)
 	li	a0, CLONE_VFORK | CLONE_VM | SIGCHLD
 	li	a1, 0
 	li	v0, __NR_clone
@@ -16,4 +16,4 @@
 1:	sw	v0, errno
 	li	v0, -1
 2:	jr	ra
-	END(pipe)
+	END(vfork)