mirror of
https://sourceware.org/git/glibc.git
synced 2025-08-08 17:42:12 +03:00
Update.
* elf/Makefile: Add rules to build and run initfirst test. * elf/initfirst.c: New file. * elf/firstobj.c: New file.
This commit is contained in:
22
elf/initfirst.c
Normal file
22
elf/initfirst.c
Normal file
@@ -0,0 +1,22 @@
|
||||
#include <dlfcn.h>
|
||||
#include <stdio.h>
|
||||
|
||||
int
|
||||
main (void)
|
||||
{
|
||||
void *h = dlopen ("firstobj.so", RTLD_LAZY);
|
||||
void *f;
|
||||
if (! h)
|
||||
{
|
||||
printf ("cannot find firstobj.so: %s\n", dlerror ());
|
||||
return 1;
|
||||
}
|
||||
f = dlsym (h, "foo");
|
||||
if (! f)
|
||||
{
|
||||
printf ("cannot find symbol foo: %s\n", dlerror ());
|
||||
return 2;
|
||||
}
|
||||
((void (*) (void)) f) ();
|
||||
return 0;
|
||||
}
|
Reference in New Issue
Block a user