Last change
on this file was 2036, checked in by bird, 20 years ago |
Initial revision
|
-
Property cvs2svn:cvs-rev
set to
1.1
-
Property svn:eol-style
set to
native
-
Property svn:executable
set to
*
-
Property svn:keywords
set to
Author Date Id Revision
|
File size:
517 bytes
|
Line | |
---|
1 | #include <dlfcn.h>
|
---|
2 | #include <stdio.h>
|
---|
3 |
|
---|
4 | int
|
---|
5 | xyzzy (void)
|
---|
6 | {
|
---|
7 | printf ("%s:%s\n", __FILE__, __func__);
|
---|
8 | return 21;
|
---|
9 | }
|
---|
10 |
|
---|
11 | int
|
---|
12 | back (void)
|
---|
13 | {
|
---|
14 | printf ("%s:%s\n", __FILE__, __func__);
|
---|
15 | return 1;
|
---|
16 | }
|
---|
17 |
|
---|
18 | extern int foo (void);
|
---|
19 |
|
---|
20 | static int
|
---|
21 | do_test (void)
|
---|
22 | {
|
---|
23 | void *p = dlopen ("$ORIGIN/tst-deep1mod2.so", RTLD_LAZY|RTLD_DEEPBIND);
|
---|
24 |
|
---|
25 | int (*f) (void) = dlsym (p, "bar");
|
---|
26 | if (f == NULL)
|
---|
27 | {
|
---|
28 | puts (dlerror ());
|
---|
29 | return 1;
|
---|
30 | }
|
---|
31 |
|
---|
32 | return foo () + f ();
|
---|
33 | }
|
---|
34 |
|
---|
35 | #define TEST_FUNCTION do_test ()
|
---|
36 | #include "../test-skeleton.c"
|
---|
Note:
See
TracBrowser
for help on using the repository browser.