summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPer Fogelstrom <pefo@cvs.openbsd.org>1999-02-01 17:02:48 +0000
committerPer Fogelstrom <pefo@cvs.openbsd.org>1999-02-01 17:02:48 +0000
commitff65b5e4757edc5aa47aef0a06d2f910d17b894d (patch)
tree447894af33c5d191e7177d26452d3809994d35f5
parentbec0fd2d874580bd6461552dfda8b1fe71985603 (diff)
When compiling for ELF use .init and .fini sections instead of special syms.
-rw-r--r--lib/csu/c++/c++rt0.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/csu/c++/c++rt0.c b/lib/csu/c++/c++rt0.c
index 7c407785146..4e22ced6537 100644
--- a/lib/csu/c++/c++rt0.c
+++ b/lib/csu/c++/c++rt0.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: c++rt0.c,v 1.5 1998/09/15 11:01:51 pefo Exp $ */
+/* $OpenBSD: c++rt0.c,v 1.6 1999/02/01 17:02:47 pefo Exp $ */
/* $NetBSD: c++rt0.c,v 1.6 1997/12/29 15:36:50 pk Exp $ */
/*
@@ -80,8 +80,13 @@ __ctors()
(**p++)();
}
+#if !defined(NATIVE_EXEC_ELF)
extern void __init __P((void)) asm(".init");
extern void __fini __P((void)) asm(".fini");
+#else
+extern void __init __P((void)) __attribute__ ((section (".init")));
+extern void __fini __P((void)) __attribute__ ((section (".fini")));
+#endif
void
__init()