about summary refs log tree commit diff
path: root/sysdeps/i386/setjmp.S
diff options
context:
space:
mode:
authorRoland McGrath <roland@gnu.org>1995-09-01 22:25:08 +0000
committerRoland McGrath <roland@gnu.org>1995-09-01 22:25:08 +0000
commit44c8d1a2a8775ad8c67fa1c46ccc67cccf585d93 (patch)
treec77e32c88b64caccdd673fc54efdba189361a6e6 /sysdeps/i386/setjmp.S
parente3726b056b3b1cfde7019e29d5d3c50ce70e08e9 (diff)
downloadglibc-44c8d1a2a8775ad8c67fa1c46ccc67cccf585d93.tar.gz
glibc-44c8d1a2a8775ad8c67fa1c46ccc67cccf585d93.tar.xz
glibc-44c8d1a2a8775ad8c67fa1c46ccc67cccf585d93.zip
Fri Sep 1 16:16:12 1995 Roland McGrath <roland@churchy.gnu.ai.mit.edu>
	* libc-symbols.h (link_warning): Take new first arg SYMBOL; ask
	for a warning on references to that specific symbol, not the
	entire containing object file.
	(stub_warning): Pass symbol name to link_warning.
	* stdio/gets.c: Pass function name in link_warning invocation.

	* hurd/intr-msg.c: Treat apparent EINTR return from msg trap like
	MACH_SEND_INTERRUPTED.  That indicates interrupt_operation was
	sent, but failed.

	* stdlib/msort.c: Include memcopy.h.
	(msort_with_tmp): If operating on aligned op_t words, use direct word
	fetches and stores.

	* sysdeps/i386/dl-machine.h (ELF_MACHINE_BEFORE_RTLD_RELOC): Add
	missing backslash.
Diffstat (limited to 'sysdeps/i386/setjmp.S')
-rw-r--r--sysdeps/i386/setjmp.S29
1 files changed, 21 insertions, 8 deletions
diff --git a/sysdeps/i386/setjmp.S b/sysdeps/i386/setjmp.S
index a07d6f1137..ccb7147606 100644
--- a/sysdeps/i386/setjmp.S
+++ b/sysdeps/i386/setjmp.S
@@ -24,13 +24,26 @@ Cambridge, MA 02139, USA.  */
 ENTRY (__sigsetjmp)
 	movl 4(%esp), %eax	/* User's jmp_buf in %eax.  */
      	/* Save registers.  */
-	movl %ebx, JB_BX(%eax)
-	movl %esi, JB_SI(%eax)
-	movl %edi, JB_DI(%eax)
-	movl %ebp, JB_BP(%eax)
+	movl %ebx, (JB_BX*4)(%eax)
+	movl %esi, (JB_SI*4)(%eax)
+	movl %edi, (JB_DI*4)(%eax)
+	movl %ebp, (JB_BP*4)(%eax)
 	leal 4(%esp), %ecx	/* Save SP as it will be after we return.  */
-     	movl %ecx, JB_SP(%eax)
+     	movl %ecx, (JB_SP*4)(%eax)
 	movl 0(%esp), %ecx	/* Save PC we are returning to now.  */
-     	movl %ecx, JB_PC(%eax)
-	xorl %eax, %eax		/* Return zero.  */
-	ret
+     	movl %ecx, (JB_PC*4)(%eax)
+
+	/* Make a tail call to __sigjmp_save; it takes the same args.  */
+#ifdef	PIC
+	/* We cannot use the PLT, because it requires that %ebx be set, but
+           we can't save and restore our caller's value.  Instead, we do an
+           indirect jump through the GOT, using for the temporary register
+           %ecx, which is call-clobbered.  */
+	call here
+here:	popl %ecx
+	addl $_GLOBAL_OFFSET_TABLE_+[.-here], %ecx
+	movl C_SYMBOL_NAME(__sigjmp_save@GOT)(%ecx), %ecx
+	jmp *%ecx
+#else
+	jmp __sigjmp_save
+#endif