summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorPhilip Guenther <guenther@cvs.openbsd.org>2014-11-15 01:40:08 +0000
committerPhilip Guenther <guenther@cvs.openbsd.org>2014-11-15 01:40:08 +0000
commit83fa2ccd4fffd67edf241ed3a2635d2fd808a9b0 (patch)
tree96b8b0a17624cf57aafb3a414f3302a395aea8b3 /lib
parentfcc46724c00aff11a4d7b91eda10c7df88eaff2a (diff)
ELF uberalles, so move the files up out of common_elf
ok miod@ deraadt@
Diffstat (limited to 'lib')
-rw-r--r--lib/csu/Makefile30
-rw-r--r--lib/csu/common_elf/crt0.c126
-rw-r--r--lib/csu/common_elf/crtbegin.c182
-rw-r--r--lib/csu/common_elf/crtbeginS.c171
-rw-r--r--lib/csu/common_elf/crtend.c22
-rw-r--r--lib/csu/common_elf/crtendS.c19
-rw-r--r--lib/csu/common_elf/extern.h23
-rw-r--r--lib/csu/common_elf/os-note-elf.h19
8 files changed, 14 insertions, 578 deletions
diff --git a/lib/csu/Makefile b/lib/csu/Makefile
index 44e2c113c09..fe08ffab1dd 100644
--- a/lib/csu/Makefile
+++ b/lib/csu/Makefile
@@ -1,13 +1,11 @@
-# $OpenBSD: Makefile,v 1.18 2014/11/12 02:31:47 guenther Exp $
+# $OpenBSD: Makefile,v 1.19 2014/11/15 01:40:07 guenther Exp $
OBJS= crt0.o gcrt0.o
OBJS+= crtbegin.o crtend.o
OBJS+= crtbeginS.o crtendS.o
SRCS= crt0.c crtbegin.c crtbeginS.c crtend.c crtendS.c
-ELFDIR= ${.CURDIR}/common_elf
-.PATH: ${ELFDIR}
-CFLAGS+= -I${ELFDIR} -I${.CURDIR}/${MACHINE_CPU}
+CFLAGS+= -I${.CURDIR}/${MACHINE_CPU}
# XXX "use -fno-omit-frame-pointer; the reason is almost crazy; pr#287"
.if ${MACHINE_ARCH} == "amd64" || ${MACHINE_ARCH} == "i386"
@@ -49,38 +47,38 @@ PICFLAG= -fPIC
all: ${OBJS}
crt0.o: crt0.c
- @echo ${COMPILE.c} ${ELFDIR}/crt0.c -o ${.TARGET}
- @${COMPILE.c} ${ELFDIR}/crt0.c -o ${.TARGET}.o
+ @echo ${COMPILE.c} ${.CURDIR}/crt0.c -o ${.TARGET}
+ @${COMPILE.c} ${.CURDIR}/crt0.c -o ${.TARGET}.o
@${LD} -x -r -o ${.TARGET} ${.TARGET}.o
@rm -f ${.TARGET}.o
gcrt0.o: crt0.c
- @echo ${COMPILE.c} -DMCRT0 ${ELFDIR}/crt0.c -o ${.TARGET}
- @${COMPILE.c} -DMCRT0 ${ELFDIR}/crt0.c -o ${.TARGET}.o
+ @echo ${COMPILE.c} -DMCRT0 ${.CURDIR}/crt0.c -o ${.TARGET}
+ @${COMPILE.c} -DMCRT0 ${.CURDIR}/crt0.c -o ${.TARGET}.o
@${LD} -x -r -o ${.TARGET} ${.TARGET}.o
@rm -f ${.TARGET}.o
crtbegin.o: crtbegin.c
- @echo ${COMPILE.c} ${ELFDIR}/crtbegin.c -o ${.TARGET}
- @${COMPILE.c} ${ELFDIR}/crtbegin.c -o ${.TARGET}.o
+ @echo ${COMPILE.c} ${.CURDIR}/crtbegin.c -o ${.TARGET}
+ @${COMPILE.c} ${.CURDIR}/crtbegin.c -o ${.TARGET}.o
@${LD} -x -r -o ${.TARGET} ${.TARGET}.o
@rm -f ${.TARGET}.o
crtbeginS.o: crtbeginS.c
- @echo ${COMPILE.c} ${PICFLAG} ${ELFDIR}/crtbeginS.c -o ${.TARGET}
- @${COMPILE.c} ${PICFLAG} ${ELFDIR}/crtbeginS.c -o ${.TARGET}.o
+ @echo ${COMPILE.c} ${PICFLAG} ${.CURDIR}/crtbeginS.c -o ${.TARGET}
+ @${COMPILE.c} ${PICFLAG} ${.CURDIR}/crtbeginS.c -o ${.TARGET}.o
@${LD} -x -r -o ${.TARGET} ${.TARGET}.o
@rm -f ${.TARGET}.o
crtend.o: crtend.c
- @echo ${COMPILE.c} ${ELFDIR}/crtend.c -o ${.TARGET}
- @${COMPILE.c} ${ELFDIR}/crtend.c -o ${.TARGET}.o
+ @echo ${COMPILE.c} ${.CURDIR}/crtend.c -o ${.TARGET}
+ @${COMPILE.c} ${.CURDIR}/crtend.c -o ${.TARGET}.o
@${LD} -x -r -o ${.TARGET} ${.TARGET}.o
@rm -f ${.TARGET}.o
crtendS.o: crtendS.c
- @echo ${COMPILE.c} ${PICFLAG} ${ELFDIR}/crtendS.c -o ${.TARGET}
- @${COMPILE.c} ${PICFLAG} ${ELFDIR}/crtendS.c -o ${.TARGET}.o
+ @echo ${COMPILE.c} ${PICFLAG} ${.CURDIR}/crtendS.c -o ${.TARGET}
+ @${COMPILE.c} ${PICFLAG} ${.CURDIR}/crtendS.c -o ${.TARGET}.o
@${LD} -x -r -o ${.TARGET} ${.TARGET}.o
@rm -f ${.TARGET}.o
diff --git a/lib/csu/common_elf/crt0.c b/lib/csu/common_elf/crt0.c
deleted file mode 100644
index aaef64a7a57..00000000000
--- a/lib/csu/common_elf/crt0.c
+++ /dev/null
@@ -1,126 +0,0 @@
-/* $OpenBSD: crt0.c,v 1.2 2013/12/12 08:12:08 guenther Exp $ */
-
-/*
- * Copyright (c) 1995 Christopher G. Demetriou
- * All rights reserved.
- *
- * 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.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by Christopher G. Demetriou
- * for the NetBSD Project.
- * 4. The name of the author may not be used to endorse or promote products
- * derived from this software without specific prior written permission
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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 <stdlib.h>
-#include <limits.h>
-
-#include "md_init.h"
-
-/* some defaults */
-#ifndef MD_START_ARGS
-#define MD_START_ARGS \
- int argc, char **argv, char **envp, void (*cleanup)(void)
-#endif
-#ifndef MD_START
-#define MD_START ___start
-static void ___start(MD_START_ARGS) __used;
-#endif
-#ifndef MD_EPROL_LABEL
-#define MD_EPROL_LABEL __asm(" .text\n_eprol:")
-#endif
-
-void __init_tcb(char **_envp);
-#pragma weak __init_tcb
-
-static char *_strrchr(char *, char);
-
-char **environ;
-char *__progname = "";
-char __progname_storage[NAME_MAX+1];
-
-#ifdef MCRT0
-extern void monstartup(u_long, u_long);
-extern void _mcleanup(void);
-extern unsigned char _etext, _eprol;
-#endif /* MCRT0 */
-
-#ifdef MD_CRT0_START
-MD_CRT0_START;
-#endif
-
-void
-MD_START(MD_START_ARGS)
-{
- char *namep, *s;
-#ifdef MD_START_SETUP
- MD_START_SETUP
-#endif
-
- environ = envp;
-
- if ((namep = argv[0]) != NULL) { /* NULL ptr if argc = 0 */
- if ((__progname = _strrchr(namep, '/')) == NULL)
- __progname = namep;
- else
- __progname++;
- for (s = __progname_storage; *__progname &&
- s < &__progname_storage[sizeof __progname_storage - 1]; )
- *s++ = *__progname++;
- *s = '\0';
- __progname = __progname_storage;
- }
-
-#ifndef MD_NO_CLEANUP
- if (cleanup != NULL)
- atexit(cleanup);
- else
-#endif
- if (__init_tcb != NULL)
- __init_tcb(envp);
-
-#ifdef MCRT0
- atexit(_mcleanup);
- monstartup((u_long)&_eprol, (u_long)&_etext);
-#endif
-
- __init();
-
- exit(main(argc, argv, envp));
-}
-
-static char *
-_strrchr(char *p, char ch)
-{
- char *save;
-
- for (save = NULL;; ++p) {
- if (*p == ch)
- save = p;
- if (*p == '\0')
- return (save);
- }
-}
-
-#ifdef MCRT0
-MD_EPROL_LABEL;
-#endif
diff --git a/lib/csu/common_elf/crtbegin.c b/lib/csu/common_elf/crtbegin.c
deleted file mode 100644
index bf2c4fb09cd..00000000000
--- a/lib/csu/common_elf/crtbegin.c
+++ /dev/null
@@ -1,182 +0,0 @@
-/* $OpenBSD: crtbegin.c,v 1.17 2013/12/28 18:38:42 kettenis Exp $ */
-/* $NetBSD: crtbegin.c,v 1.1 1996/09/12 16:59:03 cgd Exp $ */
-
-/*
- * Copyright (c) 1993 Paul Kranenburg
- * All rights reserved.
- *
- * 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.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by Paul Kranenburg.
- * 4. The name of the author may not be used to endorse or promote products
- * derived from this software without specific prior written permission
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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.
- */
-
-/*
- * Run-time module for GNU C++ compiled shared libraries.
- *
- * The linker constructs the following arrays of pointers to global
- * constructors and destructors. The first element contains the
- * number of pointers in each.
- * The tables are also null-terminated.
- */
-#include <stdlib.h>
-
-#include "md_init.h"
-#include "os-note-elf.h"
-#include "extern.h"
-
-struct dwarf2_eh_object {
- void *space[8];
-};
-
-void __register_frame_info(const void *, struct dwarf2_eh_object *)
- __attribute__((weak));
-
-void __register_frame_info(const void *begin, struct dwarf2_eh_object *ob)
-{
-}
-
-static const char __EH_FRAME_BEGIN__[]
- __attribute__((section(".eh_frame"), aligned(4))) = { };
-
-/*
- * java class registration hooks
- */
-
-#if (__GNUC__ > 2)
-static void *__JCR_LIST__[]
- __attribute__((section(".jcr"), aligned(sizeof(void*)))) = { };
-
-extern void _Jv_RegisterClasses (void *)
- __attribute__((weak));
-#endif
-
-/*
- * Include support for the __cxa_atexit/__cxa_finalize C++ abi for
- * gcc > 2.x. __dso_handle is NULL in the main program and a unique
- * value for each C++ shared library. For more info on this API, see:
- *
- * http://www.codesourcery.com/cxx-abi/abi.html#dso-dtor
- */
-
-#if (__GNUC__ > 2)
-void *__dso_handle = NULL;
-__asm(".hidden __dso_handle");
-
-long __guard_local __dso_hidden __attribute__((section(".openbsd.randomdata")));
-
-extern int __cxa_atexit(void (*)(void *), void *, void *) __attribute__((weak));
-
-int
-atexit(void (*fn)(void))
-{
- return (__cxa_atexit((void (*)(void *))fn, NULL, NULL));
-}
-#endif
-
-static const init_f __CTOR_LIST__[1]
- __attribute__((section(".ctors"))) = { (void *)-1 }; /* XXX */
-static const init_f __DTOR_LIST__[1]
- __attribute__((section(".dtors"))) = { (void *)-1 }; /* XXX */
-
-static void __dtors(void) __used;
-static void __ctors(void) __used;
-
-static void
-__ctors()
-{
- unsigned long i = (unsigned long) __CTOR_LIST__[0];
- const init_f *p;
-
- if (i == -1) {
- for (i = 1; __CTOR_LIST__[i] != NULL; i++)
- ;
- i--;
- }
- p = __CTOR_LIST__ + i;
- while (i--)
- (**p--)();
-}
-
-static void
-__dtors()
-{
- const init_f *p = __DTOR_LIST__ + 1;
-
- while (*p)
- (**p++)();
-}
-
-void __init(void);
-void __fini(void);
-static void __do_init(void) __used;
-static void __do_fini(void) __used;
-
-MD_SECTION_PROLOGUE(".init", __init);
-
-MD_SECTION_PROLOGUE(".fini", __fini);
-
-MD_SECT_CALL_FUNC(".init", __do_init);
-MD_SECT_CALL_FUNC(".fini", __do_fini);
-
-
-void
-__do_init()
-{
- static int initialized = 0;
- static struct dwarf2_eh_object object;
-
- /*
- * Call global constructors.
- * Arrange to call global destructors at exit.
- */
- if (!initialized) {
- initialized = 1;
-
- __register_frame_info(__EH_FRAME_BEGIN__, &object);
-
-#if (__GNUC__ > 2)
- if (__JCR_LIST__[0] && _Jv_RegisterClasses)
- _Jv_RegisterClasses(__JCR_LIST__);
-#endif
-
- (__ctors)();
-
- atexit(__fini);
- }
-}
-
-void
-__do_fini()
-{
- static int finalized = 0;
-
- if (!finalized) {
- finalized = 1;
- /*
- * Call global destructors.
- */
- (__dtors)();
- }
-}
-
diff --git a/lib/csu/common_elf/crtbeginS.c b/lib/csu/common_elf/crtbeginS.c
deleted file mode 100644
index f3c784214a7..00000000000
--- a/lib/csu/common_elf/crtbeginS.c
+++ /dev/null
@@ -1,171 +0,0 @@
-/* $OpenBSD: crtbeginS.c,v 1.14 2013/12/28 18:38:42 kettenis Exp $ */
-/* $NetBSD: crtbegin.c,v 1.1 1996/09/12 16:59:03 cgd Exp $ */
-
-/*
- * Copyright (c) 1993 Paul Kranenburg
- * All rights reserved.
- *
- * 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.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by Paul Kranenburg.
- * 4. The name of the author may not be used to endorse or promote products
- * derived from this software without specific prior written permission
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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.
- */
-
-/*
- * Run-time module for GNU C++ compiled shared libraries.
- *
- * The linker constructs the following arrays of pointers to global
- * constructors and destructors. The first element contains the
- * number of pointers in each.
- * The tables are also null-terminated.
-
- */
-#include <stdlib.h>
-
-#include "md_init.h"
-#include "os-note-elf.h"
-#include "extern.h"
-
-/*
- * java class registration hooks
- */
-
-#if (__GNUC__ > 2)
-static void *__JCR_LIST__[]
- __attribute__((section(".jcr"), aligned(sizeof(void*)))) = { };
-
-extern void _Jv_RegisterClasses (void *)
- __attribute__((weak));
-#endif
-
-/*
- * Include support for the __cxa_atexit/__cxa_finalize C++ abi for
- * gcc > 2.x. __dso_handle is NULL in the main program and a unique
- * value for each C++ shared library. For more info on this API, see:
- *
- * http://www.codesourcery.com/cxx-abi/abi.html#dso-dtor
- */
-
-#if (__GNUC__ > 2)
-void *__dso_handle = &__dso_handle;
-__asm(".hidden __dso_handle");
-
-long __guard_local __dso_hidden __attribute__((section(".openbsd.randomdata")));
-
-extern int __cxa_atexit(void (*)(void *), void *, void *) __attribute__((weak));
-extern void __cxa_finalize(void *) __attribute__((weak));
-
-int
-atexit(void (*fn)(void))
-{
- return (__cxa_atexit((void (*)(void *))fn, NULL, &__dso_handle));
-}
-asm(".hidden atexit");
-#endif
-
-static init_f __CTOR_LIST__[1]
- __attribute__((section(".ctors"))) = { (void *)-1 }; /* XXX */
-static init_f __DTOR_LIST__[1]
- __attribute__((section(".dtors"))) = { (void *)-1 }; /* XXX */
-
-static void __dtors(void) __used;
-static void __ctors(void) __used;
-
-void
-__ctors(void)
-{
- unsigned long i = (unsigned long) __CTOR_LIST__[0];
- init_f *p;
-
- if (i == -1) {
- for (i = 1; __CTOR_LIST__[i] != NULL; i++)
- ;
- i--;
- }
- p = __CTOR_LIST__ + i;
- while (i--) {
- (**p--)();
- }
-}
-
-static void
-__dtors(void)
-{
- init_f *p = __DTOR_LIST__ + 1;
-
- while (*p) {
- (**p++)();
- }
-}
-void _init(void);
-void _fini(void);
-static void _do_init(void) __used;
-static void _do_fini(void) __used;
-
-MD_SECTION_PROLOGUE(".init", _init);
-
-MD_SECTION_PROLOGUE(".fini", _fini);
-
-MD_SECT_CALL_FUNC(".init", _do_init);
-MD_SECT_CALL_FUNC(".fini", _do_fini);
-
-void
-_do_init(void)
-{
- static int initialized = 0;
-
- /*
- * Call global constructors.
- * Arrange to call global destructors at exit.
- */
- if (!initialized) {
- initialized = 1;
-
-#if (__GNUC__ > 2)
- if (__JCR_LIST__[0] && _Jv_RegisterClasses)
- _Jv_RegisterClasses(__JCR_LIST__);
-#endif
-
- __ctors();
- }
-}
-
-void
-_do_fini(void)
-{
- static int finalized = 0;
- if (!finalized) {
- finalized = 1;
-
-#if (__GNUC__ > 2)
- if (__cxa_finalize != NULL)
- __cxa_finalize(__dso_handle);
-#endif
-
- /*
- * since the _init() function sets up the destructors to
- * be called by atexit, do not call the destructors here.
- */
- __dtors();
- }
-}
diff --git a/lib/csu/common_elf/crtend.c b/lib/csu/common_elf/crtend.c
deleted file mode 100644
index 287e7bc1045..00000000000
--- a/lib/csu/common_elf/crtend.c
+++ /dev/null
@@ -1,22 +0,0 @@
-/* $OpenBSD: crtend.c,v 1.10 2012/12/05 23:19:57 deraadt Exp $ */
-/* $NetBSD: crtend.c,v 1.1 1996/09/12 16:59:04 cgd Exp $ */
-
-#include <sys/types.h>
-#include "md_init.h"
-#include "extern.h"
-
-static init_f __CTOR_LIST__[1]
- __used __attribute__((section(".ctors"))) = { (void *)0 }; /* XXX */
-static init_f __DTOR_LIST__[1]
- __used __attribute__((section(".dtors"))) = { (void *)0 }; /* XXX */
-
-static const int __EH_FRAME_END__[]
- __used __attribute__((section(".eh_frame"), aligned(4))) = { 0 };
-
-#if (__GNUC__ > 2)
-static void * __JCR_END__[]
- __used __attribute__((section(".jcr"), aligned(sizeof(void*)))) = { 0 };
-#endif
-
-MD_SECTION_EPILOGUE(".init");
-MD_SECTION_EPILOGUE(".fini");
diff --git a/lib/csu/common_elf/crtendS.c b/lib/csu/common_elf/crtendS.c
deleted file mode 100644
index 6ebfc5b3591..00000000000
--- a/lib/csu/common_elf/crtendS.c
+++ /dev/null
@@ -1,19 +0,0 @@
-/* $OpenBSD: crtendS.c,v 1.8 2012/12/05 23:19:57 deraadt Exp $ */
-/* $NetBSD: crtend.c,v 1.1 1997/04/16 19:38:24 thorpej Exp $ */
-
-#include <sys/types.h>
-#include "md_init.h"
-#include "extern.h"
-
-static init_f __CTOR_LIST__[1]
- __used __attribute__((section(".ctors"))) = { (void *)0 }; /* XXX */
-static init_f __DTOR_LIST__[1]
- __used __attribute__((section(".dtors"))) = { (void *)0 }; /* XXX */
-
-#if (__GNUC__ > 2)
-static void * __JCR_END__[]
- __used __attribute__((section(".jcr"), aligned(sizeof(void*)))) = { 0 };
-#endif
-
-MD_SECTION_EPILOGUE(".init");
-MD_SECTION_EPILOGUE(".fini");
diff --git a/lib/csu/common_elf/extern.h b/lib/csu/common_elf/extern.h
deleted file mode 100644
index 53d49a36788..00000000000
--- a/lib/csu/common_elf/extern.h
+++ /dev/null
@@ -1,23 +0,0 @@
-/*
- * Copyright (c) 2004 Marc Espie <espie@openbsd.org>
- *
- * Permission to use, copy, modify, and distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
- * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
- * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
- * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
- * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
- * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
- * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
- */
-struct ps_strings;
-
-extern void ___start(int argc, char **argv, char **envp, void (*cleanup)(void),
- const void *obj, struct ps_strings *ps_strings);
-extern void __init(void);
-extern int main(int argc, char *argv[], char *envp[]);
-
-typedef void (*init_f)(void);
diff --git a/lib/csu/common_elf/os-note-elf.h b/lib/csu/common_elf/os-note-elf.h
deleted file mode 100644
index 48e33f22eb9..00000000000
--- a/lib/csu/common_elf/os-note-elf.h
+++ /dev/null
@@ -1,19 +0,0 @@
-/* $OpenBSD: os-note-elf.h,v 1.5 2009/03/06 23:13:40 kurt Exp $ */
-/*
- * Contents:
- *
- * long Name length
- * long Description length
- * long ELF_NOTE_TYPE_OSVERSION (1) XXX - need a define.
- * "OpenBSD\0"
- * version? 0 XXX
- */
-
-__asm(" .section \".note.openbsd.ident\", \"a\"\n"
-" .p2align 2\n"
-" .long 8\n"
-" .long 4\n"
-" .long 1\n"
-" .ascii \"OpenBSD\\0\"\n"
-" .long 0\n"
-" .previous\n");