mirror of
https://sourceware.org/git/glibc.git
synced 2024-11-24 22:10:13 +00:00
20bb288327
* dlfcn/defaultmod1.c: Add prototypes to avoid warnings. * dlfcn/defaultmod2.c: Likewise. * dlfcn/dlopen.c: Likewise. * dlfcn/dlopenold.c: Likewise. * dlfcn/failtestmod.c: Likewise. * dlfcn/glreflib1.c: Likewise. * dlfcn/glreflib2.c: Likewise. * dlfcn/eval.c: Likewise. Add attributes. * ctype/ctype-extn.c: Define isblank and not __isblank.
27 lines
459 B
C
27 lines
459 B
C
#include <dlfcn.h>
|
|
#include <stdio.h>
|
|
|
|
|
|
extern void constr (void) __attribute__ ((__constructor__));
|
|
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);
|
|
}
|