repo.or.cz
/
binutils.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
Typo fix in most recent entry.
[binutils.git]
/
ld
/
testsuite
/
ld-elf
/
dl6cmain.c
blob
f6c285cdf6217202511b3f14159d9a35f52349fa
1
#include <stdio.h>
2
#include <dlfcn.h>
3
4
int
bar
= -
20
;
5
6
int
7
main
(
void
)
8
{
9
int
ret
=
0
;
10
void
*
handle
;
11
void
(*
fcn
) (
void
);
12
13
handle
=
dlopen
(
"./tmpdir/libdl6c.so"
,
RTLD_GLOBAL
|
RTLD_LAZY
);
14
if
(!
handle
)
15
{
16
printf
(
"dlopen ./tmpdir/libdl6c.so: %s
\n
"
,
dlerror
());
17
return
1
;
18
}
19
20
fcn
= (
void
(*)(
void
))
dlsym
(
handle
,
"foo"
);
21
if
(!
fcn
)
22
{
23
printf
(
"dlsym foo: %s
\n
"
,
dlerror
());
24
ret
+=
1
;
25
}
26
else
27
{
28
(*
fcn
) ();
29
}
30
31
dlclose
(
handle
);
32
return
ret
;
33
}