repo.or.cz
/
glibc.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
Fix ordering of DSO constructors and destructors.
[glibc.git]
/
elf
/
tst-leaks1.c
blob
36e4aee9cf86f0cdd5a6e04cab5f21f69b82c4af
1
#include <stdio.h>
2
#include <dlfcn.h>
3
#include <mcheck.h>
4
#include <stdlib.h>
5
6
int
7
main
(
void
)
8
{
9
mtrace
();
10
11
int
ret
=
0
;
12
for
(
int
i
=
0
;
i
<
10
;
i
++)
13
{
14
void
*
h
=
dlopen
(
i
<
5
?
"./tst-leaks1.c"
15
:
"$ORIGIN/tst-leaks1.o"
,
RTLD_LAZY
);
16
if
(
h
!=
NULL
)
17
{
18
puts
(
"dlopen unexpectedly succeeded"
);
19
ret
=
1
;
20
dlclose
(
h
);
21
}
22
}
23
24
return
ret
;
25
}