CVS commit: [matt-nb6-plus] src/lib/csu/arch/arm

2013-01-22 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Tue Jan 22 22:56:36 UTC 2013

Modified Files:
src/lib/csu/arch/arm [matt-nb6-plus]: Makefile.inc

Log Message:
If we are using aapcs (EABI), we must be using init/fini arrays


To generate a diff of this commit:
cvs rdiff -u -r1.1.10.1 -r1.1.10.2 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.1.10.1 src/lib/csu/arch/arm/Makefile.inc:1.1.10.2
--- src/lib/csu/arch/arm/Makefile.inc:1.1.10.1	Fri Nov 30 23:32:14 2012
+++ src/lib/csu/arch/arm/Makefile.inc	Tue Jan 22 22:56:35 2013
@@ -1,3 +1,7 @@
-# $NetBSD: Makefile.inc,v 1.1.10.1 2012/11/30 23:32:14 matt Exp $
+# $NetBSD: Makefile.inc,v 1.1.10.2 2013/01/22 22:56:35 matt Exp $
 
 CPPFLAGS+=	-DELFSIZE=32
+.if ${MACHINE_ARCH} == earm || ${MACHINE_ARCH} == earmeb \
+|| ${CPUFLAGS:M-mabi=aapcs*} != 
+CPPFLAGS+=  -DHAVE_INITFINI_ARRAY
+.endif



CVS commit: [matt-nb6-plus] src/lib/csu/arch/arm

2013-01-22 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Wed Jan 23 02:14:54 UTC 2013

Modified Files:
src/lib/csu/arch/arm [matt-nb6-plus]: Makefile.inc

Log Message:
Handle CPUFLAGS being empty


To generate a diff of this commit:
cvs rdiff -u -r1.1.10.2 -r1.1.10.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.1.10.2 src/lib/csu/arch/arm/Makefile.inc:1.1.10.3
--- src/lib/csu/arch/arm/Makefile.inc:1.1.10.2	Tue Jan 22 22:56:35 2013
+++ src/lib/csu/arch/arm/Makefile.inc	Wed Jan 23 02:14:54 2013
@@ -1,7 +1,7 @@
-# $NetBSD: Makefile.inc,v 1.1.10.2 2013/01/22 22:56:35 matt Exp $
+# $NetBSD: Makefile.inc,v 1.1.10.3 2013/01/23 02:14:54 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: [matt-nb6-plus] src/lib/csu/arch/arm

2012-11-30 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Fri Nov 30 23:32:14 UTC 2012

Modified Files:
src/lib/csu/arch/arm [matt-nb6-plus]: Makefile.inc crt0.S crti.S crtn.S
Added Files:
src/lib/csu/arch/arm [matt-nb6-plus]: crtbegin.S crtend.S

Log Message:
Pull from HEAD.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.1.10.1 src/lib/csu/arch/arm/Makefile.inc \
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.4.6.2 src/lib/csu/arch/arm/crtbegin.S
cvs rdiff -u -r0 -r1.2.6.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/Makefile.inc
diff -u src/lib/csu/arch/arm/Makefile.inc:1.1 src/lib/csu/arch/arm/Makefile.inc:1.1.10.1
--- src/lib/csu/arch/arm/Makefile.inc:1.1	Sat Aug  7 18:01:33 2010
+++ src/lib/csu/arch/arm/Makefile.inc	Fri Nov 30 23:32:14 2012
@@ -1,5 +1,3 @@
-# $NetBSD: Makefile.inc,v 1.1 2010/08/07 18:01:33 joerg Exp $
+# $NetBSD: Makefile.inc,v 1.1.10.1 2012/11/30 23:32:14 matt Exp $
 
 CPPFLAGS+=	-DELFSIZE=32
-
-
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.1.10.1
--- src/lib/csu/arch/arm/crt0.S:1.1	Sat Aug  7 18:01:33 2010
+++ src/lib/csu/arch/arm/crt0.S	Fri Nov 30 23:32:14 2012
@@ -1,11 +1,12 @@
-/*	$NetBSD: crt0.S,v 1.1 2010/08/07 18:01:33 joerg Exp $	*/
+/*	$NetBSD: crt0.S,v 1.1.10.1 2012/11/30 23:32:14 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,43 +15,41 @@
  * 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.1 2010/08/07 18:01:33 joerg Exp $)
+#include arm/asm.h
+
+RCSID($NetBSD: crt0.S,v 1.1.10.1 2012/11/30 23:32:14 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),
+	 *