Source-Changes-HG archive

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

[src/netbsd-1-5]: src/lib/csu/sparc64 Approved by thorpej:



details:   https://anonhg.NetBSD.org/src/rev/acb1022844aa
branches:  netbsd-1-5
changeset: 488736:acb1022844aa
user:      mycroft <mycroft%NetBSD.org@localhost>
date:      Wed Jul 26 23:02:11 2000 +0000

description:
Approved by thorpej:
Fix PIC support.
Deference argc as a long, per ELF ABI.

basesrc/lib/csu/sparc64/crt0.c                          1.12 -> 1.16

diffstat:

 lib/csu/sparc64/crt0.c |  15 ++++++++++-----
 1 files changed, 10 insertions(+), 5 deletions(-)

diffs (50 lines):

diff -r 0632ce37c221 -r acb1022844aa lib/csu/sparc64/crt0.c
--- a/lib/csu/sparc64/crt0.c    Wed Jul 26 22:59:49 2000 +0000
+++ b/lib/csu/sparc64/crt0.c    Wed Jul 26 23:02:11 2000 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: crt0.c,v 1.12 2000/06/14 17:24:56 cgd Exp $ */
+/* $NetBSD: crt0.c,v 1.12.2.1 2000/07/26 23:02:11 mycroft Exp $ */
 
 /*
  * Copyright (c) 1995 Christopher G. Demetriou
@@ -60,8 +60,8 @@
        clr     %fp
        add     %sp, 8*16 + 0x7ff, %o0          ! start of stack
        mov     %g1, %o1                        ! Cleanup routine
-       clr     %o1                             ! XXXX
-       clr     %o2                             ! obj
+       mov     %g3, %o1                        ! XXXX our rtld uses %g3
+       mov     %g2, %o2                        ! XXXX obj from rtld.
        ba,pt   %icc, ___start                  ! XXXX jump over the retl egcs 2.96 inserts
        mov     %g1, %o3                        ! ps_strings XXXX
 ");
@@ -79,7 +79,11 @@
        long argc;
        char **argv, *namep;
 
-       argc = *(int *)sp;
+       argc = *(long *)sp;
+#ifdef __sparc_v9__
+       /* XXX Temporary hack for argc format conversion. */
+       argc = (argc >> 32) | (argc & 0xffffffff);
+#endif
        argv = sp + 1;
        environ = sp + 2 + argc;                /* 2: argc + NULL ending argv */
 
@@ -106,6 +110,7 @@
 
        atexit(_fini);
        _init();
+
        exit(main(argc, argv, environ));
 }
 
@@ -113,7 +118,7 @@
  * NOTE: Leave the RCS ID _after_ _start(), in case it gets placed in .text.
  */
 #if defined(LIBC_SCCS) && !defined(lint)
-__RCSID("$NetBSD: crt0.c,v 1.12 2000/06/14 17:24:56 cgd Exp $");
+__RCSID("$NetBSD: crt0.c,v 1.12.2.1 2000/07/26 23:02:11 mycroft Exp $");
 #endif /* LIBC_SCCS and not lint */
 
 /* XXX XXX XXX THIS SHOULD GO AWAY XXX XXX XXX



Home | Main Index | Thread Index | Old Index