summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorrahnds <rahnds@openbsd.org>1999-01-28 05:01:14 +0000
committerrahnds <rahnds@openbsd.org>1999-01-28 05:01:14 +0000
commitce346678dc22c7a508c88f063f06e1b25ae6acba (patch)
tree12096f5714ca3239e6010f317f533d4792c505f5 /lib
parentAdd support for: (diff)
downloadwireguard-openbsd-ce346678dc22c7a508c88f063f06e1b25ae6acba.tar.xz
wireguard-openbsd-ce346678dc22c7a508c88f063f06e1b25ae6acba.zip
update for binutils 2.9.1, whenever it might show up... The changes
are cleanup that would not work correctly with the newer version. works fine with the current (old) version of gas/ld. ALSO: Found a very long outstanding bug on the powerpc port. whenever nroff was run, say during a build, it would complain about memory being freed twice. Found the cause of this was that *roff which is written in C++ was using globals that had constructors/destructors and due to a bug in the crt code, the destructors were getting called when a program exited via falling out of the main loop. calling exit directly would not exersize the bug that ran the destructors twice. THIS BUG IS NOW FIXED.
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 ff818f2ef61..4160b272ca6 100644
--- a/lib/csu/powerpc/crtbegin.c
+++ b/lib/csu/powerpc/crtbegin.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: crtbegin.c,v 1.1.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