[Midnightbsd-cvs] src [10425] trunk/lib/csu: initial add of new architectures.

laffer1 at midnightbsd.org laffer1 at midnightbsd.org
Tue Jun 5 18:44:36 EDT 2018


Revision: 10425
          http://svnweb.midnightbsd.org/src/?rev=10425
Author:   laffer1
Date:     2018-06-05 18:44:35 -0400 (Tue, 05 Jun 2018)
Log Message:
-----------
initial add of new architectures.

Added Paths:
-----------
    trunk/lib/csu/arm/
    trunk/lib/csu/arm/Makefile
    trunk/lib/csu/arm/crt1.c
    trunk/lib/csu/arm/crti.S
    trunk/lib/csu/arm/crtn.S
    trunk/lib/csu/ia64/
    trunk/lib/csu/ia64/Makefile
    trunk/lib/csu/ia64/crt1.S
    trunk/lib/csu/ia64/crti.S
    trunk/lib/csu/ia64/crtn.S
    trunk/lib/csu/mips/
    trunk/lib/csu/mips/Makefile
    trunk/lib/csu/mips/crt1.c
    trunk/lib/csu/mips/crti.S
    trunk/lib/csu/mips/crtn.S
    trunk/lib/csu/powerpc/
    trunk/lib/csu/powerpc/Makefile
    trunk/lib/csu/powerpc/crt1.c
    trunk/lib/csu/powerpc/crti.S
    trunk/lib/csu/powerpc/crtn.S
    trunk/lib/csu/powerpc64/
    trunk/lib/csu/powerpc64/Makefile
    trunk/lib/csu/powerpc64/crt1.c
    trunk/lib/csu/powerpc64/crti.S
    trunk/lib/csu/powerpc64/crtn.S

Added: trunk/lib/csu/arm/Makefile
===================================================================
--- trunk/lib/csu/arm/Makefile	                        (rev 0)
+++ trunk/lib/csu/arm/Makefile	2018-06-05 22:44:35 UTC (rev 10425)
@@ -0,0 +1,45 @@
+# $MidnightBSD$
+# $FreeBSD: stable/10/lib/csu/arm/Makefile 313582 2017-02-11 05:47:56Z ngie $
+
+.PATH: ${.CURDIR:H}/common
+
+SRCS=		crt1.c crti.S crtn.S
+OBJS=		${SRCS:N*.h:R:S/$/.o/g}
+OBJS+=		Scrt1.o gcrt1.o
+CFLAGS+=	-I${.CURDIR:H}/common \
+		-I${SRCTOP}/lib/libc/include
+
+all: ${OBJS}
+
+CLEANFILES=	${OBJS}
+CLEANFILES+=	crt1.s gcrt1.s Scrt1.s
+
+# See the comment in lib/csu/common/crtbrand.c for the reason crt1.c is not
+# directly compiled to .o files.
+
+crt1.s: crt1.c
+	${CC} ${CFLAGS} -S -o ${.TARGET} ${.CURDIR}/crt1.c
+	sed ${SED_FIX_NOTE} ${.TARGET}
+
+crt1.o: crt1.s
+	${CC} ${ACFLAGS} -c -o ${.TARGET} crt1.s
+
+gcrt1.s: crt1.c
+	${CC} ${CFLAGS} -DGCRT -S -o ${.TARGET} ${.CURDIR}/crt1.c
+	sed ${SED_FIX_NOTE} ${.TARGET}
+
+gcrt1.o: gcrt1.s
+	${CC} ${ACFLAGS} -c -o ${.TARGET} gcrt1.s
+
+Scrt1.s: crt1.c
+	${CC} ${CFLAGS} -fPIC -DPIC -S -o ${.TARGET} ${.CURDIR}/crt1.c
+	sed ${SED_FIX_NOTE} ${.TARGET}
+
+Scrt1.o: Scrt1.s
+	${CC} ${ACFLAGS} -c -o ${.TARGET} Scrt1.s
+
+realinstall:
+	${INSTALL} -o ${LIBOWN} -g ${LIBGRP} -m ${LIBMODE} \
+	    ${OBJS} ${DESTDIR}${LIBDIR}
+
+.include <bsd.lib.mk>


Property changes on: trunk/lib/csu/arm/Makefile
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+MidnightBSD=%H
\ No newline at end of property
Added: svn:mime-type
## -0,0 +1 ##
+text/plain
\ No newline at end of property
Added: trunk/lib/csu/arm/crt1.c
===================================================================
--- trunk/lib/csu/arm/crt1.c	                        (rev 0)
+++ trunk/lib/csu/arm/crt1.c	2018-06-05 22:44:35 UTC (rev 10425)
@@ -0,0 +1,131 @@
+/* $MidnightBSD$ */
+/* LINTLIBRARY */
+/*-
+ * Copyright 2001 David E. O'Brien.
+ * All rights reserved.
+ * Copyright 1996-1998 John D. Polstra.
+ * All rights reserved.
+ * Copyright (c) 1997 Jason R. Thorpe.
+ * Copyright (c) 1995 Christopher G. Demetriou
+ * 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.
+ * 3. All advertising materials mentioning features or use of this software
+ *    must display the following acknowledgement:
+ *          This product includes software developed for the
+ *          FreeBSD Project.  See http://www.freebsd.org/ for
+ *          information about FreeBSD.
+ *          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.
+ */
+
+#include <sys/cdefs.h>
+__FBSDID("$FreeBSD: stable/10/lib/csu/arm/crt1.c 300323 2016-05-20 19:14:15Z emaste $");
+
+#include <stdlib.h>
+
+#include "libc_private.h"
+#include "crtbrand.c"
+#include "ignore_init.c"
+
+struct Struct_Obj_Entry;
+struct ps_strings;
+
+extern void _start(int, char **, char **, const struct Struct_Obj_Entry *,
+    void (*)(void), struct ps_strings *);
+
+#ifdef GCRT
+extern void _mcleanup(void);
+extern void monstartup(void *, void *);
+extern int eprol;
+extern int etext;
+#endif
+
+struct ps_strings *__ps_strings;
+
+void __start(int, char **, char **, struct ps_strings *,
+    const struct Struct_Obj_Entry *, void (*)(void));
+
+/* The entry function. */
+__asm("	.text			\n"
+"	.align	0		\n"
+"	.globl	_start		\n"
+"	_start:			\n"
+"	mov	r5, r2		/* cleanup */		\n"
+"	mov	r4, r1		/* obj_main */		\n"
+"	mov	r3, r0		/* ps_strings */	\n"
+"	/* Get argc, argv, and envp from stack */	\n"
+"	ldr	r0, [sp, #0x0000]	\n"
+"	add	r1, sp, #0x0004		\n"
+"	add	r2, r1, r0, lsl #2	\n"
+"	add	r2, r2, #0x0004		\n"
+"	/* Ensure the stack is properly aligned before calling C code. */\n"
+"	bic	sp, sp, #7	\n"
+"	sub	sp, sp, #8	\n"
+"	str	r5, [sp, #4]	\n"
+"	str	r4, [sp, #0]	\n"
+"\n"
+"	b	 __start  ");
+/* ARGSUSED */
+void
+__start(int argc, char **argv, char **env, struct ps_strings *ps_strings,
+    const struct Struct_Obj_Entry *obj __unused, void (*cleanup)(void))
+{
+
+	handle_argv(argc, argv, env);
+
+	if (ps_strings != (struct ps_strings *)0)
+		__ps_strings = ps_strings;
+
+	if (&_DYNAMIC != NULL)
+		atexit(cleanup);
+	else
+		_init_tls();
+#ifdef GCRT
+	atexit(_mcleanup);
+	monstartup(&eprol, &etext);
+#endif
+	handle_static_init(argc, argv, env);
+	exit(main(argc, argv, env));
+}
+
+static const struct {
+	int32_t	namesz;
+	int32_t	descsz;
+	int32_t	type;
+	char	name[sizeof(NOTE_FREEBSD_VENDOR)];
+	char	desc[sizeof(MACHINE_ARCH)];
+} archtag __attribute__ ((section (NOTE_SECTION), aligned(4))) __used = {
+	.namesz = sizeof(NOTE_FREEBSD_VENDOR),
+	.descsz = sizeof(MACHINE_ARCH),
+	.type = ARCH_NOTETYPE,
+	.name = NOTE_FREEBSD_VENDOR,
+	.desc = MACHINE_ARCH
+};
+
+#ifdef GCRT
+__asm__(".text");
+__asm__("eprol:");
+__asm__(".previous");
+#endif


Property changes on: trunk/lib/csu/arm/crt1.c
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+MidnightBSD=%H
\ No newline at end of property
Added: svn:mime-type
## -0,0 +1 ##
+text/plain
\ No newline at end of property
Added: trunk/lib/csu/arm/crti.S
===================================================================
--- trunk/lib/csu/arm/crti.S	                        (rev 0)
+++ trunk/lib/csu/arm/crti.S	2018-06-05 22:44:35 UTC (rev 10425)
@@ -0,0 +1,22 @@
+/* $MidnightBSD$ */
+#include <machine/asm.h>
+__FBSDID("$FreeBSD: stable/10/lib/csu/arm/crti.S 135679 2004-09-23 23:00:51Z cognet $");
+
+	.section .init,"ax",%progbits
+	.align 4
+	.globl	_init
+	.type	_init,%function
+_init:
+	mov	ip, sp
+	stmdb	sp!, {fp, ip, lr, pc}
+	sub	fp, ip, #4
+
+	.section .fini,"ax",%progbits
+	.align 4
+	.globl	_fini
+	.type	_fini,%function
+_fini:
+	mov	ip, sp
+	stmdb	sp!, {fp, ip, lr, pc}
+	sub	fp, ip, #4
+


Property changes on: trunk/lib/csu/arm/crti.S
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+MidnightBSD=%H
\ No newline at end of property
Added: svn:mime-type
## -0,0 +1 ##
+text/plain
\ No newline at end of property
Added: trunk/lib/csu/arm/crtn.S
===================================================================
--- trunk/lib/csu/arm/crtn.S	                        (rev 0)
+++ trunk/lib/csu/arm/crtn.S	2018-06-05 22:44:35 UTC (rev 10425)
@@ -0,0 +1,11 @@
+/* $MidnightBSD$ */
+#include <machine/asm.h>
+__FBSDID("$FreeBSD: stable/10/lib/csu/arm/crtn.S 216338 2010-12-09 21:31:21Z dim $");
+
+	.section .init,"ax",%progbits
+	ldmea	fp, {fp, sp, pc}
+	mov	pc, lr
+
+	.section .fini,"ax",%progbits
+	ldmea	fp, {fp, sp, pc}
+	mov	pc, lr


Property changes on: trunk/lib/csu/arm/crtn.S
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+MidnightBSD=%H
\ No newline at end of property
Added: svn:mime-type
## -0,0 +1 ##
+text/plain
\ No newline at end of property
Added: trunk/lib/csu/ia64/Makefile
===================================================================
--- trunk/lib/csu/ia64/Makefile	                        (rev 0)
+++ trunk/lib/csu/ia64/Makefile	2018-06-05 22:44:35 UTC (rev 10425)
@@ -0,0 +1,63 @@
+# $MidnightBSD$
+# $FreeBSD: stable/10/lib/csu/ia64/Makefile 234502 2012-04-20 21:00:39Z dim $
+
+.PATH: ${.CURDIR}/../common
+
+SRCS=		crti.S crtn.S
+OBJS=		${SRCS:N*.h:R:S/$/.o/g}
+OBJS+=		crt1.o gcrt1.o Scrt1.o
+
+all: ${OBJS}
+
+CLEANFILES=	${OBJS}
+CLEANFILES+=	crt1_.o gcrt1_.o Scrt1_.o
+CLEANFILES+=	crtbrand.o gcrtbrand.o Scrtbrand.o
+CLEANFILES+=	crtbrand.s gcrtbrand.s Scrtbrand.s
+
+crt1_.o: crt1.S
+	${CC} ${CFLAGS} -c -o ${.TARGET} ${.ALLSRC}
+
+# See the comment in lib/csu/common/crtbrand.c for the reason crtbrand.c is not
+# directly compiled to .o files.
+
+crtbrand.s: crtbrand.c
+	${CC} ${CFLAGS} -S -o ${.TARGET} ${.ALLSRC}
+	sed -i "" -e '/\.note\.ABI-tag/s/progbits/note/' ${.TARGET}
+
+crtbrand.o: crtbrand.s
+	${CC} ${ACFLAGS} -c -o ${.TARGET} crtbrand.s
+
+crt1.o: crt1_.o crtbrand.o
+	${LD} ${LDFLAGS} -r -o ${.TARGET} crt1_.o crtbrand.o
+
+gcrt1_.o: crt1.S
+	${CC} ${CFLAGS} -DGCRT -c -o ${.TARGET} ${.ALLSRC}
+
+gcrtbrand.s: crtbrand.c
+	${CC} ${CFLAGS} -DGCRT -S -o ${.TARGET} ${.ALLSRC}
+	sed -i "" -e '/\.note\.ABI-tag/s/progbits/note/' ${.TARGET}
+
+gcrtbrand.o: gcrtbrand.s
+	${CC} ${ACFLAGS} -c -o ${.TARGET} gcrtbrand.s
+
+gcrt1.o: gcrt1_.o gcrtbrand.o
+	${LD} ${LDFLAGS} -r -o ${.TARGET} ${.ALLSRC}
+
+Scrt1_.o: crt1.S
+	${CC} ${CFLAGS} -fPIC -DPIC -c -o ${.TARGET} ${.ALLSRC}
+
+Scrtbrand.s: crtbrand.c
+	${CC} ${CFLAGS} -fPIC -DPIC -S -o ${.TARGET} ${.ALLSRC}
+	sed -i "" -e '/\.note\.ABI-tag/s/progbits/note/' ${.TARGET}
+
+Scrtbrand.o: Scrtbrand.s
+	${CC} ${ACFLAGS} -c -o ${.TARGET} Scrtbrand.s
+
+Scrt1.o: Scrt1_.o Scrtbrand.o
+	${LD} ${LDFLAGS} -r -o ${.TARGET} ${.ALLSRC}
+
+realinstall:
+	${INSTALL} -o ${LIBOWN} -g ${LIBGRP} -m ${LIBMODE} \
+	    ${OBJS} ${DESTDIR}${LIBDIR}
+
+.include <bsd.lib.mk>


Property changes on: trunk/lib/csu/ia64/Makefile
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+MidnightBSD=%H
\ No newline at end of property
Added: svn:mime-type
## -0,0 +1 ##
+text/plain
\ No newline at end of property
Added: trunk/lib/csu/ia64/crt1.S
===================================================================
--- trunk/lib/csu/ia64/crt1.S	                        (rev 0)
+++ trunk/lib/csu/ia64/crt1.S	2018-06-05 22:44:35 UTC (rev 10425)
@@ -0,0 +1,198 @@
+/* $MidnightBSD$ */
+/*
+ * Copyright (c) 2003 Marcel Moolenaar
+ * 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 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.
+ */
+
+#include <machine/asm.h>
+__FBSDID("$FreeBSD: stable/10/lib/csu/ia64/crt1.S 216338 2010-12-09 21:31:21Z dim $");
+
+		.text
+
+/*
+ * void _start(char **ap, struct ps_strings *, void (*cleanup)(void));
+ */
+#define	AP		in0
+#define	CLEANUP		in2
+
+#define	GP		loc0
+#define	ARGC		loc1
+#define	ARGV		loc2
+#define	ENVP		loc3
+
+		.global		_start
+		.type		_start, @function
+		.proc		_start
+_start:
+		.prologue
+		.save		rp, r0
+		.body
+{		.mlx
+		alloc		r14=ar.pfs,3,4,3,0
+		movl		r15=@gprel(1f)
+}
+1:
+{		.mmi
+		ld4		ARGC=[AP]
+		adds		ARGV=8,AP
+		mov		r16=ip
+		;;
+}
+{		.mmi
+		sub		gp=r16,r15
+		sub		GP=r16,r15
+		shladd		r14=ARGC,3,AP
+		;;
+}
+{		.mii
+		addl		r15=@ltoff(environ),gp
+		cmp4.ge		p6,p7=0,ARGC
+		adds		ENVP=16,r14
+		;;
+}
+{		.mmi
+		ld8		r14=[r15]
+(p7)		ld8		r15=[ARGV]
+		addl		r16=@gprel(__progname),gp
+		;;
+}
+{		.mib
+		st8		[r14]=ENVP
+(p7)		cmp.eq		p6,p0=0,r15
+(p6)		br.dpnt		.L1
+		;;
+}
+		/* Normalize __progname. */
+{		.mmi
+		st8		[r16]=r15
+		ld1		r14=[r15],1
+		nop		0
+		;;
+}
+.L0:
+{		.mib
+		cmp4.eq		p7,p0=0,r14
+		cmp4.eq		p6,p0=0x2f,r14
+(p7)		br.dptk		.L1
+		;;
+}
+{		.mmb
+(p6)		st8		[r16]=r15
+		ld1		r14=[r15],1
+		br.dptk.many	.L0
+}
+.L1:
+{		.mib
+		cmp.ne		p7,p0=0,CLEANUP
+		mov		out0=CLEANUP
+(p7)		br.call.sptk	b0=atexit
+		;;
+}
+{		.mfb
+		mov		gp=GP
+		nop		0
+		br.call.sptk	b0=_init_tls
+}
+#ifdef GCRT
+{		.mmi
+		mov		gp=GP
+		;;
+		addl		r14=@ltoff(@fptr(_mcleanup)),gp
+		nop		0
+		;;
+}
+{		.mfb
+		ld8		out0=[r14]
+		nop		0
+		br.call.sptk	b0=atexit
+		;;
+}
+#endif
+{		.mmi
+		mov		gp=GP
+		;;
+		addl		r14=@ltoff(@fptr(_fini)),gp
+		nop		0
+		;;
+}
+{		.mfb
+		ld8		out0=[r14]
+		nop		0
+		br.call.sptk	b0=atexit
+		;;
+}
+#ifdef GCRT
+{		.mmi
+		mov		gp=GP
+		;;
+		addl		r14=@ltoff(eprol),gp
+		addl		r15=@ltoff(etext),gp
+		;;
+}
+{		.mmb
+		ld8		out0=[r14]
+		ld8		out1=[r15]
+		br.call.sptk	b0=monstartup
+		;;
+}
+#endif
+{		.mfb
+		mov		gp=GP
+		nop		0
+		br.call.sptk	b0=_init
+		;;
+}
+{		.mmi
+		mov		gp=GP
+		mov		out0=ARGC
+		mov		out1=ARGV
+}
+{		.mfb
+		mov		out2=ENVP
+		nop		0
+		br.call.sptk	b0=main
+		;;
+}
+{		.mib
+		mov		gp=GP
+		mov		out0=r8
+		br.call.sptk	b0=exit
+		;;
+}
+		.endp		_start
+
+#ifdef GCRT
+eprol:
+#endif
+
+		.rodata
+.empty:		stringz		""
+
+		.sdata
+		.global		__progname
+		.size		__progname,8
+		.type		__progname, at object
+__progname:	data8		.empty
+
+		.common		environ,8,8


Property changes on: trunk/lib/csu/ia64/crt1.S
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+MidnightBSD=%H
\ No newline at end of property
Added: svn:mime-type
## -0,0 +1 ##
+text/plain
\ No newline at end of property
Added: trunk/lib/csu/ia64/crti.S
===================================================================
--- trunk/lib/csu/ia64/crti.S	                        (rev 0)
+++ trunk/lib/csu/ia64/crti.S	2018-06-05 22:44:35 UTC (rev 10425)
@@ -0,0 +1,61 @@
+/* $MidnightBSD$ */
+/*-
+ * Copyright (c) 2001 Peter Wemm <peter at FreeBSD.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 AUTHOR 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 AUTHOR 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.
+ *
+ * $FreeBSD: stable/10/lib/csu/ia64/crti.S 216338 2010-12-09 21:31:21Z dim $
+ */
+
+#include <machine/asm.h>
+__FBSDID("$FreeBSD: stable/10/lib/csu/ia64/crti.S 216338 2010-12-09 21:31:21Z dim $");
+
+/*
+ * This file (and its companion crtn.S) form the terminators of the
+ * .init and .fini sections.
+ */
+	.file	"crti.S"
+
+	.section .init,"ax", at progbits
+	.global	_init#
+	.proc	_init#
+_init:
+	.regstk	0,2,0,0
+	.prologue 12,loc0
+	.save	ar.pfs,loc1
+	alloc	loc1=ar.pfs,0,2,0,0
+	mov	loc0=b0			/* Save return addr */
+	.body
+	.endp	_init#
+
+	.section .fini,"ax", at progbits
+	.global	_fini#
+	.proc	_fini#
+_fini:
+	.regstk	0,2,0,0
+	.prologue 12,loc0
+	.save	ar.pfs,loc1
+	alloc	loc1=ar.pfs,0,2,0,0
+	mov	loc0=b0			/* Save return addr */
+	.body
+	.endp	_fini#


Property changes on: trunk/lib/csu/ia64/crti.S
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+MidnightBSD=%H
\ No newline at end of property
Added: svn:mime-type
## -0,0 +1 ##
+text/plain
\ No newline at end of property
Added: trunk/lib/csu/ia64/crtn.S
===================================================================
--- trunk/lib/csu/ia64/crtn.S	                        (rev 0)
+++ trunk/lib/csu/ia64/crtn.S	2018-06-05 22:44:35 UTC (rev 10425)
@@ -0,0 +1,45 @@
+/* $MidnightBSD$ */
+/*-
+ * Copyright (c) 2001 Peter Wemm <peter at FreeBSD.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 AUTHOR 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 AUTHOR 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.
+ *
+ * $FreeBSD: stable/10/lib/csu/ia64/crtn.S 216338 2010-12-09 21:31:21Z dim $
+ */
+
+#include <machine/asm.h>
+__FBSDID("$FreeBSD: stable/10/lib/csu/ia64/crtn.S 216338 2010-12-09 21:31:21Z dim $");
+
+	.file	"crtn.S"
+
+	.section .init,"ax", at progbits
+	.regstk 0,2,0,0
+	mov	b0=loc0			/* Recover return addr */
+	mov	ar.pfs=loc1
+	br.ret.sptk.many b0
+
+	.section .fini,"ax", at progbits
+	.regstk 0,2,0,0
+	mov	b0=loc0			/* Recover return addr */
+	mov	ar.pfs=loc1
+	br.ret.sptk.many b0


Property changes on: trunk/lib/csu/ia64/crtn.S
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+MidnightBSD=%H
\ No newline at end of property
Added: svn:mime-type
## -0,0 +1 ##
+text/plain
\ No newline at end of property
Added: trunk/lib/csu/mips/Makefile
===================================================================
--- trunk/lib/csu/mips/Makefile	                        (rev 0)
+++ trunk/lib/csu/mips/Makefile	2018-06-05 22:44:35 UTC (rev 10425)
@@ -0,0 +1,45 @@
+# $MidnightBSD$
+# $FreeBSD: stable/10/lib/csu/mips/Makefile 313582 2017-02-11 05:47:56Z ngie $
+
+.PATH: ${.CURDIR:H}/common
+
+SRCS=		crt1.c crti.S crtn.S
+OBJS=		${SRCS:N*.h:R:S/$/.o/g}
+OBJS+=		Scrt1.o gcrt1.o
+CFLAGS+=	-I${.CURDIR:H}/common \
+		-I${SRCTOP}/lib/libc/include
+
+all: ${OBJS}
+
+CLEANFILES=	${OBJS}
+CLEANFILES+=	crt1.s gcrt1.s Scrt1.s
+
+# See the comment in lib/csu/common/crtbrand.c for the reason crt1.c is not
+# directly compiled to .o files.
+
+crt1.s: crt1.c
+	${CC} ${CFLAGS} -S -o ${.TARGET} ${.CURDIR}/crt1.c
+	sed ${SED_FIX_NOTE} ${.TARGET}
+
+crt1.o: crt1.s
+	${CC} ${ACFLAGS} -c -o ${.TARGET} crt1.s
+
+gcrt1.s: crt1.c
+	${CC} ${CFLAGS} -DGCRT -S -o ${.TARGET} ${.CURDIR}/crt1.c
+	sed ${SED_FIX_NOTE} ${.TARGET}
+
+gcrt1.o: gcrt1.s
+	${CC} ${ACFLAGS} -c -o ${.TARGET} gcrt1.s
+
+Scrt1.s: crt1.c
+	${CC} ${CFLAGS} -fPIC -DPIC -S -o ${.TARGET} ${.CURDIR}/crt1.c
+	sed ${SED_FIX_NOTE} ${.TARGET}
+
+Scrt1.o: Scrt1.s
+	${CC} ${ACFLAGS} -c -o ${.TARGET} Scrt1.s
+
+realinstall:
+	${INSTALL} -o ${LIBOWN} -g ${LIBGRP} -m ${LIBMODE} \
+	    ${OBJS} ${DESTDIR}${LIBDIR}
+
+.include <bsd.lib.mk>


Property changes on: trunk/lib/csu/mips/Makefile
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+MidnightBSD=%H
\ No newline at end of property
Added: svn:mime-type
## -0,0 +1 ##
+text/plain
\ No newline at end of property
Added: trunk/lib/csu/mips/crt1.c
===================================================================
--- trunk/lib/csu/mips/crt1.c	                        (rev 0)
+++ trunk/lib/csu/mips/crt1.c	2018-06-05 22:44:35 UTC (rev 10425)
@@ -0,0 +1,91 @@
+/* $MidnightBSD$ */
+/*-
+ * Copyright 1996-1998 John D. Polstra.
+ * All rights reserved.
+ * Copyright (c) 1995 Christopher G. Demetriou
+ * 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.
+ * 3. All advertising materials mentioning features or use of this software
+ *    must display the following acknowledgement:
+ *      This product includes software developed by Christopher G. Demetriou
+ *    for the NetBSD Project.
+ * 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.
+ *
+ * $FreeBSD: stable/10/lib/csu/mips/crt1.c 300323 2016-05-20 19:14:15Z emaste $
+ */
+
+#include <sys/cdefs.h>
+__FBSDID("$FreeBSD: stable/10/lib/csu/mips/crt1.c 300323 2016-05-20 19:14:15Z emaste $");
+
+#include <stdlib.h>
+#include "libc_private.h"
+#include "crtbrand.c"
+#include "ignore_init.c"
+
+struct Struct_Obj_Entry;
+struct ps_strings;
+
+#ifdef GCRT
+extern void _mcleanup(void);
+extern void monstartup(void *, void *);
+extern int eprol;
+extern int etext;
+#endif
+
+void __start(char **, void (*)(void), struct Struct_Obj_Entry *, struct ps_strings *);
+
+/* The entry function. */
+void
+__start(char **ap,
+	void (*cleanup)(void),			/* from shared loader */
+	struct Struct_Obj_Entry *obj __unused,	/* from shared loader */
+	struct ps_strings *ps_strings __unused)
+{
+	int argc;
+	char **argv;
+	char **env;
+
+	argc = * (long *) ap;
+	argv = ap + 1;
+	env  = ap + 2 + argc;
+	handle_argv(argc, argv, env);
+
+	if (&_DYNAMIC != NULL)
+		atexit(cleanup);
+	else
+		_init_tls();
+
+#ifdef GCRT
+	atexit(_mcleanup);
+	monstartup(&eprol, &etext);
+#endif
+
+	handle_static_init(argc, argv, env);
+	exit(main(argc, argv, env));
+}
+
+#ifdef GCRT
+__asm__(".text");
+__asm__("eprol:");
+__asm__(".previous");
+#endif


Property changes on: trunk/lib/csu/mips/crt1.c
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+MidnightBSD=%H
\ No newline at end of property
Added: svn:mime-type
## -0,0 +1 ##
+text/plain
\ No newline at end of property
Added: trunk/lib/csu/mips/crti.S
===================================================================
--- trunk/lib/csu/mips/crti.S	                        (rev 0)
+++ trunk/lib/csu/mips/crti.S	2018-06-05 22:44:35 UTC (rev 10425)
@@ -0,0 +1,51 @@
+/* $MidnightBSD$ */
+#include <machine/asm.h>
+__FBSDID("$FreeBSD: stable/10/lib/csu/mips/crti.S 205112 2010-03-13 02:10:20Z jmallett $");
+
+	.section .init,"ax",%progbits
+	.align 4
+	.globl	_init
+	.type	_init,%function
+_init:
+	.set noreorder
+#if defined(__ABICALLS__) && (defined(__mips_o32) || defined(__mips_o64))
+	SETUP_GP
+#endif
+	PTR_ADDU sp, sp, -CALLFRAME_SIZ
+	REG_S	ra, CALLFRAME_RA(sp)
+#if defined(__ABICALLS__)
+#if defined(__mips_o32) || defined(__mips_o64)
+	SAVE_GP(CALLFRAME_GP)
+#else
+	SETUP_GP64(CALLFRAME_GP, _init)
+#endif
+#else /* __ABICALLS__ */
+#if defined(__mips_n32) || defined(__mips_n64)
+	REG_S	gp, CALLFRAME_GP(sp)
+#endif
+#endif
+	.set reorder
+
+	.section .fini,"ax",%progbits
+	.align 4
+	.globl	_fini
+	.type	_fini,%function
+_fini:
+	.set noreorder
+#if defined(__ABICALLS__) && (defined(__mips_o32) || defined(__mips_o64))
+	SETUP_GP
+#endif
+	PTR_ADDU sp, sp, -CALLFRAME_SIZ
+	REG_S	ra, CALLFRAME_RA(sp)
+#if defined(__ABICALLS__)
+#if defined(__mips_o32) || defined(__mips_o64)
+	SAVE_GP(CALLFRAME_GP)
+#else
+	SETUP_GP64(CALLFRAME_GP, _fini)
+#endif
+#else /* __ABICALLS__ */
+#if defined(__mips_n32) || defined(__mips_n64)
+	REG_S	gp, CALLFRAME_GP(sp)
+#endif
+#endif
+	.set reorder


Property changes on: trunk/lib/csu/mips/crti.S
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+MidnightBSD=%H
\ No newline at end of property
Added: svn:mime-type
## -0,0 +1 ##
+text/plain
\ No newline at end of property
Added: trunk/lib/csu/mips/crtn.S
===================================================================
--- trunk/lib/csu/mips/crtn.S	                        (rev 0)
+++ trunk/lib/csu/mips/crtn.S	2018-06-05 22:44:35 UTC (rev 10425)
@@ -0,0 +1,25 @@
+/* $MidnightBSD$ */
+#include <machine/asm.h>
+__FBSDID("$FreeBSD: stable/10/lib/csu/mips/crtn.S 204674 2010-03-03 21:59:23Z imp $");
+
+	.section .init,"ax",%progbits
+	.align 4
+	.set noreorder
+#if defined(__ABICALLS__) && (defined(__mips_n32) || defined(__mips_n64))
+	REG_L	gp, CALLFRAME_GP(sp)
+#endif
+	REG_L	ra, CALLFRAME_RA(sp)
+	jr	ra
+	PTR_ADDU sp, sp, CALLFRAME_SIZ
+	.set reorder
+
+	.section .fini,"ax",%progbits
+	.align 4
+	.set noreorder
+#if defined(__ABICALLS__) && (defined(__mips_n32) || defined(__mips_n64))
+	REG_L	gp, CALLFRAME_GP(sp)
+#endif
+	REG_L	ra, CALLFRAME_RA(sp)
+	jr	ra
+	PTR_ADDU sp, sp, CALLFRAME_SIZ
+	.set reorder


Property changes on: trunk/lib/csu/mips/crtn.S
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+MidnightBSD=%H
\ No newline at end of property
Added: svn:mime-type
## -0,0 +1 ##
+text/plain
\ No newline at end of property
Added: trunk/lib/csu/powerpc/Makefile
===================================================================
--- trunk/lib/csu/powerpc/Makefile	                        (rev 0)
+++ trunk/lib/csu/powerpc/Makefile	2018-06-05 22:44:35 UTC (rev 10425)
@@ -0,0 +1,45 @@
+# $MidnightBSD$
+# $FreeBSD: stable/10/lib/csu/powerpc/Makefile 313582 2017-02-11 05:47:56Z ngie $
+
+.PATH: ${.CURDIR:H}/common
+
+SRCS=		crt1.c crti.S crtn.S
+OBJS=		${SRCS:N*.h:R:S/$/.o/g}
+OBJS+=		Scrt1.o gcrt1.o
+CFLAGS+=	-I${.CURDIR:H}/common \
+		-I${SRCTOP}/lib/libc/include
+
+all: ${OBJS}
+
+CLEANFILES=	${OBJS}
+CLEANFILES+=	crt1.s gcrt1.s Scrt1.s
+
+# See the comment in lib/csu/common/crtbrand.c for the reason crt1.c is not
+# directly compiled to .o files.
+
+crt1.s: crt1.c
+	${CC} ${CFLAGS} -S -o ${.TARGET} ${.CURDIR}/crt1.c
+	sed ${SED_FIX_NOTE} ${.TARGET}
+
+crt1.o: crt1.s
+	${CC} ${ACFLAGS} -c -o ${.TARGET} crt1.s
+
+gcrt1.s: crt1.c
+	${CC} ${CFLAGS} -DGCRT -S -o ${.TARGET} ${.CURDIR}/crt1.c
+	sed ${SED_FIX_NOTE} ${.TARGET}
+
+gcrt1.o: gcrt1.s
+	${CC} ${ACFLAGS} -c -o ${.TARGET} gcrt1.s
+
+Scrt1.s: crt1.c
+	${CC} ${CFLAGS} -fPIC -DPIC -S -o ${.TARGET} ${.CURDIR}/crt1.c
+	sed ${SED_FIX_NOTE} ${.TARGET}
+
+Scrt1.o: Scrt1.s
+	${CC} ${ACFLAGS} -c -o ${.TARGET} Scrt1.s
+
+realinstall:
+	${INSTALL} -o ${LIBOWN} -g ${LIBGRP} -m ${LIBMODE} \
+	    ${OBJS} ${DESTDIR}${LIBDIR}
+
+.include <bsd.lib.mk>


Property changes on: trunk/lib/csu/powerpc/Makefile
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+MidnightBSD=%H
\ No newline at end of property
Added: svn:mime-type
## -0,0 +1 ##
+text/plain
\ No newline at end of property
Added: trunk/lib/csu/powerpc/crt1.c
===================================================================
--- trunk/lib/csu/powerpc/crt1.c	                        (rev 0)
+++ trunk/lib/csu/powerpc/crt1.c	2018-06-05 22:44:35 UTC (rev 10425)
@@ -0,0 +1,103 @@
+/* $MidnightBSD$ */
+/* LINTLIBRARY */
+/*-
+ * Copyright 2001 David E. O'Brien.
+ * All rights reserved.
+ * Copyright 1996-1998 John D. Polstra.
+ * All rights reserved.
+ * Copyright (c) 1997 Jason R. Thorpe.
+ * Copyright (c) 1995 Christopher G. Demetriou
+ * 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.
+ * 3. All advertising materials mentioning features or use of this software
+ *    must display the following acknowledgement:
+ *          This product includes software developed for the
+ *          FreeBSD Project.  See http://www.freebsd.org/ for
+ *          information about FreeBSD.
+ *          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.
+ */
+
+#include <sys/cdefs.h>
+__FBSDID("$FreeBSD: stable/10/lib/csu/powerpc/crt1.c 300323 2016-05-20 19:14:15Z emaste $");
+
+#include <stdlib.h>
+
+#include "libc_private.h"
+#include "crtbrand.c"
+#include "ignore_init.c"
+
+struct Struct_Obj_Entry;
+struct ps_strings;
+
+#ifdef GCRT
+extern void _mcleanup(void);
+extern void monstartup(void *, void *);
+extern int eprol;
+extern int etext;
+#endif
+
+struct ps_strings *__ps_strings;
+
+void _start(int, char **, char **, const struct Struct_Obj_Entry *,
+    void (*)(void), struct ps_strings *);
+
+/* The entry function. */
+/*
+ * First 5 arguments are specified by the PowerPC SVR4 ABI.
+ * The last argument, ps_strings, is a BSD extension.
+ */
+/* ARGSUSED */
+void
+_start(int argc, char **argv, char **env,
+    const struct Struct_Obj_Entry *obj __unused, void (*cleanup)(void),
+    struct ps_strings *ps_strings)
+{
+
+
+	handle_argv(argc, argv, env);
+
+	if (ps_strings != (struct ps_strings *)0)
+		__ps_strings = ps_strings;
+
+	if (&_DYNAMIC != NULL)
+		atexit(cleanup);
+	else
+		_init_tls();
+
+#ifdef GCRT
+	atexit(_mcleanup);
+	monstartup(&eprol, &etext);
+#endif
+
+	handle_static_init(argc, argv, env);
+	exit(main(argc, argv, env));
+}
+
+#ifdef GCRT
+__asm__(".text");
+__asm__("eprol:");
+__asm__(".previous");
+#endif


Property changes on: trunk/lib/csu/powerpc/crt1.c
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+MidnightBSD=%H
\ No newline at end of property
Added: svn:mime-type
## -0,0 +1 ##
+text/plain
\ No newline at end of property
Added: trunk/lib/csu/powerpc/crti.S
===================================================================
--- trunk/lib/csu/powerpc/crti.S	                        (rev 0)
+++ trunk/lib/csu/powerpc/crti.S	2018-06-05 22:44:35 UTC (rev 10425)
@@ -0,0 +1,52 @@
+/* $MidnightBSD$ */
+/*-
+ * Copyright 2001 David E. O'Brien
+ * 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 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.
+ */
+
+#include <machine/asm.h>
+__FBSDID("$FreeBSD: stable/10/lib/csu/powerpc/crti.S 217399 2011-01-14 11:34:58Z kib $");
+
+	.section .init,"ax", at progbits
+	.align	2
+	.globl	_init
+	.type	_init, at function
+_init:
+	stwu 1,-16(1)
+	mflr 0
+	stw 31,12(1)
+	stw 0,20(1)
+	mr 31,1
+
+
+	.section .fini,"ax", at progbits
+	.align	2
+	.globl	_fini
+_fini:
+	stwu 1,-16(1)
+	mflr 0
+	stw 31,12(1)
+	stw 0,20(1)
+	mr 31,1
+
+	.section .note.GNU-stack,"",%progbits


Property changes on: trunk/lib/csu/powerpc/crti.S
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+MidnightBSD=%H
\ No newline at end of property
Added: svn:mime-type
## -0,0 +1 ##
+text/plain
\ No newline at end of property
Added: trunk/lib/csu/powerpc/crtn.S
===================================================================
--- trunk/lib/csu/powerpc/crtn.S	                        (rev 0)
+++ trunk/lib/csu/powerpc/crtn.S	2018-06-05 22:44:35 UTC (rev 10425)
@@ -0,0 +1,47 @@
+/* $MidnightBSD$ */
+/*-
+ * Copyright 2001 David E. O'Brien
+ * 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 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.
+ */
+
+#include <machine/asm.h>
+__FBSDID("$FreeBSD: stable/10/lib/csu/powerpc/crtn.S 217399 2011-01-14 11:34:58Z kib $");
+
+	.section .init,"ax", at progbits
+	lwz 11,0(1)
+	lwz 0,4(11)
+	mtlr 0
+	lwz 31,-4(11)
+	mr 1,11
+	blr
+
+
+	.section .fini,"ax", at progbits
+	lwz 11,0(1)
+	lwz 0,4(11)
+	mtlr 0
+	lwz 31,-4(11)
+	mr 1,11
+	blr
+
+	.section .note.GNU-stack,"",%progbits


Property changes on: trunk/lib/csu/powerpc/crtn.S
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+MidnightBSD=%H
\ No newline at end of property
Added: svn:mime-type
## -0,0 +1 ##
+text/plain
\ No newline at end of property
Added: trunk/lib/csu/powerpc64/Makefile
===================================================================
--- trunk/lib/csu/powerpc64/Makefile	                        (rev 0)
+++ trunk/lib/csu/powerpc64/Makefile	2018-06-05 22:44:35 UTC (rev 10425)
@@ -0,0 +1,46 @@
+# $MidnightBSD$
+# $FreeBSD: stable/10/lib/csu/powerpc64/Makefile 313582 2017-02-11 05:47:56Z ngie $
+
+.PATH: ${.CURDIR:H}/common
+
+SRCS=		crt1.c crti.S crtn.S
+OBJS=		${SRCS:N*.h:R:S/$/.o/g}
+OBJS+=		Scrt1.o gcrt1.o
+CFLAGS+=	-I${.CURDIR:H}/common \
+		-I${SRCTOP}/lib/libc/include \
+		-mlongcall
+
+all: ${OBJS}
+
+CLEANFILES=	${OBJS}
+CLEANFILES+=	crt1.s gcrt1.s Scrt1.s
+
+# See the comment in lib/csu/common/crtbrand.c for the reason crt1.c is not
+# directly compiled to .o files.
+
+crt1.s: crt1.c
+	${CC} ${CFLAGS} -S -o ${.TARGET} ${.CURDIR}/crt1.c
+	sed ${SED_FIX_NOTE} ${.TARGET}
+
+crt1.o: crt1.s
+	${CC} ${ACFLAGS} -c -o ${.TARGET} crt1.s
+
+gcrt1.s: crt1.c
+	${CC} ${CFLAGS} -DGCRT -S -o ${.TARGET} ${.CURDIR}/crt1.c
+	sed ${SED_FIX_NOTE} ${.TARGET}
+
+gcrt1.o: gcrt1.s
+	${CC} ${ACFLAGS} -c -o ${.TARGET} gcrt1.s
+
+Scrt1.s: crt1.c
+	${CC} ${CFLAGS} -fPIC -DPIC -S -o ${.TARGET} ${.CURDIR}/crt1.c
+	sed ${SED_FIX_NOTE} ${.TARGET}
+
+Scrt1.o: Scrt1.s
+	${CC} ${ACFLAGS} -c -o ${.TARGET} Scrt1.s
+
+realinstall:
+	${INSTALL} -o ${LIBOWN} -g ${LIBGRP} -m ${LIBMODE} \
+	    ${OBJS} ${DESTDIR}${LIBDIR}
+
+.include <bsd.lib.mk>


Property changes on: trunk/lib/csu/powerpc64/Makefile
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+MidnightBSD=%H
\ No newline at end of property
Added: svn:mime-type
## -0,0 +1 ##
+text/plain
\ No newline at end of property
Added: trunk/lib/csu/powerpc64/crt1.c
===================================================================
--- trunk/lib/csu/powerpc64/crt1.c	                        (rev 0)
+++ trunk/lib/csu/powerpc64/crt1.c	2018-06-05 22:44:35 UTC (rev 10425)
@@ -0,0 +1,102 @@
+/* $MidnightBSD$ */
+/* LINTLIBRARY */
+/*-
+ * Copyright 2001 David E. O'Brien.
+ * All rights reserved.
+ * Copyright 1996-1998 John D. Polstra.
+ * All rights reserved.
+ * Copyright (c) 1997 Jason R. Thorpe.
+ * Copyright (c) 1995 Christopher G. Demetriou
+ * 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.
+ * 3. All advertising materials mentioning features or use of this software
+ *    must display the following acknowledgement:
+ *          This product includes software developed for the
+ *          FreeBSD Project.  See http://www.freebsd.org/ for
+ *          information about FreeBSD.
+ *          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.
+ */
+
+#include <sys/cdefs.h>
+__FBSDID("$FreeBSD: stable/10/lib/csu/powerpc64/crt1.c 300323 2016-05-20 19:14:15Z emaste $");
+
+#include <stdlib.h>
+
+#include "libc_private.h"
+#include "crtbrand.c"
+#include "ignore_init.c"
+
+struct Struct_Obj_Entry;
+struct ps_strings;
+
+extern void _start(int, char **, char **, const struct Struct_Obj_Entry *,
+    void (*)(void), struct ps_strings *);
+
+#ifdef GCRT
+extern void _mcleanup(void);
+extern void monstartup(void *, void *);
+extern int eprol;
+extern int etext;
+#endif
+
+struct ps_strings *__ps_strings;
+
+/* The entry function. */
+/*
+ * First 5 arguments are specified by the PowerPC SVR4 ABI.
+ * The last argument, ps_strings, is a BSD extension.
+ */
+/* ARGSUSED */
+void
+_start(int argc, char **argv, char **env,
+    const struct Struct_Obj_Entry *obj __unused, void (*cleanup)(void),
+    struct ps_strings *ps_strings)
+{
+
+	handle_argv(argc, argv, env);
+
+	if (ps_strings != (struct ps_strings *)0)
+		__ps_strings = ps_strings;
+
+	if (&_DYNAMIC != NULL)
+		atexit(cleanup);
+	else
+		_init_tls();
+
+#ifdef GCRT
+	atexit(_mcleanup);
+	monstartup(&eprol, &etext);
+#endif
+
+	handle_static_init(argc, argv, env);
+	exit(main(argc, argv, env));
+}
+
+#ifdef GCRT
+__asm__(".text");
+__asm__("eprol:");
+__asm__(".previous");
+#endif


Property changes on: trunk/lib/csu/powerpc64/crt1.c
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+MidnightBSD=%H
\ No newline at end of property
Added: svn:mime-type
## -0,0 +1 ##
+text/plain
\ No newline at end of property
Added: trunk/lib/csu/powerpc64/crti.S
===================================================================
--- trunk/lib/csu/powerpc64/crti.S	                        (rev 0)
+++ trunk/lib/csu/powerpc64/crti.S	2018-06-05 22:44:35 UTC (rev 10425)
@@ -0,0 +1,62 @@
+/* $MidnightBSD$ */
+/*-
+ * Copyright 2001 David E. O'Brien
+ * 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 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.
+ */
+
+#include <machine/asm.h>
+__FBSDID("$FreeBSD: stable/10/lib/csu/powerpc64/crti.S 218824 2011-02-18 21:44:53Z nwhitehorn $");
+
+	.section .init,"ax", at progbits
+	.align	2
+	.globl	_init
+	.section ".opd","aw"
+	.align	3
+_init:
+	.quad	.L._init,.TOC. at tocbase,0
+	.previous
+	.type	_init, at function
+
+	.align 4
+.L._init:
+	stdu 1,-48(1)
+	mflr 0
+	std 0,64(1)
+
+	.section .fini,"ax", at progbits
+	.align	2
+	.globl	_fini
+	.section ".opd","aw"
+	.align	3
+_fini:
+	.quad	.L._fini,.TOC. at tocbase,0
+	.previous
+	.type	_fini, at function
+
+	.align 4
+.L._fini:
+	stdu 1,-48(1)
+	mflr 0
+	std 0,64(1)
+
+	.section .note.GNU-stack,"",%progbits


Property changes on: trunk/lib/csu/powerpc64/crti.S
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+MidnightBSD=%H
\ No newline at end of property
Added: svn:mime-type
## -0,0 +1 ##
+text/plain
\ No newline at end of property
Added: trunk/lib/csu/powerpc64/crtn.S
===================================================================
--- trunk/lib/csu/powerpc64/crtn.S	                        (rev 0)
+++ trunk/lib/csu/powerpc64/crtn.S	2018-06-05 22:44:35 UTC (rev 10425)
@@ -0,0 +1,43 @@
+/* $MidnightBSD$ */
+/*-
+ * Copyright 2001 David E. O'Brien
+ * 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 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.
+ */
+
+#include <machine/asm.h>
+__FBSDID("$FreeBSD: stable/10/lib/csu/powerpc64/crtn.S 217399 2011-01-14 11:34:58Z kib $");
+
+	.section .init,"ax", at progbits
+	ld %r1,0(%r1)
+	ld 0,16(%r1)
+	mtlr 0
+	blr
+
+
+	.section .fini,"ax", at progbits
+	ld %r1,0(%r1)
+	ld 0,16(%r1)
+	mtlr 0
+	blr
+
+	.section .note.GNU-stack,"",%progbits


Property changes on: trunk/lib/csu/powerpc64/crtn.S
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+MidnightBSD=%H
\ No newline at end of property
Added: svn:mime-type
## -0,0 +1 ##
+text/plain
\ No newline at end of property


More information about the Midnightbsd-cvs mailing list