Index: libc/arch/mips32/Makefile.inc
===================================================================
--- libc/arch/mips32/Makefile.inc	(revision e708063fcb109c2a31c5e928ec97215959de8633)
+++ libc/arch/mips32/Makefile.inc	(revision a71d9af9f07b33417eac0e091ee4318de370ac93)
@@ -32,9 +32,8 @@
 TARGET = mipsel-linux-gnu
 TOOLCHAIN_DIR = /usr/local/mipsel/bin
-CFLAGS += -mips3 -mno-abicalls
+CFLAGS += -mips3
 
 ARCH_SOURCES += arch/$(ARCH)/src/syscall.c \
 	arch/$(ARCH)/src/psthread.S
 
-LFLAGS += -N
 
Index: libc/arch/mips32/_link.ld.in
===================================================================
--- libc/arch/mips32/_link.ld.in	(revision e708063fcb109c2a31c5e928ec97215959de8633)
+++ libc/arch/mips32/_link.ld.in	(revision a71d9af9f07b33417eac0e091ee4318de370ac93)
@@ -18,10 +18,11 @@
 	} :text
 
-	.data ALIGN(0x4000) : SUBALIGN(0x4000) {
+	.data : {
 		*(.data);
+		*(.data.rel*);
 	} :data
 	.got : {
 		_gp = .;
-		*(.data.rel*);
+		*(.got);
 	} :data
 	.sbss : {
Index: libc/arch/mips32/include/psthread.h
===================================================================
--- libc/arch/mips32/include/psthread.h	(revision e708063fcb109c2a31c5e928ec97215959de8633)
+++ libc/arch/mips32/include/psthread.h	(revision a71d9af9f07b33417eac0e091ee4318de370ac93)
@@ -32,5 +32,8 @@
 #include <types.h>
 
-#define SP_DELTA	(8)
+/* +16 is just for sure that the called function
+ * have space to store it's arguments
+ */
+#define SP_DELTA	(8+16)
 
 typedef struct  {
Index: libc/arch/mips32/src/entry.s
===================================================================
--- libc/arch/mips32/src/entry.s	(revision e708063fcb109c2a31c5e928ec97215959de8633)
+++ libc/arch/mips32/src/entry.s	(revision a71d9af9f07b33417eac0e091ee4318de370ac93)
@@ -28,9 +28,8 @@
 
 .text
-
-.org 0
-
 .section .init, "ax"
-.globl __start
+.global __start
+.set noreorder
+.option pic2
 
 ## User-space task entry point
@@ -39,15 +38,27 @@
 .ent __start
 __start:
-	lui $28, _gp
+	.frame $sp, 32, $31
+	.cpload $25
 	
-	# Mips o32 may store its arguments on stack, make space,
+	
+	# Mips o32 may store its arguments on stack, make space (16 bytes),
 	# so that it could work with -O0
-	addiu $sp, -16
+	# Make space additional 16 bytes for the stack frame
+
+	addiu $sp, -32
+	.cprestore 16   # Allow PIC code
 	
 	jal __main
+	nop
 	
 	jal main
+	nop
 	
 	jal __exit
+	nop
 	
 .end __start
+
+# Alignment of output section data to 0x4000
+.section .data
+.align 14
Index: libc/arch/mips32/src/psthread.S
===================================================================
--- libc/arch/mips32/src/psthread.S	(revision e708063fcb109c2a31c5e928ec97215959de8633)
+++ libc/arch/mips32/src/psthread.S	(revision a71d9af9f07b33417eac0e091ee4318de370ac93)
@@ -31,5 +31,4 @@
 .set noat
 .set noreorder
-.set nomacro
 
 
@@ -84,5 +83,9 @@
 	CONTEXT_LOAD $a0
 
+	# Just for the jump into first function, but one instruction
+	# should not bother us
+	move $t9, $ra	
 	# context_restore returns 0
 	j $ra
 	xor $v0, $v0	
+
Index: libc/arch/mips32/src/thread_entry.s
===================================================================
--- libc/arch/mips32/src/thread_entry.s	(revision e708063fcb109c2a31c5e928ec97215959de8633)
+++ libc/arch/mips32/src/thread_entry.s	(revision a71d9af9f07b33417eac0e091ee4318de370ac93)
@@ -28,9 +28,9 @@
 
 .text
-
+	
 .set noat
 .set noreorder
-.set nomacro
-
+.option pic2
+	
 .globl __thread_entry
 
@@ -40,5 +40,6 @@
 .ent __thread_entry
 __thread_entry:
-	lui $28, _gp
+	.frame $sp, 32, $31
+	.cpload $25
 
 	#
@@ -47,7 +48,8 @@
 	add $4, $2, 0
 	# Mips o32 may store its arguments on stack, make space
-	addiu $sp, -16
+	addiu $sp, -32
+	.cprestore 16
 	
-	j __thread_main
+	jal __thread_main
 	nop
 		
