From 183799fd6eb753239dccb0ace66412ed9c19247a Mon Sep 17 00:00:00 2001 From: Eric Andersen Date: Thu, 8 Aug 2002 15:47:22 +0000 Subject: Add a simple test for shared lib ctor/dtors -Erik --- test/ldso/Makefile | 1 + test/ldso/howdy.c | 12 ++++++++++++ 2 files changed, 13 insertions(+) (limited to 'test') diff --git a/test/ldso/Makefile b/test/ldso/Makefile index 0a3f010c3..57b4a1fa6 100644 --- a/test/ldso/Makefile +++ b/test/ldso/Makefile @@ -19,6 +19,7 @@ TESTDIR=../ include $(TESTDIR)/Rules.mak +CFLAGS+=--uclibc-ctors all: dltest libhowdy.so run dltest.o: dltest.c diff --git a/test/ldso/howdy.c b/test/ldso/howdy.c index 00a144b30..343c81d7c 100644 --- a/test/ldso/howdy.c +++ b/test/ldso/howdy.c @@ -5,3 +5,15 @@ int howdy(const char *s) return printf("howdy: %s\n", s); } +void __attribute__((constructor)) howdy_ctor(void) +{ + printf("I am the libhowdy constructor!\n"); +} + +void __attribute__((destructor)) howdy_dtor(void) +{ + printf("I am the libhowdy destructor!\n"); +} + + + -- cgit v1.2.3