Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/lib/csu/arch/m68k Use pc-relative branch in crt0.S
details: https://anonhg.NetBSD.org/src/rev/4833eefe1aec
branches: trunk
changeset: 787896:4833eefe1aec
user: matt <matt%NetBSD.org@localhost>
date: Thu Jul 11 17:07:35 2013 +0000
description:
Use pc-relative branch in crt0.S
Add crtend.S and crtbegin.h (uses pc-relative branches as well).
diffstat:
lib/csu/arch/m68k/Makefile.inc | 4 +-
lib/csu/arch/m68k/crt0.S | 4 +-
lib/csu/arch/m68k/crtbegin.h | 37 ++++++++++++++++++++++++++++
lib/csu/arch/m68k/crtend.S | 55 ++++++++++++++++++++++++++++++++++++++++++
4 files changed, 96 insertions(+), 4 deletions(-)
diffs (129 lines):
diff -r 73ad4e921ffd -r 4833eefe1aec lib/csu/arch/m68k/Makefile.inc
--- a/lib/csu/arch/m68k/Makefile.inc Thu Jul 11 16:46:06 2013 +0000
+++ b/lib/csu/arch/m68k/Makefile.inc Thu Jul 11 17:07:35 2013 +0000
@@ -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
diff -r 73ad4e921ffd -r 4833eefe1aec lib/csu/arch/m68k/crt0.S
--- a/lib/csu/arch/m68k/crt0.S Thu Jul 11 16:46:06 2013 +0000
+++ b/lib/csu/arch/m68k/crt0.S Thu Jul 11 17:07:35 2013 +0000
@@ -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 @@
pea (16+4)(%sp,%d1.l) | envp = &argv[argc + 1]
pea 20(%sp) | argv
movl %d0,-(%sp) | argc
- jsr ___start
+ bsr ___start
diff -r 73ad4e921ffd -r 4833eefe1aec lib/csu/arch/m68k/crtbegin.h
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/lib/csu/arch/m68k/crtbegin.h Thu Jul 11 17:07:35 2013 +0000
@@ -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");
diff -r 73ad4e921ffd -r 4833eefe1aec lib/csu/arch/m68k/crtend.S
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/lib/csu/arch/m68k/crtend.S Thu Jul 11 17:07:35 2013 +0000
@@ -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
Home |
Main Index |
Thread Index |
Old Index