Wed May 29 00:57:37 1996 David Mosberger-Tang <davidm@azstarnet.com>
authorRoland McGrath <roland@gnu.org>
Sun, 2 Jun 1996 18:48:36 +0000 (18:48 +0000)
committerRoland McGrath <roland@gnu.org>
Sun, 2 Jun 1996 18:48:36 +0000 (18:48 +0000)
* sysdeps/unix/bsd/osf/alpha/brk.S,
  sysdeps/unix/sysv/linux/alpha/brk.S (__curbrk): Store the entire
  break value, not just the low 32 bits to accomodate large
  memories.
Tue May 28 10:46:04 1996  Richard Henderson  <rth@tamu.edu>

* sysdeps/unix/sysv/linux/alpha/brk.S: Rather than attempt to
dynamically resolve _end for initializing __curbrk, support the
brk(0) query idiom.

sysdeps/unix/sysv/linux/alpha/brk.S

index 4582539..1c4a4f9 100644 (file)
@@ -23,17 +23,7 @@ break value (instead of the new, requested one).  */
 #include <sysdep.h>
 #include <errnos.h>
 
-#ifndef       HAVE_GNU_LD
-#define _end           end
-#endif
-
-       .extern _end,8
-
-       .data
-
-       .globl __curbrk
-__curbrk:
-       .quad _end
+.comm __curbrk, 8
 
        .text
 LEAF(__brk, 0)
@@ -42,11 +32,15 @@ LEAF(__brk, 0)
 
        ldi     v0, __NR_brk
        call_pal PAL_callsys
+
+       /* Correctly handle the brk(0) query case.  */
+       cmoveq  a0, v0, a0
+
        subq    a0, v0, t0
        bne     t0, error
 
        /* Update __curbrk and return cleanly.  */
-       stl     a0, __curbrk
+       stq     a0, __curbrk
        mov     zero, v0
        ret
 
@@ -54,6 +48,6 @@ LEAF(__brk, 0)
 error: ldi     v0, ENOMEM
        jmp     zero, syscall_error
 
-       .end __brk
+       END(__brk)
 
 weak_alias (__brk, brk)