diff options
author | Theo de Raadt <deraadt@cvs.openbsd.org> | 2002-05-23 23:16:29 +0000 |
---|---|---|
committer | Theo de Raadt <deraadt@cvs.openbsd.org> | 2002-05-23 23:16:29 +0000 |
commit | 38a35b49b4503c1d19b0bdab6b093ead12c52aa1 (patch) | |
tree | 9d13d29e9de493a2ec7bb1c278663304a2ffe37c | |
parent | ef5bd749423e84793524382e1fcfc549b0377fef (diff) |
This stuff has no license. Delete it. If someone wants it back, get the licenses cleaned up, and put it in regress
-rw-r--r-- | libexec/ld.so/test/A.C | 29 | ||||
-rw-r--r-- | libexec/ld.so/test/B.C | 9 | ||||
-rw-r--r-- | libexec/ld.so/test/Makefile | 56 | ||||
-rw-r--r-- | libexec/ld.so/test/a.h | 17 | ||||
-rw-r--r-- | libexec/ld.so/test/dltest.c | 103 | ||||
-rw-r--r-- | libexec/ld.so/test/ldt.c | 10 | ||||
-rw-r--r-- | libexec/ld.so/test/libbar.c | 16 | ||||
-rw-r--r-- | libexec/ld.so/test/libdep.c | 19 | ||||
-rw-r--r-- | libexec/ld.so/test/libfoo.c | 20 | ||||
-rw-r--r-- | libexec/ld.so/test/tst.C | 9 |
10 files changed, 0 insertions, 288 deletions
diff --git a/libexec/ld.so/test/A.C b/libexec/ld.so/test/A.C deleted file mode 100644 index aaf9aa3127b..00000000000 --- a/libexec/ld.so/test/A.C +++ /dev/null @@ -1,29 +0,0 @@ -/* $OpenBSD: A.C,v 1.3 2001/01/28 19:34:29 niklas Exp $ */ - -#include "iostream.h" -#include "a.h" - -AA::AA(char *arg) -{ - cout << "A constructor " << arg << "\n"; - argstr = arg; -} -AA::~AA() -{ - cout << "A destructor " << argstr << "\n"; -} - -AA a("a");; -AA b("b");; -/* -AA f; -*/ - -B::B() -{ - cout << "B constructor\n"; -} -B::~B() -{ - cout << "B destructor\n"; -} diff --git a/libexec/ld.so/test/B.C b/libexec/ld.so/test/B.C deleted file mode 100644 index db3c8ea2d55..00000000000 --- a/libexec/ld.so/test/B.C +++ /dev/null @@ -1,9 +0,0 @@ -/* $OpenBSD: B.C,v 1.2 2001/01/28 19:34:29 niklas Exp $ */ - -#include "iostream.h" -#include "a.h" -AA e("e");; -AA f("f");; -/* -AA f; -*/ diff --git a/libexec/ld.so/test/Makefile b/libexec/ld.so/test/Makefile deleted file mode 100644 index f195ab46de5..00000000000 --- a/libexec/ld.so/test/Makefile +++ /dev/null @@ -1,56 +0,0 @@ -# $OpenBSD: Makefile,v 1.9 2002/02/11 13:58:49 art Exp $ - -DIR=/usr/src/libexec/ld.so/obj/ld.so -#necessary to build the shared objects. not necessary for dltest but -#doesn't hurt -CFLAGS += -fpic -CFLAGS += -g -CFLAGS += -I${.CURDIR}/.. -I${.CURDIR}/../${MACHINE_ARCH} -LDFLAGS += -Wl,--export-dynamic -Wl,-dynamic-linker,${DIR} -Wl,-rpath,. -#LDFLAGS += -Wl,--export-dynamic - -SRCS= ldt.c -PROG= ldt -MAN= -CLEANFILES= dltest dltest.o libfoo.so libfoo.o libbar.so libbar.o libdep.so -CLEANFILES+= libdep.o CCtest dltest A.o B.o tst.o libA.so libB.so - -all: dltest CCtest - -dltest: dltest.o libfoo.so libbar.so libdep.so - $(CC) ${CFLAGS} -o $@ dltest.o ${LDFLAGS} - -libfoo.so: libfoo.o - $(CC) -shared -o libfoo.so libfoo.o - -libbar.so: libbar.o - $(CC) -shared -o libbar.so libbar.o - -libdep.so: libdep.o - $(CC) -shared -o libdep.so libdep.o - -A.o: A.C - g++ -c ${CFLAGS} ${.IMPSRC} - -libA.so: A.o - $(CC) -shared -o $@ A.o - -B.o: B.C - g++ -c ${CFLAGS} ${.IMPSRC} - -libB.so: B.o - $(CC) -shared -o $@ B.o - -CCtest: libA.so libB.so tst.o - g++ ${LDFLAGS} -o $@ tst.o libB.so libA.so - -run: - @echo running CCtest - LD_LIBRARY_PATH=. CCtest - @echo running dltest -l bar -f bar - LD_LIBRARY_PATH=. dltest -l bar -f bar - @echo running dltest -l foo -f foo - LD_LIBRARY_PATH=. dltest -l foo -f foo - -.include <bsd.prog.mk> -.include <bsd.subdir.mk> diff --git a/libexec/ld.so/test/a.h b/libexec/ld.so/test/a.h deleted file mode 100644 index c70443765fd..00000000000 --- a/libexec/ld.so/test/a.h +++ /dev/null @@ -1,17 +0,0 @@ -/* $OpenBSD: a.h,v 1.3 2001/01/28 19:34:29 niklas Exp $ */ - -class B { -public: - B(); - ~B(); - int i; -}; - -class AA { - B b; - char *argstr; -public: - AA(char *arg); - ~AA(); - int i; -}; diff --git a/libexec/ld.so/test/dltest.c b/libexec/ld.so/test/dltest.c deleted file mode 100644 index 3293cdf3e12..00000000000 --- a/libexec/ld.so/test/dltest.c +++ /dev/null @@ -1,103 +0,0 @@ -/* $OpenBSD: dltest.c,v 1.5 2001/10/24 13:06:35 mpech Exp $ */ - -#include <stdio.h> -#include <stdlib.h> -#include <unistd.h> -#include <dlfcn.h> -#include <ctype.h> -#include <elf_abi.h> -#include <nlist.h> -#include "archdep.h" -#include "resolve.h" - -typedef void (*func_t)(const char *); - -#define DL_NOW 0 -void -dltest(const char *s) -{ - printf("From dltest: "); - for(;*s; s++) { - putchar(toupper(*s)); - } - putchar('\n'); -} -struct elf_object *foo; - -main(int argc, char **argv) -{ - void *handle; - func_t fptr; - char *libname = "libfoo.so"; - char **name = NULL; - char *funcname = "foo"; - char *param = "Dynamic Loading Test"; - int ch; - int mode; - - while((ch = getopt(argc, argv, "a:b:f:l:")) != -1) { - switch(ch) { - case 'a': - param = optarg; - break; - - case 'b': - switch(*optarg) { - case 'l': - mode = DL_LAZY; - break; - - case 'n': - mode = DL_NOW; - break; - } - break; - - case 'l': - libname = optarg; - break; - - case 'f': - funcname = optarg; - break; - } - } - - printf("opening library %s for function %s\n", libname, funcname); - handle = dlopen(libname, mode); - if(handle == NULL) { - fprintf(stderr, "%s: dlopen: '%s'\n", libname, dlerror()); - exit(1); - } - - fptr = (func_t)dlsym(handle, funcname); - if(fptr == NULL) { - fprintf(stderr, "%s: dlsym: '%s'\n", funcname, dlerror()); - exit(1); - } - - name = (char **)dlsym(handle, "libname"); - if(name == NULL) { - fprintf(stderr, "libname: dlsym: '%s'\n", dlerror()); - exit(1); - } - - printf("Call '%s' in '%s':\n", funcname, *name); - - (*fptr)(param); - -#ifdef __mips__ - dlctl(handle, DL_DUMP_MAP, NULL); -#endif /* __mips__ */ - - dlclose(handle); - - printf("After 'dlclose()'\n"); -#ifdef __mips__ - dlctl(handle, DL_DUMP_MAP, NULL); -#endif /* __mips__ */ - - return(0); -} - - diff --git a/libexec/ld.so/test/ldt.c b/libexec/ld.so/test/ldt.c deleted file mode 100644 index 74d9643e55b..00000000000 --- a/libexec/ld.so/test/ldt.c +++ /dev/null @@ -1,10 +0,0 @@ -/* $OpenBSD: ldt.c,v 1.2 2001/01/28 19:34:29 niklas Exp $ */ - -#include <stdio.h> -main() -{ - int ptr = (int)fprintf; - - printf("Hello world\n"); - printf("printf = 0x%08x\n", ptr); -} diff --git a/libexec/ld.so/test/libbar.c b/libexec/ld.so/test/libbar.c deleted file mode 100644 index 1ad13f83127..00000000000 --- a/libexec/ld.so/test/libbar.c +++ /dev/null @@ -1,16 +0,0 @@ -/* $OpenBSD: libbar.c,v 1.2 2001/01/28 19:34:29 niklas Exp $ */ - -#include <stdio.h> - -extern void dltest(const char *); -extern void dep(const char *s); - -const char *const libname = "libbar.so"; - -void bar(const char *s) -{ - dltest("called from libbar."); - printf("libbar: %s\n", s); - dep("!olleH!"); -} - diff --git a/libexec/ld.so/test/libdep.c b/libexec/ld.so/test/libdep.c deleted file mode 100644 index 364e7e81eba..00000000000 --- a/libexec/ld.so/test/libdep.c +++ /dev/null @@ -1,19 +0,0 @@ -/* $OpenBSD: libdep.c,v 1.2 2001/01/28 19:34:29 niklas Exp $ */ - -#include <stdio.h> -const char *const libname = "libdep.so"; - - -void -dep(const char *s) -{ - const char *saved = s; - - printf("libdep: "); - for(; *s; s++); - for(s--; s>= saved; s--) { - putchar(*s); - putchar('*'); - } - putchar('\n'); -} diff --git a/libexec/ld.so/test/libfoo.c b/libexec/ld.so/test/libfoo.c deleted file mode 100644 index 6ac55551988..00000000000 --- a/libexec/ld.so/test/libfoo.c +++ /dev/null @@ -1,20 +0,0 @@ -/* $OpenBSD: libfoo.c,v 1.2 2001/01/28 19:34:29 niklas Exp $ */ - -#include <stdio.h> - -extern void dltest(const char *s); -const char *const libname = "libfoo.so"; - -void -foo(const char *s) -{ - const char *saved = s; - - dltest("called from libfoo"); - printf("libfoo: "); - for(; *s; s++); - for(s--; s>= saved; s--) { - putchar(*s); - } - putchar('\n'); -} diff --git a/libexec/ld.so/test/tst.C b/libexec/ld.so/test/tst.C deleted file mode 100644 index 9bdb1ba958e..00000000000 --- a/libexec/ld.so/test/tst.C +++ /dev/null @@ -1,9 +0,0 @@ -/* $OpenBSD: tst.C,v 1.3 2001/01/28 19:34:29 niklas Exp $ */ - -#include "iostream.h" -#include "a.h" - -AA c("c"); -main() -{ -} |