update from main archive 960906
authorUlrich Drepper <drepper@redhat.com>
Sat, 7 Sep 1996 04:10:03 +0000 (04:10 +0000)
committerUlrich Drepper <drepper@redhat.com>
Sat, 7 Sep 1996 04:10:03 +0000 (04:10 +0000)
sysdeps/alpha/elf/start.S
sysdeps/unix/alpha/sysdep.S

index d20a009..c8b374a 100644 (file)
@@ -21,6 +21,7 @@ Cambridge, MA 02139, USA.  */
 
        .text
        .align 3
+       .globl _start
        .ent _start, 0
 _start:
        .frame fp, 0, zero
index 336eb02..8d70bda 100644 (file)
@@ -17,8 +17,7 @@ not, write to the Free Software Foundation, Inc., 675 Mass Ave,
 Cambridge, MA 02139, USA.  */
 
 #include <sysdep.h>
-#define _ERRNO_H
-#include <errnos.h>
+#include <features.h>
 
        .section .bss
        .globl errno
@@ -30,15 +29,60 @@ errno:      .space 4
 #endif
 
        .text
-LEAF(__syscall_error, 0)
+       .align 2
+
+#ifdef _LIBC_REENTRANT
+
+       .globl __syscall_error
+       .ent __syscall_error
+__syscall_error:
        ldgp    gp, 0(t12)
+       lda     sp, -16(sp)
+       .frame  sp, 16, ra, 0
+       stq     ra, 0(sp)
+       stq     v0, 8(sp)
+       .mask   0x4000001, -16
        .prologue 1
 
-       /* Store return value in errno... */
-       stl     v0, errno
+       /* Find our pre-thread errno address  */
+       jsr     ra, __errno_location
+
+       /* Store the error value.  */
+       ldl     t0, 8(sp)
+       stl     t0, 0(v0)
 
-       /* And just kick back a -1.  */
+       /* And kick back a -1.  */
        ldi     v0, -1
+
+       ldq     ra, 0(sp)
+       lda     sp, 16(sp)
        ret
+       .end __syscall_error
+
+/* A default non-threaded version of __errno_location that just returns
+   the address of errno.  */
+
+       .weak   __errno_location
+       .ent    __errno_location
+__errno_location:
+       .frame  sp, 0, ra
+       ldgp    gp, 0(t12)
+       .mask   0, 0
+       .prologue 1
 
+       lda     v0, errno
+       ret
+       .end __errno_location
+
+#else
+
+ENTRY(__syscall_error)
+       ldgp    gp, 0(t12)
+       .prologue 1
+
+       stl     v0, errno
+       lda     v0, -1
+       ret
        END(__syscall_error)
+
+#endif /* _LIBC_REENTRANT */