From e3726b056b3b1cfde7019e29d5d3c50ce70e08e9 Mon Sep 17 00:00:00 2001 From: Roland McGrath Date: Thu, 31 Aug 1995 17:33:01 +0000 Subject: Rewrote i386 setjmp in assembly. Thu Aug 31 13:23:35 1995 Roland McGrath * sysdeps/unix/i386/brk.S [PIC]: Set __curbrk through the GOT. Rewrote i386 setjmp code in assembly, so as to avoid fighting with the compiler for the register values. * sysdeps/i386/setjmp.S, sysdeps/i386/__longjmp.S: New files. * sysdeps/i386/setjmp.c, sysdeps/i386/__longjmp.c: Files removed. * sysdeps/i386/jmp_buf.h [! _ASM] (__jmp_buf): Define as array of ints. [__USE_MISC || _ASM] (JB_*): New macros, for indices therein. (_JMPBUF_UNWINDS): Use JB_SP. --- sysdeps/unix/i386/brk.S | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'sysdeps/unix/i386/brk.S') diff --git a/sysdeps/unix/i386/brk.S b/sysdeps/unix/i386/brk.S index f55ac7c775..f1717bbf8e 100644 --- a/sysdeps/unix/i386/brk.S +++ b/sysdeps/unix/i386/brk.S @@ -34,7 +34,16 @@ C_LABEL(__curbrk) .text SYSCALL__ (brk, 1) movl 4(%esp), %eax +#ifdef PIC + /* Standard PIC nonsense to store into `__curbrk' through the GOT. */ + call here +here: popl %ecx + addl $_GLOBAL_OFFSET_TABLE_+[.-here], %ecx + movl C_SYMBOL_NAME(__curbrk@GOT)(%ecx), %ecx + movl %eax, (%ecx) +#else movl %eax, C_SYMBOL_NAME(__curbrk) +#endif xorl %eax, %eax ret -- cgit 1.4.1