Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/lib/libc/arch/sparc64 Use large (-fPIC) relocations.



details:   https://anonhg.NetBSD.org/src/rev/7c38e0678a04
branches:  trunk
changeset: 526607:7c38e0678a04
user:      eeh <eeh%NetBSD.org@localhost>
date:      Tue May 07 01:34:21 2002 +0000

description:
Use large (-fPIC) relocations.

diffstat:

 lib/libc/arch/sparc64/gen/__sigsetjmp14.S |  75 +++++++++++++++++++++---------
 lib/libc/arch/sparc64/gen/sigsetjmp.S     |  31 +++++++++++-
 lib/libc/arch/sparc64/sys/__clone.S       |   4 +-
 lib/libc/arch/sparc64/sys/brk.S           |  21 +++++++-
 lib/libc/arch/sparc64/sys/cerror.S        |  15 +++++-
 lib/libc/arch/sparc64/sys/sbrk.S          |  20 +++++++-
 lib/libc/arch/sparc64/sys/setlogin.S      |  11 +++-
 7 files changed, 143 insertions(+), 34 deletions(-)

diffs (truncated from 355 to 300 lines):

diff -r a748de9fc23e -r 7c38e0678a04 lib/libc/arch/sparc64/gen/__sigsetjmp14.S
--- a/lib/libc/arch/sparc64/gen/__sigsetjmp14.S Tue May 07 01:32:46 2002 +0000
+++ b/lib/libc/arch/sparc64/gen/__sigsetjmp14.S Tue May 07 01:34:21 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: __sigsetjmp14.S,v 1.4 2000/08/28 00:45:59 eeh Exp $    */
+/*     $NetBSD: __sigsetjmp14.S,v 1.5 2002/05/07 01:34:21 eeh Exp $    */
 /*
  * Copyright (c) 1995 Paul Kranenburg
  * All rights reserved.
@@ -33,45 +33,76 @@
 #include "SYS.h"
 
 #ifdef PIC
+#ifdef BIGPIC
+       
+ENTRY(__sigsetjmp14)
+       PIC_PROLOGUE(%g1,%o2)           ! %g1 = _GLOBAL_OFFSET_TABLE
+       st      %o1,[%o0+0x48]          ! jmpbuf[JBLEN]
+       sethi   %hi(_C_LABEL(__setjmp14)), %o2
+       sethi   %hi(_C_LABEL(_setjmp)), %o3
+       or      %o2, %lo(_C_LABEL(__setjmp14)), %o2
+       or      %o3, %lo(_C_LABEL(_setjmp)), %o3
+       brnz    %o1, 1f 
+        ldx    [%g1+%o3], %o3          ! if (%o1 != 0) goto _setjmp;
+       ldx     [%g1+%o2], %o3          ! else goto __setjmp;
+1:
+       jmp     %o3
+        nop
+       
+ENTRY(__siglongjmp14)
+       PIC_PROLOGUE(%g1,%o2)           ! %g1 = _GLOBAL_OFFSET_TABLE
+       ld      [%o0+0x48], %o2         ! jmpbuf[JBLEN]
+       sethi   %hi(_C_LABEL(__longjmp14)), %o3 
+       sethi   %hi(_C_LABEL(_longjmp)), %o4
+       or      %o3, %lo(_C_LABEL(__longjmp14)), %o3
+       or      %o4, %lo(_C_LABEL(_longjmp)), %o4
+       brnz,a  %o2, 1f 
+        ldx    [%g1+%o4], %o4          ! if (%o2 != 0) goto _longjmp;
+       ldx     [%g1+%o3], %o4          ! else goto __longjmp;
+1:
+       jmp     %o4     
+        nop
+       unimp 0
+#else
 
 ENTRY(__sigsetjmp14)
-       PIC_PROLOGUE(%g1,%o2)   ! %g1 = _GLOBAL_OFFSET_TABLE
-       cmp %o1,0
-       st %o1,[%o0+0x48]               ! jmpbuf[JBLEN]
-       bne,a 1f
-        ldx [%g1+_C_LABEL(__setjmp14)], %g1    ! if (%o1 != 0) goto _setjmp;
-       ldx [%g1+_C_LABEL(_setjmp)], %g1        ! else goto __setjmp;
+       PIC_PROLOGUE(%g1,%o2)                   ! %g1 = _GLOBAL_OFFSET_TABLE
+       cmp     %o1,0
+       st      %o1,[%o0+0x48]                  ! jmpbuf[JBLEN]
+       bne,a   1f
+        ldx    [%g1+_C_LABEL(__setjmp14)], %g1 ! if (%o1 != 0) goto _setjmp;
+       ldx     [%g1+_C_LABEL(_setjmp)], %g1    ! else goto __setjmp;
 1:
        jmp %g1
         nop
 
 ENTRY(__siglongjmp14)
-       PIC_PROLOGUE(%g1,%o2)   ! %g1 = _GLOBAL_OFFSET_TABLE
-       ld [%o0+0x48],%o2               ! jmpbuf[JBLEN]
-       cmp %o2,0
-       bne,a 1f
-        ldx [%g1+_C_LABEL(__longjmp14)], %g1    ! if (%g2 != 0) goto _longjmp;
-       ldx [%g1+_C_LABEL(_longjmp)], %g1 ! else goto __longjmp;
+       PIC_PROLOGUE(%g1,%o2)                   ! %g1 = _GLOBAL_OFFSET_TABLE
+       ld      [%o0+0x48],%o2                  ! jmpbuf[JBLEN]
+       cmp     %o2,0
+       bne,a   1f
+        ldx    [%g1+_C_LABEL(__longjmp14)], %g1 ! if (%g1 != 0) goto _longjmp;
+       ldx     [%g1+_C_LABEL(_longjmp)], %g1   ! else goto __longjmp;
 1:
        jmp %g1
         nop
        unimp 0
-
+#endif /* BIGPIC */
 #else /* PIC */
 
 ENTRY(__sigsetjmp14)
-       cmp %o1,0
-       be _C_LABEL(_setjmp)
-        st %o1,[%o0+0x48]              ! jmpbuf[JBLEN]
-       ba,a _C_LABEL(__setjmp14)
+       cmp     %o1,0
+       be      _C_LABEL(_setjmp)
+        st     %o1,[%o0+0x48]          ! jmpbuf[JBLEN]
+       ba,a    _C_LABEL(__setjmp14)
        unimp 0
 
 ENTRY(__siglongjmp14)
-       ld [%o0+0x48],%g1
-       cmp %g1,0
-       be _C_LABEL(_longjmp)
+       ld      [%o0+0x48],%g1
+       cmp     %g1,0
+       be      _C_LABEL(_longjmp)
         nop
-       ba,a _C_LABEL(__longjmp14)
+       ba,a    _C_LABEL(__longjmp14)
        unimp 0
 
 #endif /* PIC */
diff -r a748de9fc23e -r 7c38e0678a04 lib/libc/arch/sparc64/gen/sigsetjmp.S
--- a/lib/libc/arch/sparc64/gen/sigsetjmp.S     Tue May 07 01:32:46 2002 +0000
+++ b/lib/libc/arch/sparc64/gen/sigsetjmp.S     Tue May 07 01:34:21 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: sigsetjmp.S,v 1.5 2000/08/28 00:45:59 eeh Exp $        */
+/*     $NetBSD: sigsetjmp.S,v 1.6 2002/05/07 01:34:21 eeh Exp $        */
 /*
  * Copyright (c) 1995 Paul Kranenburg
  * All rights reserved.
@@ -33,7 +33,8 @@
 #include "SYS.h"
 
 #ifdef PIC
-
+#ifdef BIGPIC
+       
 ENTRY(sigsetjmp)
        PIC_PROLOGUE(%g1,%o2)           ! %g1 = _GLOBAL_OFFSET_TABLE
        set     _C_LABEL(setjmp), %o2   ! if (%o1 != 0) goto _setjmp;
@@ -55,6 +56,32 @@
         nop
        unimp 0
 
+#else
+       
+ENTRY(sigsetjmp)
+       PIC_PROLOGUE(%g1,%o2)           ! %g1 = _GLOBAL_OFFSET_TABLE
+       cmp     %o1, 0
+       bne,a   1f
+        ldx    [%g1 + _C_LABEL(setjmp)], %g1   ! if (%o1 != 0) goto _setjmp;
+       ldx     [%g1 + _C_LABEL(_setjmp)], %g1  ! else goto __setjmp;
+1:     
+       jmp %g1
+        st     %o1,[%o0+0x48]          ! jmpbuf[JBLEN]
+
+
+ENTRY(siglongjmp)
+       PIC_PROLOGUE(%g1,%o2)           ! %g1 = _GLOBAL_OFFSET_TABLE
+       cmp     %o2, 0
+       ld      [%o0 + 0x48],%o2        ! jmpbuf[JBLEN]
+       bne,a   1f
+        ldx    [%g1 + _C_LABEL(longjmp)], %g1  ! if (%o2 != 0) goto _longjmp;
+       ldx     [%g1 + _C_LABEL(_longjmp)], %g1 ! else goto __longjmp;
+1:     
+       jmp %g1
+        nop
+       unimp 0
+
+#endif /* BIGPIC */
 #else /* PIC */
 
 ENTRY(sigsetjmp)
diff -r a748de9fc23e -r 7c38e0678a04 lib/libc/arch/sparc64/sys/__clone.S
--- a/lib/libc/arch/sparc64/sys/__clone.S       Tue May 07 01:32:46 2002 +0000
+++ b/lib/libc/arch/sparc64/sys/__clone.S       Tue May 07 01:34:21 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: __clone.S,v 1.1 2001/07/23 07:35:44 thorpej Exp $      */
+/*     $NetBSD: __clone.S,v 1.2 2002/05/07 01:34:22 eeh Exp $  */
 
 /*-     
  * Copyright (c) 2001 The NetBSD Foundation, Inc.
@@ -81,7 +81,7 @@
        call    %l0             ! Call the clone's entry point.
         nop
 
-       CALL(_C_LABEL(_exit))
+       JUMP(_exit)
        /* NOTREACHED */
 
 2:     ret
diff -r a748de9fc23e -r 7c38e0678a04 lib/libc/arch/sparc64/sys/brk.S
--- a/lib/libc/arch/sparc64/sys/brk.S   Tue May 07 01:32:46 2002 +0000
+++ b/lib/libc/arch/sparc64/sys/brk.S   Tue May 07 01:34:21 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: brk.S,v 1.9 2000/07/25 20:15:40 mycroft Exp $  */
+/*     $NetBSD: brk.S,v 1.10 2002/05/07 01:34:22 eeh Exp $     */
 
 /*
  * Copyright (c) 1992, 1993
@@ -44,7 +44,7 @@
 #if 0
        .asciz "@(#)brk.s       8.1 (Berkeley) 6/4/93"
 #else
-       RCSID("$NetBSD: brk.S,v 1.9 2000/07/25 20:15:40 mycroft Exp $")
+       RCSID("$NetBSD: brk.S,v 1.10 2002/05/07 01:34:22 eeh Exp $")
 #endif
 #endif /* SYSLIBC_SCCS and not lint */
 
@@ -66,6 +66,7 @@
 
 ENTRY(_brk)
 #ifdef PIC
+#ifdef BIGPIC
        PIC_PROLOGUE(%o5,%o4)
        set     _C_LABEL(__minbrk), %o4
        ldx     [%o5 + %o4], %o4
@@ -83,6 +84,22 @@
        retl                            /* success, return 0 & record new break */
         stx    %o2, [%o4]
 #else
+       PIC_PROLOGUE(%o5,%o4)
+       ldx     [%o5 + _C_LABEL(__minbrk)], %o4
+       ldx     [%o4], %o1              /* %o1 = minbrk */
+       cmp     %o1, %o0                /* if (minbrk > %o0) */
+       movg    %xcc, %o1, %o0          /*      %o0 = minbrk */
+       mov     %o0, %o2                /* save argument to syscall */
+       mov     SYS_break, %g1
+       t       ST_SYSCALL
+       bcc,a,pt        %icc, 1f
+        ldx    [%o5 + _C_LABEL(__curbrk)], %o4
+       ERROR()
+1:
+       retl                            /* success, return 0 & record new break */
+        stx    %o2, [%o4]
+#endif
+#else
        sethi   %hi(_C_LABEL(__minbrk)), %o1    /* %o1 = minbrk */
        ldx     [%o1 + %lo(_C_LABEL(__minbrk))], %o1
        cmp     %o1, %o0                /* if (minbrk > %o0) */
diff -r a748de9fc23e -r 7c38e0678a04 lib/libc/arch/sparc64/sys/cerror.S
--- a/lib/libc/arch/sparc64/sys/cerror.S        Tue May 07 01:32:46 2002 +0000
+++ b/lib/libc/arch/sparc64/sys/cerror.S        Tue May 07 01:34:21 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: cerror.S,v 1.4 2000/07/26 00:53:50 eeh Exp $   */
+/*     $NetBSD: cerror.S,v 1.5 2002/05/07 01:34:22 eeh Exp $   */
 
 /*
  * Copyright (c) 1992, 1993
@@ -44,7 +44,7 @@
 #if 0
        .asciz "@(#)cerror.s    8.1 (Berkeley) 6/4/93"
 #else
-       RCSID("$NetBSD: cerror.S,v 1.4 2000/07/26 00:53:50 eeh Exp $")
+       RCSID("$NetBSD: cerror.S,v 1.5 2002/05/07 01:34:22 eeh Exp $")
 #endif
 #endif /* LIBC_SCCS and not lint */
 
@@ -62,6 +62,16 @@
 #else
        .globl  _C_LABEL(errno)
 #ifdef PIC
+#ifdef BIGPIC
+FUNC(__cerror)
+       PIC_PROLOGUE(%g1, %o3)
+       set     _C_LABEL(errno),%o1
+       ldx     [%g1 + %o1], %g1
+       st      %o0, [%g1]
+       mov     -1, %o0
+       retl
+        mov    -1, %o1
+#else
 FUNC(__cerror)
        PIC_PROLOGUE(%g1, %o3)
        ldx     [%g1 + _C_LABEL(errno)], %g1
@@ -69,6 +79,7 @@
        mov     -1, %o0
        retl
         mov    -1, %o1
+#endif
 #else
 FUNC(__cerror)
        sethi   %hi(_C_LABEL(errno)), %g1
diff -r a748de9fc23e -r 7c38e0678a04 lib/libc/arch/sparc64/sys/sbrk.S
--- a/lib/libc/arch/sparc64/sys/sbrk.S  Tue May 07 01:32:46 2002 +0000
+++ b/lib/libc/arch/sparc64/sys/sbrk.S  Tue May 07 01:34:21 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: sbrk.S,v 1.7 2000/07/25 15:14:46 mycroft Exp $ */
+/*     $NetBSD: sbrk.S,v 1.8 2002/05/07 01:34:22 eeh Exp $     */
 
 /*
  * Copyright (c) 1992, 1993
@@ -44,7 +44,7 @@
 #if 0
        .asciz "@(#)sbrk.s      8.1 (Berkeley) 6/4/93"
 #else
-       RCSID("$NetBSD: sbrk.S,v 1.7 2000/07/25 15:14:46 mycroft Exp $")
+       RCSID("$NetBSD: sbrk.S,v 1.8 2002/05/07 01:34:22 eeh Exp $")
 #endif
 #endif /* SYSLIBC_SCCS and not lint */
 
@@ -65,6 +65,7 @@
 
 ENTRY(_sbrk)
 #ifdef PIC
+#ifdef BIGPIC
        PIC_PROLOGUE(%o5,%o4)
        set     _C_LABEL(__curbrk), %o3
        ldx     [%o5 + %o3], %o2
@@ -80,6 +81,21 @@
        retl                                    /* and update curbrk */
         stx    %o4, [%o2]
 #else
+       PIC_PROLOGUE(%o5,%o4)



Home | Main Index | Thread Index | Old Index