CVS commit: src/lib/csu/arch/ia64
Module Name:src Committed By: scole Date: Sat May 4 22:55:32 UTC 2019 Modified Files: src/lib/csu/arch/ia64: crt0.S Log Message: add stop (;;) to elimate WAW dependency compiler warning To generate a diff of this commit: cvs rdiff -u -r1.2 -r1.3 src/lib/csu/arch/ia64/crt0.S Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/lib/csu/arch/ia64/crt0.S diff -u src/lib/csu/arch/ia64/crt0.S:1.2 src/lib/csu/arch/ia64/crt0.S:1.3 --- src/lib/csu/arch/ia64/crt0.S:1.2 Mon Nov 26 17:37:45 2018 +++ src/lib/csu/arch/ia64/crt0.S Sat May 4 22:55:32 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: crt0.S,v 1.2 2018/11/26 17:37:45 joerg Exp $ */ +/* $NetBSD: crt0.S,v 1.3 2019/05/04 22:55:32 scole Exp $ */ /*- * Copyright (c) 2014 The NetBSD Foundation, Inc. @@ -31,7 +31,7 @@ #include -RCSID("$NetBSD: crt0.S,v 1.2 2018/11/26 17:37:45 joerg Exp $") +RCSID("$NetBSD: crt0.S,v 1.3 2019/05/04 22:55:32 scole Exp $") STRONG_ALIAS(_start,__start) @@ -53,5 +53,6 @@ __start: 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
CVS commit: src/lib/csu/arch/riscv
Module Name:src Committed By: maya Date: Sun Feb 10 07:28:06 UTC 2019 Modified Files: src/lib/csu/arch/riscv: crti.S crtn.S Log Message: Update comment (copied from or1k) To generate a diff of this commit: cvs rdiff -u -r1.1 -r1.2 src/lib/csu/arch/riscv/crti.S \ src/lib/csu/arch/riscv/crtn.S Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/lib/csu/arch/riscv/crti.S diff -u src/lib/csu/arch/riscv/crti.S:1.1 src/lib/csu/arch/riscv/crti.S:1.2 --- src/lib/csu/arch/riscv/crti.S:1.1 Fri Sep 19 17:36:25 2014 +++ src/lib/csu/arch/riscv/crti.S Sun Feb 10 07:28:06 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: crti.S,v 1.1 2014/09/19 17:36:25 matt Exp $ */ +/* $NetBSD: crti.S,v 1.2 2019/02/10 07:28:06 maya Exp $ */ /*- * Copyright (c) 2014 The NetBSD Foundation, Inc. @@ -31,11 +31,11 @@ #include -RCSID("$NetBSD: crti.S,v 1.1 2014/09/19 17:36:25 matt Exp $") +RCSID("$NetBSD: crti.S,v 1.2 2019/02/10 07:28:06 maya Exp $") #include "sysident.S" /* - * Since OR1K for NetBSD uses .init_array/.fini_array, + * Since RISC-V for NetBSD uses .init_array/.fini_array, * there is no need for .init/.fini */ Index: src/lib/csu/arch/riscv/crtn.S diff -u src/lib/csu/arch/riscv/crtn.S:1.1 src/lib/csu/arch/riscv/crtn.S:1.2 --- src/lib/csu/arch/riscv/crtn.S:1.1 Fri Sep 19 17:36:25 2014 +++ src/lib/csu/arch/riscv/crtn.S Sun Feb 10 07:28:06 2019 @@ -1,3 +1,3 @@ -/* $NetBSD: crtn.S,v 1.1 2014/09/19 17:36:25 matt Exp $ */ +/* $NetBSD: crtn.S,v 1.2 2019/02/10 07:28:06 maya Exp $ */ -/* no need for anything here since OR1K for NetBSD uses .init_array/.fini_array */ +/* no need for anything here since RISC-V for NetBSD uses .init_array/.fini_array */
CVS commit: src/lib/csu/arch/alpha
Module Name:src Committed By: christos Date: Sat Jan 14 15:50:24 UTC 2017 Modified Files: src/lib/csu/arch/alpha: crtbegin.h Log Message: remove useless include; asm.h is not useful for c files. our current assumption is that stuff in cdefs.h is duplicated in asm.h. To generate a diff of this commit: cvs rdiff -u -r1.1 -r1.2 src/lib/csu/arch/alpha/crtbegin.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/lib/csu/arch/alpha/crtbegin.h diff -u src/lib/csu/arch/alpha/crtbegin.h:1.1 src/lib/csu/arch/alpha/crtbegin.h:1.2 --- src/lib/csu/arch/alpha/crtbegin.h:1.1 Thu Jul 11 12:40:27 2013 +++ src/lib/csu/arch/alpha/crtbegin.h Sat Jan 14 10:50:24 2017 @@ -1,4 +1,4 @@ -/* $NetBSD: crtbegin.h,v 1.1 2013/07/11 16:40:27 matt Exp $ */ +/* $NetBSD: crtbegin.h,v 1.2 2017/01/14 15:50:24 christos Exp $ */ /*- * Copyright (c) 2013 The NetBSD Foundation, Inc. * All rights reserved. @@ -29,7 +29,6 @@ */ #include -#include /* Assume we need to reload our GP. */ __asm( ".pushsection .init"
CVS commit: src/lib/csu/arch/sh3
Module Name:src Committed By: uwe Date: Mon Aug 29 21:27:03 UTC 2016 Modified Files: src/lib/csu/arch/sh3: crt0.S Log Message: ___start is __dso_hidden, so use CALL_DATUM_LOCAL and drop the PIC prologue from __start. To generate a diff of this commit: cvs rdiff -u -r1.5 -r1.6 src/lib/csu/arch/sh3/crt0.S Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/lib/csu/arch/sh3/crt0.S diff -u src/lib/csu/arch/sh3/crt0.S:1.5 src/lib/csu/arch/sh3/crt0.S:1.6 --- src/lib/csu/arch/sh3/crt0.S:1.5 Sun Aug 28 13:50:25 2016 +++ src/lib/csu/arch/sh3/crt0.S Mon Aug 29 21:27:03 2016 @@ -1,4 +1,4 @@ -/* $NetBSD: crt0.S,v 1.5 2016/08/28 13:50:25 christos Exp $ */ +/* $NetBSD: crt0.S,v 1.6 2016/08/29 21:27:03 uwe Exp $ */ /* * Copyright (c) 1998 Christos Zoulas @@ -37,7 +37,7 @@ #include -RCSID("$NetBSD: crt0.S,v 1.5 2016/08/28 13:50:25 christos Exp $") +RCSID("$NetBSD: crt0.S,v 1.6 2016/08/29 21:27:03 uwe Exp $") STRONG_ALIAS(_start,__start) @@ -49,7 +49,6 @@ STRONG_ALIAS(_start,__start) * proper registers. */ _ENTRY(__start) - PIC_PROLOGUE_NOSAVE(.L_got) mov.l .L___start, r0 mov r7, r4 ! void (*cleanup)(void) mov r8, r5 ! const Obj_Entry *obj @@ -57,7 +56,5 @@ _ENTRY(__start) mov r9, r6 ! struct ps_strings *ps_strings .p2align 2 -.L_got: - PIC_GOT_DATUM .L___start: - CALL_DATUM(___start, 1b) + CALL_DATUM_LOCAL(___start, 1b)
CVS commit: src/lib/csu/arch/sh3
Module Name:src Committed By: christos Date: Sun Aug 28 13:50:26 UTC 2016 Modified Files: src/lib/csu/arch/sh3: crt0.S Log Message: fix pic code; otherwise we generate text relocations. To generate a diff of this commit: cvs rdiff -u -r1.4 -r1.5 src/lib/csu/arch/sh3/crt0.S Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/lib/csu/arch/sh3/crt0.S diff -u src/lib/csu/arch/sh3/crt0.S:1.4 src/lib/csu/arch/sh3/crt0.S:1.5 --- src/lib/csu/arch/sh3/crt0.S:1.4 Tue Jan 31 15:17:57 2012 +++ src/lib/csu/arch/sh3/crt0.S Sun Aug 28 09:50:25 2016 @@ -1,4 +1,4 @@ -/* $NetBSD: crt0.S,v 1.4 2012/01/31 20:17:57 uwe Exp $ */ +/* $NetBSD: crt0.S,v 1.5 2016/08/28 13:50:25 christos Exp $ */ /* * Copyright (c) 1998 Christos Zoulas @@ -37,7 +37,7 @@ #include -RCSID("$NetBSD: crt0.S,v 1.4 2012/01/31 20:17:57 uwe Exp $") +RCSID("$NetBSD: crt0.S,v 1.5 2016/08/28 13:50:25 christos Exp $") STRONG_ALIAS(_start,__start) @@ -49,11 +49,15 @@ STRONG_ALIAS(_start,__start) * proper registers. */ _ENTRY(__start) + PIC_PROLOGUE_NOSAVE(.L_got) mov.l .L___start, r0 mov r7, r4 ! void (*cleanup)(void) mov r8, r5 ! const Obj_Entry *obj - jmp @r0 +1: JUMP r0 mov r9, r6 ! struct ps_strings *ps_strings .p2align 2 -.L___start: .long _C_LABEL(___start) +.L_got: + PIC_GOT_DATUM +.L___start: + CALL_DATUM(___start, 1b)
CVS commit: src/lib/csu/arch/alpha
Module Name:src Committed By: christos Date: Sun Jan 24 16:27:38 UTC 2016 Modified Files: src/lib/csu/arch/alpha: Makefile.inc Log Message: Alpha needs _KERNTYPES To generate a diff of this commit: cvs rdiff -u -r1.1 -r1.2 src/lib/csu/arch/alpha/Makefile.inc Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/lib/csu/arch/alpha/Makefile.inc diff -u src/lib/csu/arch/alpha/Makefile.inc:1.1 src/lib/csu/arch/alpha/Makefile.inc:1.2 --- src/lib/csu/arch/alpha/Makefile.inc:1.1 Thu Jul 11 12:40:27 2013 +++ src/lib/csu/arch/alpha/Makefile.inc Sun Jan 24 11:27:38 2016 @@ -1,3 +1,3 @@ -# $NetBSD: Makefile.inc,v 1.1 2013/07/11 16:40:27 matt Exp $ +# $NetBSD: Makefile.inc,v 1.2 2016/01/24 16:27:38 christos Exp $ -CPPFLAGS+= -I${ARCHDIR} -DELFSIZE=64 +CPPFLAGS+= -I${ARCHDIR} -DELFSIZE=64 -D_KERNTYPES
CVS commit: src/lib/csu/arch/alpha
Module Name:src Committed By: christos Date: Sun Jan 24 16:47:32 UTC 2016 Modified Files: src/lib/csu/arch/alpha: Makefile.inc Log Message: Undo previous; the lossage is more basic. To generate a diff of this commit: cvs rdiff -u -r1.2 -r1.3 src/lib/csu/arch/alpha/Makefile.inc Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/lib/csu/arch/alpha/Makefile.inc diff -u src/lib/csu/arch/alpha/Makefile.inc:1.2 src/lib/csu/arch/alpha/Makefile.inc:1.3 --- src/lib/csu/arch/alpha/Makefile.inc:1.2 Sun Jan 24 11:27:38 2016 +++ src/lib/csu/arch/alpha/Makefile.inc Sun Jan 24 11:47:32 2016 @@ -1,3 +1,3 @@ -# $NetBSD: Makefile.inc,v 1.2 2016/01/24 16:27:38 christos Exp $ +# $NetBSD: Makefile.inc,v 1.3 2016/01/24 16:47:32 christos Exp $ -CPPFLAGS+= -I${ARCHDIR} -DELFSIZE=64 -D_KERNTYPES +CPPFLAGS+= -I${ARCHDIR} -DELFSIZE=64
CVS commit: src/lib/csu/arch/mips
Module Name:src Committed By: matt Date: Fri May 1 21:35:56 UTC 2015 Modified Files: src/lib/csu/arch/mips: crti.S Log Message: Make sure .init and .fini are word (4byte) aligned. To generate a diff of this commit: cvs rdiff -u -r1.2 -r1.3 src/lib/csu/arch/mips/crti.S Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/lib/csu/arch/mips/crti.S diff -u src/lib/csu/arch/mips/crti.S:1.2 src/lib/csu/arch/mips/crti.S:1.3 --- src/lib/csu/arch/mips/crti.S:1.2 Sun Jun 30 08:00:34 2013 +++ src/lib/csu/arch/mips/crti.S Fri May 1 21:35:56 2015 @@ -1,4 +1,4 @@ -/* $NetBSD: crti.S,v 1.2 2013/06/30 08:00:34 matt Exp $ */ +/* $NetBSD: crti.S,v 1.3 2015/05/01 21:35:56 matt Exp $ */ /*- * Copyright (c) 2011 The NetBSD Foundation, Inc. @@ -31,11 +31,12 @@ #include mips/asm.h -RCSID($NetBSD: crti.S,v 1.2 2013/06/30 08:00:34 matt Exp $) +RCSID($NetBSD: crti.S,v 1.3 2015/05/01 21:35:56 matt Exp $) #include sysident.S .section .init, ax, @progbits + .p2align 2 NESTED_NOPROFILE(_init, CALLFRAME_SIZ, ra) SETUP_GP PTR_SUBU sp, sp, CALLFRAME_SIZ # allocate stack frame @@ -48,6 +49,7 @@ NESTED_NOPROFILE(_init, CALLFRAME_SIZ, r END(_init) .section .fini, ax, @progbits + .p2align 2 NESTED_NOPROFILE(_fini, CALLFRAME_SIZ, ra) SETUP_GP PTR_SUBU sp, sp, CALLFRAME_SIZ # allocate stack frame
CVS commit: src/lib/csu/arch/vax
Module Name:src Committed By: joerg Date: Sun Mar 16 11:41:30 UTC 2014 Modified Files: src/lib/csu/arch/vax: crtbegin.S Log Message: __do_global_ctors_aux and __do_global_ctors_aux must be used locally, so mark them as hidden. To generate a diff of this commit: cvs rdiff -u -r1.6 -r1.7 src/lib/csu/arch/vax/crtbegin.S Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/lib/csu/arch/vax/crtbegin.S diff -u src/lib/csu/arch/vax/crtbegin.S:1.6 src/lib/csu/arch/vax/crtbegin.S:1.7 --- src/lib/csu/arch/vax/crtbegin.S:1.6 Wed Jul 10 23:30:45 2013 +++ src/lib/csu/arch/vax/crtbegin.S Sun Mar 16 11:41:30 2014 @@ -1,4 +1,4 @@ -/* $NetBSD: crtbegin.S,v 1.6 2013/07/10 23:30:45 matt Exp $ */ +/* $NetBSD: crtbegin.S,v 1.7 2014/03/16 11:41:30 joerg Exp $ */ /*- * Copyright (c) 2013 The NetBSD Foundation, Inc. * All rights reserved. @@ -30,7 +30,7 @@ #include vax/asm.h -RCSID($NetBSD: crtbegin.S,v 1.6 2013/07/10 23:30:45 matt Exp $) +RCSID($NetBSD: crtbegin.S,v 1.7 2014/03/16 11:41:30 joerg Exp $) .section .ctors, aw, @progbits .p2align 2 @@ -80,6 +80,8 @@ __dso_handle: * needed. */ + .hidden __do_global_dtors_aux + _ENTRY(__do_global_dtors_aux, 0x0100) /* save r8 */ tstb __finished /* done this already? */ bneq 4f @@ -128,6 +130,8 @@ END(__do_global_dtors_aux) .weak __register_frame_info .weak _Jv_RegisterClasses + .hidden __do_global_ctors_aux + _ENTRY(__do_global_ctors_aux, 0x0800) tstb __initialized bneq 4f
CVS commit: src/lib/csu/arch/ia64
Module Name:src Committed By: cherry Date: Fri Mar 14 18:15:02 UTC 2014 Added Files: src/lib/csu/arch/ia64: Makefile.inc crt0.S crtbegin.h crtend.S crti.S crtn.S Log Message: Add crtstuff for ia64. Compile tested only To generate a diff of this commit: cvs rdiff -u -r0 -r1.1 src/lib/csu/arch/ia64/Makefile.inc \ src/lib/csu/arch/ia64/crt0.S src/lib/csu/arch/ia64/crtbegin.h \ src/lib/csu/arch/ia64/crtend.S src/lib/csu/arch/ia64/crti.S \ src/lib/csu/arch/ia64/crtn.S Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Added files: Index: src/lib/csu/arch/ia64/Makefile.inc diff -u /dev/null src/lib/csu/arch/ia64/Makefile.inc:1.1 --- /dev/null Fri Mar 14 18:15:02 2014 +++ src/lib/csu/arch/ia64/Makefile.inc Fri Mar 14 18:15:02 2014 @@ -0,0 +1,3 @@ +# $NetBSD: Makefile.inc,v 1.1 2014/03/14 18:15:02 cherry Exp $ + +CPPFLAGS+= -DELFSIZE=64 -I${ARCHDIR} Index: src/lib/csu/arch/ia64/crt0.S diff -u /dev/null src/lib/csu/arch/ia64/crt0.S:1.1 --- /dev/null Fri Mar 14 18:15:02 2014 +++ src/lib/csu/arch/ia64/crt0.S Fri Mar 14 18:15:02 2014 @@ -0,0 +1,56 @@ +/* $NetBSD: crt0.S,v 1.1 2014/03/14 18:15:02 cherry Exp $ */ + +/*- + * Copyright (c) 2014 The NetBSD Foundation, Inc. + * All rights reserved. + * + * This code is derived from software contributed to The NetBSD Foundation + * by Cherry G. Mathew of Backyard Innovations, UK, Ltd. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + *notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + *notice, this list of conditions and the following disclaimer in the + *documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS + * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ + +#include machine/asm.h + +RCSID($NetBSD: crt0.S,v 1.1 2014/03/14 18:15:02 cherry Exp $) + +STRONG_ALIAS(_start,__start) + +.proc __start +.global __start + +/* + * Called with: + * in0 = cleanup + * in1 = obj + * in2 = ps_strings + * in3 = sp + * See: sys/arch/ia64/ia64/machdep.c:setregs() + */ + +__start: + .regstk 4, 0, 0, 0 + + mov sp = in3 /* Setup Memory Stack Pointer. */ + alloc r31 = ar.pfs, 3, 0, 0, 0 /* Adjust backingstore for ___start() */ + br.call.sptk.many rp = ___start + Index: src/lib/csu/arch/ia64/crtbegin.h diff -u /dev/null src/lib/csu/arch/ia64/crtbegin.h:1.1 --- /dev/null Fri Mar 14 18:15:02 2014 +++ src/lib/csu/arch/ia64/crtbegin.h Fri Mar 14 18:15:02 2014 @@ -0,0 +1,41 @@ +/*- + * Copyright (c) 2013, 2014 The NetBSD Foundation, Inc. + * All rights reserved. + * + * This code is derived from software contributed to The NetBSD Foundation + * by Matt Thomas of 3am Software Foundry and + * Cherry G. Mathew of Backyard Innovations, UK, Ltd. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + *notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + *notice, this list of conditions and the following disclaimer in the + *documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS + * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING
CVS commit: src/lib/csu/arch/powerpc
Module Name:src Committed By: matt Date: Thu Mar 6 19:05:59 UTC 2014 Modified Files: src/lib/csu/arch/powerpc: crti.S Log Message: Use _XENTRY To generate a diff of this commit: cvs rdiff -u -r1.3 -r1.4 src/lib/csu/arch/powerpc/crti.S Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/lib/csu/arch/powerpc/crti.S diff -u src/lib/csu/arch/powerpc/crti.S:1.3 src/lib/csu/arch/powerpc/crti.S:1.4 --- src/lib/csu/arch/powerpc/crti.S:1.3 Thu Feb 27 18:11:08 2014 +++ src/lib/csu/arch/powerpc/crti.S Thu Mar 6 19:05:59 2014 @@ -1,4 +1,4 @@ -/* $NetBSD: crti.S,v 1.3 2014/02/27 18:11:08 matt Exp $ */ +/* $NetBSD: crti.S,v 1.4 2014/03/06 19:05:59 matt Exp $ */ /*- * Copyright (c) 2011 The NetBSD Foundation, Inc. @@ -31,12 +31,12 @@ #include powerpc/asm.h -RCSID($NetBSD: crti.S,v 1.3 2014/02/27 18:11:08 matt Exp $) +RCSID($NetBSD: crti.S,v 1.4 2014/03/06 19:05:59 matt Exp $) #include sysident.S .section .init, ax, @progbits -_ENTRY(_init) +_XENTRY(_init) mflr %r0 #ifdef _LP64 stdu %r1, -(6*SZREG)(%r1) @@ -47,7 +47,7 @@ _ENTRY(_init) #endif .section .fini, ax, @progbits -_ENTRY(_fini) +_XENTRY(_fini) mflr %r0 #ifdef _LP64 stdu %r1, -(6*SZREG)(%r1)
CVS commit: src/lib/csu/arch/powerpc
Module Name:src Committed By: matt Date: Thu Feb 27 16:47:48 UTC 2014 Modified Files: src/lib/csu/arch/powerpc: crt0.S crtend.S crti.S crtn.S Log Message: Add powerpc64 support To generate a diff of this commit: cvs rdiff -u -r1.4 -r1.5 src/lib/csu/arch/powerpc/crt0.S cvs rdiff -u -r1.2 -r1.3 src/lib/csu/arch/powerpc/crtend.S cvs rdiff -u -r1.1 -r1.2 src/lib/csu/arch/powerpc/crti.S \ src/lib/csu/arch/powerpc/crtn.S Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/lib/csu/arch/powerpc/crt0.S diff -u src/lib/csu/arch/powerpc/crt0.S:1.4 src/lib/csu/arch/powerpc/crt0.S:1.5 --- src/lib/csu/arch/powerpc/crt0.S:1.4 Sat Jul 2 20:16:09 2011 +++ src/lib/csu/arch/powerpc/crt0.S Thu Feb 27 16:47:48 2014 @@ -29,25 +29,34 @@ #include powerpc/asm.h -RCSID($NetBSD: crt0.S,v 1.4 2011/07/02 20:16:09 matt Exp $) +RCSID($NetBSD: crt0.S,v 1.5 2014/02/27 16:47:48 matt Exp $) STRONG_ALIAS(_start,__start) .hidden ___start +#ifndef _LP64 .weak _SDA_BASE_ +#endif ENTRY_NOPROFILE(__start) +#ifndef _LP64 bcl 20,31,1f 1: mflr %r11 /* SVR4 ABI says small data is in r13 */ addis %r13,%r11,_SDA_BASE_-1b@ha addi %r13,%r13,_SDA_BASE_-1b@l +#endif mr %r3,%r7 /* cleanup */ mr %r4,%r6 /* obj */ mr %r5,%r8 /* ps_strings */ +#ifdef _LP64 + b .___start + nop +#else b ___start +#endif END(__start) Index: src/lib/csu/arch/powerpc/crtend.S diff -u src/lib/csu/arch/powerpc/crtend.S:1.2 src/lib/csu/arch/powerpc/crtend.S:1.3 --- src/lib/csu/arch/powerpc/crtend.S:1.2 Thu Jun 27 21:24:39 2013 +++ src/lib/csu/arch/powerpc/crtend.S Thu Feb 27 16:47:48 2014 @@ -1,4 +1,4 @@ -/* $NetBSD: crtend.S,v 1.2 2013/06/27 21:24:39 matt Exp $ */ +/* $NetBSD: crtend.S,v 1.3 2014/02/27 16:47:48 matt Exp $ */ /*- * Copyright (c) 2011 The NetBSD Foundation, Inc. * All rights reserved. @@ -30,26 +30,42 @@ #include powerpc/asm.h -RCSID($NetBSD: crtend.S,v 1.2 2013/06/27 21:24:39 matt Exp $) +RCSID($NetBSD: crtend.S,v 1.3 2014/02/27 16:47:48 matt Exp $) .section .ctors, aw, @progbits - .p2align 2 + .p2align P2SZREG .global __CTOR_LIST_END__ .hidden __CTOR_LIST_END__ __CTOR_LIST_END__: +#ifdef _LP64 + .quad 0 +#else .long 0 +#endif .section .dtors, aw, @progbits - .p2align 2 + .p2align P2SZREG .global __DTOR_LIST_END__ .hidden __DTOR_LIST_END__ __DTOR_LIST_END__: +#ifdef _LP64 + .quad 0 +#else .long 0 +#endif .section .eh_frame, a, @progbits - .p2align 2 + .p2align P2SZREG +#ifdef _LP64 + .quad 0 +#else .long 0 +#endif .section .jcr, aw, @progbits - .p2align 2 + .p2align P2SZREG +#ifdef _LP64 + .quad 0 +#else .long 0 +#endif Index: src/lib/csu/arch/powerpc/crti.S diff -u src/lib/csu/arch/powerpc/crti.S:1.1 src/lib/csu/arch/powerpc/crti.S:1.2 --- src/lib/csu/arch/powerpc/crti.S:1.1 Tue Feb 8 02:02:25 2011 +++ src/lib/csu/arch/powerpc/crti.S Thu Feb 27 16:47:48 2014 @@ -1,4 +1,4 @@ -/* $NetBSD: crti.S,v 1.1 2011/02/08 02:02:25 matt Exp $ */ +/* $NetBSD: crti.S,v 1.2 2014/02/27 16:47:48 matt Exp $ */ /*- * Copyright (c) 2011 The NetBSD Foundation, Inc. @@ -31,20 +31,54 @@ #include powerpc/asm.h -RCSID($NetBSD: crti.S,v 1.1 2011/02/08 02:02:25 matt Exp $) +RCSID($NetBSD: crti.S,v 1.2 2014/02/27 16:47:48 matt Exp $) #include sysident.S + .globl _init + .type _init,@function .section .init, ax, @progbits - .align 2; .globl _init; .type _init,@function + .align P2SZREG +#ifdef _LP64 + .globl ._init + .pushsection .opd, aw + .align 3 +_init: .quad ._init,.TOC.@tocbase,0 + .size _init, (3*SZREG) + .popsection +._init: +#else _init: +#endif mflr %r0 +#ifdef _LP64 + stlongu %r1, -(6*SZREG)(%r1) + stlong %r0, (2*SZREG)(%r1) +#else stw %r0, (1*SZREG)(%r1) stwu %r1, -(4*SZREG)(%r1) +#endif + .globl _fini + .type _fini,@function .section .fini, ax, @progbits - .align 2; .globl _fini; .type _fini,@function + .align P2SZREG +#ifdef _LP64 + .globl ._fini + .pushsection .opd, aw + .align 3 +_fini: .quad ._fini,.TOC.@tocbase,0 + .size _fini, (3*SZREG) + .popsection +._fini: +#else _fini: +#endif mflr %r0 +#ifdef _LP64 + stlongu %r1, -(6*SZREG)(%r1) + stlong %r0, (2*SZREG)(%r1) +#else stw %r0, (1*SZREG)(%r1) stwu %r1, -(4*SZREG)(%r1) +#endif Index: src/lib/csu/arch/powerpc/crtn.S diff -u src/lib/csu/arch/powerpc/crtn.S:1.1 src/lib/csu/arch/powerpc/crtn.S:1.2 --- src/lib/csu/arch/powerpc/crtn.S:1.1 Tue Feb 8 02:02:25 2011 +++ src/lib/csu/arch/powerpc/crtn.S Thu Feb 27 16:47:48 2014 @@ -29,16 +29,26 @@ #include powerpc/asm.h -RCSID($NetBSD: crtn.S,v 1.1 2011/02/08 02:02:25 matt Exp $) +RCSID($NetBSD: crtn.S,v 1.2 2014/02/27 16:47:48 matt Exp $) .section .init, ax, @progbits +#ifdef _LP64 + ldreg %r0, (2*SZREG)(%r1) + addi %r1, %r1, (6*SZREG) +#else addi %r1, %r1, (4*SZREG) lwz %r0, (1*SZREG)(%r1) +#endif mtlr %r0 blr .section .fini, ax, @progbits +#ifdef _LP64 + ldreg %r0, (2*SZREG)(%r1) + addi %r1, %r1, (6*SZREG) +#else
CVS commit: src/lib/csu/arch/powerpc
Module Name:src Committed By: matt Date: Thu Feb 27 18:01:51 UTC 2014 Modified Files: src/lib/csu/arch/powerpc: crt0.S Log Message: Use the CALL() macro. To generate a diff of this commit: cvs rdiff -u -r1.5 -r1.6 src/lib/csu/arch/powerpc/crt0.S Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/lib/csu/arch/powerpc/crt0.S diff -u src/lib/csu/arch/powerpc/crt0.S:1.5 src/lib/csu/arch/powerpc/crt0.S:1.6 --- src/lib/csu/arch/powerpc/crt0.S:1.5 Thu Feb 27 16:47:48 2014 +++ src/lib/csu/arch/powerpc/crt0.S Thu Feb 27 18:01:51 2014 @@ -29,7 +29,7 @@ #include powerpc/asm.h -RCSID($NetBSD: crt0.S,v 1.5 2014/02/27 16:47:48 matt Exp $) +RCSID($NetBSD: crt0.S,v 1.6 2014/02/27 18:01:51 matt Exp $) STRONG_ALIAS(_start,__start) @@ -53,10 +53,5 @@ ENTRY_NOPROFILE(__start) mr %r4,%r6 /* obj */ mr %r5,%r8 /* ps_strings */ -#ifdef _LP64 - b .___start - nop -#else - b ___start -#endif + CALL(___start) END(__start)
CVS commit: src/lib/csu/arch/powerpc
Module Name:src Committed By: matt Date: Thu Feb 27 18:11:08 UTC 2014 Modified Files: src/lib/csu/arch/powerpc: crti.S Log Message: Use _ENTRY To generate a diff of this commit: cvs rdiff -u -r1.2 -r1.3 src/lib/csu/arch/powerpc/crti.S Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/lib/csu/arch/powerpc/crti.S diff -u src/lib/csu/arch/powerpc/crti.S:1.2 src/lib/csu/arch/powerpc/crti.S:1.3 --- src/lib/csu/arch/powerpc/crti.S:1.2 Thu Feb 27 16:47:48 2014 +++ src/lib/csu/arch/powerpc/crti.S Thu Feb 27 18:11:08 2014 @@ -1,4 +1,4 @@ -/* $NetBSD: crti.S,v 1.2 2014/02/27 16:47:48 matt Exp $ */ +/* $NetBSD: crti.S,v 1.3 2014/02/27 18:11:08 matt Exp $ */ /*- * Copyright (c) 2011 The NetBSD Foundation, Inc. @@ -31,53 +31,27 @@ #include powerpc/asm.h -RCSID($NetBSD: crti.S,v 1.2 2014/02/27 16:47:48 matt Exp $) +RCSID($NetBSD: crti.S,v 1.3 2014/02/27 18:11:08 matt Exp $) #include sysident.S - .globl _init - .type _init,@function .section .init, ax, @progbits - .align P2SZREG -#ifdef _LP64 - .globl ._init - .pushsection .opd, aw - .align 3 -_init: .quad ._init,.TOC.@tocbase,0 - .size _init, (3*SZREG) - .popsection -._init: -#else -_init: -#endif +_ENTRY(_init) mflr %r0 #ifdef _LP64 - stlongu %r1, -(6*SZREG)(%r1) - stlong %r0, (2*SZREG)(%r1) + stdu %r1, -(6*SZREG)(%r1) + std %r0, (2*SZREG)(%r1) #else stw %r0, (1*SZREG)(%r1) stwu %r1, -(4*SZREG)(%r1) #endif - .globl _fini - .type _fini,@function .section .fini, ax, @progbits - .align P2SZREG -#ifdef _LP64 - .globl ._fini - .pushsection .opd, aw - .align 3 -_fini: .quad ._fini,.TOC.@tocbase,0 - .size _fini, (3*SZREG) - .popsection -._fini: -#else -_fini: -#endif +_ENTRY(_fini) mflr %r0 #ifdef _LP64 - stlongu %r1, -(6*SZREG)(%r1) - stlong %r0, (2*SZREG)(%r1) + stdu %r1, -(6*SZREG)(%r1) + std %r0, (2*SZREG)(%r1) #else stw %r0, (1*SZREG)(%r1) stwu %r1, -(4*SZREG)(%r1)
CVS commit: src/lib/csu/arch/earm
Module Name:src Committed By: joerg Date: Fri Dec 20 15:35:48 UTC 2013 Modified Files: src/lib/csu/arch/earm: crtend.S Log Message: Drop .fpu. Discussed with Matt. To generate a diff of this commit: cvs rdiff -u -r1.1 -r1.2 src/lib/csu/arch/earm/crtend.S Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/lib/csu/arch/earm/crtend.S diff -u src/lib/csu/arch/earm/crtend.S:1.1 src/lib/csu/arch/earm/crtend.S:1.2 --- src/lib/csu/arch/earm/crtend.S:1.1 Mon Aug 13 02:49:04 2012 +++ src/lib/csu/arch/earm/crtend.S Fri Dec 20 15:35:48 2013 @@ -1,4 +1,4 @@ -/* $NetBSD: crtend.S,v 1.1 2012/08/13 02:49:04 matt Exp $ */ +/* $NetBSD: crtend.S,v 1.2 2013/12/20 15:35:48 joerg Exp $ */ /*- * Copyright (c) 2011 The NetBSD Foundation, Inc. * All rights reserved. @@ -30,9 +30,8 @@ #include arm/asm.h -RCSID($NetBSD: crtend.S,v 1.1 2012/08/13 02:49:04 matt Exp $) +RCSID($NetBSD: crtend.S,v 1.2 2013/12/20 15:35:48 joerg Exp $) - .fpu softvfp .eabi_attribute 18, 4 /* sizeof(wchar_t) */ .eabi_attribute 23, 0 /* doesn't use floating point */ .eabi_attribute 24, 1 /* 8 byte alignment permitted */
CVS commit: src/lib/csu/arch/mips
Module Name:src Committed By: matt Date: Sun Dec 8 06:32:36 UTC 2013 Modified Files: src/lib/csu/arch/mips: crt0.S Log Message: Make sure t9 ($25) is properly set before calling ___start To generate a diff of this commit: cvs rdiff -u -r1.2 -r1.3 src/lib/csu/arch/mips/crt0.S Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/lib/csu/arch/mips/crt0.S diff -u src/lib/csu/arch/mips/crt0.S:1.2 src/lib/csu/arch/mips/crt0.S:1.3 --- src/lib/csu/arch/mips/crt0.S:1.2 Tue Jun 25 16:47:47 2013 +++ src/lib/csu/arch/mips/crt0.S Sun Dec 8 06:32:36 2013 @@ -1,4 +1,4 @@ -/* $NetBSD: crt0.S,v 1.2 2013/06/25 16:47:47 matt Exp $ */ +/* $NetBSD: crt0.S,v 1.3 2013/12/08 06:32:36 matt Exp $ */ /*- * Copyright (c) 2013 The NetBSD Foundation, Inc. @@ -31,7 +31,7 @@ #include mips/asm.h -RCSID($NetBSD: crt0.S,v 1.2 2013/06/25 16:47:47 matt Exp $) +RCSID($NetBSD: crt0.S,v 1.3 2013/12/08 06:32:36 matt Exp $) STRONG_ALIAS(_start,__start) @@ -53,6 +53,8 @@ NESTED_NOPROFILE(__start, CALLFRAME_SIZ, SETUP_GP64(t3, __start) move a0, a1 /* cleanup */ move a1, a2 /* Obj_Entry */ - move a2, a3 /* ps_strings */ - j _C_LABEL(___start) + PTR_L t9,%call16(_C_LABEL(___start))(gp) + move a2, a3 /* ps_strings */ + .reloc 1f,R_MIPS_JALR,___start +1: jr t9 END(__start)
CVS commit: src/lib/csu/arch/arm
Module Name:src Committed By: matt Date: Tue Sep 10 22:00:01 UTC 2013 Modified Files: src/lib/csu/arch/arm: Makefile.inc Log Message: Define ELF_NOTE_MARCH_DESC for when running non-eabi in compat_netbsd32 To generate a diff of this commit: cvs rdiff -u -r1.6 -r1.7 src/lib/csu/arch/arm/Makefile.inc Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/lib/csu/arch/arm/Makefile.inc diff -u src/lib/csu/arch/arm/Makefile.inc:1.6 src/lib/csu/arch/arm/Makefile.inc:1.7 --- src/lib/csu/arch/arm/Makefile.inc:1.6 Thu Jun 27 21:24:39 2013 +++ src/lib/csu/arch/arm/Makefile.inc Tue Sep 10 22:00:01 2013 @@ -1,6 +1,7 @@ -# $NetBSD: Makefile.inc,v 1.6 2013/06/27 21:24:39 matt Exp $ +# $NetBSD: Makefile.inc,v 1.7 2013/09/10 22:00:01 matt Exp $ CPPFLAGS+= -I${ARCHDIR} .if (!empty(CPUFLAGS) ${CPUFLAGS:M-mabi=aapcs*} != ) CPPFLAGS+= -DHAVE_INITFINI_ARRAY .endif +CPPFLAGS+= -DELF_NOTE_MARCH_DESC=\${CSU_MACHINE_ARCH}\
CVS commit: src/lib/csu/arch/earm
Module Name:src Committed By: matt Date: Thu Sep 5 00:27:38 UTC 2013 Modified Files: src/lib/csu/arch/earm: crt0.S Log Message: bic sp not allowed in thumb (even with thumb2) To generate a diff of this commit: cvs rdiff -u -r1.2 -r1.3 src/lib/csu/arch/earm/crt0.S Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/lib/csu/arch/earm/crt0.S diff -u src/lib/csu/arch/earm/crt0.S:1.2 src/lib/csu/arch/earm/crt0.S:1.3 --- src/lib/csu/arch/earm/crt0.S:1.2 Wed Aug 21 03:03:02 2013 +++ src/lib/csu/arch/earm/crt0.S Thu Sep 5 00:27:38 2013 @@ -1,4 +1,4 @@ -/* $NetBSD: crt0.S,v 1.2 2013/08/21 03:03:02 matt Exp $ */ +/* $NetBSD: crt0.S,v 1.3 2013/09/05 00:27:38 matt Exp $ */ /*- * Copyright (c) 2012 The NetBSD Foundation, Inc. @@ -31,7 +31,7 @@ #include arm/asm.h -RCSID($NetBSD: crt0.S,v 1.2 2013/08/21 03:03:02 matt Exp $) +RCSID($NetBSD: crt0.S,v 1.3 2013/09/05 00:27:38 matt Exp $) STRONG_ALIAS(_start,__start) @@ -44,7 +44,7 @@ _ENTRY(__start) mov r2, ip /* tmp - ps_strings */ /* Ensure the stack is properly aligned before calling C code. */ -#if !defined(__thumb__) || defined(_ARM_ARCH_T2) +#if !defined(__thumb__) bic sp, sp, #7 #else movs r6, #7
CVS commit: src/lib/csu/arch/mips
Module Name:src Committed By: matt Date: Thu Sep 5 00:28:11 UTC 2013 Modified Files: src/lib/csu/arch/mips: crtend.S Log Message: mips .eh_frame is writable To generate a diff of this commit: cvs rdiff -u -r1.2 -r1.3 src/lib/csu/arch/mips/crtend.S Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/lib/csu/arch/mips/crtend.S diff -u src/lib/csu/arch/mips/crtend.S:1.2 src/lib/csu/arch/mips/crtend.S:1.3 --- src/lib/csu/arch/mips/crtend.S:1.2 Thu Jul 11 16:23:40 2013 +++ src/lib/csu/arch/mips/crtend.S Thu Sep 5 00:28:11 2013 @@ -1,4 +1,4 @@ -/* $NetBSD: crtend.S,v 1.2 2013/07/11 16:23:40 matt Exp $ */ +/* $NetBSD: crtend.S,v 1.3 2013/09/05 00:28:11 matt Exp $ */ /*- * Copyright (c) 2012 The NetBSD Foundation, Inc. * All rights reserved. @@ -30,7 +30,7 @@ #include mips/asm.h -RCSID($NetBSD: crtend.S,v 1.2 2013/07/11 16:23:40 matt Exp $) +RCSID($NetBSD: crtend.S,v 1.3 2013/09/05 00:28:11 matt Exp $) .section .ctors, aw, @progbits .p2align PTR_SCALESHIFT @@ -46,7 +46,7 @@ __CTOR_LIST_END__: __DTOR_LIST_END__: .word 0 - .section .eh_frame, a, @progbits + .section .eh_frame, aw, @progbits .p2align PTR_SCALESHIFT .space _MIPS_SZPTR / 8
CVS commit: src/lib/csu/arch/earm
Module Name:src Committed By: matt Date: Wed Aug 21 03:03:02 UTC 2013 Modified Files: src/lib/csu/arch/earm: crt0.S Log Message: Thumbify To generate a diff of this commit: cvs rdiff -u -r1.1 -r1.2 src/lib/csu/arch/earm/crt0.S Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/lib/csu/arch/earm/crt0.S diff -u src/lib/csu/arch/earm/crt0.S:1.1 src/lib/csu/arch/earm/crt0.S:1.2 --- src/lib/csu/arch/earm/crt0.S:1.1 Mon Aug 13 02:49:04 2012 +++ src/lib/csu/arch/earm/crt0.S Wed Aug 21 03:03:02 2013 @@ -1,4 +1,4 @@ -/* $NetBSD: crt0.S,v 1.1 2012/08/13 02:49:04 matt Exp $ */ +/* $NetBSD: crt0.S,v 1.2 2013/08/21 03:03:02 matt Exp $ */ /*- * Copyright (c) 2012 The NetBSD Foundation, Inc. @@ -31,7 +31,7 @@ #include arm/asm.h -RCSID($NetBSD: crt0.S,v 1.1 2012/08/13 02:49:04 matt Exp $) +RCSID($NetBSD: crt0.S,v 1.2 2013/08/21 03:03:02 matt Exp $) STRONG_ALIAS(_start,__start) @@ -44,7 +44,14 @@ _ENTRY(__start) mov r2, ip /* tmp - ps_strings */ /* Ensure the stack is properly aligned before calling C code. */ +#if !defined(__thumb__) || defined(_ARM_ARCH_T2) bic sp, sp, #7 +#else + movs r6, #7 + mov r7, sp + bics r7, r7, r6 + mov sp, r7 +#endif /* * void ___start(void (*cleanup)(void),
CVS commit: src/lib/csu/arch/m68k
Module Name:src Committed By: martin Date: Sat Jul 27 13:07:06 UTC 2013 Modified Files: src/lib/csu/arch/m68k: crtbegin.h Log Message: In .fini invoke destructors (fix copy pasto) To generate a diff of this commit: cvs rdiff -u -r1.3 -r1.4 src/lib/csu/arch/m68k/crtbegin.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/lib/csu/arch/m68k/crtbegin.h diff -u src/lib/csu/arch/m68k/crtbegin.h:1.3 src/lib/csu/arch/m68k/crtbegin.h:1.4 --- src/lib/csu/arch/m68k/crtbegin.h:1.3 Fri Jul 19 06:26:41 2013 +++ src/lib/csu/arch/m68k/crtbegin.h Sat Jul 27 13:07:06 2013 @@ -1,4 +1,4 @@ -/* $NetBSD: crtbegin.h,v 1.3 2013/07/19 06:26:41 matt Exp $ */ +/* $NetBSD: crtbegin.h,v 1.4 2013/07/27 13:07:06 martin Exp $ */ /*- * Copyright (c) 2013 The NetBSD Foundation, Inc. * All rights reserved. @@ -38,7 +38,7 @@ __asm( .pushsection .init __asm( .pushsection .fini #ifdef __pic__ -\n\t bsrl __do_global_ctors_aux +\n\t bsrl __do_global_dtors_aux #else \n\t jsr __do_global_dtors_aux #endif
CVS commit: src/lib/csu/arch/m68k
Module Name:src Committed By: martin Date: Fri Jul 26 18:47:23 UTC 2013 Modified Files: src/lib/csu/arch/m68k: crt0.S Log Message: Simplify to new ___start() signature. Seems to fix PR port-m68k/48076. To generate a diff of this commit: cvs rdiff -u -r1.2 -r1.3 src/lib/csu/arch/m68k/crt0.S Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/lib/csu/arch/m68k/crt0.S diff -u src/lib/csu/arch/m68k/crt0.S:1.2 src/lib/csu/arch/m68k/crt0.S:1.3 --- src/lib/csu/arch/m68k/crt0.S:1.2 Thu Jul 11 17:07:35 2013 +++ src/lib/csu/arch/m68k/crt0.S Fri Jul 26 18:47:23 2013 @@ -35,18 +35,13 @@ * Id: LICENSE,v 1.2 2000/06/14 15:57:33 cgd Exp */ -RCSID($NetBSD: crt0.S,v 1.2 2013/07/11 17:07:35 matt Exp $) +RCSID($NetBSD: crt0.S,v 1.3 2013/07/26 18:47:23 martin Exp $) STRONG_ALIAS(_start,__start) _ENTRY(__start) - movl (%sp),%d0 movl %a2,-(%sp) | ps_strings movl %a0,-(%sp) | obj movl %a1,-(%sp) | cleanup - movl %d0,%d1 - lsll #2,%d1 - pea (16+4)(%sp,%d1.l) | envp = argv[argc + 1] - pea 20(%sp) | argv - movl %d0,-(%sp) | argc + | call: ___start(cleanup, obj, ps_strings) bsr ___start
CVS commit: src/lib/csu/arch/m68k
Module Name:src Committed By: matt Date: Fri Jul 26 19:49:19 UTC 2013 Modified Files: src/lib/csu/arch/m68k: crt0.S Log Message: Use jbsr and add END(__start) To generate a diff of this commit: cvs rdiff -u -r1.3 -r1.4 src/lib/csu/arch/m68k/crt0.S Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/lib/csu/arch/m68k/crt0.S diff -u src/lib/csu/arch/m68k/crt0.S:1.3 src/lib/csu/arch/m68k/crt0.S:1.4 --- src/lib/csu/arch/m68k/crt0.S:1.3 Fri Jul 26 18:47:23 2013 +++ src/lib/csu/arch/m68k/crt0.S Fri Jul 26 19:49:19 2013 @@ -35,7 +35,7 @@ * Id: LICENSE,v 1.2 2000/06/14 15:57:33 cgd Exp */ -RCSID($NetBSD: crt0.S,v 1.3 2013/07/26 18:47:23 martin Exp $) +RCSID($NetBSD: crt0.S,v 1.4 2013/07/26 19:49:19 matt Exp $) STRONG_ALIAS(_start,__start) @@ -44,4 +44,5 @@ _ENTRY(__start) movl %a0,-(%sp) | obj movl %a1,-(%sp) | cleanup | call: ___start(cleanup, obj, ps_strings) - bsr ___start + jbsr ___start +END(__start)
CVS commit: src/lib/csu/arch/m68k
Module Name:src Committed By: matt Date: Fri Jul 19 06:26:41 UTC 2013 Modified Files: src/lib/csu/arch/m68k: crtbegin.h Log Message: Deal with m68010 not having bsrl so usr jsr on !__pic__ To generate a diff of this commit: cvs rdiff -u -r1.2 -r1.3 src/lib/csu/arch/m68k/crtbegin.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/lib/csu/arch/m68k/crtbegin.h diff -u src/lib/csu/arch/m68k/crtbegin.h:1.2 src/lib/csu/arch/m68k/crtbegin.h:1.3 --- src/lib/csu/arch/m68k/crtbegin.h:1.2 Thu Jul 18 18:43:04 2013 +++ src/lib/csu/arch/m68k/crtbegin.h Fri Jul 19 06:26:41 2013 @@ -1,4 +1,4 @@ -/* $NetBSD: crtbegin.h,v 1.2 2013/07/18 18:43:04 matt Exp $ */ +/* $NetBSD: crtbegin.h,v 1.3 2013/07/19 06:26:41 matt Exp $ */ /*- * Copyright (c) 2013 The NetBSD Foundation, Inc. * All rights reserved. @@ -29,9 +29,17 @@ */ __asm( .pushsection .init +#ifdef __pic__ +\n\t bsrl __do_global_ctors_aux +#else \n\t jsr __do_global_ctors_aux +#endif \n\t .popsection); __asm( .pushsection .fini +#ifdef __pic__ +\n\t bsrl __do_global_ctors_aux +#else \n\t jsr __do_global_dtors_aux +#endif \n\t .popsection);
CVS commit: src/lib/csu/arch/m68k
Module Name:src Committed By: matt Date: Thu Jul 18 18:43:04 UTC 2013 Modified Files: src/lib/csu/arch/m68k: crtbegin.h Log Message: s/bsrl/jsr/ and let gas figure it out To generate a diff of this commit: cvs rdiff -u -r1.1 -r1.2 src/lib/csu/arch/m68k/crtbegin.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/lib/csu/arch/m68k/crtbegin.h diff -u src/lib/csu/arch/m68k/crtbegin.h:1.1 src/lib/csu/arch/m68k/crtbegin.h:1.2 --- src/lib/csu/arch/m68k/crtbegin.h:1.1 Thu Jul 11 17:07:35 2013 +++ src/lib/csu/arch/m68k/crtbegin.h Thu Jul 18 18:43:04 2013 @@ -1,4 +1,4 @@ -/* $NetBSD: crtbegin.h,v 1.1 2013/07/11 17:07:35 matt Exp $ */ +/* $NetBSD: crtbegin.h,v 1.2 2013/07/18 18:43:04 matt Exp $ */ /*- * Copyright (c) 2013 The NetBSD Foundation, Inc. * All rights reserved. @@ -29,9 +29,9 @@ */ __asm( .pushsection .init -\n\t bsrl __do_global_ctors_aux +\n\t jsr __do_global_ctors_aux \n\t .popsection); __asm( .pushsection .fini -\n\t bsrl __do_global_dtors_aux +\n\t jsr __do_global_dtors_aux \n\t .popsection);
CVS commit: src/lib/csu/arch/hppa
Module Name:src Committed By: skrll Date: Sat Jul 13 18:52:35 UTC 2013 Added Files: src/lib/csu/arch/hppa: Makefile.inc crt0.S crtbegin.h crtend.S crti.S crtn.S Log Message: Add crtstuff for hppa. Lightly tested. To generate a diff of this commit: cvs rdiff -u -r0 -r1.1 src/lib/csu/arch/hppa/Makefile.inc \ src/lib/csu/arch/hppa/crt0.S src/lib/csu/arch/hppa/crtbegin.h \ src/lib/csu/arch/hppa/crtend.S src/lib/csu/arch/hppa/crti.S \ src/lib/csu/arch/hppa/crtn.S Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Added files: Index: src/lib/csu/arch/hppa/Makefile.inc diff -u /dev/null src/lib/csu/arch/hppa/Makefile.inc:1.1 --- /dev/null Sat Jul 13 18:52:35 2013 +++ src/lib/csu/arch/hppa/Makefile.inc Sat Jul 13 18:52:35 2013 @@ -0,0 +1,3 @@ +# $NetBSD: Makefile.inc,v 1.1 2013/07/13 18:52:35 skrll Exp $ + +CPPFLAGS+= -DELFSIZE=32 -I${ARCHDIR} Index: src/lib/csu/arch/hppa/crt0.S diff -u /dev/null src/lib/csu/arch/hppa/crt0.S:1.1 --- /dev/null Sat Jul 13 18:52:35 2013 +++ src/lib/csu/arch/hppa/crt0.S Sat Jul 13 18:52:35 2013 @@ -0,0 +1,67 @@ +/* $NetBSD: crt0.S,v 1.1 2013/07/13 18:52:35 skrll Exp $ */ + +/*- + * Copyright (c) 2013 The NetBSD Foundation, Inc. + * All rights reserved. + * + * This code is derived from software contributed to The NetBSD Foundation + * by Nick Hudson + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + *notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + *notice, this list of conditions and the following disclaimer in the + *documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS + * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ + +#include machine/asm.h + +RCSID($NetBSD: crt0.S,v 1.1 2013/07/13 18:52:35 skrll Exp $) + + .import _GLOBAL_OFFSET_TABLE_ + .hidden ___start + +STRONG_ALIAS(__start,_start) + +/* + * void _start(struct ps_strings *ps_strings, + *void (*cleanup)(void), + *const Obj_Entry *obj); + */ +_ENTRY(_start) + .callinfo frame=0, calls + .entry + + bl L$lpc, %r27 + depi0, 31, 2, %r27 +L$lpc: addil L'_GLOBAL_OFFSET_TABLE_ - ($PIC_pcrel$0 - 8), %r27 + ldo R'_GLOBAL_OFFSET_TABLE_ - ($PIC_pcrel$0 - 12)(%r1),%r27 + copy %r27, %r19 + + /* + * void ___start(void (*cleanup)(void), + *const Obj_Entry *obj, + *struct ps_strings *ps_strings); + */ + copy %arg0, %arg3 ; ps_strings - tmp + copy %arg1, %arg0 ; cleanup - arg0 + copy %arg2, %arg1 ; obj - arg1 + b ___start + copy %arg3, %arg2 ; ps_strings (tmp) - arg2 + +EXIT(_start) Index: src/lib/csu/arch/hppa/crtbegin.h diff -u /dev/null src/lib/csu/arch/hppa/crtbegin.h:1.1 --- /dev/null Sat Jul 13 18:52:35 2013 +++ src/lib/csu/arch/hppa/crtbegin.h Sat Jul 13 18:52:35 2013 @@ -0,0 +1,43 @@ +/* $NetBSD*/ + +/*- + * Copyright (c) 2013 The NetBSD Foundation, Inc. + * All rights reserved. + * + * This code is derived from software contributed to The NetBSD Foundation + * by Nick Hudson + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + *notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + *notice, this list of conditions and the following disclaimer in the + *documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS + * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +
CVS commit: src/lib/csu/arch
Module Name:src Committed By: martin Date: Thu Jul 11 06:57:16 UTC 2013 Modified Files: src/lib/csu/arch/sparc: Makefile.inc crt0.S Added Files: src/lib/csu/arch/sparc: crtbegin.h crtend.S src/lib/csu/arch/sparc64: Makefile.inc crt0.S crtbegin.h crtend.S crti.S crtn.S Log Message: Add support for sparc and sparc64 To generate a diff of this commit: cvs rdiff -u -r1.1 -r1.2 src/lib/csu/arch/sparc/Makefile.inc \ src/lib/csu/arch/sparc/crt0.S cvs rdiff -u -r0 -r1.1 src/lib/csu/arch/sparc/crtbegin.h \ src/lib/csu/arch/sparc/crtend.S cvs rdiff -u -r0 -r1.1 src/lib/csu/arch/sparc64/Makefile.inc \ src/lib/csu/arch/sparc64/crt0.S src/lib/csu/arch/sparc64/crtbegin.h \ src/lib/csu/arch/sparc64/crtend.S src/lib/csu/arch/sparc64/crti.S \ src/lib/csu/arch/sparc64/crtn.S Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/lib/csu/arch/sparc/Makefile.inc diff -u src/lib/csu/arch/sparc/Makefile.inc:1.1 src/lib/csu/arch/sparc/Makefile.inc:1.2 --- src/lib/csu/arch/sparc/Makefile.inc:1.1 Sat Aug 7 18:01:34 2010 +++ src/lib/csu/arch/sparc/Makefile.inc Thu Jul 11 06:57:15 2013 @@ -1,5 +1,5 @@ -# $NetBSD: Makefile.inc,v 1.1 2010/08/07 18:01:34 joerg Exp $ +# $NetBSD: Makefile.inc,v 1.2 2013/07/11 06:57:15 martin Exp $ -CPPFLAGS+= -DELFSIZE=32 +CPPFLAGS+= -DELFSIZE=32 -I${ARCHDIR} Index: src/lib/csu/arch/sparc/crt0.S diff -u src/lib/csu/arch/sparc/crt0.S:1.1 src/lib/csu/arch/sparc/crt0.S:1.2 --- src/lib/csu/arch/sparc/crt0.S:1.1 Sat Aug 7 18:01:34 2010 +++ src/lib/csu/arch/sparc/crt0.S Thu Jul 11 06:57:15 2013 @@ -1,4 +1,4 @@ -/* $NetBSD: crt0.S,v 1.1 2010/08/07 18:01:34 joerg Exp $ */ +/* $NetBSD: crt0.S,v 1.2 2013/07/11 06:57:15 martin Exp $ */ /* * Copyright (c) 1998 Christos Zoulas @@ -37,20 +37,21 @@ #include machine/asm.h -RCSID($NetBSD: crt0.S,v 1.1 2010/08/07 18:01:34 joerg Exp $) +RCSID($NetBSD: crt0.S,v 1.2 2013/07/11 06:57:15 martin Exp $) STRONG_ALIAS(_start,__start) + ! called with: + ! %g3 = cleanup + ! %g2 = obj + ! %g1 = ps_strings + ! call: ___start(cleanup, obj, ps_strings) _ENTRY(__start) mov 0, %fp - ld [%sp + 64], %o0 ! get argc - add %sp, 68, %o1 ! get argv - sll %o0, 2, %o2 ! - add %o2, 4, %o2 ! envp = argv + (argc 2) + 4 - add %o1, %o2, %o2 ! - andn %sp, 7, %sp ! align + andn %sp, 7, %sp ! align stack sub %sp, 24, %sp ! expand to standard stack frame size - mov %g3, %o3 - mov %g2, %o4 + mov %g3, %o0 + mov %g2, %o1 call ___start - mov %g1, %o5 + mov %g1, %o2 + Added files: Index: src/lib/csu/arch/sparc/crtbegin.h diff -u /dev/null src/lib/csu/arch/sparc/crtbegin.h:1.1 --- /dev/null Thu Jul 11 06:57:16 2013 +++ src/lib/csu/arch/sparc/crtbegin.h Thu Jul 11 06:57:15 2013 @@ -0,0 +1,40 @@ +/*- + * Copyright (c) 2013 The NetBSD Foundation, Inc. + * All rights reserved. + * + * This code is derived from software contributed to The NetBSD Foundation + * by Matt Thomas of 3am Software Foundry. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + *notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + *notice, this list of conditions and the following disclaimer in the + *documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS + * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ + +__asm( \n\t + .pushsection .init, \ax\, @progbits \n\t + call __do_global_ctors_aux\n\t + nop \n\t + .popsection); + +__asm( \n\t + .pushsection .fini, \ax\, @progbits \n\t + call __do_global_dtors_aux\n\t + nop \n\t + .popsection); Index: src/lib/csu/arch/sparc/crtend.S diff -u /dev/null src/lib/csu/arch/sparc/crtend.S:1.1 --- /dev/null Thu Jul 11 06:57:16 2013 +++ src/lib/csu/arch/sparc/crtend.S Thu Jul 11 06:57:15 2013 @@ -0,0 +1,55 @@ +/* $NetBSD: crtend.S,v 1.1 2013/07/11 06:57:15 martin Exp $ */ +/*- + * Copyright (c) 2010 Joerg Sonnenberger jo...@netbsd.org + * All rights
CVS commit: src/lib/csu/arch/mips
Module Name:src Committed By: matt Date: Thu Jul 11 16:23:40 UTC 2013 Modified Files: src/lib/csu/arch/mips: crtend.S Log Message: Make this work for N64 as well. To generate a diff of this commit: cvs rdiff -u -r1.1 -r1.2 src/lib/csu/arch/mips/crtend.S Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/lib/csu/arch/mips/crtend.S diff -u src/lib/csu/arch/mips/crtend.S:1.1 src/lib/csu/arch/mips/crtend.S:1.2 --- src/lib/csu/arch/mips/crtend.S:1.1 Sat Jun 22 02:37:09 2013 +++ src/lib/csu/arch/mips/crtend.S Thu Jul 11 16:23:40 2013 @@ -1,4 +1,4 @@ -/* $NetBSD: crtend.S,v 1.1 2013/06/22 02:37:09 matt Exp $ */ +/* $NetBSD: crtend.S,v 1.2 2013/07/11 16:23:40 matt Exp $ */ /*- * Copyright (c) 2012 The NetBSD Foundation, Inc. * All rights reserved. @@ -30,26 +30,26 @@ #include mips/asm.h -RCSID($NetBSD: crtend.S,v 1.1 2013/06/22 02:37:09 matt Exp $) +RCSID($NetBSD: crtend.S,v 1.2 2013/07/11 16:23:40 matt Exp $) .section .ctors, aw, @progbits - .p2align 2 + .p2align PTR_SCALESHIFT .global __CTOR_LIST_END__ .hidden __CTOR_LIST_END__ __CTOR_LIST_END__: .word 0 .section .dtors, aw, @progbits - .p2align 2 + .p2align PTR_SCALESHIFT .global __DTOR_LIST_END__ .hidden __DTOR_LIST_END__ __DTOR_LIST_END__: .word 0 .section .eh_frame, a, @progbits - .p2align 2 - .space 4 + .p2align PTR_SCALESHIFT + .space _MIPS_SZPTR / 8 .section .jcr, aw, @progbits - .p2align 2 - .space 4 + .p2align PTR_SCALESHIFT + .space _MIPS_SZPTR / 8
CVS commit: src/lib/csu/arch/alpha
Module Name:src Committed By: matt Date: Thu Jul 11 16:40:28 UTC 2013 Added Files: src/lib/csu/arch/alpha: Makefile.inc crt0.S crtbegin.h crtend.S crti.S crtn.S Log Message: Add crtstuff for alpha. Compile tested only. To generate a diff of this commit: cvs rdiff -u -r0 -r1.1 src/lib/csu/arch/alpha/Makefile.inc \ src/lib/csu/arch/alpha/crt0.S src/lib/csu/arch/alpha/crtbegin.h \ src/lib/csu/arch/alpha/crtend.S src/lib/csu/arch/alpha/crti.S \ src/lib/csu/arch/alpha/crtn.S Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Added files: Index: src/lib/csu/arch/alpha/Makefile.inc diff -u /dev/null src/lib/csu/arch/alpha/Makefile.inc:1.1 --- /dev/null Thu Jul 11 16:40:28 2013 +++ src/lib/csu/arch/alpha/Makefile.inc Thu Jul 11 16:40:27 2013 @@ -0,0 +1,3 @@ +# $NetBSD: Makefile.inc,v 1.1 2013/07/11 16:40:27 matt Exp $ + +CPPFLAGS+= -I${ARCHDIR} -DELFSIZE=64 Index: src/lib/csu/arch/alpha/crt0.S diff -u /dev/null src/lib/csu/arch/alpha/crt0.S:1.1 --- /dev/null Thu Jul 11 16:40:28 2013 +++ src/lib/csu/arch/alpha/crt0.S Thu Jul 11 16:40:27 2013 @@ -0,0 +1,54 @@ +/* $NetBSD: crt0.S,v 1.1 2013/07/11 16:40:27 matt Exp $ */ + +/*- + * Copyright (c) 2013 The NetBSD Foundation, Inc. + * All rights reserved. + * + * This code is derived from software contributed to The NetBSD Foundation + * by Matt Thomas of 3am Software Foundry. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + *notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + *notice, this list of conditions and the following disclaimer in the + *documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS + * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ + +#include alpha/asm.h + +RCSID($NetBSD: crt0.S,v 1.1 2013/07/11 16:40:27 matt Exp $) + +STRONG_ALIAS(_start,__start) + +/* + * Assumes kernel (or ld_elf.so) passes the following parameters to + * user-space in registers: + * + * a0 stack pointer + * a1 cleanup + * a2 Obj_Entry + * a3 ps_strings + */ + +LEAF(__start, 4) + LDGP(pv) + mov a1, a0 /* cleanup */ + mov a2, a1 /* Obj_Entry */ + mov a3, a2 /* ps_strings */ + CALL(___start) +END(__start) Index: src/lib/csu/arch/alpha/crtbegin.h diff -u /dev/null src/lib/csu/arch/alpha/crtbegin.h:1.1 --- /dev/null Thu Jul 11 16:40:28 2013 +++ src/lib/csu/arch/alpha/crtbegin.h Thu Jul 11 16:40:27 2013 @@ -0,0 +1,50 @@ +/* $NetBSD: crtbegin.h,v 1.1 2013/07/11 16:40:27 matt Exp $ */ +/*- + * Copyright (c) 2013 The NetBSD Foundation, Inc. + * All rights reserved. + * + * This code is derived from software contributed to The NetBSD Foundation + * by Matt Thomas of 3am Software Foundry. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + *notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + *notice, this list of conditions and the following disclaimer in the + *documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS + * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE
CVS commit: src/lib/csu/arch/m68k
Module Name:src Committed By: matt Date: Thu Jul 11 17:07:35 UTC 2013 Modified Files: src/lib/csu/arch/m68k: Makefile.inc crt0.S Added Files: src/lib/csu/arch/m68k: crtbegin.h crtend.S Log Message: Use pc-relative branch in crt0.S Add crtend.S and crtbegin.h (uses pc-relative branches as well). To generate a diff of this commit: cvs rdiff -u -r1.1 -r1.2 src/lib/csu/arch/m68k/Makefile.inc \ src/lib/csu/arch/m68k/crt0.S cvs rdiff -u -r0 -r1.1 src/lib/csu/arch/m68k/crtbegin.h \ src/lib/csu/arch/m68k/crtend.S Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/lib/csu/arch/m68k/Makefile.inc diff -u src/lib/csu/arch/m68k/Makefile.inc:1.1 src/lib/csu/arch/m68k/Makefile.inc:1.2 --- src/lib/csu/arch/m68k/Makefile.inc:1.1 Sat Aug 7 18:01:34 2010 +++ src/lib/csu/arch/m68k/Makefile.inc Thu Jul 11 17:07:35 2013 @@ -1,5 +1,5 @@ -# $NetBSD: Makefile.inc,v 1.1 2010/08/07 18:01:34 joerg Exp $ +# $NetBSD: Makefile.inc,v 1.2 2013/07/11 17:07:35 matt Exp $ -CPPFLAGS+= -DELFSIZE=32 +CPPFLAGS+= -I${ARCHDIR} -DELFSIZE=32 Index: src/lib/csu/arch/m68k/crt0.S diff -u src/lib/csu/arch/m68k/crt0.S:1.1 src/lib/csu/arch/m68k/crt0.S:1.2 --- src/lib/csu/arch/m68k/crt0.S:1.1 Sat Aug 7 18:01:34 2010 +++ src/lib/csu/arch/m68k/crt0.S Thu Jul 11 17:07:35 2013 @@ -35,7 +35,7 @@ * Id: LICENSE,v 1.2 2000/06/14 15:57:33 cgd Exp */ -RCSID($NetBSD: crt0.S,v 1.1 2010/08/07 18:01:34 joerg Exp $) +RCSID($NetBSD: crt0.S,v 1.2 2013/07/11 17:07:35 matt Exp $) STRONG_ALIAS(_start,__start) @@ -49,4 +49,4 @@ _ENTRY(__start) pea (16+4)(%sp,%d1.l) | envp = argv[argc + 1] pea 20(%sp) | argv movl %d0,-(%sp) | argc - jsr ___start + bsr ___start Added files: Index: src/lib/csu/arch/m68k/crtbegin.h diff -u /dev/null src/lib/csu/arch/m68k/crtbegin.h:1.1 --- /dev/null Thu Jul 11 17:07:35 2013 +++ src/lib/csu/arch/m68k/crtbegin.h Thu Jul 11 17:07:35 2013 @@ -0,0 +1,37 @@ +/* $NetBSD: crtbegin.h,v 1.1 2013/07/11 17:07:35 matt Exp $ */ +/*- + * Copyright (c) 2013 The NetBSD Foundation, Inc. + * All rights reserved. + * + * This code is derived from software contributed to The NetBSD Foundation + * by Matt Thomas of 3am Software Foundry. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + *notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + *notice, this list of conditions and the following disclaimer in the + *documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS + * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ + +__asm( .pushsection .init +\n\t bsrl __do_global_ctors_aux +\n\t .popsection); + +__asm( .pushsection .fini +\n\t bsrl __do_global_dtors_aux +\n\t .popsection); Index: src/lib/csu/arch/m68k/crtend.S diff -u /dev/null src/lib/csu/arch/m68k/crtend.S:1.1 --- /dev/null Thu Jul 11 17:07:35 2013 +++ src/lib/csu/arch/m68k/crtend.S Thu Jul 11 17:07:35 2013 @@ -0,0 +1,55 @@ +/* $NetBSD: crtend.S,v 1.1 2013/07/11 17:07:35 matt Exp $ */ +/*- + * Copyright (c) 2011 The NetBSD Foundation, Inc. + * All rights reserved. + * + * This code is derived from software contributed to The NetBSD Foundation + * by Matt Thomas of 3am Software Foundry. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + *notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + *notice, this list of conditions and the following disclaimer in the + *documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS + * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
CVS commit: src/lib/csu/arch/vax
Module Name:src Committed By: matt Date: Wed Jul 10 14:27:02 UTC 2013 Modified Files: src/lib/csu/arch/vax: crtbegin.S Log Message: Fix logic inversion. To generate a diff of this commit: cvs rdiff -u -r1.3 -r1.4 src/lib/csu/arch/vax/crtbegin.S Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/lib/csu/arch/vax/crtbegin.S diff -u src/lib/csu/arch/vax/crtbegin.S:1.3 src/lib/csu/arch/vax/crtbegin.S:1.4 --- src/lib/csu/arch/vax/crtbegin.S:1.3 Tue Jun 25 00:30:07 2013 +++ src/lib/csu/arch/vax/crtbegin.S Wed Jul 10 14:27:01 2013 @@ -1,4 +1,4 @@ -/* $NetBSD: crtbegin.S,v 1.3 2013/06/25 00:30:07 matt Exp $ */ +/* $NetBSD: crtbegin.S,v 1.4 2013/07/10 14:27:01 matt Exp $ */ /*- * Copyright (c) 2013 The NetBSD Foundation, Inc. * All rights reserved. @@ -30,7 +30,7 @@ #include vax/asm.h -RCSID($NetBSD: crtbegin.S,v 1.3 2013/06/25 00:30:07 matt Exp $) +RCSID($NetBSD: crtbegin.S,v 1.4 2013/07/10 14:27:01 matt Exp $) .section .ctors, aw, @progbits .p2align 2 @@ -91,7 +91,7 @@ _ENTRY(__do_global_dtors_aux, 0x0100) / * __cxa_finalize(__dso_handle); */ movab __cxa_finalize, %r0 - bneq 1f + beql 1f pushal __dso_handle calls $0, (%r0) 1:
CVS commit: src/lib/csu/arch/mips
Module Name:src Committed By: matt Date: Wed Jul 10 15:05:46 UTC 2013 Modified Files: src/lib/csu/arch/mips: Makefile.inc Log Message: Add a ELFSIZE define To generate a diff of this commit: cvs rdiff -u -r1.1 -r1.2 src/lib/csu/arch/mips/Makefile.inc Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/lib/csu/arch/mips/Makefile.inc diff -u src/lib/csu/arch/mips/Makefile.inc:1.1 src/lib/csu/arch/mips/Makefile.inc:1.2 --- src/lib/csu/arch/mips/Makefile.inc:1.1 Sat Jun 22 02:37:09 2013 +++ src/lib/csu/arch/mips/Makefile.inc Wed Jul 10 15:05:46 2013 @@ -1,3 +1,3 @@ -# $NetBSD: Makefile.inc,v 1.1 2013/06/22 02:37:09 matt Exp $ +# $NetBSD: Makefile.inc,v 1.2 2013/07/10 15:05:46 matt Exp $ -CPPFLAGS+= -I${ARCHDIR} +CPPFLAGS+= -I${ARCHDIR} -DELFSIZE=_MIPS_SZPTR
CVS commit: src/lib/csu/arch/vax
Module Name:src Committed By: matt Date: Wed Jul 10 22:55:40 UTC 2013 Modified Files: src/lib/csu/arch/vax: crtbegin.S Log Message: Fix another bneq - beql botch To generate a diff of this commit: cvs rdiff -u -r1.4 -r1.5 src/lib/csu/arch/vax/crtbegin.S Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/lib/csu/arch/vax/crtbegin.S diff -u src/lib/csu/arch/vax/crtbegin.S:1.4 src/lib/csu/arch/vax/crtbegin.S:1.5 --- src/lib/csu/arch/vax/crtbegin.S:1.4 Wed Jul 10 14:27:01 2013 +++ src/lib/csu/arch/vax/crtbegin.S Wed Jul 10 22:55:40 2013 @@ -1,4 +1,4 @@ -/* $NetBSD: crtbegin.S,v 1.4 2013/07/10 14:27:01 matt Exp $ */ +/* $NetBSD: crtbegin.S,v 1.5 2013/07/10 22:55:40 matt Exp $ */ /*- * Copyright (c) 2013 The NetBSD Foundation, Inc. * All rights reserved. @@ -30,7 +30,7 @@ #include vax/asm.h -RCSID($NetBSD: crtbegin.S,v 1.4 2013/07/10 14:27:01 matt Exp $) +RCSID($NetBSD: crtbegin.S,v 1.5 2013/07/10 22:55:40 matt Exp $) .section .ctors, aw, @progbits .p2align 2 @@ -114,7 +114,7 @@ _ENTRY(__do_global_dtors_aux, 0x0100) / * __deregister_frame_info(__EH_FRAME_LIST__[0]); */ moval __deregister_frame_info, %r0 - bneq 4f + beql 4f pushal __EH_FRAME_LIST__ calls $0, (%r0) #endif /* SHARED */
CVS commit: src/lib/csu/arch/vax
Module Name:src Committed By: matt Date: Wed Jul 10 23:30:45 UTC 2013 Modified Files: src/lib/csu/arch/vax: crtbegin.S Log Message: Add END(func) so gdb doesn't get so confused. To generate a diff of this commit: cvs rdiff -u -r1.5 -r1.6 src/lib/csu/arch/vax/crtbegin.S Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/lib/csu/arch/vax/crtbegin.S diff -u src/lib/csu/arch/vax/crtbegin.S:1.5 src/lib/csu/arch/vax/crtbegin.S:1.6 --- src/lib/csu/arch/vax/crtbegin.S:1.5 Wed Jul 10 22:55:40 2013 +++ src/lib/csu/arch/vax/crtbegin.S Wed Jul 10 23:30:45 2013 @@ -1,4 +1,4 @@ -/* $NetBSD: crtbegin.S,v 1.5 2013/07/10 22:55:40 matt Exp $ */ +/* $NetBSD: crtbegin.S,v 1.6 2013/07/10 23:30:45 matt Exp $ */ /*- * Copyright (c) 2013 The NetBSD Foundation, Inc. * All rights reserved. @@ -30,7 +30,7 @@ #include vax/asm.h -RCSID($NetBSD: crtbegin.S,v 1.5 2013/07/10 22:55:40 matt Exp $) +RCSID($NetBSD: crtbegin.S,v 1.6 2013/07/10 23:30:45 matt Exp $) .section .ctors, aw, @progbits .p2align 2 @@ -120,6 +120,7 @@ _ENTRY(__do_global_dtors_aux, 0x0100) / #endif /* SHARED */ 4: ret +END(__do_global_dtors_aux) .weak __deregister_frame_info .weak __cxa_finalize @@ -167,6 +168,7 @@ _ENTRY(__do_global_ctors_aux, 0x0800) brb 3b /* get next one */ 4: ret +END(__do_global_ctors_aux) .hidden _C_LABEL(__CTOR_LIST_END__)
CVS commit: src/lib/csu/arch/mips
Module Name:src Committed By: matt Date: Sun Jun 30 08:00:35 UTC 2013 Modified Files: src/lib/csu/arch/mips: crtbegin.h crti.S crtn.S Log Message: For O32, don't save $gp on the stack, save $s0 instead and just keep $gp in $s0. To generate a diff of this commit: cvs rdiff -u -r1.2 -r1.3 src/lib/csu/arch/mips/crtbegin.h cvs rdiff -u -r1.1 -r1.2 src/lib/csu/arch/mips/crti.S \ src/lib/csu/arch/mips/crtn.S Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/lib/csu/arch/mips/crtbegin.h diff -u src/lib/csu/arch/mips/crtbegin.h:1.2 src/lib/csu/arch/mips/crtbegin.h:1.3 --- src/lib/csu/arch/mips/crtbegin.h:1.2 Tue Jun 25 16:51:14 2013 +++ src/lib/csu/arch/mips/crtbegin.h Sun Jun 30 08:00:34 2013 @@ -32,8 +32,7 @@ __asm( \n\t #ifdef __mips_o32 .set noreorder \n\t .set nomacro \n\t - lw $28,16($sp) \n\t - nop \n\t + move $28,$16 \n\t lw $25,%got(__do_global_ctors_aux)($28) \n\t nop \n\t addiu $25,$25,%lo(__do_global_ctors_aux) \n\t @@ -52,8 +51,7 @@ __asm( \n\t #ifdef __mips_o32 .set noreorder \n\t .set nomacro \n\t - lw $28,16($sp) \n\t - nop \n\t + move $28,$16 \n\t lw $25,%got(__do_global_dtors_aux)($28) \n\t nop \n\t addiu $25,$25,%lo(__do_global_dtors_aux) \n\t Index: src/lib/csu/arch/mips/crti.S diff -u src/lib/csu/arch/mips/crti.S:1.1 src/lib/csu/arch/mips/crti.S:1.2 --- src/lib/csu/arch/mips/crti.S:1.1 Sat Jun 22 02:37:09 2013 +++ src/lib/csu/arch/mips/crti.S Sun Jun 30 08:00:34 2013 @@ -1,4 +1,4 @@ -/* $NetBSD: crti.S,v 1.1 2013/06/22 02:37:09 matt Exp $ */ +/* $NetBSD: crti.S,v 1.2 2013/06/30 08:00:34 matt Exp $ */ /*- * Copyright (c) 2011 The NetBSD Foundation, Inc. @@ -31,7 +31,7 @@ #include mips/asm.h -RCSID($NetBSD: crti.S,v 1.1 2013/06/22 02:37:09 matt Exp $) +RCSID($NetBSD: crti.S,v 1.2 2013/06/30 08:00:34 matt Exp $) #include sysident.S @@ -39,16 +39,22 @@ RCSID($NetBSD: crti.S,v 1.1 2013/06/22 NESTED_NOPROFILE(_init, CALLFRAME_SIZ, ra) SETUP_GP PTR_SUBU sp, sp, CALLFRAME_SIZ # allocate stack frame -SAVE_GP(CALLFRAME_GP) -SETUP_GP64(CALLFRAME_GP, _init) REG_S ra, CALLFRAME_RA(sp) # save RA +#ifdef __mips_o32 + REG_S s0, CALLFRAME_S0(sp) # save s0 + move s0, gp +#endif +SETUP_GP64(CALLFRAME_GP, _init) END(_init) .section .fini, ax, @progbits NESTED_NOPROFILE(_fini, CALLFRAME_SIZ, ra) SETUP_GP PTR_SUBU sp, sp, CALLFRAME_SIZ # allocate stack frame -SAVE_GP(CALLFRAME_GP) -SETUP_GP64(CALLFRAME_GP, _fini) REG_S ra, CALLFRAME_RA(sp) # save RA +#ifdef __mips_o32 + REG_S s0, CALLFRAME_S0(sp) # save s0 + move s0, gp +#endif +SETUP_GP64(CALLFRAME_GP, _fini) END(_fini) Index: src/lib/csu/arch/mips/crtn.S diff -u src/lib/csu/arch/mips/crtn.S:1.1 src/lib/csu/arch/mips/crtn.S:1.2 --- src/lib/csu/arch/mips/crtn.S:1.1 Sat Jun 22 02:37:09 2013 +++ src/lib/csu/arch/mips/crtn.S Sun Jun 30 08:00:34 2013 @@ -29,16 +29,24 @@ #include mips/asm.h -RCSID($NetBSD: crtn.S,v 1.1 2013/06/22 02:37:09 matt Exp $) +RCSID($NetBSD: crtn.S,v 1.2 2013/06/30 08:00:34 matt Exp $) .section .init, ax, @progbits - RESTORE_GP64 REG_L ra, CALLFRAME_RA(sp) +#if defined(__mips_o32) || defined(__mips_o64) + REG_L s0, CALLFRAME_S0(sp) +#else + REG_L gp, CALLFRAME_GP(sp) +#endif PTR_ADDU sp, sp, CALLFRAME_SIZ jr ra .section .fini, ax, @progbits - RESTORE_GP64 REG_L ra, CALLFRAME_RA(sp) +#ifdef __mips_o32 + REG_L s0, CALLFRAME_S0(sp) +#else + REG_L gp, CALLFRAME_GP(sp) +#endif PTR_ADDU sp, sp, CALLFRAME_SIZ jr ra
CVS commit: src/lib/csu/arch/mips
Module Name:src Committed By: matt Date: Tue Jun 25 16:47:47 UTC 2013 Modified Files: src/lib/csu/arch/mips: crt0.S Log Message: Initialize $gp To generate a diff of this commit: cvs rdiff -u -r1.1 -r1.2 src/lib/csu/arch/mips/crt0.S Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/lib/csu/arch/mips/crt0.S diff -u src/lib/csu/arch/mips/crt0.S:1.1 src/lib/csu/arch/mips/crt0.S:1.2 --- src/lib/csu/arch/mips/crt0.S:1.1 Sat Jun 22 02:37:09 2013 +++ src/lib/csu/arch/mips/crt0.S Tue Jun 25 16:47:47 2013 @@ -1,4 +1,4 @@ -/* $NetBSD: crt0.S,v 1.1 2013/06/22 02:37:09 matt Exp $ */ +/* $NetBSD: crt0.S,v 1.2 2013/06/25 16:47:47 matt Exp $ */ /*- * Copyright (c) 2013 The NetBSD Foundation, Inc. @@ -31,7 +31,7 @@ #include mips/asm.h -RCSID($NetBSD: crt0.S,v 1.1 2013/06/22 02:37:09 matt Exp $) +RCSID($NetBSD: crt0.S,v 1.2 2013/06/25 16:47:47 matt Exp $) STRONG_ALIAS(_start,__start) @@ -49,6 +49,8 @@ STRONG_ALIAS(_start,__start) */ NESTED_NOPROFILE(__start, CALLFRAME_SIZ, ra) + SETUP_GP + SETUP_GP64(t3, __start) move a0, a1 /* cleanup */ move a1, a2 /* Obj_Entry */ move a2, a3 /* ps_strings */
CVS commit: src/lib/csu/arch/mips
Module Name:src Committed By: matt Date: Tue Jun 25 16:51:14 UTC 2013 Modified Files: src/lib/csu/arch/mips: crtbegin.h Log Message: Deal with O32 callling sequences. To generate a diff of this commit: cvs rdiff -u -r1.1 -r1.2 src/lib/csu/arch/mips/crtbegin.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/lib/csu/arch/mips/crtbegin.h diff -u src/lib/csu/arch/mips/crtbegin.h:1.1 src/lib/csu/arch/mips/crtbegin.h:1.2 --- src/lib/csu/arch/mips/crtbegin.h:1.1 Sat Jun 22 02:37:09 2013 +++ src/lib/csu/arch/mips/crtbegin.h Tue Jun 25 16:51:14 2013 @@ -28,10 +28,41 @@ */ __asm( \n\t - .pushsection .init, \ax\, @progbits \n\t - jal __do_global_ctors_aux \n\t + .pushsection .init, \ax\, @progbits \n\t +#ifdef __mips_o32 + .set noreorder \n\t + .set nomacro \n\t + lw $28,16($sp) \n\t + nop \n\t + lw $25,%got(__do_global_ctors_aux)($28) \n\t + nop \n\t + addiu $25,$25,%lo(__do_global_ctors_aux) \n\t + .reloc 1f,R_MIPS_JALR,__do_global_ctors_aux \n\t + 1: jalr $25 \n\t +nop \n\t + .set macro \n\t + .set reorder \n\t +#else + jal __do_global_ctors_aux\n\t +#endif .popsection); + __asm( \n\t .pushsection .fini, \ax\, @progbits \n\t - jal __do_global_dtors_aux \n\t +#ifdef __mips_o32 + .set noreorder \n\t + .set nomacro \n\t + lw $28,16($sp) \n\t + nop \n\t + lw $25,%got(__do_global_dtors_aux)($28) \n\t + nop \n\t + addiu $25,$25,%lo(__do_global_dtors_aux) \n\t + .reloc 1f,R_MIPS_JALR,__do_global_dtors_aux \n\t + 1: jalr $25 \n\t +nop \n\t + .set macro \n\t + .set reorder \n\t +#else + jal __do_global_dtors_aux\n\t +#endif .popsection);
CVS commit: src/lib/csu/arch/earm
Module Name:src Committed By: matt Date: Mon Jun 24 14:53:42 UTC 2013 Modified Files: src/lib/csu/arch/earm: crtbegin.S Log Message: Make sure dwarf_eh_object is 8 words long. To generate a diff of this commit: cvs rdiff -u -r1.2 -r1.3 src/lib/csu/arch/earm/crtbegin.S Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/lib/csu/arch/earm/crtbegin.S diff -u src/lib/csu/arch/earm/crtbegin.S:1.2 src/lib/csu/arch/earm/crtbegin.S:1.3 --- src/lib/csu/arch/earm/crtbegin.S:1.2 Sun May 5 10:26:57 2013 +++ src/lib/csu/arch/earm/crtbegin.S Mon Jun 24 14:53:42 2013 @@ -1,4 +1,4 @@ -/* $NetBSD: crtbegin.S,v 1.2 2013/05/05 10:26:57 skrll Exp $ */ +/* $NetBSD: crtbegin.S,v 1.3 2013/06/24 14:53:42 matt Exp $ */ /*- * Copyright (c) 2012 The NetBSD Foundation, Inc. * All rights reserved. @@ -30,7 +30,7 @@ #include arm/asm.h -RCSID($NetBSD: crtbegin.S,v 1.2 2013/05/05 10:26:57 skrll Exp $) +RCSID($NetBSD: crtbegin.S,v 1.3 2013/06/24 14:53:42 matt Exp $) .section .eh_frame, a, %progbits .p2align 2 @@ -209,7 +209,7 @@ __do_global_ctors_aux: .local __initialized .comm __initialized,1,1 .local __dwarf_eh_object - .comm __dwarf_eh_object,24,4 + .comm __dwarf_eh_object,32,4 .section .init_array,aw,%init_array .p2align 2
CVS commit: src/lib/csu/arch/vax
Module Name:src Committed By: matt Date: Mon Jun 24 14:49:55 UTC 2013 Modified Files: src/lib/csu/arch/vax: crtbegin.S Log Message: Like the rest, make __DTOR_LIST__ start with a -1 Make sure dwarf_eh_object is 8 words long. To generate a diff of this commit: cvs rdiff -u -r1.1 -r1.2 src/lib/csu/arch/vax/crtbegin.S Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/lib/csu/arch/vax/crtbegin.S diff -u src/lib/csu/arch/vax/crtbegin.S:1.1 src/lib/csu/arch/vax/crtbegin.S:1.2 --- src/lib/csu/arch/vax/crtbegin.S:1.1 Fri Jun 21 15:54:08 2013 +++ src/lib/csu/arch/vax/crtbegin.S Mon Jun 24 14:49:55 2013 @@ -1,4 +1,4 @@ -/* $NetBSD: crtbegin.S,v 1.1 2013/06/21 15:54:08 matt Exp $ */ +/* $NetBSD: crtbegin.S,v 1.2 2013/06/24 14:49:55 matt Exp $ */ /*- * Copyright (c) 2013 The NetBSD Foundation, Inc. * All rights reserved. @@ -30,7 +30,7 @@ #include vax/asm.h -RCSID($NetBSD: crtbegin.S,v 1.1 2013/06/21 15:54:08 matt Exp $) +RCSID($NetBSD: crtbegin.S,v 1.2 2013/06/24 14:49:55 matt Exp $) .section .ctors, aw, @progbits .p2align 2 @@ -40,6 +40,7 @@ __CTOR_LIST__: /* symbol is not used */ .section .dtors, aw, @progbits .p2align 2 __DTOR_LIST__: + .word -1 .section .eh_frame, a, @progbits .p2align 2 @@ -63,7 +64,7 @@ __dso_handle: #endif .local __dwarf_eh_object - .comm __dwarf_eh_object,24 + .comm __dwarf_eh_object,32 .local __initialized .comm __initialized,1 .local __finished @@ -102,7 +103,7 @@ __do_global_dtors_aux: * We use load with postincrement to advance the pointer along. * We know the list ends with 0. If we load one, we must be done. */ - moval __DTOR_LIST__, %r8 /* skip first entry */ + moval __DTOR_LIST__+4, %r8 /* skip first entry */ 2: movl (%r8)+, %r0 /* r0 = *r8++; */ beql 3f calls $0, (%r0)
CVS commit: src/lib/csu/arch/earm
Module Name:src Committed By: matt Date: Mon Jun 24 20:56:18 UTC 2013 Modified Files: src/lib/csu/arch/earm: crtbegin.S Log Message: Use (target1) for .init/fini array entries To generate a diff of this commit: cvs rdiff -u -r1.3 -r1.4 src/lib/csu/arch/earm/crtbegin.S Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/lib/csu/arch/earm/crtbegin.S diff -u src/lib/csu/arch/earm/crtbegin.S:1.3 src/lib/csu/arch/earm/crtbegin.S:1.4 --- src/lib/csu/arch/earm/crtbegin.S:1.3 Mon Jun 24 14:53:42 2013 +++ src/lib/csu/arch/earm/crtbegin.S Mon Jun 24 20:56:18 2013 @@ -1,4 +1,4 @@ -/* $NetBSD: crtbegin.S,v 1.3 2013/06/24 14:53:42 matt Exp $ */ +/* $NetBSD: crtbegin.S,v 1.4 2013/06/24 20:56:18 matt Exp $ */ /*- * Copyright (c) 2012 The NetBSD Foundation, Inc. * All rights reserved. @@ -30,7 +30,7 @@ #include arm/asm.h -RCSID($NetBSD: crtbegin.S,v 1.3 2013/06/24 14:53:42 matt Exp $) +RCSID($NetBSD: crtbegin.S,v 1.4 2013/06/24 20:56:18 matt Exp $) .section .eh_frame, a, %progbits .p2align 2 @@ -117,7 +117,7 @@ __do_global_dtors_aux: .pushsection .fini_array,aw,%fini_array .p2align 2 - .word __do_global_dtors_aux + .word __do_global_dtors_aux(target1) .popsection #endif /* SHARED */ @@ -213,4 +213,4 @@ __do_global_ctors_aux: .section .init_array,aw,%init_array .p2align 2 - .word __do_global_ctors_aux + .word __do_global_ctors_aux(target1)
CVS commit: src/lib/csu/arch/vax
Module Name:src Committed By: matt Date: Tue Jun 25 00:30:07 UTC 2013 Modified Files: src/lib/csu/arch/vax: Makefile.inc crtbegin.S crtend.S Log Message: Use .long not .word Use _ENTRY [with these changes, the crtstuff passes its ATF tests.] To generate a diff of this commit: cvs rdiff -u -r1.2 -r1.3 src/lib/csu/arch/vax/Makefile.inc \ src/lib/csu/arch/vax/crtbegin.S cvs rdiff -u -r1.1 -r1.2 src/lib/csu/arch/vax/crtend.S Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/lib/csu/arch/vax/Makefile.inc diff -u src/lib/csu/arch/vax/Makefile.inc:1.2 src/lib/csu/arch/vax/Makefile.inc:1.3 --- src/lib/csu/arch/vax/Makefile.inc:1.2 Fri Jun 21 15:54:08 2013 +++ src/lib/csu/arch/vax/Makefile.inc Tue Jun 25 00:30:07 2013 @@ -1,3 +1,3 @@ -# $NetBSD: Makefile.inc,v 1.2 2013/06/21 15:54:08 matt Exp $ +# $NetBSD: Makefile.inc,v 1.3 2013/06/25 00:30:07 matt Exp $ -CPPFLAGS+= -DELFSIZE=32 +CPPFLAGS+= -I${ARCHDIR} Index: src/lib/csu/arch/vax/crtbegin.S diff -u src/lib/csu/arch/vax/crtbegin.S:1.2 src/lib/csu/arch/vax/crtbegin.S:1.3 --- src/lib/csu/arch/vax/crtbegin.S:1.2 Mon Jun 24 14:49:55 2013 +++ src/lib/csu/arch/vax/crtbegin.S Tue Jun 25 00:30:07 2013 @@ -1,4 +1,4 @@ -/* $NetBSD: crtbegin.S,v 1.2 2013/06/24 14:49:55 matt Exp $ */ +/* $NetBSD: crtbegin.S,v 1.3 2013/06/25 00:30:07 matt Exp $ */ /*- * Copyright (c) 2013 The NetBSD Foundation, Inc. * All rights reserved. @@ -30,17 +30,17 @@ #include vax/asm.h -RCSID($NetBSD: crtbegin.S,v 1.2 2013/06/24 14:49:55 matt Exp $) +RCSID($NetBSD: crtbegin.S,v 1.3 2013/06/25 00:30:07 matt Exp $) .section .ctors, aw, @progbits .p2align 2 __CTOR_LIST__: /* symbol is not used */ - .word -1 + .long -1 .section .dtors, aw, @progbits .p2align 2 __DTOR_LIST__: - .word -1 + .long -1 .section .eh_frame, a, @progbits .p2align 2 @@ -58,9 +58,9 @@ __JCR_LIST__: .hidden __dso_handle __dso_handle: #ifdef SHARED - .word __dso_handle + .long __dso_handle #else - .word 0 + .long 0 #endif .local __dwarf_eh_object @@ -80,9 +80,7 @@ __dso_handle: * needed. */ - .type __do_global_dtors_aux, @function -__do_global_dtors_aux: - .word 0x0100/* save r8 */ +_ENTRY(__do_global_dtors_aux, 0x0100) /* save r8 */ tstb __finished /* done this already? */ bneq 4f movb $1, __finished /* mark it as done */ @@ -129,8 +127,7 @@ __do_global_dtors_aux: .weak __register_frame_info .weak _Jv_RegisterClasses - .type __do_global_ctors_aux, @function -__do_global_ctors_aux: +_ENTRY(__do_global_ctors_aux, 0x0800) tstb __initialized bneq 4f movb $1, __initialized Index: src/lib/csu/arch/vax/crtend.S diff -u src/lib/csu/arch/vax/crtend.S:1.1 src/lib/csu/arch/vax/crtend.S:1.2 --- src/lib/csu/arch/vax/crtend.S:1.1 Fri Jun 21 15:54:08 2013 +++ src/lib/csu/arch/vax/crtend.S Tue Jun 25 00:30:07 2013 @@ -1,4 +1,4 @@ -/* $NetBSD: crtend.S,v 1.1 2013/06/21 15:54:08 matt Exp $ */ +/* $NetBSD: crtend.S,v 1.2 2013/06/25 00:30:07 matt Exp $ */ /*- * Copyright (c) 2012 The NetBSD Foundation, Inc. * All rights reserved. @@ -30,21 +30,21 @@ #include vax/asm.h -RCSID($NetBSD: crtend.S,v 1.1 2013/06/21 15:54:08 matt Exp $) +RCSID($NetBSD: crtend.S,v 1.2 2013/06/25 00:30:07 matt Exp $) .section .ctors, aw, @progbits .p2align 2 .global __CTOR_LIST_END__ .hidden __CTOR_LIST_END__ __CTOR_LIST_END__: - .word 0 + .long 0 .section .dtors, aw, @progbits .p2align 2 .global __DTOR_LIST_END__ .hidden __DTOR_LIST_END__ __DTOR_LIST_END__: - .word 0 + .long 0 .section .eh_frame, a, @progbits .p2align 2
CVS commit: src/lib/csu/arch/vax
Module Name:src Committed By: matt Date: Fri Jun 21 15:54:08 UTC 2013 Modified Files: src/lib/csu/arch/vax: Makefile.inc crt0.S Added Files: src/lib/csu/arch/vax: crtbegin.S crtend.S Log Message: USE_COMPILERCRTSTUFF=no support for vax. To generate a diff of this commit: cvs rdiff -u -r1.1 -r1.2 src/lib/csu/arch/vax/Makefile.inc cvs rdiff -u -r1.2 -r1.3 src/lib/csu/arch/vax/crt0.S cvs rdiff -u -r0 -r1.1 src/lib/csu/arch/vax/crtbegin.S \ src/lib/csu/arch/vax/crtend.S Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/lib/csu/arch/vax/Makefile.inc diff -u src/lib/csu/arch/vax/Makefile.inc:1.1 src/lib/csu/arch/vax/Makefile.inc:1.2 --- src/lib/csu/arch/vax/Makefile.inc:1.1 Sat Aug 7 18:01:34 2010 +++ src/lib/csu/arch/vax/Makefile.inc Fri Jun 21 15:54:08 2013 @@ -1,5 +1,3 @@ -# $NetBSD: Makefile.inc,v 1.1 2010/08/07 18:01:34 joerg Exp $ +# $NetBSD: Makefile.inc,v 1.2 2013/06/21 15:54:08 matt Exp $ CPPFLAGS+= -DELFSIZE=32 - - Index: src/lib/csu/arch/vax/crt0.S diff -u src/lib/csu/arch/vax/crt0.S:1.2 src/lib/csu/arch/vax/crt0.S:1.3 --- src/lib/csu/arch/vax/crt0.S:1.2 Sat Jul 2 20:14:10 2011 +++ src/lib/csu/arch/vax/crt0.S Fri Jun 21 15:54:08 2013 @@ -1,10 +1,12 @@ -/* $NetBSD: crt0.S,v 1.2 2011/07/02 20:14:10 matt Exp $ */ +/* $NetBSD: crt0.S,v 1.3 2013/06/21 15:54:08 matt Exp $ */ -/* - * Copyright (c) 1999 Matt Thomas - * Copyright (c) 1995 Christopher G. Demetriou +/*- + * Copyright (c) 2013 The NetBSD Foundation, Inc. * All rights reserved. - * + * + * This code is derived from software contributed to The NetBSD Foundation + * by Matt Thomas of 3am Software Foundry. + * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: @@ -13,37 +15,28 @@ * 2. Redistributions in binary form must reproduce the above copyright *notice, this list of conditions and the following disclaimer in the *documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - *must display the following acknowledgement: - * This product includes software developed for the - * NetBSD Project. See http://www.NetBSD.org/ for - * information about NetBSD. - * 4. The name of the author may not be used to endorse or promote products - *derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * Id: LICENSE,v 1.2 2000/06/14 15:57:33 cgd Exp + * + * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS + * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. */ -#include machine/asm.h +#include vax/asm.h -RCSID($NetBSD: crt0.S,v 1.2 2011/07/02 20:14:10 matt Exp $) +RCSID($NetBSD: crt0.S,v 1.3 2013/06/21 15:54:08 matt Exp $) STRONG_ALIAS(_start,__start) -_ENTRY(__start) - .word 0x0101 - pushl %r9 /* ps_strings */ - pushl %r8 /* obj */ +_ENTRY(__start, 0x0101) + movq %r8,-(%sp) /* ps_strings / obj */ pushl %r7 /* cleanup */ calls $3,___start +END(__start) Added files: Index: src/lib/csu/arch/vax/crtbegin.S diff -u /dev/null src/lib/csu/arch/vax/crtbegin.S:1.1 --- /dev/null Fri Jun 21 15:54:08 2013 +++ src/lib/csu/arch/vax/crtbegin.S Fri Jun 21 15:54:08 2013 @@ -0,0 +1,178 @@ +/* $NetBSD: crtbegin.S,v 1.1 2013/06/21 15:54:08 matt Exp $ */ +/*- + * Copyright (c) 2013 The NetBSD Foundation, Inc. + * All rights reserved. + * + * This code
CVS commit: src/lib/csu/arch
Module Name:src Committed By: skrll Date: Sun May 5 10:26:57 UTC 2013 Modified Files: src/lib/csu/arch/arm: crtbegin.S src/lib/csu/arch/earm: crtbegin.S Log Message: Whitespace To generate a diff of this commit: cvs rdiff -u -r1.4 -r1.5 src/lib/csu/arch/arm/crtbegin.S cvs rdiff -u -r1.1 -r1.2 src/lib/csu/arch/earm/crtbegin.S Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/lib/csu/arch/arm/crtbegin.S diff -u src/lib/csu/arch/arm/crtbegin.S:1.4 src/lib/csu/arch/arm/crtbegin.S:1.5 --- src/lib/csu/arch/arm/crtbegin.S:1.4 Sat Aug 25 15:39:05 2012 +++ src/lib/csu/arch/arm/crtbegin.S Sun May 5 10:26:57 2013 @@ -1,4 +1,4 @@ -/* $NetBSD: crtbegin.S,v 1.4 2012/08/25 15:39:05 matt Exp $ */ +/* $NetBSD: crtbegin.S,v 1.5 2013/05/05 10:26:57 skrll Exp $ */ /*- * Copyright (c) 2012 The NetBSD Foundation, Inc. * All rights reserved. @@ -30,7 +30,7 @@ #include arm/asm.h -RCSID($NetBSD: crtbegin.S,v 1.4 2012/08/25 15:39:05 matt Exp $) +RCSID($NetBSD: crtbegin.S,v 1.5 2013/05/05 10:26:57 skrll Exp $) .section .ctors, aw, %progbits .p2align 2 @@ -186,7 +186,7 @@ __do_global_dtors_aux: .type __do_global_ctors_aux, %function __do_global_ctors_aux: - GOT_INIT(r3, .Lctors_got, .Lctors) + GOT_INIT(r3, .Lctors_got, .Lctors) ldr r1, .L__initialized #ifdef PIC ldrb r0, [r1, r3]! @@ -249,7 +249,7 @@ __do_global_ctors_aux: /* * Get the start and end of the CTOR list. */ - + ldr r4, .L__CTOR_LIST__ ldr r5, .L__CTOR_LIST_END__ #ifdef PIC Index: src/lib/csu/arch/earm/crtbegin.S diff -u src/lib/csu/arch/earm/crtbegin.S:1.1 src/lib/csu/arch/earm/crtbegin.S:1.2 --- src/lib/csu/arch/earm/crtbegin.S:1.1 Mon Aug 13 02:49:04 2012 +++ src/lib/csu/arch/earm/crtbegin.S Sun May 5 10:26:57 2013 @@ -1,4 +1,4 @@ -/* $NetBSD: crtbegin.S,v 1.1 2012/08/13 02:49:04 matt Exp $ */ +/* $NetBSD: crtbegin.S,v 1.2 2013/05/05 10:26:57 skrll Exp $ */ /*- * Copyright (c) 2012 The NetBSD Foundation, Inc. * All rights reserved. @@ -30,7 +30,7 @@ #include arm/asm.h -RCSID($NetBSD: crtbegin.S,v 1.1 2012/08/13 02:49:04 matt Exp $) +RCSID($NetBSD: crtbegin.S,v 1.2 2013/05/05 10:26:57 skrll Exp $) .section .eh_frame, a, %progbits .p2align 2 @@ -129,7 +129,7 @@ __do_global_dtors_aux: .type __do_global_ctors_aux, %function __do_global_ctors_aux: - GOT_INIT(r3, .Lctors_got, .Lctors) + GOT_INIT(r3, .Lctors_got, .Lctors) ldr r1, .L__initialized /* GOTOFF if PIC */ #ifdef PIC ldrb r0, [r1, r3]! /* r1 = r1 + got */
CVS commit: src/lib/csu/arch/arm
Module Name:src Committed By: skrll Date: Mon Apr 29 07:22:00 UTC 2013 Modified Files: src/lib/csu/arch/arm: Makefile.inc Log Message: Simplify. earm is dealt with elsewhere. To generate a diff of this commit: cvs rdiff -u -r1.4 -r1.5 src/lib/csu/arch/arm/Makefile.inc Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/lib/csu/arch/arm/Makefile.inc diff -u src/lib/csu/arch/arm/Makefile.inc:1.4 src/lib/csu/arch/arm/Makefile.inc:1.5 --- src/lib/csu/arch/arm/Makefile.inc:1.4 Wed Jan 23 02:14:14 2013 +++ src/lib/csu/arch/arm/Makefile.inc Mon Apr 29 07:21:59 2013 @@ -1,7 +1,6 @@ -# $NetBSD: Makefile.inc,v 1.4 2013/01/23 02:14:14 matt Exp $ +# $NetBSD: Makefile.inc,v 1.5 2013/04/29 07:21:59 skrll Exp $ CPPFLAGS+= -DELFSIZE=32 -.if ${MACHINE_ARCH} == earm || ${MACHINE_ARCH} == earmeb \ -|| (!empty(CPUFLAGS) ${CPUFLAGS:M-mabi=aapcs*} != ) +.if (!empty(CPUFLAGS) ${CPUFLAGS:M-mabi=aapcs*} != ) CPPFLAGS+= -DHAVE_INITFINI_ARRAY .endif
CVS commit: src/lib/csu/arch/arm
Module Name:src Committed By: matt Date: Tue Jan 22 22:49:48 UTC 2013 Modified Files: src/lib/csu/arch/arm: Makefile.inc Log Message: If you are using aapcs, you must be using INITFINI To generate a diff of this commit: cvs rdiff -u -r1.2 -r1.3 src/lib/csu/arch/arm/Makefile.inc Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/lib/csu/arch/arm/Makefile.inc diff -u src/lib/csu/arch/arm/Makefile.inc:1.2 src/lib/csu/arch/arm/Makefile.inc:1.3 --- src/lib/csu/arch/arm/Makefile.inc:1.2 Sun Sep 16 13:46:49 2012 +++ src/lib/csu/arch/arm/Makefile.inc Tue Jan 22 22:49:48 2013 @@ -1,3 +1,7 @@ -# $NetBSD: Makefile.inc,v 1.2 2012/09/16 13:46:49 skrll Exp $ +# $NetBSD: Makefile.inc,v 1.3 2013/01/22 22:49:48 matt Exp $ CPPFLAGS+= -DELFSIZE=32 +.if ${MACHINE_ARCH} == earm || ${MACHINE_ARCH} == earmeb \ +|| ${CPUFLAGS:M-mabi=aapcs*} != +CPPFLAGS+= -DHAVE_INITFINI_ARRAY +.endif
CVS commit: src/lib/csu/arch/arm
Module Name:src Committed By: matt Date: Wed Jan 23 02:14:14 UTC 2013 Modified Files: src/lib/csu/arch/arm: Makefile.inc Log Message: Handle CPUFLAGS being empty To generate a diff of this commit: cvs rdiff -u -r1.3 -r1.4 src/lib/csu/arch/arm/Makefile.inc Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/lib/csu/arch/arm/Makefile.inc diff -u src/lib/csu/arch/arm/Makefile.inc:1.3 src/lib/csu/arch/arm/Makefile.inc:1.4 --- src/lib/csu/arch/arm/Makefile.inc:1.3 Tue Jan 22 22:49:48 2013 +++ src/lib/csu/arch/arm/Makefile.inc Wed Jan 23 02:14:14 2013 @@ -1,7 +1,7 @@ -# $NetBSD: Makefile.inc,v 1.3 2013/01/22 22:49:48 matt Exp $ +# $NetBSD: Makefile.inc,v 1.4 2013/01/23 02:14:14 matt Exp $ CPPFLAGS+= -DELFSIZE=32 .if ${MACHINE_ARCH} == earm || ${MACHINE_ARCH} == earmeb \ -|| ${CPUFLAGS:M-mabi=aapcs*} != +|| (!empty(CPUFLAGS) ${CPUFLAGS:M-mabi=aapcs*} != ) CPPFLAGS+= -DHAVE_INITFINI_ARRAY .endif
CVS commit: src/lib/csu/arch/arm
Module Name:src Committed By: matt Date: Sat Aug 25 15:39:05 UTC 2012 Modified Files: src/lib/csu/arch/arm: crtbegin.S Log Message: Fix fini processing. To generate a diff of this commit: cvs rdiff -u -r1.3 -r1.4 src/lib/csu/arch/arm/crtbegin.S Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/lib/csu/arch/arm/crtbegin.S diff -u src/lib/csu/arch/arm/crtbegin.S:1.3 src/lib/csu/arch/arm/crtbegin.S:1.4 --- src/lib/csu/arch/arm/crtbegin.S:1.3 Fri Aug 24 16:37:45 2012 +++ src/lib/csu/arch/arm/crtbegin.S Sat Aug 25 15:39:05 2012 @@ -1,4 +1,4 @@ -/* $NetBSD: crtbegin.S,v 1.3 2012/08/24 16:37:45 matt Exp $ */ +/* $NetBSD: crtbegin.S,v 1.4 2012/08/25 15:39:05 matt Exp $ */ /*- * Copyright (c) 2012 The NetBSD Foundation, Inc. * All rights reserved. @@ -30,7 +30,7 @@ #include arm/asm.h -RCSID($NetBSD: crtbegin.S,v 1.3 2012/08/24 16:37:45 matt Exp $) +RCSID($NetBSD: crtbegin.S,v 1.4 2012/08/25 15:39:05 matt Exp $) .section .ctors, aw, %progbits .p2align 2 @@ -122,7 +122,7 @@ __do_global_dtors_aux: add r4, r4, r7 /* addr = offset + got */ add r5, r5, r7 /* addr = offset + got */ #endif - sub r5, r5, #4 /* skip first entry */ + add r4, r4, #4 /* skip first entry */ 1: cmp r4, r5 /* end of list */ ldrne ip, [r4], #4 /* ip = *r4++; */
CVS commit: src/lib/csu/arch/arm
Module Name:src Committed By: matt Date: Fri Aug 24 16:37:45 UTC 2012 Modified Files: src/lib/csu/arch/arm: crtbegin.S Log Message: Fix code around __register_frame_info (fixes core dumps) To generate a diff of this commit: cvs rdiff -u -r1.2 -r1.3 src/lib/csu/arch/arm/crtbegin.S Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/lib/csu/arch/arm/crtbegin.S diff -u src/lib/csu/arch/arm/crtbegin.S:1.2 src/lib/csu/arch/arm/crtbegin.S:1.3 --- src/lib/csu/arch/arm/crtbegin.S:1.2 Sat Aug 11 07:25:13 2012 +++ src/lib/csu/arch/arm/crtbegin.S Fri Aug 24 16:37:45 2012 @@ -1,4 +1,4 @@ -/* $NetBSD: crtbegin.S,v 1.2 2012/08/11 07:25:13 matt Exp $ */ +/* $NetBSD: crtbegin.S,v 1.3 2012/08/24 16:37:45 matt Exp $ */ /*- * Copyright (c) 2012 The NetBSD Foundation, Inc. * All rights reserved. @@ -30,7 +30,7 @@ #include arm/asm.h -RCSID($NetBSD: crtbegin.S,v 1.2 2012/08/11 07:25:13 matt Exp $) +RCSID($NetBSD: crtbegin.S,v 1.3 2012/08/24 16:37:45 matt Exp $) .section .ctors, aw, %progbits .p2align 2 @@ -211,14 +211,12 @@ __do_global_ctors_aux: cmp ip, #0 beq 1f - ldr r2, .L__EH_FRAME_LIST__ - ldr r3, .L__dwarf_eh_object + ldr r0, .L__EH_FRAME_LIST__ + ldr r1, .L__dwarf_eh_object #ifdef PIC - add r2, r2, r7 /* object addr = got addr + offset */ - add r3, r3, r7 /* object addr = got addr + offset */ + add r0, r0, r7 /* object addr = got addr + offset */ + add r1, r1, r7 /* object addr = got addr + offset */ #endif - ldr r0, [r2] - ldr r1, [r3] #ifdef _ARM_ARCH_4T blx ip
CVS commit: src/lib/csu/arch/earm
Module Name:src Committed By: matt Date: Mon Aug 13 02:49:04 UTC 2012 Added Files: src/lib/csu/arch/earm: Makefile.inc crt0.S crtbegin.S crtend.S crti.S crtn.S Log Message: crt* files for ARM EABI. This is pretty different from OABI. crti.S only has sysident, crtn.S is empty. True dtor/ctor processing is done elsewhere (in crt0.o for static or the rtld for dynamic images). All that is done in here is either a call to __cxa_finalize (dtor, only when SHARED) or register_frame_info and _JV_RegisterClasses. To generate a diff of this commit: cvs rdiff -u -r0 -r1.1 src/lib/csu/arch/earm/Makefile.inc \ src/lib/csu/arch/earm/crt0.S src/lib/csu/arch/earm/crtbegin.S \ src/lib/csu/arch/earm/crtend.S src/lib/csu/arch/earm/crti.S \ src/lib/csu/arch/earm/crtn.S Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Added files: Index: src/lib/csu/arch/earm/Makefile.inc diff -u /dev/null src/lib/csu/arch/earm/Makefile.inc:1.1 --- /dev/null Mon Aug 13 02:49:04 2012 +++ src/lib/csu/arch/earm/Makefile.inc Mon Aug 13 02:49:04 2012 @@ -0,0 +1,5 @@ +# $NetBSD: Makefile.inc,v 1.1 2012/08/13 02:49:04 matt Exp $ + +CPPFLAGS+= -DELFSIZE=32 +CPPFLAGS+= -DHAVE_INITFINI_ARRAY + Index: src/lib/csu/arch/earm/crt0.S diff -u /dev/null src/lib/csu/arch/earm/crt0.S:1.1 --- /dev/null Mon Aug 13 02:49:04 2012 +++ src/lib/csu/arch/earm/crt0.S Mon Aug 13 02:49:04 2012 @@ -0,0 +1,55 @@ +/* $NetBSD: crt0.S,v 1.1 2012/08/13 02:49:04 matt Exp $ */ + +/*- + * Copyright (c) 2012 The NetBSD Foundation, Inc. + * All rights reserved. + * + * This code is derived from software contributed to The NetBSD Foundation + * by Matt Thomas of 3am Software Foundry. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + *notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + *notice, this list of conditions and the following disclaimer in the + *documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS + * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ + +#include arm/asm.h + +RCSID($NetBSD: crt0.S,v 1.1 2012/08/13 02:49:04 matt Exp $) + +STRONG_ALIAS(_start,__start) + +_ENTRY(__start) + /* + * We need to swap ps_strings and cleanup + */ + mov ip, r0 /* ps_strings - tmp */ + mov r0, r2 /* cleanup - ps_strings */ + mov r2, ip /* tmp - ps_strings */ + + /* 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); + */ + + b ___start Index: src/lib/csu/arch/earm/crtbegin.S diff -u /dev/null src/lib/csu/arch/earm/crtbegin.S:1.1 --- /dev/null Mon Aug 13 02:49:04 2012 +++ src/lib/csu/arch/earm/crtbegin.S Mon Aug 13 02:49:04 2012 @@ -0,0 +1,216 @@ +/* $NetBSD: crtbegin.S,v 1.1 2012/08/13 02:49:04 matt Exp $ */ +/*- + * Copyright (c) 2012 The NetBSD Foundation, Inc. + * All rights reserved. + * + * This code is derived from software contributed to The NetBSD Foundation + * by Matt Thomas of 3am Software Foundry. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + *notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + *notice, this list of conditions and the following disclaimer in the + *documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS + * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
CVS commit: src/lib/csu/arch/arm
Module Name:src Committed By: matt Date: Sat Aug 11 07:25:13 UTC 2012 Modified Files: src/lib/csu/arch/arm: crtbegin.S Log Message: Fix typo. To generate a diff of this commit: cvs rdiff -u -r1.1 -r1.2 src/lib/csu/arch/arm/crtbegin.S Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/lib/csu/arch/arm/crtbegin.S diff -u src/lib/csu/arch/arm/crtbegin.S:1.1 src/lib/csu/arch/arm/crtbegin.S:1.2 --- src/lib/csu/arch/arm/crtbegin.S:1.1 Sat Aug 11 01:33:36 2012 +++ src/lib/csu/arch/arm/crtbegin.S Sat Aug 11 07:25:13 2012 @@ -1,4 +1,4 @@ -/* $NetBSD: crtbegin.S,v 1.1 2012/08/11 01:33:36 matt Exp $ */ +/* $NetBSD: crtbegin.S,v 1.2 2012/08/11 07:25:13 matt Exp $ */ /*- * Copyright (c) 2012 The NetBSD Foundation, Inc. * All rights reserved. @@ -30,7 +30,7 @@ #include arm/asm.h -RCSID($NetBSD: crtbegin.S,v 1.1 2012/08/11 01:33:36 matt Exp $) +RCSID($NetBSD: crtbegin.S,v 1.2 2012/08/11 07:25:13 matt Exp $) .section .ctors, aw, %progbits .p2align 2 @@ -132,7 +132,7 @@ __do_global_dtors_aux: adrne lr, 1b /* set up to return to loop start */ #ifdef _ARM_ARCH_4T bxne ip /* call it */ -#els +#else movne pc, ip /* call entry */ #endif
CVS commit: src/lib/csu/arch/arm
Module Name:src Committed By: matt Date: Sat Aug 11 07:25:44 UTC 2012 Modified Files: src/lib/csu/arch/arm: crt0.S Log Message: Replace copyright since it now has new contents To generate a diff of this commit: cvs rdiff -u -r1.2 -r1.3 src/lib/csu/arch/arm/crt0.S Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/lib/csu/arch/arm/crt0.S diff -u src/lib/csu/arch/arm/crt0.S:1.2 src/lib/csu/arch/arm/crt0.S:1.3 --- src/lib/csu/arch/arm/crt0.S:1.2 Sat Aug 11 01:33:36 2012 +++ src/lib/csu/arch/arm/crt0.S Sat Aug 11 07:25:44 2012 @@ -1,11 +1,12 @@ -/* $NetBSD: crt0.S,v 1.2 2012/08/11 01:33:36 matt Exp $ */ +/* $NetBSD: crt0.S,v 1.3 2012/08/11 07:25:44 matt Exp $ */ -/* - * Copyright (C) 1997 Mark Brinicombe - * Copyright (C) 1995 Wolfgang Solfrank. - * Copyright (C) 1995 TooLs GmbH. +/*- + * Copyright (c) 2012 The NetBSD Foundation, Inc. * All rights reserved. * + * This code is derived from software contributed to The NetBSD Foundation + * by Matt Thomas of 3am Software Foundry. + * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: @@ -14,26 +15,23 @@ * 2. Redistributions in binary form must reproduce the above copyright *notice, this list of conditions and the following disclaimer in the *documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - *must display the following acknowledgement: - * This product includes software developed by TooLs GmbH. - * 4. The name of TooLs GmbH may not be used to endorse or promote products - *derived from this software without specific prior written permission. * - * THIS SOFTWARE IS PROVIDED BY TOOLS GMBH ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL TOOLS GMBH BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; - * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR - * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF - * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS + * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. */ -#include machine/asm.h -RCSID($NetBSD: crt0.S,v 1.2 2012/08/11 01:33:36 matt Exp $) +#include arm/asm.h + +RCSID($NetBSD: crt0.S,v 1.3 2012/08/11 07:25:44 matt Exp $) STRONG_ALIAS(_start,__start)
CVS commit: src/lib/csu/arch/arm
Module Name:src Committed By: matt Date: Sat Aug 11 07:26:25 UTC 2012 Modified Files: src/lib/csu/arch/arm: crtend.S Log Message: Update copyright year. To generate a diff of this commit: cvs rdiff -u -r1.1 -r1.2 src/lib/csu/arch/arm/crtend.S Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/lib/csu/arch/arm/crtend.S diff -u src/lib/csu/arch/arm/crtend.S:1.1 src/lib/csu/arch/arm/crtend.S:1.2 --- src/lib/csu/arch/arm/crtend.S:1.1 Sat Aug 11 01:33:36 2012 +++ src/lib/csu/arch/arm/crtend.S Sat Aug 11 07:26:25 2012 @@ -1,6 +1,6 @@ -/* $NetBSD: crtend.S,v 1.1 2012/08/11 01:33:36 matt Exp $ */ +/* $NetBSD: crtend.S,v 1.2 2012/08/11 07:26:25 matt Exp $ */ /*- - * Copyright (c) 2011 The NetBSD Foundation, Inc. + * Copyright (c) 2012 The NetBSD Foundation, Inc. * All rights reserved. * * This code is derived from software contributed to The NetBSD Foundation @@ -30,7 +30,7 @@ #include arm/asm.h -RCSID($NetBSD: crtend.S,v 1.1 2012/08/11 01:33:36 matt Exp $) +RCSID($NetBSD: crtend.S,v 1.2 2012/08/11 07:26:25 matt Exp $) .section .ctors, aw, %progbits .p2align 2
CVS commit: src/lib/csu/arch/arm
Module Name:src Committed By: matt Date: Sat Aug 11 01:33:36 UTC 2012 Modified Files: src/lib/csu/arch/arm: crt0.S crti.S crtn.S Added Files: src/lib/csu/arch/arm: crtbegin.S crtend.S Log Message: USE_COMPILERCRTSTUFF=no support for arm This passes all the lib/csu atf tests. To generate a diff of this commit: cvs rdiff -u -r1.1 -r1.2 src/lib/csu/arch/arm/crt0.S \ src/lib/csu/arch/arm/crti.S src/lib/csu/arch/arm/crtn.S cvs rdiff -u -r0 -r1.1 src/lib/csu/arch/arm/crtbegin.S \ src/lib/csu/arch/arm/crtend.S Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/lib/csu/arch/arm/crt0.S diff -u src/lib/csu/arch/arm/crt0.S:1.1 src/lib/csu/arch/arm/crt0.S:1.2 --- src/lib/csu/arch/arm/crt0.S:1.1 Sat Aug 7 18:01:33 2010 +++ src/lib/csu/arch/arm/crt0.S Sat Aug 11 01:33:36 2012 @@ -1,4 +1,4 @@ -/* $NetBSD: crt0.S,v 1.1 2010/08/07 18:01:33 joerg Exp $ */ +/* $NetBSD: crt0.S,v 1.2 2012/08/11 01:33:36 matt Exp $ */ /* * Copyright (C) 1997 Mark Brinicombe @@ -33,24 +33,25 @@ */ #include machine/asm.h -RCSID($NetBSD: crt0.S,v 1.1 2010/08/07 18:01:33 joerg Exp $) +RCSID($NetBSD: crt0.S,v 1.2 2012/08/11 01:33:36 matt Exp $) STRONG_ALIAS(_start,__start) _ENTRY(__start) - mov r5, r2 /* cleanup */ - mov r4, r1 /* obj_main */ - mov r3, r0 /* ps_strings */ - /* Get argc, argv, and envp from stack */ - ldr r0, [sp, #0x] - add r1, sp, #0x0004 - add r2, r1, r0, lsl #2 - add r2, r2, #0x0004 + /* + * We need to swap ps_strings and cleanup + */ + mov ip, r0 /* ps_strings - tmp */ + mov r0, r2 /* cleanup - ps_strings */ + mov r2, ip /* tmp - ps_strings */ /* Ensure the stack is properly aligned before calling C code. */ bic sp, sp, #7 - sub sp, sp, #8 - str r5, [sp, #4] - str r4, [sp, #0] + + /* + * void ___start(void (*cleanup)(void), + *const Obj_Entry *obj, + *struct ps_strings *ps_strings); + */ b ___start Index: src/lib/csu/arch/arm/crti.S diff -u src/lib/csu/arch/arm/crti.S:1.1 src/lib/csu/arch/arm/crti.S:1.2 --- src/lib/csu/arch/arm/crti.S:1.1 Sat Aug 7 18:01:33 2010 +++ src/lib/csu/arch/arm/crti.S Sat Aug 11 01:33:36 2012 @@ -1,4 +1,4 @@ -/* $NetBSD: crti.S,v 1.1 2010/08/07 18:01:33 joerg Exp $ */ +/* $NetBSD: crti.S,v 1.2 2012/08/11 01:33:36 matt Exp $ */ /*- * Copyright (c) 2001 Ross Harvey @@ -35,21 +35,23 @@ #include machine/asm.h -RCSID($NetBSD: crti.S,v 1.1 2010/08/07 18:01:33 joerg Exp $) +RCSID($NetBSD: crti.S,v 1.2 2012/08/11 01:33:36 matt Exp $) #include sysident.S - .section .init, ax, @progbits + .section .init, ax, %progbits .align 0 .globl _init + .type _init,%function _init: mov ip, sp stmfd sp!, {fp, ip, lr, pc} sub fp, ip, #4 - .section .fini, ax, @progbits + .section .fini, ax, %progbits .align 0 .globl _fini + .type _fini,%function _fini: mov ip, sp stmfd sp!, {fp, ip, lr, pc} Index: src/lib/csu/arch/arm/crtn.S diff -u src/lib/csu/arch/arm/crtn.S:1.1 src/lib/csu/arch/arm/crtn.S:1.2 --- src/lib/csu/arch/arm/crtn.S:1.1 Sat Aug 7 18:01:33 2010 +++ src/lib/csu/arch/arm/crtn.S Sat Aug 11 01:33:36 2012 @@ -1,4 +1,4 @@ -/* $NetBSD: crtn.S,v 1.1 2010/08/07 18:01:33 joerg Exp $ */ +/* $NetBSD: crtn.S,v 1.2 2012/08/11 01:33:36 matt Exp $ */ /*- * Copyright (c) 2001 Ross Harvey @@ -35,10 +35,10 @@ #include machine/asm.h -RCSID($NetBSD: crtn.S,v 1.1 2010/08/07 18:01:33 joerg Exp $) +RCSID($NetBSD: crtn.S,v 1.2 2012/08/11 01:33:36 matt Exp $) - .section .init, ax, @progbits + .section .init, ax, %progbits ldmea fp, {fp, sp, pc} - .section .fini, ax, @progbits + .section .fini, ax, %progbits ldmea fp, {fp, sp, pc} Added files: Index: src/lib/csu/arch/arm/crtbegin.S diff -u /dev/null src/lib/csu/arch/arm/crtbegin.S:1.1 --- /dev/null Sat Aug 11 01:33:36 2012 +++ src/lib/csu/arch/arm/crtbegin.S Sat Aug 11 01:33:36 2012 @@ -0,0 +1,295 @@ +/* $NetBSD: crtbegin.S,v 1.1 2012/08/11 01:33:36 matt Exp $ */ +/*- + * Copyright (c) 2012 The NetBSD Foundation, Inc. + * All rights reserved. + * + * This code is derived from software contributed to The NetBSD Foundation + * by Matt Thomas of 3am Software Foundry. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + *notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + *notice, this list of conditions and the following disclaimer in the + *documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS + * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT
CVS commit: src/lib/csu/arch/sh3
Module Name:src Committed By: uwe Date: Sat Jun 2 22:15:15 UTC 2012 Modified Files: src/lib/csu/arch/sh3: crtbegin.S Log Message: Claim copyright (per Joerg's request). To generate a diff of this commit: cvs rdiff -u -r1.1 -r1.2 src/lib/csu/arch/sh3/crtbegin.S Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/lib/csu/arch/sh3/crtbegin.S diff -u src/lib/csu/arch/sh3/crtbegin.S:1.1 src/lib/csu/arch/sh3/crtbegin.S:1.2 --- src/lib/csu/arch/sh3/crtbegin.S:1.1 Tue Jan 31 20:30:15 2012 +++ src/lib/csu/arch/sh3/crtbegin.S Sat Jun 2 22:15:15 2012 @@ -1,6 +1,6 @@ -/* $NetBSD: crtbegin.S,v 1.1 2012/01/31 20:30:15 uwe Exp $ */ +/* $NetBSD: crtbegin.S,v 1.2 2012/06/02 22:15:15 uwe Exp $ */ /*- - * Copyright (c) 2010 Joerg Sonnenberger jo...@netbsd.org + * Copyright (c) 2012 Valeriy E. Ushakov * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -30,7 +30,7 @@ #include machine/asm.h -RCSID($NetBSD: crtbegin.S,v 1.1 2012/01/31 20:30:15 uwe Exp $) +RCSID($NetBSD: crtbegin.S,v 1.2 2012/06/02 22:15:15 uwe Exp $) .section .ctors, aw, @progbits .p2align 2
CVS commit: src/lib/csu/arch/sh3
Module Name:src Committed By: uwe Date: Tue Jan 31 20:17:57 UTC 2012 Modified Files: src/lib/csu/arch/sh3: crt0.S Log Message: New ___start() C function takes 3 arguments instead of 6 and fetches argc, argv and environ from ps_strings instead. Adjust the trampoline accordingly. Fix brain fart in previous: direct jump is jmp @rN, not bsrf rN. To generate a diff of this commit: cvs rdiff -u -r1.3 -r1.4 src/lib/csu/arch/sh3/crt0.S Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/lib/csu/arch/sh3/crt0.S diff -u src/lib/csu/arch/sh3/crt0.S:1.3 src/lib/csu/arch/sh3/crt0.S:1.4 --- src/lib/csu/arch/sh3/crt0.S:1.3 Sun Jan 29 23:27:24 2012 +++ src/lib/csu/arch/sh3/crt0.S Tue Jan 31 20:17:57 2012 @@ -1,4 +1,4 @@ -/* $NetBSD: crt0.S,v 1.3 2012/01/29 23:27:24 uwe Exp $ */ +/* $NetBSD: crt0.S,v 1.4 2012/01/31 20:17:57 uwe Exp $ */ /* * Copyright (c) 1998 Christos Zoulas @@ -37,21 +37,23 @@ #include machine/asm.h -RCSID($NetBSD: crt0.S,v 1.3 2012/01/29 23:27:24 uwe Exp $) +RCSID($NetBSD: crt0.S,v 1.4 2012/01/31 20:17:57 uwe Exp $) STRONG_ALIAS(_start,__start) /* - * Kernel setregs() passes all arguments in registers to avoid - * copyout. This trampoline pushes 5th and 6th arguments into stack, - * where C ABI expects them to be, and calls the real startup code - * written in C. + * Kernel setregs() passes arguments for the 6-argument version of + * ___start (but with 5th and 6th in registers, to avoid copyout). + * Since we now use 3-argument version of ___start - that obtains + * argc, argv and environ from ps_strings - move its arguments to + * proper registers. */ _ENTRY(__start) mov.l .L___start, r0 - mov.l r9, @-sp - braf r0 - mov.l r8, @-sp + mov r7, r4 ! void (*cleanup)(void) + mov r8, r5 ! const Obj_Entry *obj + jmp @r0 + mov r9, r6 ! struct ps_strings *ps_strings .p2align 2 .L___start: .long _C_LABEL(___start)
CVS commit: src/lib/csu/arch/sh3
Module Name:src Committed By: uwe Date: Tue Jan 31 20:30:15 UTC 2012 Added Files: src/lib/csu/arch/sh3: crtbegin.S Log Message: Implement crtbegin* for sh3. Tested to work on landisk. To generate a diff of this commit: cvs rdiff -u -r0 -r1.1 src/lib/csu/arch/sh3/crtbegin.S Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Added files: Index: src/lib/csu/arch/sh3/crtbegin.S diff -u /dev/null src/lib/csu/arch/sh3/crtbegin.S:1.1 --- /dev/null Tue Jan 31 20:30:15 2012 +++ src/lib/csu/arch/sh3/crtbegin.S Tue Jan 31 20:30:15 2012 @@ -0,0 +1,366 @@ +/* $NetBSD: crtbegin.S,v 1.1 2012/01/31 20:30:15 uwe Exp $ */ +/*- + * Copyright (c) 2010 Joerg Sonnenberger jo...@netbsd.org + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + *notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + *notice, this list of conditions and the following disclaimer in + *the documentation and/or other materials provided with the + *distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED + * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include machine/asm.h + +RCSID($NetBSD: crtbegin.S,v 1.1 2012/01/31 20:30:15 uwe Exp $) + + .section .ctors, aw, @progbits + .p2align 2 +__CTOR_LIST__: + .long -1 + + .section .dtors, aw, @progbits + .p2align 2 +__DTOR_LIST__: + .long -1 + + .section .eh_frame, a, @progbits + .p2align 2 +__EH_FRAME_LIST__: + + .section .jcr, aw, @progbits + .p2align 2 +__JCR_LIST__: + + .section .data.rel, aw, @progbits + .p2align 2 + .globl __dso_handle + .hidden __dso_handle + .type __dso_handle, @object + .size __dso_handle, 4 +__dso_handle: +#ifdef SHARED + .long __dso_handle +#else + .long 0 +#endif + +__dwarf_eh_object: + .zero 32 + +__initialized: + .zero 1 +__finished: + .zero 1 + + .text + .weak __cxa_finalize + .weak __deregister_frame_info + .weak __register_frame_info + .weak _Jv_RegisterClasses + +/* + * A bit of CPP syntactic sugar for accessing variables. + * + * For PIC we are obliged to use @(r0, r12) since r12 has the GOT + * address and only r0 can be used in @(r0, Rm) addressing mode, so we + * always load variable address to r0. + */ +#ifdef PIC +#define VAR_DATUM(var) var@GOTOFF +#define FUNC_DATUM(f) f@GOT +#define R0VAR (r0, r12) +#else +#define VAR_DATUM(var) var +#define FUNC_DATUM(f) f +#define R0VAR r0 +#endif + + +__do_global_ctors_aux: +mov.l r8, @-sp +mov.l r9, @-sp +#ifdef PIC +mov.l r12, @-sp +mov.l .Lc_got, r12 +mova.Lc_got, r0 +add r0, r12 +#endif +mov.l r14, @-sp +sts.l pr, @-sp + mov sp, r14 + + !! if (__initialized) return; + mov.l .Lc___initialized, r0 + mov.b @R0VAR, r1 + tst r1, r1 + bf .Lc_return + + !! __initialized = 1; + mov #1, r1 + mov.b r1, @R0VAR + + + !! if (__register_frame_info) + !! __register_frame_info(__EH_FRAME_LIST__[0], __dwarf_eh_object) +#ifdef PIC + mov.l .Lc___register_frame_info_GOT, r0 + mov.l @R0VAR, r1 + tst r1, r1 + bt .Lc___register_frame_info_done + mov.l .Lc___register_frame_info, r0 + mov.l .Lc___EH_FRAME_LIST__, r4 + mov.l .Lc___dwarf_eh_object, r5 + add r12, r4 +.Lc___register_frame_info_call: + CALL r0 + add r12, r5 +#else /* !PIC */ + mov.l .Lc___register_frame_info, r0 + tst r0, r0 + bt .Lc___register_frame_info_done + mov.l .Lc___EH_FRAME_LIST__, r4 + mov.l .Lc___dwarf_eh_object, r5 + CALL r0 + nop +#endif +.Lc___register_frame_info_done: + + !! if (_Jv_RegisterClasses __JCR_LIST__[0]) + !! _Jv_RegisterClasses(__JCR_LIST__[0]); +#ifdef PIC + mov.l .Lc__Jv_RegisterClasses_GOT, r0 + mov.l @R0VAR, r1 + tst r1, r1 + bt .Lc__Jv_RegisterClasses_done + + mov.l .Lc___JCR_LIST__, r0 + mov.l @R0VAR, r1 + tst r1, r1 + bt .Lc__Jv_RegisterClasses_done + + mov.l .Lc__Jv_RegisterClasses, r2 + mov r0, r4 +.Lc__Jv_RegisterClasses_call: + CALL r2 + add r12, r4 + +#else /* !PIC */ + mov.l .Lc__Jv_RegisterClasses, r2 + tst r2, r2 + bt
CVS commit: src/lib/csu/arch/sh3
Module Name:src Committed By: uwe Date: Sun Jan 29 23:27:24 UTC 2012 Modified Files: src/lib/csu/arch/sh3: crt0.S Log Message: Since it's in a separate file now, we cannot use direct branch to label. To generate a diff of this commit: cvs rdiff -u -r1.2 -r1.3 src/lib/csu/arch/sh3/crt0.S Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/lib/csu/arch/sh3/crt0.S diff -u src/lib/csu/arch/sh3/crt0.S:1.2 src/lib/csu/arch/sh3/crt0.S:1.3 --- src/lib/csu/arch/sh3/crt0.S:1.2 Sat Jan 28 12:21:13 2012 +++ src/lib/csu/arch/sh3/crt0.S Sun Jan 29 23:27:24 2012 @@ -1,4 +1,4 @@ -/* $NetBSD: crt0.S,v 1.2 2012/01/28 12:21:13 uwe Exp $ */ +/* $NetBSD: crt0.S,v 1.3 2012/01/29 23:27:24 uwe Exp $ */ /* * Copyright (c) 1998 Christos Zoulas @@ -37,7 +37,7 @@ #include machine/asm.h -RCSID($NetBSD: crt0.S,v 1.2 2012/01/28 12:21:13 uwe Exp $) +RCSID($NetBSD: crt0.S,v 1.3 2012/01/29 23:27:24 uwe Exp $) STRONG_ALIAS(_start,__start) @@ -48,6 +48,10 @@ STRONG_ALIAS(_start,__start) * written in C. */ _ENTRY(__start) + mov.l .L___start, r0 mov.l r9, @-sp - bra ___start + braf r0 mov.l r8, @-sp + + .p2align 2 +.L___start: .long _C_LABEL(___start)
CVS commit: src/lib/csu/arch/sh3
Module Name:src Committed By: uwe Date: Sat Jan 28 12:21:14 UTC 2012 Modified Files: src/lib/csu/arch/sh3: crt0.S Log Message: Asm cosmetic. Add a comment that explains what this trampoline does. To generate a diff of this commit: cvs rdiff -u -r1.1 -r1.2 src/lib/csu/arch/sh3/crt0.S Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/lib/csu/arch/sh3/crt0.S diff -u src/lib/csu/arch/sh3/crt0.S:1.1 src/lib/csu/arch/sh3/crt0.S:1.2 --- src/lib/csu/arch/sh3/crt0.S:1.1 Sat Aug 7 18:01:34 2010 +++ src/lib/csu/arch/sh3/crt0.S Sat Jan 28 12:21:13 2012 @@ -1,4 +1,4 @@ -/* $NetBSD: crt0.S,v 1.1 2010/08/07 18:01:34 joerg Exp $ */ +/* $NetBSD: crt0.S,v 1.2 2012/01/28 12:21:13 uwe Exp $ */ /* * Copyright (c) 1998 Christos Zoulas @@ -37,11 +37,17 @@ #include machine/asm.h -RCSID($NetBSD: crt0.S,v 1.1 2010/08/07 18:01:34 joerg Exp $) +RCSID($NetBSD: crt0.S,v 1.2 2012/01/28 12:21:13 uwe Exp $) STRONG_ALIAS(_start,__start) +/* + * Kernel setregs() passes all arguments in registers to avoid + * copyout. This trampoline pushes 5th and 6th arguments into stack, + * where C ABI expects them to be, and calls the real startup code + * written in C. + */ _ENTRY(__start) - mov.l r9,@-r15 - bra ___start - mov.l r8,@-r15 + mov.l r9, @-sp + bra ___start + mov.l r8, @-sp
CVS commit: src/lib/csu/arch/sh3
Module Name:src Committed By: uwe Date: Sat Jan 28 12:44:19 UTC 2012 Modified Files: src/lib/csu/arch/sh3: crti.S Log Message: Add a comment that explains what this code does. To generate a diff of this commit: cvs rdiff -u -r1.1 -r1.2 src/lib/csu/arch/sh3/crti.S Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/lib/csu/arch/sh3/crti.S diff -u src/lib/csu/arch/sh3/crti.S:1.1 src/lib/csu/arch/sh3/crti.S:1.2 --- src/lib/csu/arch/sh3/crti.S:1.1 Sat Aug 7 18:01:34 2010 +++ src/lib/csu/arch/sh3/crti.S Sat Jan 28 12:44:19 2012 @@ -1,4 +1,4 @@ -/* $NetBSD: crti.S,v 1.1 2010/08/07 18:01:34 joerg Exp $ */ +/* $NetBSD: crti.S,v 1.2 2012/01/28 12:44:19 uwe Exp $ */ /*- * Copyright (c) 2001 Ross Harvey @@ -35,10 +35,16 @@ #include machine/asm.h -RCSID($NetBSD: crti.S,v 1.1 2010/08/07 18:01:34 joerg Exp $) +RCSID($NetBSD: crti.S,v 1.2 2012/01/28 12:44:19 uwe Exp $) #include sysident.S + +/* + * Provide function prologues for the code in .init and .fini sections. + * Corresponding epilogues are in crtn.S + */ + .section .init, ax, @progbits .align 4 .globl _init
CVS commit: src/lib/csu/arch/sh3
Module Name:src Committed By: uwe Date: Sat Jan 28 12:45:43 UTC 2012 Modified Files: src/lib/csu/arch/sh3: crtn.S Log Message: Add a comment that explains what this code does. To generate a diff of this commit: cvs rdiff -u -r1.1 -r1.2 src/lib/csu/arch/sh3/crtn.S Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/lib/csu/arch/sh3/crtn.S diff -u src/lib/csu/arch/sh3/crtn.S:1.1 src/lib/csu/arch/sh3/crtn.S:1.2 --- src/lib/csu/arch/sh3/crtn.S:1.1 Sat Aug 7 18:01:34 2010 +++ src/lib/csu/arch/sh3/crtn.S Sat Jan 28 12:45:43 2012 @@ -1,4 +1,4 @@ -/* $NetBSD: crtn.S,v 1.1 2010/08/07 18:01:34 joerg Exp $ */ +/* $NetBSD: crtn.S,v 1.2 2012/01/28 12:45:43 uwe Exp $ */ /*- * Copyright (c) 2001 Ross Harvey @@ -35,7 +35,13 @@ #include machine/asm.h -RCSID($NetBSD: crtn.S,v 1.1 2010/08/07 18:01:34 joerg Exp $) +RCSID($NetBSD: crtn.S,v 1.2 2012/01/28 12:45:43 uwe Exp $) + + +/* + * Provide function epilogues for the code in .init and .fini sections. + * Corresponding prologues are in crti.S + */ .section .init, ax, @progbits mov r14, sp
CVS commit: src/lib/csu/arch/sh3
Module Name:src Committed By: uwe Date: Sat Jan 28 15:08:47 UTC 2012 Added Files: src/lib/csu/arch/sh3: crtend.S Log Message: Steal arch/i386/crtend.S To generate a diff of this commit: cvs rdiff -u -r0 -r1.1 src/lib/csu/arch/sh3/crtend.S Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Added files: Index: src/lib/csu/arch/sh3/crtend.S diff -u /dev/null src/lib/csu/arch/sh3/crtend.S:1.1 --- /dev/null Sat Jan 28 15:08:47 2012 +++ src/lib/csu/arch/sh3/crtend.S Sat Jan 28 15:08:47 2012 @@ -0,0 +1,52 @@ +/* $NetBSD: crtend.S,v 1.1 2012/01/28 15:08:47 uwe Exp $ */ +/*- + * Copyright (c) 2010 Joerg Sonnenberger jo...@netbsd.org + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + *notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + *notice, this list of conditions and the following disclaimer in + *the documentation and/or other materials provided with the + *distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED + * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include machine/asm.h + +RCSID($NetBSD: crtend.S,v 1.1 2012/01/28 15:08:47 uwe Exp $) + + .section .ctors, aw, @progbits + .align 4 + .global __CTOR_LIST_END__ + .hidden __CTOR_LIST_END__ +__CTOR_LIST_END__: + .long 0 + + .section .dtors, aw, @progbits + .align 4 + .long 0 + + .section .eh_frame, a, @progbits + .align 4 + .long 0 + + .section .jcr, aw, @progbits + .align 4 + .long 0
CVS commit: src/lib/csu/arch/vax
Module Name:src Committed By: matt Date: Sat Jul 2 20:14:10 UTC 2011 Modified Files: src/lib/csu/arch/vax: crt0.S Log Message: Adapt to the new ___start calling convention To generate a diff of this commit: cvs rdiff -u -r1.1 -r1.2 src/lib/csu/arch/vax/crt0.S Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/lib/csu/arch/vax/crt0.S diff -u src/lib/csu/arch/vax/crt0.S:1.1 src/lib/csu/arch/vax/crt0.S:1.2 --- src/lib/csu/arch/vax/crt0.S:1.1 Sat Aug 7 18:01:34 2010 +++ src/lib/csu/arch/vax/crt0.S Sat Jul 2 20:14:10 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: crt0.S,v 1.1 2010/08/07 18:01:34 joerg Exp $ */ +/* $NetBSD: crt0.S,v 1.2 2011/07/02 20:14:10 matt Exp $ */ /* * Copyright (c) 1999 Matt Thomas @@ -37,7 +37,7 @@ #include machine/asm.h -RCSID($NetBSD: crt0.S,v 1.1 2010/08/07 18:01:34 joerg Exp $) +RCSID($NetBSD: crt0.S,v 1.2 2011/07/02 20:14:10 matt Exp $) STRONG_ALIAS(_start,__start) @@ -46,8 +46,4 @@ pushl %r9 /* ps_strings */ pushl %r8 /* obj */ pushl %r7 /* cleanup */ - movl (%r6),%r0 /* argc */ - pushal 8(%r6)[%r0] /* envp = argv[argc + 1] */ - pushal 4(%r6) /* argv */ - pushl %r0 /* argc */ - calls $6,___start + calls $3,___start
CVS commit: src/lib/csu/arch/powerpc
Module Name:src Committed By: matt Date: Sat Jul 2 20:16:09 UTC 2011 Modified Files: src/lib/csu/arch/powerpc: crt0.S Log Message: The kernel and ld.elf_so call with a different order for cleanup, obj, ps_strings so deal with it. With this change, USE_COMPILERCRTSTUFF=no works. To generate a diff of this commit: cvs rdiff -u -r1.3 -r1.4 src/lib/csu/arch/powerpc/crt0.S Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/lib/csu/arch/powerpc/crt0.S diff -u src/lib/csu/arch/powerpc/crt0.S:1.3 src/lib/csu/arch/powerpc/crt0.S:1.4 --- src/lib/csu/arch/powerpc/crt0.S:1.3 Fri Jul 1 02:59:05 2011 +++ src/lib/csu/arch/powerpc/crt0.S Sat Jul 2 20:16:09 2011 @@ -29,7 +29,7 @@ #include powerpc/asm.h -RCSID($NetBSD: crt0.S,v 1.3 2011/07/01 02:59:05 joerg Exp $) +RCSID($NetBSD: crt0.S,v 1.4 2011/07/02 20:16:09 matt Exp $) STRONG_ALIAS(_start,__start) @@ -45,9 +45,9 @@ addis %r13,%r11,_SDA_BASE_-1b@ha addi %r13,%r13,_SDA_BASE_-1b@l - mr %r3,%r6 - mr %r4,%r7 - mr %r5,%r8 + mr %r3,%r7 /* cleanup */ + mr %r4,%r6 /* obj */ + mr %r5,%r8 /* ps_strings */ b ___start END(__start)
CVS commit: src/lib/csu/arch/powerpc
Module Name:src Committed By: matt Date: Thu Jun 30 20:10:17 UTC 2011 Modified Files: src/lib/csu/arch/powerpc: crt0.S Log Message: Adapt to new ___start definition. Use PIC method to load %r13 with address of _SDA_BASE_ To generate a diff of this commit: cvs rdiff -u -r1.1 -r1.2 src/lib/csu/arch/powerpc/crt0.S Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/lib/csu/arch/powerpc/crt0.S diff -u src/lib/csu/arch/powerpc/crt0.S:1.1 src/lib/csu/arch/powerpc/crt0.S:1.2 --- src/lib/csu/arch/powerpc/crt0.S:1.1 Tue Feb 8 02:02:25 2011 +++ src/lib/csu/arch/powerpc/crt0.S Thu Jun 30 20:10:17 2011 @@ -29,21 +29,23 @@ #include powerpc/asm.h -RCSID($NetBSD: crt0.S,v 1.1 2011/02/08 02:02:25 matt Exp $) +RCSID($NetBSD: crt0.S,v 1.2 2011/06/30 20:10:17 matt Exp $) STRONG_ALIAS(_start,__start) .weak _SDA_BASE_ - .weak _SDA_BASE2_ ENTRY_NOPROFILE(__start) + bcl 20,31,1f +1: + mflr %r11 /* SVR4 ABI says small data is in r13 */ - lis %r13,_SDA_BASE_@ha - addi %r13,%r13,_SDA_BASE_@l + addis %r13,%r11,_SDA_BASE_-1b@ha + addi %r13,%r13,_SDA_BASE_-1b@l - /* E[mbedded] ABI says small data is in r2 */ - lis %r2,_SDA_BASE2_@ha - addi %r2,%r2,_SDA_BASE2_@l + mr %r3,%r6 + mr %r4,%r7 + mr %r5,%r8 b ___start END(__start)
CVS commit: src/lib/csu/arch
Module Name:src Committed By: joerg Date: Fri Jul 1 02:59:05 UTC 2011 Modified Files: src/lib/csu/arch/i386: crt0.S src/lib/csu/arch/powerpc: crt0.S src/lib/csu/arch/x86_64: crt0.S Log Message: Explicitly declare ___start as hidden. To generate a diff of this commit: cvs rdiff -u -r1.2 -r1.3 src/lib/csu/arch/i386/crt0.S cvs rdiff -u -r1.2 -r1.3 src/lib/csu/arch/powerpc/crt0.S cvs rdiff -u -r1.2 -r1.3 src/lib/csu/arch/x86_64/crt0.S Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/lib/csu/arch/i386/crt0.S diff -u src/lib/csu/arch/i386/crt0.S:1.2 src/lib/csu/arch/i386/crt0.S:1.3 --- src/lib/csu/arch/i386/crt0.S:1.2 Thu Jun 30 19:48:43 2011 +++ src/lib/csu/arch/i386/crt0.S Fri Jul 1 02:59:05 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: crt0.S,v 1.2 2011/06/30 19:48:43 joerg Exp $ */ +/* $NetBSD: crt0.S,v 1.3 2011/07/01 02:59:05 joerg Exp $ */ /* * Copyright (c) 1998 Christos Zoulas @@ -37,7 +37,9 @@ #include machine/asm.h -RCSID($NetBSD: crt0.S,v 1.2 2011/06/30 19:48:43 joerg Exp $) +RCSID($NetBSD: crt0.S,v 1.3 2011/07/01 02:59:05 joerg Exp $) + + .hidden ___start STRONG_ALIAS(_start,__start) _ENTRY(__start) Index: src/lib/csu/arch/powerpc/crt0.S diff -u src/lib/csu/arch/powerpc/crt0.S:1.2 src/lib/csu/arch/powerpc/crt0.S:1.3 --- src/lib/csu/arch/powerpc/crt0.S:1.2 Thu Jun 30 20:10:17 2011 +++ src/lib/csu/arch/powerpc/crt0.S Fri Jul 1 02:59:05 2011 @@ -29,10 +29,12 @@ #include powerpc/asm.h -RCSID($NetBSD: crt0.S,v 1.2 2011/06/30 20:10:17 matt Exp $) +RCSID($NetBSD: crt0.S,v 1.3 2011/07/01 02:59:05 joerg Exp $) STRONG_ALIAS(_start,__start) + .hidden ___start + .weak _SDA_BASE_ ENTRY_NOPROFILE(__start) Index: src/lib/csu/arch/x86_64/crt0.S diff -u src/lib/csu/arch/x86_64/crt0.S:1.2 src/lib/csu/arch/x86_64/crt0.S:1.3 --- src/lib/csu/arch/x86_64/crt0.S:1.2 Thu Jun 30 19:48:43 2011 +++ src/lib/csu/arch/x86_64/crt0.S Fri Jul 1 02:59:05 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: crt0.S,v 1.2 2011/06/30 19:48:43 joerg Exp $ */ +/* $NetBSD: crt0.S,v 1.3 2011/07/01 02:59:05 joerg Exp $ */ /* * Copyright (c) 1998 Christos Zoulas @@ -35,9 +35,10 @@ #include machine/asm.h -RCSID($NetBSD: crt0.S,v 1.2 2011/06/30 19:48:43 joerg Exp $) +RCSID($NetBSD: crt0.S,v 1.3 2011/07/01 02:59:05 joerg Exp $) STRONG_ALIAS(_start,__start) + .hidden ___start _ENTRY(__start) andq$~15,%rsp
CVS commit: src/lib/csu/arch/powerpc
Module Name:src Committed By: matt Date: Tue Feb 8 02:02:26 UTC 2011 Added Files: src/lib/csu/arch/powerpc: Makefile.inc crt0.S crtbegin.S crtend.S crti.S crtn.S Log Message: First pass at new crtstuff for powerpc. Doesn't quite work yet (obj parameter to ___start seems to get corrupted sometimes) To generate a diff of this commit: cvs rdiff -u -r0 -r1.1 src/lib/csu/arch/powerpc/Makefile.inc \ src/lib/csu/arch/powerpc/crt0.S src/lib/csu/arch/powerpc/crtbegin.S \ src/lib/csu/arch/powerpc/crtend.S src/lib/csu/arch/powerpc/crti.S \ src/lib/csu/arch/powerpc/crtn.S Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Added files: Index: src/lib/csu/arch/powerpc/Makefile.inc diff -u /dev/null src/lib/csu/arch/powerpc/Makefile.inc:1.1 --- /dev/null Tue Feb 8 02:02:26 2011 +++ src/lib/csu/arch/powerpc/Makefile.inc Tue Feb 8 02:02:25 2011 @@ -0,0 +1,5 @@ +# $NetBSD: Makefile.inc,v 1.1 2011/02/08 02:02:25 matt Exp $ + +CPPFLAGS+= -DELFSIZE=32 + + Index: src/lib/csu/arch/powerpc/crt0.S diff -u /dev/null src/lib/csu/arch/powerpc/crt0.S:1.1 --- /dev/null Tue Feb 8 02:02:26 2011 +++ src/lib/csu/arch/powerpc/crt0.S Tue Feb 8 02:02:25 2011 @@ -0,0 +1,49 @@ +/*- + * Copyright (c) 2011 The NetBSD Foundation, Inc. + * All rights reserved. + * + * This code is derived from software contributed to The NetBSD Foundation + * by Matt Thomas of 3am Software Foundry. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + *notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + *notice, this list of conditions and the following disclaimer in the + *documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS + * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ + +#include powerpc/asm.h + +RCSID($NetBSD: crt0.S,v 1.1 2011/02/08 02:02:25 matt Exp $) + +STRONG_ALIAS(_start,__start) + + .weak _SDA_BASE_ + .weak _SDA_BASE2_ + +ENTRY_NOPROFILE(__start) + /* SVR4 ABI says small data is in r13 */ + lis %r13,_SDA_BASE_@ha + addi %r13,%r13,_SDA_BASE_@l + + /* E[mbedded] ABI says small data is in r2 */ + lis %r2,_SDA_BASE2_@ha + addi %r2,%r2,_SDA_BASE2_@l + + b ___start +END(__start) Index: src/lib/csu/arch/powerpc/crtbegin.S diff -u /dev/null src/lib/csu/arch/powerpc/crtbegin.S:1.1 --- /dev/null Tue Feb 8 02:02:26 2011 +++ src/lib/csu/arch/powerpc/crtbegin.S Tue Feb 8 02:02:25 2011 @@ -0,0 +1,268 @@ +/* $NetBSD: crtbegin.S,v 1.1 2011/02/08 02:02:25 matt Exp $ */ +/*- + * Copyright (c) 2011 The NetBSD Foundation, Inc. + * All rights reserved. + * + * This code is derived from software contributed to The NetBSD Foundation + * by Matt Thomas of 3am Software Foundry. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + *notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + *notice, this list of conditions and the following disclaimer in the + *documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS + * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS
CVS commit: src/lib/csu/arch/x86_64
Module Name:src Committed By: joerg Date: Tue Nov 30 18:37:59 UTC 2010 Modified Files: src/lib/csu/arch/x86_64: crtbegin.S Log Message: Fix stack alignment for non-constructor/destructor calls. AMD64 stack is 16 Byte aligned at the start of the function, so always push rbx. To generate a diff of this commit: cvs rdiff -u -r1.1 -r1.2 src/lib/csu/arch/x86_64/crtbegin.S Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/lib/csu/arch/x86_64/crtbegin.S diff -u src/lib/csu/arch/x86_64/crtbegin.S:1.1 src/lib/csu/arch/x86_64/crtbegin.S:1.2 --- src/lib/csu/arch/x86_64/crtbegin.S:1.1 Sat Aug 7 18:01:34 2010 +++ src/lib/csu/arch/x86_64/crtbegin.S Tue Nov 30 18:37:59 2010 @@ -1,4 +1,4 @@ -/* $NetBSD: crtbegin.S,v 1.1 2010/08/07 18:01:34 joerg Exp $ */ +/* $NetBSD: crtbegin.S,v 1.2 2010/11/30 18:37:59 joerg Exp $ */ /*- * Copyright (c) 2010 Joerg Sonnenberger jo...@netbsd.org * All rights reserved. @@ -30,7 +30,7 @@ #include machine/asm.h -RCSID($NetBSD: crtbegin.S,v 1.1 2010/08/07 18:01:34 joerg Exp $) +RCSID($NetBSD: crtbegin.S,v 1.2 2010/11/30 18:37:59 joerg Exp $) .section .ctors, aw, @progbits .align 8 @@ -82,6 +82,7 @@ je 1f ret 1: + pushq %rbx movb $1, __finished(%rip) @@ -93,7 +94,6 @@ 2: #endif - pushq %rbx leaq 8+__DTOR_LIST__(%rip), %rbx 3: movq (%rbx), %rax @@ -103,14 +103,13 @@ addq $8, %rbx jmp 3b 4: - popq %rbx cmpq $0, __deregister_frame_i...@gotpcrel(%rip) je 5f leaq __EH_FRAME_LIST__(%rip), %rdi call __deregister_frame_i...@plt 5: - + popq %rbx ret @@ -119,6 +118,7 @@ je 1f ret 1: + pushq %rbx movb $1, __initialized(%rip) cmpq $0, __register_frame_i...@gotpcrel(%rip) @@ -136,7 +136,6 @@ call _jv_registerclas...@plt 3: - pushq %rbx leaq -8+__CTOR_LIST_END__(%rip), %rbx 4: movq (%rbx), %rax