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 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 <m68k/asm.h>
+
+RCSID("$NetBSD: crtend.S,v 1.1 2013/07/11 17:07:35 matt Exp $")
+
+ .section .ctors, "aw", @progbits
+ .p2align 2
+ .global __CTOR_LIST_END__
+ .hidden __CTOR_LIST_END__
+__CTOR_LIST_END__:
+ .long 0
+
+ .section .dtors, "aw", @progbits
+ .p2align 2
+ .global __DTOR_LIST_END__
+ .hidden __DTOR_LIST_END__
+__DTOR_LIST_END__:
+ .long 0
+
+ .section .eh_frame, "a", @progbits
+ .p2align 2
+ .long 0
+
+ .section .jcr, "aw", @progbits
+ .p2align 2
+ .long 0