diff options
author | Artur Grabowski <art@cvs.openbsd.org> | 2001-01-25 05:37:21 +0000 |
---|---|---|
committer | Artur Grabowski <art@cvs.openbsd.org> | 2001-01-25 05:37:21 +0000 |
commit | 7d939435d7da1593848247ec7f7f9974f0f341c9 (patch) | |
tree | f445ea79f75e1fc4b7c182e99f6de94d928ab8eb /lib | |
parent | ff99a23e859470a9ecc8e00d2702db176c3dc532 (diff) |
This is not how we'll do dynamic libraries on alpha anyway.
Zap dead code.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/csu/alpha/Makefile | 18 | ||||
-rw-r--r-- | lib/csu/alpha/crt0.c | 101 |
2 files changed, 17 insertions, 102 deletions
diff --git a/lib/csu/alpha/Makefile b/lib/csu/alpha/Makefile index c4ac7bd97e3..381806925ad 100644 --- a/lib/csu/alpha/Makefile +++ b/lib/csu/alpha/Makefile @@ -1,19 +1,21 @@ -# $OpenBSD: Makefile,v 1.6 1998/06/01 19:38:04 mickey Exp $ +# $OpenBSD: Makefile,v 1.7 2001/01/25 05:37:20 art Exp $ # $NetBSD: Makefile,v 1.6 1996/10/18 05:27:38 thorpej Exp $ .include <bsd.own.mk> # for ELF_TOOLCHAIN definition -CFLAGS+= -DLIBC_SCCS -DPIC -DDYNAMIC -DELFSIZE=64 +CFLAGS+= -DLIBC_SCCS -DPIC -DELFSIZE=64 CFLAGS+= -I${.CURDIR}/../../../libexec/elf_rtld/include .if !defined(ELF_TOOLCHAIN) CFLAGS+= -DECOFF_COMPAT .endif -OBJS= crt0.o gcrt0.o crtbegin.o crtend.o +OBJS= crt0.o gcrt0.o crtbegin.o crtend.o crtbeginS.o crtendS.o CLEANFILES+= core a.out +PICFLAG?=-fpic + all: ${OBJS} crt0.o: crt0.c @@ -31,11 +33,21 @@ crtbegin.o: crtbegin.c @${LD} -x -r -o ${.TARGET} ${.TARGET}.o @rm -f ${.TARGET}.o +crtbeginS.o: crtbegin.c + ${COMPILE.c} ${PICFLAG} ${.ALLSRC} -o ${.TARGET}.o + @${LD} -x -r -o ${.TARGET} ${.TARGET}.o + @rm -f ${.TARGET}.o + crtend.o: crtend.c ${COMPILE.c} ${.ALLSRC} -o ${.TARGET}.o @${LD} -x -r -o ${.TARGET} ${.TARGET}.o @rm -f ${.TARGET}.o +crtendS.o: crtend.c + ${COMPILE.c} ${PICFLAG} ${.ALLSRC} -o ${.TARGET}.o + @${LD} -x -r -o ${.TARGET} ${.TARGET}.o + @rm -f ${.TARGET}.o + install: ${INSTALL} ${INSTALL_COPY} -o ${BINOWN} -g ${BINGRP} -m 444 ${OBJS} \ ${DESTDIR}/usr/lib diff --git a/lib/csu/alpha/crt0.c b/lib/csu/alpha/crt0.c index 513c070968b..8140ac9f231 100644 --- a/lib/csu/alpha/crt0.c +++ b/lib/csu/alpha/crt0.c @@ -1,4 +1,4 @@ -/* $OpenBSD: crt0.c,v 1.3 1999/08/20 14:11:34 niklas Exp $ */ +/* $OpenBSD: crt0.c,v 1.4 2001/01/25 05:37:20 art Exp $ */ /* $NetBSD: crt0.c,v 1.1 1996/09/12 16:59:02 cgd Exp $ */ /* * Copyright (c) 1995 Christopher G. Demetriou @@ -32,20 +32,12 @@ */ #if defined(LIBC_SCCS) && !defined(lint) -static char rcsid[] = "$OpenBSD: crt0.c,v 1.3 1999/08/20 14:11:34 niklas Exp $"; +static char rcsid[] = "$OpenBSD: crt0.c,v 1.4 2001/01/25 05:37:20 art Exp $"; #endif /* LIBC_SCCS and not lint */ -#ifdef ECOFF_COMPAT -#undef DYNAMIC -#endif - #include <stdlib.h> #include <sys/syscall.h> -#ifdef DYNAMIC -#include "rtld.h" -#else typedef void Obj_Entry; -#endif /* * Lots of the chunks of this file cobbled together from pieces of @@ -73,20 +65,6 @@ extern void __init __P((void)); extern void __fini __P((void)); #endif /* ECOFF_COMPAT */ -#ifdef DYNAMIC -void rtld_setup __P((void (*)(void), const Obj_Entry *obj)); - -const Obj_Entry *mainprog_obj; - -/* - * Arrange for _DYNAMIC to exist weakly at address zero. That way, - * if we happen to be compiling without -static but with without any - * shared libs present, things will still work. - */ -asm(".weak _DYNAMIC; _DYNAMIC = 0"); -extern int _DYNAMIC; -#endif /* DYNAMIC */ - #ifdef MCRT0 extern void monstartup __P((u_long, u_long)); extern void _mcleanup __P((void)); @@ -113,11 +91,6 @@ __start(sp, cleanup, obj) __progname++; } -#ifdef DYNAMIC - if (&_DYNAMIC != NULL) - rtld_setup(cleanup, obj); -#endif - #ifdef MCRT0 atexit(_mcleanup); monstartup((u_long)&_eprol, (u_long)&_etext); @@ -152,73 +125,3 @@ asm (" .text"); asm ("_eprol:"); #endif -#ifdef DYNAMIC -void -rtld_setup(cleanup, obj) - void (*cleanup) __P((void)); - const Obj_Entry *obj; -{ - - if ((obj == NULL) || (obj->magic != RTLD_MAGIC)) - _FATAL("Corrupt Obj_Entry pointer in GOT"); - if (obj->version != RTLD_VERSION) - _FATAL("Dynamic linker version mismatch"); - - mainprog_obj = obj; - atexit(cleanup); -} - -void * -dlopen(name, mode) - char *name; - int mode; -{ - - if (mainprog_obj == NULL) - return NULL; - return (mainprog_obj->dlopen)(name, mode); -} - -int -dlclose(fd) - void *fd; -{ - - if (mainprog_obj == NULL) - return -1; - return (mainprog_obj->dlclose)(fd); -} - -void * -dlsym(fd, name) - void *fd; - char *name; -{ - - if (mainprog_obj == NULL) - return NULL; - return (mainprog_obj->dlsym)(fd, name); -} - -#if 0 /* not supported for ELF shlibs, apparently */ -int -dlctl(fd, cmd, arg) - void *fd, *arg; - int cmd; -{ - - if (mainprog_obj == NULL) - return -1; - return (mainprog_obj->dlctl)(fd, cmd, arg); -} -#endif - -char * -dlerror() -{ - - if (mainprog_obj == NULL) - return NULL; - return (mainprog_obj->dlerror)(); -} -#endif /* DYNAMIC */ |