about summary refs log tree commit diff
path: root/sysdeps/sparc/bsd-_setjmp.S
diff options
context:
space:
mode:
Diffstat (limited to 'sysdeps/sparc/bsd-_setjmp.S')
-rw-r--r--sysdeps/sparc/bsd-_setjmp.S31
1 files changed, 14 insertions, 17 deletions
diff --git a/sysdeps/sparc/bsd-_setjmp.S b/sysdeps/sparc/bsd-_setjmp.S
index 522fe0e3a1..bf49765f4d 100644
--- a/sysdeps/sparc/bsd-_setjmp.S
+++ b/sysdeps/sparc/bsd-_setjmp.S
@@ -20,24 +20,21 @@
 #include <sysdep.h>
 
 ENTRY (_setjmp)
+
 #ifdef PIC
-1:
-	jmpl  2f,%o1
-	nop
-2:
-	sethi %hi(_GLOBAL_OFFSET_TABLE_-(1b-.)),%l7
-	or    %l7,%lo(_GLOBAL_OFFSET_TABLE_-(1b-.)),%l7
-	add   %l7,%o1,%l7
-	sethi %hi(C_SYMBOL_NAME (__sigsetjmp)),%g1
-	or    %g1,%lo(C_SYMBOL_NAME (__sigsetjmp)),%g1
-	ld    [%l7+%g1],%g1
-	ld    [%g1],%g1
-	jmpl  %g1,%g0
-	mov   %g0,%o1           /* Pass second argument of zero */
+	save	%sp, -64, %sp
+1:	call	2f
+	sethi	%hi(_GLOBAL_OFFSET_TABLE_-(1b-.)), %g1
+2:	or	%l7, %lo(_GLOBAL_OFFSET_TABLE_-(1b-.)), %g1
+	add	%g1, %o7, %g1
+	sethi	%hi(C_SYMBOL_NAME(__sigsetjmp)), %g2
+	restore
+	or	%g2, %lo(C_SYMBOL_NAME(__sigsetjmp)), %g2
+	ld	[%g1+%g2], %g1
 #else
+	sethi	%hi(C_SYMBOL_NAME(__sigsetjmp)), %g1
+	or	%g1, %lo(C_SYMBOL_NAME(__sigsetjmp)), %g1
+#endif
 
-	sethi %hi(C_SYMBOL_NAME (__sigsetjmp)), %g1
-	or %lo(C_SYMBOL_NAME (__sigsetjmp)), %g1, %g1
 	jmp %g1
-	mov %g0, %o1		/* Pass second argument of zero.  */
-#endif
+	 mov %g0, %o1		/* Pass second argument of zero.  */