Source-Changes-HG archive

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

[src/trunk]: src The ELF ABI declares that argc must fill an `argument slot'....



details:   https://anonhg.NetBSD.org/src/rev/c38973053a2d
branches:  trunk
changeset: 495355:c38973053a2d
user:      mycroft <mycroft%NetBSD.org@localhost>
date:      Wed Jul 26 15:40:07 2000 +0000

description:
The ELF ABI declares that argc must fill an `argument slot'.  Make it so.
For __sparc_v9__ only, do a hack to make executables work temporarily before
and after the kernel is switched.

diffstat:

 lib/csu/alpha/crt0.c     |   8 ++++----
 lib/csu/sparc64/crt0.c   |  12 ++++++++----
 libexec/ld.elf_so/rtld.c |  10 +++++++---
 3 files changed, 19 insertions(+), 11 deletions(-)

diffs (97 lines):

diff -r 66d7ea2baba4 -r c38973053a2d lib/csu/alpha/crt0.c
--- a/lib/csu/alpha/crt0.c      Wed Jul 26 15:19:35 2000 +0000
+++ b/lib/csu/alpha/crt0.c      Wed Jul 26 15:40:07 2000 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: crt0.c,v 1.22 2000/07/26 02:11:44 mycroft Exp $ */
+/* $NetBSD: crt0.c,v 1.23 2000/07/26 15:40:07 mycroft Exp $ */
 
 /*
  * Copyright (c) 1995 Christopher G. Demetriou
@@ -46,10 +46,10 @@
        const Obj_Entry *obj;                   /* from shared loader */
        struct ps_strings *ps_strings;
 {
-       int argc;
+       long argc;
        char **argv, *namep;
 
-       argc = *(int *)sp;
+       argc = *(long *)sp;
        argv = sp + 1;
        environ = sp + 2 + argc;                /* 2: argc + NULL ending argv */
 
@@ -84,7 +84,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.22 2000/07/26 02:11:44 mycroft Exp $");
+__RCSID("$NetBSD: crt0.c,v 1.23 2000/07/26 15:40:07 mycroft Exp $");
 #endif /* LIBC_SCCS and not lint */
 
 #include "common.c"
diff -r 66d7ea2baba4 -r c38973053a2d lib/csu/sparc64/crt0.c
--- a/lib/csu/sparc64/crt0.c    Wed Jul 26 15:19:35 2000 +0000
+++ b/lib/csu/sparc64/crt0.c    Wed Jul 26 15:40:07 2000 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: crt0.c,v 1.15 2000/07/26 02:11:46 mycroft Exp $ */
+/* $NetBSD: crt0.c,v 1.16 2000/07/26 15:40:07 mycroft Exp $ */
 
 /*
  * Copyright (c) 1995 Christopher G. Demetriou
@@ -76,10 +76,14 @@
        const Obj_Entry *obj;                   /* from shared loader */
        struct ps_strings *ps_strings;
 {
-       int argc;
+       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 */
 
@@ -114,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.15 2000/07/26 02:11:46 mycroft Exp $");
+__RCSID("$NetBSD: crt0.c,v 1.16 2000/07/26 15:40:07 mycroft Exp $");
 #endif /* LIBC_SCCS and not lint */
 
 /* XXX XXX XXX THIS SHOULD GO AWAY XXX XXX XXX
diff -r 66d7ea2baba4 -r c38973053a2d libexec/ld.elf_so/rtld.c
--- a/libexec/ld.elf_so/rtld.c  Wed Jul 26 15:19:35 2000 +0000
+++ b/libexec/ld.elf_so/rtld.c  Wed Jul 26 15:40:07 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: rtld.c,v 1.39 2000/07/26 02:07:35 mycroft Exp $         */
+/*     $NetBSD: rtld.c,v 1.40 2000/07/26 15:40:07 mycroft Exp $         */
 
 /*
  * Copyright 1996 John D. Polstra.
@@ -295,7 +295,7 @@
        bool            bind_now = 0;
        const char     *ld_bind_now;
        const char    **argv;
-       int             argc;
+       long            argc;
        Obj_Entry       *obj;
        const char **real___progname;
        const Obj_Entry **real___mainprog_obj;
@@ -323,7 +323,11 @@
 
        sp += 2;                /* skip over return argument space */
        argv = (const char **) &sp[1];
-       argc = *(int *)sp;
+       argc = *(long *)sp;
+#ifdef __sparc_v9__
+       /* XXX Temporary hack for argc format conversion. */
+       argc = (argc >> 32) | (argc & 0xffffffff);
+#endif
        sp += 2 + argc;         /* Skip over argc, arguments, and NULL
                                 * terminator */
        env = (char **) sp;



Home | Main Index | Thread Index | Old Index