diff options
author | peter <peter@FreeBSD.org> | 1996-05-05 07:56:21 +0000 |
---|---|---|
committer | peter <peter@FreeBSD.org> | 1996-05-05 07:56:21 +0000 |
commit | 4b7195c99191637bf59fd4ad626297296bf3610f (patch) | |
tree | bea8a07c70223c0e39939063c6dbbdf8eb9d0f17 /lib/libc/i386/sys/Ovfork.S | |
parent | 93f1aa601a7bda9bd9b83bf5098c3f05f6edd744 (diff) | |
download | FreeBSD-src-4b7195c99191637bf59fd4ad626297296bf3610f.zip FreeBSD-src-4b7195c99191637bf59fd4ad626297296bf3610f.tar.gz |
Add support to enable libc to be compiled in ELF format. (#ifdef __ELF__)
In a nutshell, this macroizes the local/global symbol scoping rules
that are different in a.out and ELF. It also makes the i386 assembler
stubs conform to i386 PIC calling conventions - the a.out ld.so didn't
object, but the ELF one needs it as it implements PIC jumps via PLT's as
well as calls. The a.out rtld only worked because it was accidently
snooping the grandparent calling function's return address off the stack..
This also affects the libc_r code a little, because of cpp macro nesting.
Diffstat (limited to 'lib/libc/i386/sys/Ovfork.S')
-rw-r--r-- | lib/libc/i386/sys/Ovfork.S | 28 |
1 files changed, 13 insertions, 15 deletions
diff --git a/lib/libc/i386/sys/Ovfork.S b/lib/libc/i386/sys/Ovfork.S index 341b75c..2b69ca0 100644 --- a/lib/libc/i386/sys/Ovfork.S +++ b/lib/libc/i386/sys/Ovfork.S @@ -33,14 +33,15 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: Ovfork.S,v 1.2 1995/01/23 01:29:37 davidg Exp $ + * $Id: Ovfork.S,v 1.3 1996/01/22 00:00:56 julian Exp $ */ #if defined(SYSLIBC_RCS) && !defined(lint) .text - .asciz "$Id: Ovfork.S,v 1.2 1995/01/23 01:29:37 davidg Exp $" + .asciz "$Id: Ovfork.S,v 1.3 1996/01/22 00:00:56 julian Exp $" #endif /* SYSLIBC_RCS and not lint */ +#include "DEFS.h" #include "SYS.h" /* @@ -50,14 +51,11 @@ * %eax == pid of child in parent, %eax == pid of parent in child. * */ - .set vfork,66 -.globl _vfork -.type _vfork,@function -_vfork: +ENTRY(vfork) popl %ecx /* my rta into ecx */ - movl $vfork, %eax - LCALL(7,0) + lea SYS_vfork,%eax + KERNCALL jb verror vforkok: cmpl $0,%edx /* child process? */ @@ -67,14 +65,14 @@ vforkok: /* * Threaded version using __error(). */ - .globl ___error - .type ___error,@function + .globl CNAME(__error) + .type CNAME(__error),@function verror: pushl %eax #ifdef PIC - call PIC_PLT(___error) + call PIC_PLT(CNAME(__error)) #else - call ___error + call CNAME(__error) #endif popl %ecx movl %ecx,(%eax) @@ -84,15 +82,15 @@ verror: /* * Non-threaded version using global errno. */ - .globl _errno + .globl CNAME(errno) verror: #ifdef PIC PIC_PROLOGUE - movl PIC_GOT(_errno), %edx + movl PIC_GOT(CNAME(errno)), %edx movl %eax,(%edx) PIC_EPILOGUE #else - movl %eax,_errno + movl %eax,CNAME(errno) #endif movl $-1,%eax #endif /* !_THREAD_SAFE */ |