summaryrefslogtreecommitdiff
path: root/sysdeps/unix/i386
diff options
context:
space:
mode:
authorRoland McGrath <roland@gnu.org>1995-08-31 17:33:01 +0000
committerRoland McGrath <roland@gnu.org>1995-08-31 17:33:01 +0000
commite3726b056b3b1cfde7019e29d5d3c50ce70e08e9 (patch)
tree97695fe42ef6e492efc0d3b728218746d4ccae7e /sysdeps/unix/i386
parenta993273c0d4d1907028adee7a2ae012826fd316c (diff)
Rewrote i386 setjmp in assembly.
Thu Aug 31 13:23:35 1995 Roland McGrath <roland@churchy.gnu.ai.mit.edu> * 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.
Diffstat (limited to 'sysdeps/unix/i386')
-rw-r--r--sysdeps/unix/i386/brk.S9
1 files changed, 9 insertions, 0 deletions
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