projects
/
platform
/
upstream
/
glibc.git
/ blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
history
|
raw
|
HEAD
Update.
[platform/upstream/glibc.git]
/
elf
/
constload1.c
1
#include <dlfcn.h>
2
#include <errno.h>
3
#include <error.h>
4
#include <mcheck.h>
5
#include <stdlib.h>
6
7
int
8
main (void)
9
{
10
int (*foo) (void);
11
void *h;
12
int ret;
13
14
mtrace ();
15
16
h = dlopen ("constload2.so", RTLD_LAZY | RTLD_GLOBAL);
17
if (h == NULL)
18
error (EXIT_FAILURE, errno, "cannot load module \"constload2.so\"");
19
foo = dlsym (h, "foo");
20
ret = foo ();
21
if (dlclose (h) != 0)
22
{
23
puts ("failed to close");
24
exit (EXIT_FAILURE);
25
}
26
return ret;
27
}