summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/csu/powerpc/Makefile4
-rw-r--r--lib/csu/powerpc/crt0.s3
-rw-r--r--lib/csu/powerpc/crtbegin.c16
-rw-r--r--lib/csu/powerpc/crtend.c8
-rw-r--r--lib/csu/powerpc/crtend.s8
5 files changed, 15 insertions, 24 deletions
diff --git a/lib/csu/powerpc/Makefile b/lib/csu/powerpc/Makefile
index 8be332ec02f..76ca33ea512 100644
--- a/lib/csu/powerpc/Makefile
+++ b/lib/csu/powerpc/Makefile
@@ -1,5 +1,5 @@
# from: @(#)Makefile 8.1 (Berkeley) 6/1/93
-# $Id: Makefile,v 1.2 1997/04/27 20:56:04 millert Exp $
+# $Id: Makefile,v 1.3 1999/01/28 05:01:14 rahnds Exp $
CFLAGS= -DLIBC_SCCS
OBJS= crt0.o gcrt0.o crtbegin.o crtend.o
@@ -23,7 +23,7 @@ crtbegin.o: crtbegin.c
@${LD} -x -r -o ${.TARGET} ${.TARGET}.o
@rm -f ${.TARGET}.o
-crtend.o: crtend.s
+crtend.o: crtend.c
@echo ${CC} ${CFLAGS} -c ${.ALLSRC} -o ${.TARGET}
@${CC} ${CFLAGS} -c ${.ALLSRC} -o ${.TARGET}.o
@${LD} -x -r -o ${.TARGET} ${.TARGET}.o
diff --git a/lib/csu/powerpc/crt0.s b/lib/csu/powerpc/crt0.s
index 1c41855bd0b..29137b8b731 100644
--- a/lib/csu/powerpc/crt0.s
+++ b/lib/csu/powerpc/crt0.s
@@ -69,9 +69,6 @@ call_main:
bl main
.extern exit
- mr 13, 3
- bl __fini
- mr 3, 13
bl exit
eprol:
diff --git a/lib/csu/powerpc/crtbegin.c b/lib/csu/powerpc/crtbegin.c
index efe485a5946..4160b272ca6 100644
--- a/lib/csu/powerpc/crtbegin.c
+++ b/lib/csu/powerpc/crtbegin.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: crtbegin.c,v 1.1 1996/12/21 20:53:48 rahnds Exp $ */
+/* $OpenBSD: crtbegin.c,v 1.2 1999/01/28 05:01:15 rahnds Exp $ */
/* $NetBSD: crtbegin.c,v 1.1 1996/09/12 16:59:03 cgd Exp $ */
/*
@@ -48,16 +48,10 @@
*/
#include <stdlib.h>
-/* XXX hack */
-__asm__("
-.section .ctors,\"aw\"
- .long -1
-.section .dtors,\"aw\"
- .long -1
-");
-
-void (*__CTOR_LIST__[0]) __P((void));
-void (*__DTOR_LIST__[0]) __P((void));
+void (*__CTOR_LIST__[0]) __P((void))
+ __attribute__((section(".ctors"))) = { (void *)-1 }; /* XXX */
+void (*__DTOR_LIST__[0]) __P((void))
+ __attribute__((section(".dtors"))) = { (void *)-1 }; /* XXX */
static void __dtors __P((void));
static void __ctors __P((void));
diff --git a/lib/csu/powerpc/crtend.c b/lib/csu/powerpc/crtend.c
new file mode 100644
index 00000000000..bfb6418d4ab
--- /dev/null
+++ b/lib/csu/powerpc/crtend.c
@@ -0,0 +1,8 @@
+/* $NetBSD: crtend.c,v 1.1 1997/04/16 19:38:24 thorpej Exp $ */
+
+#include <sys/cdefs.h>
+
+static void (*__CTOR_LIST__[1]) __P((void))
+ __attribute__((section(".ctors"))) = { (void *)0 }; /* XXX */
+static void (*__DTOR_LIST__[1]) __P((void))
+ __attribute__((section(".dtors"))) = { (void *)0 }; /* XXX */
diff --git a/lib/csu/powerpc/crtend.s b/lib/csu/powerpc/crtend.s
deleted file mode 100644
index e7d0ca90a9b..00000000000
--- a/lib/csu/powerpc/crtend.s
+++ /dev/null
@@ -1,8 +0,0 @@
-/*
- * Emperically created.
- * this is the NULL terminator for the ctors and dtors lists.
- */
-.section .ctors,"aw"
- .long 0
-.section .dtors,"aw"
- .long 0