glibc/dlfcn/failtestmod.c
Ulrich Drepper d743ba1e9b Update.
2000-06-09  H.J. Lu  <hjl@gnu.org>

	* dlfcn/dlerror.c (_dlerror_run): Set result->errstring to NULL
	after freeing it.

	* dlfcn/Makefile (distribute): Add failtestmod.c.
	(tests): Add failtest.
	Add rules to build and run failtest.
	* dlfcn/failtest.c: New file.
	* dlfcn/failtestmod.c: New file.
2000-06-10 04:31:24 +00:00

26 lines
398 B
C

#include <dlfcn.h>
#include <stdio.h>
void
__attribute__ ((__constructor__))
constr (void)
{
void *handle;
void *m;
/* Open the library. */
handle = dlopen (NULL, RTLD_NOW);
if (handle == NULL)
{
puts ("Cannot get handle to own object");
return;
}
/* Get a symbol. */
m = dlsym (handle, "main");
puts ("called dlsym() to get main");
dlclose (handle);
}