ELF PIC support.

This commit is contained in:
itohy 1999-10-18 03:24:28 +00:00
parent 29215efa45
commit 1d0a433095
10 changed files with 79 additions and 37 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: __sigsetjmp14.S,v 1.1 1998/10/05 02:34:18 thorpej Exp $ */
/* $NetBSD: __sigsetjmp14.S,v 1.2 1999/10/18 03:24:28 itohy Exp $ */
/*-
* Copyright (c) 1990 The Regents of the University of California.
@ -43,7 +43,7 @@
#if 0
RCSID("from: @(#)_setjmp.s 5.1 (Berkeley) 5/12/90")
#else
RCSID("$NetBSD: __sigsetjmp14.S,v 1.1 1998/10/05 02:34:18 thorpej Exp $")
RCSID("$NetBSD: __sigsetjmp14.S,v 1.2 1999/10/18 03:24:28 itohy Exp $")
#endif
#endif /* LIBC_SCCS and not lint */
@ -67,15 +67,15 @@ ENTRY(__sigsetjmp14)
movl d1,a0@(_JBLEN * 4) /* save at end of area */
tstl d1
bne dosig
jra _C_LABEL(_setjmp)
jra PIC_PLT(_C_LABEL(_setjmp))
dosig:
jra _C_LABEL(__setjmp14)
jra PIC_PLT(_C_LABEL(__setjmp14))
ENTRY(__siglongjmp14)
movl sp@(4),a0 /* save area pointer */
tstl a0@(_JBLEN * 4) /* check mask... */
bne didsig
jra _C_LABEL(_longjmp)
jra PIC_PLT(_C_LABEL(_longjmp))
didsig:
jra _C_LABEL(__longjmp14)
jra PIC_PLT(_C_LABEL(__longjmp14))

View File

@ -1,4 +1,4 @@
/* $NetBSD: _setjmp.S,v 1.4 1998/07/01 06:44:14 thorpej Exp $ */
/* $NetBSD: _setjmp.S,v 1.5 1999/10/18 03:24:29 itohy Exp $ */
/*-
* Copyright (c) 1990 The Regents of the University of California.
@ -43,7 +43,7 @@
#if 0
RCSID("from: @(#)_setjmp.s 5.1 (Berkeley) 5/12/90")
#else
RCSID("$NetBSD: _setjmp.S,v 1.4 1998/07/01 06:44:14 thorpej Exp $")
RCSID("$NetBSD: _setjmp.S,v 1.5 1999/10/18 03:24:29 itohy Exp $")
#endif
#endif /* LIBC_SCCS and not lint */
@ -88,5 +88,5 @@ ok:
rts
botch:
jbsr _C_LABEL(longjmperror)
jbsr PIC_PLT(_C_LABEL(longjmperror))
stop #0

View File

@ -1,4 +1,4 @@
/* $NetBSD: sigsetjmp.S,v 1.4 1998/07/01 06:44:14 thorpej Exp $ */
/* $NetBSD: sigsetjmp.S,v 1.5 1999/10/18 03:24:29 itohy Exp $ */
/*-
* Copyright (c) 1990 The Regents of the University of California.
@ -43,7 +43,7 @@
#if 0
RCSID("from: @(#)_setjmp.s 5.1 (Berkeley) 5/12/90")
#else
RCSID("$NetBSD: sigsetjmp.S,v 1.4 1998/07/01 06:44:14 thorpej Exp $")
RCSID("$NetBSD: sigsetjmp.S,v 1.5 1999/10/18 03:24:29 itohy Exp $")
#endif
#endif /* LIBC_SCCS and not lint */
@ -67,15 +67,15 @@ ENTRY(sigsetjmp)
movl d1,a0@(_JBLEN * 4 ) /* save at end of area */
tstl d1
bne dosig
jra _C_LABEL(_setjmp)
jra PIC_PLT(_C_LABEL(_setjmp))
dosig:
jra _C_LABEL(setjmp)
jra PIC_PLT(_C_LABEL(setjmp))
ENTRY(siglongjmp)
movl sp@(4),a0 /* save area pointer */
tstl a0@(_JBLEN * 4) /* check mask... */
bne didsig
jra _C_LABEL(_longjmp)
jra PIC_PLT(_C_LABEL(_longjmp))
didsig:
jra _C_LABEL(longjmp)
jra PIC_PLT(_C_LABEL(longjmp))

View File

@ -1,4 +1,4 @@
/* $NetBSD: Ovfork.S,v 1.9 1999/05/02 20:52:02 kleink Exp $ */
/* $NetBSD: Ovfork.S,v 1.10 1999/10/18 03:24:30 itohy Exp $ */
/*-
* Copyright (c) 1990 The Regents of the University of California.
@ -43,7 +43,7 @@
#if 0
RCSID("from: @(#)Ovfork.s 5.1 (Berkeley) 5/12/90")
#else
RCSID("$NetBSD: Ovfork.S,v 1.9 1999/05/02 20:52:02 kleink Exp $")
RCSID("$NetBSD: Ovfork.S,v 1.10 1999/10/18 03:24:30 itohy Exp $")
#endif
#endif /* LIBC_SCCS and not lint */
@ -79,13 +79,13 @@ err:
.globl _C_LABEL(__errno)
movl a0,sp@-
movl d0,sp@-
#ifdef PIC
#if defined(PIC) && !defined(__ELF__)
movl #_C_LABEL(_GLOBAL_OFFSET_TABLE_),a1
lea pc@(0,a1:l),a1
movl a1@(_C_LABEL(__errno):l),a1
jsr a1@
#else
jbsr _C_LABEL(__errno)
jbsr PIC_PLT(_C_LABEL(__errno))
#endif /* PIC */
#ifdef __SVR4_ABI__
movl sp@+,a0@
@ -97,9 +97,14 @@ err:
#else
.globl _C_LABEL(errno)
#ifdef PIC
#ifdef __ELF__
lea pc@(_GLOBAL_OFFSET_TABLE_@GOTPC),a1
movl a1@(_C_LABEL(errno)@GOT:w),a1
#else
movl #_C_LABEL(_GLOBAL_OFFSET_TABLE_),a1
lea pc@(0,a1:l),a1
movl a1@(_C_LABEL(errno):w),a1
#endif
movl d0,a1@
#else
movl d0,_C_LABEL(errno)

View File

@ -1,4 +1,4 @@
/* $NetBSD: __vfork14.S,v 1.4 1999/05/02 20:52:03 kleink Exp $ */
/* $NetBSD: __vfork14.S,v 1.5 1999/10/18 03:24:30 itohy Exp $ */
/*-
* Copyright (c) 1990 The Regents of the University of California.
@ -43,7 +43,7 @@
#if 0
RCSID("from: @(#)Ovfork.s 5.1 (Berkeley) 5/12/90")
#else
RCSID("$NetBSD: __vfork14.S,v 1.4 1999/05/02 20:52:03 kleink Exp $")
RCSID("$NetBSD: __vfork14.S,v 1.5 1999/10/18 03:24:30 itohy Exp $")
#endif
#endif /* LIBC_SCCS and not lint */
@ -76,13 +76,13 @@ err:
.globl _C_LABEL(__errno)
movl a0,sp@-
movl d0,sp@-
#ifdef PIC
#if defined(PIC) && !defined(__ELF__)
movl #_C_LABEL(_GLOBAL_OFFSET_TABLE_),a1
lea pc@(0,a1:l),a1
movl a1@(_C_LABEL(__errno):l),a1
jsr a1@
#else
jbsr _C_LABEL(__errno)
jbsr PIC_PLT(_C_LABEL(__errno))
#endif /* PIC */
#ifdef __SVR4_ABI__
movl sp@+,a0@
@ -94,9 +94,14 @@ err:
#else
.globl _C_LABEL(errno)
#ifdef PIC
#ifdef __ELF__
lea pc@(_GLOBAL_OFFSET_TABLE_@GOTPC),a1
movl a1@(_C_LABEL(errno)@GOT:w),a1
#else
movl #_C_LABEL(_GLOBAL_OFFSET_TABLE_),a1
lea pc@(0,a1:l),a1
movl a1@(_C_LABEL(errno):w),a1
#endif
movl d0,a1@
#else
movl d0,_C_LABEL(errno)

View File

@ -1,4 +1,4 @@
/* $NetBSD: brk.S,v 1.8 1999/05/02 23:19:50 kleink Exp $ */
/* $NetBSD: brk.S,v 1.9 1999/10/18 03:24:30 itohy Exp $ */
/*-
* Copyright (c) 1990 The Regents of the University of California.
@ -43,7 +43,7 @@
#if 0
RCSID("from: @(#)brk.s 5.1 (Berkeley) 5/12/90")
#else
RCSID("$NetBSD: brk.S,v 1.8 1999/05/02 23:19:50 kleink Exp $")
RCSID("$NetBSD: brk.S,v 1.9 1999/10/18 03:24:30 itohy Exp $")
#endif
#endif /* LIBC_SCCS and not lint */
@ -58,9 +58,14 @@ _C_LABEL(__minbrk):
ENTRY(brk)
#ifdef PIC
#ifdef __ELF__
lea pc@(_GLOBAL_OFFSET_TABLE_@GOTPC),a1
movl a1@(_C_LABEL(__minbrk)@GOT:w),a0
#else
movl #_C_LABEL(_GLOBAL_OFFSET_TABLE_),a1
lea pc@(0,a1:l),a1
movl a1@(_C_LABEL(__minbrk):w),a0
#endif
movl a0@,d0
#else
movl _C_LABEL(__minbrk),d0
@ -73,7 +78,11 @@ ok:
trap #0
jcs err
#ifdef PIC
#ifdef __ELF__
movl a1@(CURBRK@GOT:w),a0
#else
movl a1@(CURBRK:w),a0
#endif
movl sp@(4),a0@
#else
movl sp@(4),CURBRK

View File

@ -1,4 +1,4 @@
/* $NetBSD: cerror.S,v 1.11 1999/05/02 20:52:03 kleink Exp $ */
/* $NetBSD: cerror.S,v 1.12 1999/10/18 03:24:30 itohy Exp $ */
/*-
* Copyright (c) 1990 The Regents of the University of California.
@ -43,7 +43,7 @@
#if 0
RCSID("from: @(#)cerror.s 5.1 (Berkeley) 5/12/90")
#else
RCSID("$NetBSD: cerror.S,v 1.11 1999/05/02 20:52:03 kleink Exp $")
RCSID("$NetBSD: cerror.S,v 1.12 1999/10/18 03:24:30 itohy Exp $")
#endif
#endif /* LIBC_SCCS and not lint */
@ -55,13 +55,13 @@
_ENTRY(CERROR)
#ifdef _REENTRANT
movl d0,sp@-
#ifdef PIC
#if defined(PIC) && !defined(__ELF__)
movl #_C_LABEL(_GLOBAL_OFFSET_TABLE_),a0
lea pc@(0,a0:l),a0
movl a0@(_C_LABEL(__errno):l),a0
jsr a0@
#else
jbsr _C_LABEL(__errno)
jbsr PIC_PLT(_C_LABEL(__errno))
#endif
#ifndef __SVR4_ABI__
movl d0,a0
@ -69,9 +69,14 @@ _ENTRY(CERROR)
movl sp@+,a0@
#else
#ifdef PIC
#ifdef __ELF__
lea pc@(_GLOBAL_OFFSET_TABLE_@GOTPC),a0
movl a0@(_C_LABEL(errno)@GOT:w),a0
#else
movl #_C_LABEL(_GLOBAL_OFFSET_TABLE_),a0
lea pc@(0,a0:l),a0
movl a0@(_C_LABEL(errno):w),a0
#endif
movl d0,a0@
#else
movl d0,_C_LABEL(errno)

View File

@ -1,4 +1,4 @@
/* $NetBSD: ptrace.S,v 1.8 1999/05/02 23:19:50 kleink Exp $ */
/* $NetBSD: ptrace.S,v 1.9 1999/10/18 03:24:30 itohy Exp $ */
/*-
* Copyright (c) 1990 The Regents of the University of California.
@ -43,7 +43,7 @@
#if 0
RCSID("from: @(#)ptrace.s 5.1 (Berkeley) 5/12/90")
#else
RCSID("$NetBSD: ptrace.S,v 1.8 1999/05/02 23:19:50 kleink Exp $")
RCSID("$NetBSD: ptrace.S,v 1.9 1999/10/18 03:24:30 itohy Exp $")
#endif
#endif /* LIBC_SCCS and not lint */
@ -55,13 +55,13 @@
ENTRY(ptrace)
#ifdef _REENTRANT
#ifdef PIC
#if defined(PIC) && !defined(__ELF__)
movl #_C_LABEL(_GLOBAL_OFFSET_TABLE_),a0
lea pc@(0,a0:l),a0
movl a0@(_C_LABEL(__errno):l),a0
jsr a0@
#else
jbsr _C_LABEL(__errno)
jbsr PIC_PLT(_C_LABEL(__errno))
#endif /* PIC */
#ifndef __SVR4_ABI__
movl d0,a0
@ -69,9 +69,14 @@ ENTRY(ptrace)
clrl a0@
#else
#ifdef PIC
#ifdef __ELF__
lea pc@(_GLOBAL_OFFSET_TABLE_@GOTPC),a0
movl a0@(_C_LABEL(errno)@GOT:w),a0
#else
movl #_C_LABEL(_GLOBAL_OFFSET_TABLE_),a0
lea pc@(0,a0:l),a0
movl a0@(_C_LABEL(errno):w),a0
#endif
clrl a0@
#else
clrl _C_LABEL(errno)

View File

@ -1,4 +1,4 @@
/* $NetBSD: sbrk.S,v 1.8 1999/05/02 23:19:50 kleink Exp $ */
/* $NetBSD: sbrk.S,v 1.9 1999/10/18 03:24:30 itohy Exp $ */
/*-
* Copyright (c) 1990 The Regents of the University of California.
@ -43,7 +43,7 @@
#if 0
RCSID("from: @(#)sbrk.s 5.1 (Berkeley) 5/12/90")
#else
RCSID("$NetBSD: sbrk.S,v 1.8 1999/05/02 23:19:50 kleink Exp $")
RCSID("$NetBSD: sbrk.S,v 1.9 1999/10/18 03:24:30 itohy Exp $")
#endif
#endif /* LIBC_SCCS and not lint */
@ -56,9 +56,14 @@ CURBRK: .long _C_LABEL(end)
ENTRY(sbrk)
#ifdef PIC
#ifdef __ELF__
lea pc@(_GLOBAL_OFFSET_TABLE_@GOTPC),a1
movl a1@(CURBRK@GOT:w),a1
#else
movl #_C_LABEL(_GLOBAL_OFFSET_TABLE_),a1
lea pc@(0,a1:l),a1
movl a1@(CURBRK:w),a1
#endif
movl a1@,d0
#else
movl CURBRK,d0
@ -73,6 +78,9 @@ ENTRY(sbrk)
#else
movl CURBRK,d0
movl sp@(4),CURBRK
#endif
#ifdef __SVR4_ABI__
movl d0,a0
#endif
rts
err:

View File

@ -1,4 +1,4 @@
/* $NetBSD: setlogin.S,v 1.5 1998/07/01 06:44:15 thorpej Exp $ */
/* $NetBSD: setlogin.S,v 1.6 1999/10/18 03:24:30 itohy Exp $ */
/*-
* Copyright (c) 1991 The Regents of the University of California.
@ -39,7 +39,7 @@
#if 0
RCSID("from: @(#)setlogin.s 5.1 (Berkeley) 5/6/91")
#else
RCSID("$NetBSD: setlogin.S,v 1.5 1998/07/01 06:44:15 thorpej Exp $")
RCSID("$NetBSD: setlogin.S,v 1.6 1999/10/18 03:24:30 itohy Exp $")
#endif
#endif /* LIBC_SCCS and not lint */
@ -47,9 +47,14 @@
SYSCALL(setlogin)
#ifdef PIC
#ifdef __ELF__
lea pc@(_GLOBAL_OFFSET_TABLE_@GOTPC),a1
movl a1@(_C_LABEL(__logname_valid)@GOT:w),a1
#else
movl #_C_LABEL(_GLOBAL_OFFSET_TABLE_),a1
lea pc@(0,a1:l),a1
movl a1@(_C_LABEL(__logname_valid):w),a1
#endif
clrl a1@
#else
clrl _C_LABEL(__logname_valid)