Module Name:    src
Committed By:   jmmv
Date:           Sat Jul 17 19:25:29 UTC 2010

Modified Files:
        src/tests/lib: Makefile
Added Files:
        src/tests/lib/csu: Makefile h_initfini.c t_crt0.sh
        src/tests/lib/csu/arch/alpha: initfini_asm.S
        src/tests/lib/csu/arch/arm: initfini_asm.S
        src/tests/lib/csu/arch/hppa: initfini_asm.S
        src/tests/lib/csu/arch/i386: initfini_asm.S
        src/tests/lib/csu/arch/m68k: initfini_asm.S
        src/tests/lib/csu/arch/mips: initfini_asm.S
        src/tests/lib/csu/arch/powerpc: initfini_asm.S
        src/tests/lib/csu/arch/sh3: initfini_asm.S
        src/tests/lib/csu/arch/sparc: initfini_asm.S
        src/tests/lib/csu/arch/sparc64: initfini_asm.S
        src/tests/lib/csu/arch/vax: initfini_asm.S
        src/tests/lib/csu/arch/x86_64: initfini_asm.S

Log Message:
Convert the csu tests to atf.
Initial work from the GSoC 2008 project by Lukasz Strzygowski.


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/tests/lib/Makefile
cvs rdiff -u -r0 -r1.1 src/tests/lib/csu/Makefile \
    src/tests/lib/csu/h_initfini.c src/tests/lib/csu/t_crt0.sh
cvs rdiff -u -r0 -r1.1 src/tests/lib/csu/arch/alpha/initfini_asm.S
cvs rdiff -u -r0 -r1.1 src/tests/lib/csu/arch/arm/initfini_asm.S
cvs rdiff -u -r0 -r1.1 src/tests/lib/csu/arch/hppa/initfini_asm.S
cvs rdiff -u -r0 -r1.1 src/tests/lib/csu/arch/i386/initfini_asm.S
cvs rdiff -u -r0 -r1.1 src/tests/lib/csu/arch/m68k/initfini_asm.S
cvs rdiff -u -r0 -r1.1 src/tests/lib/csu/arch/mips/initfini_asm.S
cvs rdiff -u -r0 -r1.1 src/tests/lib/csu/arch/powerpc/initfini_asm.S
cvs rdiff -u -r0 -r1.1 src/tests/lib/csu/arch/sh3/initfini_asm.S
cvs rdiff -u -r0 -r1.1 src/tests/lib/csu/arch/sparc/initfini_asm.S
cvs rdiff -u -r0 -r1.1 src/tests/lib/csu/arch/sparc64/initfini_asm.S
cvs rdiff -u -r0 -r1.1 src/tests/lib/csu/arch/vax/initfini_asm.S
cvs rdiff -u -r0 -r1.1 src/tests/lib/csu/arch/x86_64/initfini_asm.S

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/tests/lib/Makefile
diff -u src/tests/lib/Makefile:1.6 src/tests/lib/Makefile:1.7
--- src/tests/lib/Makefile:1.6	Fri Jul 16 15:42:53 2010
+++ src/tests/lib/Makefile	Sat Jul 17 19:25:26 2010
@@ -1,8 +1,8 @@
-# $NetBSD: Makefile,v 1.6 2010/07/16 15:42:53 jmmv Exp $
+# $NetBSD: Makefile,v 1.7 2010/07/17 19:25:26 jmmv Exp $
 
 .include <bsd.own.mk>
 
-TESTS_SUBDIRS=	libc libevent libposix libprop librt libpthread libutil \
+TESTS_SUBDIRS=	csu libc libevent libposix libprop librt libpthread libutil \
 		semaphore
 
 .if (${MKSKEY} != "no")

Added files:

Index: src/tests/lib/csu/Makefile
diff -u /dev/null src/tests/lib/csu/Makefile:1.1
--- /dev/null	Sat Jul 17 19:25:29 2010
+++ src/tests/lib/csu/Makefile	Sat Jul 17 19:25:27 2010
@@ -0,0 +1,19 @@
+# $NetBSD: Makefile,v 1.1 2010/07/17 19:25:27 jmmv Exp $
+
+NOMAN=		# defined
+
+.include <bsd.own.mk>
+
+TESTSDIR=	${TESTSBASE}/lib/csu
+
+.if exists(arch/${MACHINE_CPU}/initfini_asm.S)
+TESTS_SH=	t_crt0
+
+BINDIR=		${TESTSDIR}
+PROG=		h_initfini
+SRCS=		h_initfini.c initfini_asm.S
+WARNS?=		1
+.PATH:		${.CURDIR}/arch/${MACHINE_CPU}
+.endif
+
+.include <bsd.test.mk>
Index: src/tests/lib/csu/h_initfini.c
diff -u /dev/null src/tests/lib/csu/h_initfini.c:1.1
--- /dev/null	Sat Jul 17 19:25:29 2010
+++ src/tests/lib/csu/h_initfini.c	Sat Jul 17 19:25:27 2010
@@ -0,0 +1,69 @@
+/* $NetBSD: h_initfini.c,v 1.1 2010/07/17 19:25:27 jmmv Exp $ */
+
+/*
+ * Copyright (c) 2008 The NetBSD Foundation, Inc.
+ * 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 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.
+ */
+
+/*
+ * This file placed in the public domain.
+ * Jason R. Thorpe, July 16, 2001.
+ */
+
+#include <sys/cdefs.h>
+__COPYRIGHT("@(#) Copyright (c) 2008\
+ The NetBSD Foundation, inc. All rights reserved.");
+__RCSID("$NetBSD: h_initfini.c,v 1.1 2010/07/17 19:25:27 jmmv Exp $");
+
+#include <sys/types.h>
+
+#include <stdlib.h>
+#include <unistd.h>
+
+void i_am_init(void);
+void i_am_fini(void);
+
+int main(int, char *[]);
+
+#define	WRITE(str) \
+	write(STDOUT_FILENO, str, sizeof(str) - 1)
+
+int
+main(int argc, char *argv[])
+{
+	WRITE("I am main.\n");
+	exit(0);
+}
+
+void
+i_am_init(void)
+{
+	WRITE("I am init.\n");
+}
+
+void
+i_am_fini(void)
+{
+	WRITE("I am fini.\n");
+}
Index: src/tests/lib/csu/t_crt0.sh
diff -u /dev/null src/tests/lib/csu/t_crt0.sh:1.1
--- /dev/null	Sat Jul 17 19:25:29 2010
+++ src/tests/lib/csu/t_crt0.sh	Sat Jul 17 19:25:27 2010
@@ -0,0 +1,48 @@
+# $NetBSD: t_crt0.sh,v 1.1 2010/07/17 19:25:27 jmmv Exp $
+#
+# Copyright (c) 2008 The NetBSD Foundation, Inc.
+# 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 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.
+#
+
+atf_test_case initfini
+initfini_head()
+{
+	atf_set "descr" "Checks support for init/fini sections"
+	atf_set "use.fs" "true"
+}
+initfini_body()
+{
+	cat >expout <<EOF
+I am init.
+I am main.
+I am fini.
+EOF
+
+	atf_check -o file:expout "$(atf_get_srcdir)/h_initfini"
+}
+
+atf_init_test_cases()
+{
+	atf_add_test_case initfini
+}

Index: src/tests/lib/csu/arch/alpha/initfini_asm.S
diff -u /dev/null src/tests/lib/csu/arch/alpha/initfini_asm.S:1.1
--- /dev/null	Sat Jul 17 19:25:29 2010
+++ src/tests/lib/csu/arch/alpha/initfini_asm.S	Sat Jul 17 19:25:27 2010
@@ -0,0 +1,48 @@
+/* $NetBSD: initfini_asm.S,v 1.1 2010/07/17 19:25:27 jmmv Exp $ */
+
+/*
+ * Copyright (c) 2008 The NetBSD Foundation, Inc.
+ * 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 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.
+ */
+
+/*
+ * This file placed in the public domain.
+ * Jason R. Thorpe, July 16, 2001.
+ */
+
+#include <machine/asm.h>
+
+	.section .init, "ax", @progbits
+	br	ra, 1f
+1:	LDGP(ra)
+	jsr	ra, i_am_init
+	.align	3
+	.previous
+
+	.section .fini, "ax", @progbits
+	br	ra, 1f
+1:	LDGP(ra)
+	jsr	ra, i_am_fini
+	.align	3
+	.previous

Index: src/tests/lib/csu/arch/arm/initfini_asm.S
diff -u /dev/null src/tests/lib/csu/arch/arm/initfini_asm.S:1.1
--- /dev/null	Sat Jul 17 19:25:29 2010
+++ src/tests/lib/csu/arch/arm/initfini_asm.S	Sat Jul 17 19:25:27 2010
@@ -0,0 +1,42 @@
+/* $NetBSD: initfini_asm.S,v 1.1 2010/07/17 19:25:27 jmmv Exp $ */
+
+/*
+ * Copyright (c) 2008 The NetBSD Foundation, Inc.
+ * 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 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.
+ */
+
+/*
+ * This file placed in the public domain.
+ * Matt A. Thomas, July 16, 2001.
+ */
+
+#include <machine/asm.h>
+
+	.section .init, "ax", "progbits"
+	bl	_C_LABEL(i_am_init)
+	.previous
+
+	.section .fini, "ax", "progbits"
+	bl	_C_LABEL(i_am_fini)
+	.previous

Index: src/tests/lib/csu/arch/hppa/initfini_asm.S
diff -u /dev/null src/tests/lib/csu/arch/hppa/initfini_asm.S:1.1
--- /dev/null	Sat Jul 17 19:25:29 2010
+++ src/tests/lib/csu/arch/hppa/initfini_asm.S	Sat Jul 17 19:25:27 2010
@@ -0,0 +1,44 @@
+/* $NetBSD: initfini_asm.S,v 1.1 2010/07/17 19:25:27 jmmv Exp $ */
+
+/*
+ * Copyright (c) 2008 The NetBSD Foundation, Inc.
+ * 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 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.
+ */
+
+/*
+ * This file placed in the public domain.
+ * Nick Hudson, May 18, 2004.
+ */
+
+#include <machine/asm.h>
+
+	.section .init, "ax", @progbits
+	bl	i_am_init, %rp
+	nop
+	.previous
+
+	.section .fini, "ax", @progbits
+	bl	i_am_fini, %rp
+	nop
+	.previous

Index: src/tests/lib/csu/arch/i386/initfini_asm.S
diff -u /dev/null src/tests/lib/csu/arch/i386/initfini_asm.S:1.1
--- /dev/null	Sat Jul 17 19:25:29 2010
+++ src/tests/lib/csu/arch/i386/initfini_asm.S	Sat Jul 17 19:25:27 2010
@@ -0,0 +1,42 @@
+/* $NetBSD: initfini_asm.S,v 1.1 2010/07/17 19:25:27 jmmv Exp $ */
+
+/*
+ * Copyright (c) 2008 The NetBSD Foundation, Inc.
+ * 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 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.
+ */
+
+/*
+ * This file placed in the public domain.
+ * Jason R. Thorpe, July 16, 2001.
+ */
+
+#include <machine/asm.h>
+
+	.section .init, "ax", @progbits
+	call	_C_LABEL(i_am_init)
+	.previous
+
+	.section .fini, "ax", @progbits
+	call	_C_LABEL(i_am_fini)
+	.previous

Index: src/tests/lib/csu/arch/m68k/initfini_asm.S
diff -u /dev/null src/tests/lib/csu/arch/m68k/initfini_asm.S:1.1
--- /dev/null	Sat Jul 17 19:25:29 2010
+++ src/tests/lib/csu/arch/m68k/initfini_asm.S	Sat Jul 17 19:25:27 2010
@@ -0,0 +1,42 @@
+/* $NetBSD: initfini_asm.S,v 1.1 2010/07/17 19:25:27 jmmv Exp $ */
+
+/*
+ * Copyright (c) 2008 The NetBSD Foundation, Inc.
+ * 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 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.
+ */
+
+/*
+ * This file placed in the public domain.
+ * Klaus Klein, October 14, 2001.
+ */
+
+#include <machine/asm.h>
+
+	.section .init, "ax", @progbits
+	jsr	_C_LABEL(i_am_init)
+	.previous
+
+	.section .fini, "ax", @progbits
+	jsr	_C_LABEL(i_am_fini)
+	.previous

Index: src/tests/lib/csu/arch/mips/initfini_asm.S
diff -u /dev/null src/tests/lib/csu/arch/mips/initfini_asm.S:1.1
--- /dev/null	Sat Jul 17 19:25:29 2010
+++ src/tests/lib/csu/arch/mips/initfini_asm.S	Sat Jul 17 19:25:28 2010
@@ -0,0 +1,56 @@
+/* $NetBSD: initfini_asm.S,v 1.1 2010/07/17 19:25:28 jmmv Exp $ */
+
+/*
+ * Copyright (c) 2008 The NetBSD Foundation, Inc.
+ * 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 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.
+ */
+
+/*
+ * This file placed in the public domain.
+ * Jason R. Thorpe, July 16, 2001.
+ */
+
+#include <mips/asm.h>
+
+	.abicalls
+
+	.section .init, "ax", @progbits
+	.set noreorder
+	la	t9, 1f
+1:	.cpload t9
+	.set reorder
+	.cprestore
+	la	t9, i_am_init
+	jal	t9
+	.previous
+
+	.section .fini, "ax", @progbits
+	.set noreorder
+	la	t9, 2f
+2:	.cpload t9
+	.set reorder
+	.cprestore
+	la	t9, i_am_fini
+	jal	t9
+	.previous

Index: src/tests/lib/csu/arch/powerpc/initfini_asm.S
diff -u /dev/null src/tests/lib/csu/arch/powerpc/initfini_asm.S:1.1
--- /dev/null	Sat Jul 17 19:25:29 2010
+++ src/tests/lib/csu/arch/powerpc/initfini_asm.S	Sat Jul 17 19:25:28 2010
@@ -0,0 +1,42 @@
+/* $NetBSD: initfini_asm.S,v 1.1 2010/07/17 19:25:28 jmmv Exp $ */
+
+/*
+ * Copyright (c) 2008 The NetBSD Foundation, Inc.
+ * 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 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.
+ */
+
+/*
+ * This file placed in the public domain.
+ * Tsubai Masanari, July 17, 2001.
+ */
+
+#include <machine/asm.h>
+
+	.section .init, "ax", @progbits
+	bl	i_am_init
+	.previous
+
+	.section .fini, "ax", @progbits
+	bl	i_am_fini
+	.previous

Index: src/tests/lib/csu/arch/sh3/initfini_asm.S
diff -u /dev/null src/tests/lib/csu/arch/sh3/initfini_asm.S:1.1
--- /dev/null	Sat Jul 17 19:25:29 2010
+++ src/tests/lib/csu/arch/sh3/initfini_asm.S	Sat Jul 17 19:25:28 2010
@@ -0,0 +1,58 @@
+/* $NetBSD: initfini_asm.S,v 1.1 2010/07/17 19:25:28 jmmv Exp $ */
+
+/*
+ * Copyright (c) 2008 The NetBSD Foundation, Inc.
+ * 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 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.
+ */
+
+/*
+ * This file placed in the public domain.
+ * Tsubai Masanari, July 23, 2001.
+ */
+
+#include <machine/asm.h>
+
+	.section .init, "ax", @progbits
+	mov.l	Li_am_init, r0
+	jsr	@r0
+	nop
+	bra	1f
+	nop
+	.align	2
+Li_am_init:
+	.long	_C_LABEL(i_am_init)
+1:
+	.previous
+
+	.section .fini, "ax", @progbits
+	mov.l	Li_am_fini, r0
+	jsr	@r0
+	nop
+	bra	1f
+	nop
+	.align	2
+Li_am_fini:
+	.long	_C_LABEL(i_am_fini)
+1:
+	.previous

Index: src/tests/lib/csu/arch/sparc/initfini_asm.S
diff -u /dev/null src/tests/lib/csu/arch/sparc/initfini_asm.S:1.1
--- /dev/null	Sat Jul 17 19:25:29 2010
+++ src/tests/lib/csu/arch/sparc/initfini_asm.S	Sat Jul 17 19:25:28 2010
@@ -0,0 +1,44 @@
+/* $NetBSD: initfini_asm.S,v 1.1 2010/07/17 19:25:28 jmmv Exp $ */
+
+/*
+ * Copyright (c) 2008 The NetBSD Foundation, Inc.
+ * 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 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.
+ */
+
+/*
+ * This file placed in the public domain.
+ * matthew green, July 17, 2001.
+ */
+
+#include <machine/asm.h>
+
+	.section .init, "ax", @progbits
+	call	_C_LABEL(i_am_init)
+	 nop
+	.previous
+
+	.section .fini, "ax", @progbits
+	call	_C_LABEL(i_am_fini)
+	 nop
+	.previous

Index: src/tests/lib/csu/arch/sparc64/initfini_asm.S
diff -u /dev/null src/tests/lib/csu/arch/sparc64/initfini_asm.S:1.1
--- /dev/null	Sat Jul 17 19:25:29 2010
+++ src/tests/lib/csu/arch/sparc64/initfini_asm.S	Sat Jul 17 19:25:28 2010
@@ -0,0 +1,44 @@
+/* $NetBSD: initfini_asm.S,v 1.1 2010/07/17 19:25:28 jmmv Exp $ */
+
+/*
+ * Copyright (c) 2008 The NetBSD Foundation, Inc.
+ * 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 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.
+ */
+
+/*
+ * This file placed in the public domain.
+ * matthew green, July 17, 2001.
+ */
+
+#include <machine/asm.h>
+
+	.section .init, "ax", @progbits
+	call	_C_LABEL(i_am_init)
+	 nop
+	.previous
+
+	.section .fini, "ax", @progbits
+	call	_C_LABEL(i_am_fini)
+	 nop
+	.previous

Index: src/tests/lib/csu/arch/vax/initfini_asm.S
diff -u /dev/null src/tests/lib/csu/arch/vax/initfini_asm.S:1.1
--- /dev/null	Sat Jul 17 19:25:29 2010
+++ src/tests/lib/csu/arch/vax/initfini_asm.S	Sat Jul 17 19:25:28 2010
@@ -0,0 +1,42 @@
+/* $NetBSD: initfini_asm.S,v 1.1 2010/07/17 19:25:28 jmmv Exp $ */
+
+/*
+ * Copyright (c) 2008 The NetBSD Foundation, Inc.
+ * 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 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.
+ */
+
+/*
+ * This file placed in the public domain.
+ * Matt A. Thomas, July 16, 2001.
+ */
+
+#include <machine/asm.h>
+
+	.section .init, "ax", @progbits
+	calls	$0,_C_LABEL(i_am_init)
+	.previous
+
+	.section .fini, "ax", @progbits
+	calls	$0,_C_LABEL(i_am_fini)
+	.previous

Index: src/tests/lib/csu/arch/x86_64/initfini_asm.S
diff -u /dev/null src/tests/lib/csu/arch/x86_64/initfini_asm.S:1.1
--- /dev/null	Sat Jul 17 19:25:29 2010
+++ src/tests/lib/csu/arch/x86_64/initfini_asm.S	Sat Jul 17 19:25:28 2010
@@ -0,0 +1,42 @@
+/* $NetBSD: initfini_asm.S,v 1.1 2010/07/17 19:25:28 jmmv Exp $ */
+
+/*
+ * Copyright (c) 2008 The NetBSD Foundation, Inc.
+ * 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 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.
+ */
+
+/*
+ * This file placed in the public domain.
+ * Jason R. Thorpe, July 16, 2001.
+ */
+
+#include <machine/asm.h>
+
+	.section .init, "ax", @progbits
+	call	_C_LABEL(i_am_init)
+	.previous
+
+	.section .fini, "ax", @progbits
+	call	_C_LABEL(i_am_fini)
+	.previous

Reply via email to