Source-Changes-HG archive

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

[src/trunk]: src/lib/csu Do not pass the main object handle from the assemble...



details:   https://anonhg.NetBSD.org/src/rev/ce5c8df9cfd8
branches:  trunk
changeset: 446194:ce5c8df9cfd8
user:      joerg <joerg%NetBSD.org@localhost>
date:      Mon Nov 26 17:37:44 2018 +0000

description:
Do not pass the main object handle from the assembler startup stub to
the common ___start routine. It's only used for a pointless magic
version check. Thanks to martin@ for testing various architectures.

diffstat:

 lib/csu/arch/aarch64/crt0.S  |   7 ++++---
 lib/csu/arch/alpha/crt0.S    |   7 +++----
 lib/csu/arch/arm/crt0.S      |  13 ++++++-------
 lib/csu/arch/earm/crt0.S     |  13 ++++++-------
 lib/csu/arch/hppa/crt0.S     |  10 ++++------
 lib/csu/arch/i386/crt0.S     |   5 ++---
 lib/csu/arch/ia64/crt0.S     |   5 +++--
 lib/csu/arch/m68k/crt0.S     |   5 ++---
 lib/csu/arch/mips/crt0.S     |   7 +++----
 lib/csu/arch/or1k/crt0.S     |   6 +++---
 lib/csu/arch/powerpc/crt0.S  |   5 ++---
 lib/csu/arch/riscv/crt0.S    |   7 +++----
 lib/csu/arch/sh3/crt0.S      |   9 ++++-----
 lib/csu/arch/sparc/crt0.S    |  10 ++++------
 lib/csu/arch/sparc64/crt0.S  |   9 ++++-----
 lib/csu/arch/vax/crt0.S      |   8 ++++----
 lib/csu/arch/x86_64/crt0.S   |   7 +++----
 lib/csu/common/Makefile.inc  |   4 ++--
 lib/csu/common/crt0-common.c |  22 ++++++++--------------
 19 files changed, 70 insertions(+), 89 deletions(-)

diffs (truncated from 579 to 300 lines):

diff -r 13f594fc96e7 -r ce5c8df9cfd8 lib/csu/arch/aarch64/crt0.S
--- a/lib/csu/arch/aarch64/crt0.S       Mon Nov 26 17:18:01 2018 +0000
+++ b/lib/csu/arch/aarch64/crt0.S       Mon Nov 26 17:37:44 2018 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: crt0.S,v 1.1 2014/08/10 05:47:36 matt Exp $    */
+/*     $NetBSD: crt0.S,v 1.2 2018/11/26 17:37:44 joerg Exp $   */
 
 /*-
  * Copyright (c) 2014 The NetBSD Foundation, Inc.
@@ -31,14 +31,15 @@
 
 #include <aarch64/asm.h>
 
-RCSID("$NetBSD: crt0.S,v 1.1 2014/08/10 05:47:36 matt Exp $")
+RCSID("$NetBSD: crt0.S,v 1.2 2018/11/26 17:37:44 joerg Exp $")
 
 STRONG_ALIAS(_start,__start)
 
 _ENTRY(__start)
        /*
-        * void ___start(void (*cleanup)(void), const Obj_Entry *obj,
+        * void ___start(void (*cleanup)(void),
         *    struct ps_strings *ps_strings);
         */
+       mov     x1, x2
        b       ___start
 END(__start)
diff -r 13f594fc96e7 -r ce5c8df9cfd8 lib/csu/arch/alpha/crt0.S
--- a/lib/csu/arch/alpha/crt0.S Mon Nov 26 17:18:01 2018 +0000
+++ b/lib/csu/arch/alpha/crt0.S Mon Nov 26 17:37:44 2018 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: crt0.S,v 1.1 2013/07/11 16:40:27 matt Exp $ */
+/* $NetBSD: crt0.S,v 1.2 2018/11/26 17:37:44 joerg Exp $ */
 
 /*-
  * Copyright (c) 2013 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
 
 #include <alpha/asm.h>
 
-RCSID("$NetBSD: crt0.S,v 1.1 2013/07/11 16:40:27 matt Exp $")
+RCSID("$NetBSD: crt0.S,v 1.2 2018/11/26 17:37:44 joerg Exp $")
 
 STRONG_ALIAS(_start,__start)
 
@@ -48,7 +48,6 @@
 LEAF(__start, 4)
        LDGP(pv)
        mov     a1, a0          /* cleanup */
-       mov     a2, a1          /* Obj_Entry */
-       mov     a3, a2          /* ps_strings */
+       mov     a3, a1          /* ps_strings */
        CALL(___start)
 END(__start)
diff -r 13f594fc96e7 -r ce5c8df9cfd8 lib/csu/arch/arm/crt0.S
--- a/lib/csu/arch/arm/crt0.S   Mon Nov 26 17:18:01 2018 +0000
+++ b/lib/csu/arch/arm/crt0.S   Mon Nov 26 17:37:44 2018 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: crt0.S,v 1.3 2012/08/11 07:25:44 matt Exp $    */
+/*     $NetBSD: crt0.S,v 1.4 2018/11/26 17:37:44 joerg Exp $   */
 
 /*-
  * Copyright (c) 2012 The NetBSD Foundation, Inc.
@@ -31,24 +31,23 @@
 
 #include <arm/asm.h>
 
-RCSID("$NetBSD: crt0.S,v 1.3 2012/08/11 07:25:44 matt Exp $")
+RCSID("$NetBSD: crt0.S,v 1.4 2018/11/26 17:37:44 joerg Exp $")
 
 STRONG_ALIAS(_start,__start)
 
 _ENTRY(__start)
        /*
-        * We need to swap ps_strings and cleanup
+        * ps_strings is passed in r0 and cleanup in r2.
+        * It should be ps_string in r1 and cleanup in r0.
         */
-       mov     ip, r0          /* ps_strings -> tmp */
-       mov     r0, r2          /* cleanup -> ps_strings */
-       mov     r2, ip          /* tmp -> ps_strings */
+       mov     r1, r0
+       mov     r0, r2
 
        /* Ensure the stack is properly aligned before calling C code. */
        bic     sp, sp, #7
 
        /*
         * void ___start(void (*cleanup)(void),
-        *    const Obj_Entry *obj,
         *    struct ps_strings *ps_strings);
         */
 
diff -r 13f594fc96e7 -r ce5c8df9cfd8 lib/csu/arch/earm/crt0.S
--- a/lib/csu/arch/earm/crt0.S  Mon Nov 26 17:18:01 2018 +0000
+++ b/lib/csu/arch/earm/crt0.S  Mon Nov 26 17:37:44 2018 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: crt0.S,v 1.3 2013/09/05 00:27:38 matt Exp $    */
+/*     $NetBSD: crt0.S,v 1.4 2018/11/26 17:37:44 joerg Exp $   */
 
 /*-
  * Copyright (c) 2012 The NetBSD Foundation, Inc.
@@ -31,17 +31,17 @@
 
 #include <arm/asm.h>
 
-RCSID("$NetBSD: crt0.S,v 1.3 2013/09/05 00:27:38 matt Exp $")
+RCSID("$NetBSD: crt0.S,v 1.4 2018/11/26 17:37:44 joerg Exp $")
 
 STRONG_ALIAS(_start,__start)
 
 _ENTRY(__start)
        /*
-        * We need to swap ps_strings and cleanup
+        * ps_strings is passed in r0 and cleanup in r2.
+        * It should be ps_string in r1 and cleanup in r0.
         */
-       mov     ip, r0          /* ps_strings -> tmp */
-       mov     r0, r2          /* cleanup -> ps_strings */
-       mov     r2, ip          /* tmp -> ps_strings */
+       mov     r1, r0
+       mov     r0, r2
 
        /* Ensure the stack is properly aligned before calling C code. */
 #if !defined(__thumb__)
@@ -55,7 +55,6 @@
 
        /*
         * void ___start(void (*cleanup)(void),
-        *    const Obj_Entry *obj,
         *    struct ps_strings *ps_strings);
         */
 
diff -r 13f594fc96e7 -r ce5c8df9cfd8 lib/csu/arch/hppa/crt0.S
--- a/lib/csu/arch/hppa/crt0.S  Mon Nov 26 17:18:01 2018 +0000
+++ b/lib/csu/arch/hppa/crt0.S  Mon Nov 26 17:37:44 2018 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: crt0.S,v 1.1 2013/07/13 18:52:35 skrll Exp $   */
+/*     $NetBSD: crt0.S,v 1.2 2018/11/26 17:37:45 joerg Exp $   */
 
 /*-
  * Copyright (c) 2013 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
 
 #include <machine/asm.h>
 
-RCSID("$NetBSD: crt0.S,v 1.1 2013/07/13 18:52:35 skrll Exp $")
+RCSID("$NetBSD: crt0.S,v 1.2 2018/11/26 17:37:45 joerg Exp $")
 
        .import _GLOBAL_OFFSET_TABLE_
        .hidden ___start
@@ -55,13 +55,11 @@
 
        /*
         * void ___start(void (*cleanup)(void),
-        *    const Obj_Entry *obj,
         *    struct ps_strings *ps_strings);
         */
-       copy    %arg0, %arg3            ; ps_strings -> tmp
+       copy    %arg0, %arg2            ; ps_strings -> tmp
        copy    %arg1, %arg0            ; cleanup -> arg0
-       copy    %arg2, %arg1            ; obj -> arg1
        b       ___start
-       copy    %arg3, %arg2            ; ps_strings (tmp) -> arg2
+       copy    %arg2, %arg1            ; ps_strings -> arg1
 
 EXIT(_start)
diff -r 13f594fc96e7 -r ce5c8df9cfd8 lib/csu/arch/i386/crt0.S
--- a/lib/csu/arch/i386/crt0.S  Mon Nov 26 17:18:01 2018 +0000
+++ b/lib/csu/arch/i386/crt0.S  Mon Nov 26 17:37:44 2018 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: crt0.S,v 1.3 2011/07/01 02:59:05 joerg Exp $ */
+/* $NetBSD: crt0.S,v 1.4 2018/11/26 17:37:45 joerg Exp $ */
 
 /*
  * Copyright (c) 1998 Christos Zoulas
@@ -37,13 +37,12 @@
 
 #include <machine/asm.h>
 
-RCSID("$NetBSD: crt0.S,v 1.3 2011/07/01 02:59:05 joerg Exp $")
+RCSID("$NetBSD: crt0.S,v 1.4 2018/11/26 17:37:45 joerg Exp $")
 
        .hidden ___start
 
 STRONG_ALIAS(_start,__start)
 _ENTRY(__start)
        pushl   %ebx
-       pushl   %ecx
        pushl   %edx
        call    ___start
diff -r 13f594fc96e7 -r ce5c8df9cfd8 lib/csu/arch/ia64/crt0.S
--- a/lib/csu/arch/ia64/crt0.S  Mon Nov 26 17:18:01 2018 +0000
+++ b/lib/csu/arch/ia64/crt0.S  Mon Nov 26 17:37:44 2018 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: crt0.S,v 1.1 2014/03/14 18:15:02 cherry Exp $ */
+/* $NetBSD: crt0.S,v 1.2 2018/11/26 17:37:45 joerg Exp $ */
 
 /*-
  * Copyright (c) 2014 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
 
 #include <machine/asm.h>
 
-RCSID("$NetBSD: crt0.S,v 1.1 2014/03/14 18:15:02 cherry Exp $")
+RCSID("$NetBSD: crt0.S,v 1.2 2018/11/26 17:37:45 joerg Exp $")
 
 STRONG_ALIAS(_start,__start)
        
@@ -51,6 +51,7 @@
        .regstk 4, 0, 0, 0
 
        mov sp = in3 /* Setup Memory Stack Pointer. */
+       mov in1 = in2 /* obj is no longer used. */
        alloc r31 = ar.pfs, 3, 0, 0, 0 /* Adjust backingstore for ___start() */
        br.call.sptk.many rp = ___start
 
diff -r 13f594fc96e7 -r ce5c8df9cfd8 lib/csu/arch/m68k/crt0.S
--- a/lib/csu/arch/m68k/crt0.S  Mon Nov 26 17:18:01 2018 +0000
+++ b/lib/csu/arch/m68k/crt0.S  Mon Nov 26 17:37:44 2018 +0000
@@ -35,14 +35,13 @@
  * <<Id: LICENSE,v 1.2 2000/06/14 15:57:33 cgd Exp>>
  */
 
-RCSID("$NetBSD: crt0.S,v 1.4 2013/07/26 19:49:19 matt Exp $")
+RCSID("$NetBSD: crt0.S,v 1.5 2018/11/26 17:37:45 joerg Exp $")
 
 STRONG_ALIAS(_start,__start)
 
 _ENTRY(__start)
        movl    %a2,-(%sp)              | ps_strings
-       movl    %a0,-(%sp)              | obj
        movl    %a1,-(%sp)              | cleanup
-       | call: ___start(cleanup, obj, ps_strings)
+       | call: ___start(cleanup, ps_strings)
        jbsr    ___start
 END(__start)
diff -r 13f594fc96e7 -r ce5c8df9cfd8 lib/csu/arch/mips/crt0.S
--- a/lib/csu/arch/mips/crt0.S  Mon Nov 26 17:18:01 2018 +0000
+++ b/lib/csu/arch/mips/crt0.S  Mon Nov 26 17:37:44 2018 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: crt0.S,v 1.3 2013/12/08 06:32:36 matt Exp $ */
+/* $NetBSD: crt0.S,v 1.4 2018/11/26 17:37:45 joerg Exp $ */
 
 /*-
  * Copyright (c) 2013 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
 
 #include <mips/asm.h>
 
-RCSID("$NetBSD: crt0.S,v 1.3 2013/12/08 06:32:36 matt Exp $")
+RCSID("$NetBSD: crt0.S,v 1.4 2018/11/26 17:37:45 joerg Exp $")
 
 STRONG_ALIAS(_start,__start)
 
@@ -52,9 +52,8 @@
        SETUP_GP
        SETUP_GP64(t3, __start)
        move    a0, a1          /* cleanup */
-       move    a1, a2          /* Obj_Entry */
        PTR_L   t9,%call16(_C_LABEL(___start))(gp)
-        move   a2, a3          /* ps_strings */
+        move   a1, a3          /* ps_strings */
        .reloc  1f,R_MIPS_JALR,___start
 1:     jr      t9
 END(__start)
diff -r 13f594fc96e7 -r ce5c8df9cfd8 lib/csu/arch/or1k/crt0.S
--- a/lib/csu/arch/or1k/crt0.S  Mon Nov 26 17:18:01 2018 +0000
+++ b/lib/csu/arch/or1k/crt0.S  Mon Nov 26 17:37:44 2018 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: crt0.S,v 1.1 2014/09/03 19:34:25 matt Exp $    */
+/*     $NetBSD: crt0.S,v 1.2 2018/11/26 17:37:45 joerg Exp $   */
 
 /*-
  * Copyright (c) 2014 The NetBSD Foundation, Inc.
@@ -31,13 +31,13 @@
 
 #include <or1k/asm.h>
 
-RCSID("$NetBSD: crt0.S,v 1.1 2014/09/03 19:34:25 matt Exp $")
+RCSID("$NetBSD: crt0.S,v 1.2 2018/11/26 17:37:45 joerg Exp $")
 
 STRONG_ALIAS(_start,__start)
 
 _ENTRY(__start)
        /*
-        * void ___start(void (*cleanup)(void), const Obj_Entry *obj,
+        * void ___start(void (*cleanup)(void),
         *    struct ps_strings *ps_strings);
         */
        l.jal   ___start
diff -r 13f594fc96e7 -r ce5c8df9cfd8 lib/csu/arch/powerpc/crt0.S
--- a/lib/csu/arch/powerpc/crt0.S       Mon Nov 26 17:18:01 2018 +0000
+++ b/lib/csu/arch/powerpc/crt0.S       Mon Nov 26 17:37:44 2018 +0000
@@ -29,7 +29,7 @@
 
 #include <powerpc/asm.h>
 
-RCSID("$NetBSD: crt0.S,v 1.6 2014/02/27 18:01:51 matt Exp $")
+RCSID("$NetBSD: crt0.S,v 1.7 2018/11/26 17:37:45 joerg Exp $")



Home | Main Index | Thread Index | Old Index