diff options
Diffstat (limited to 'elf/restest1.c')
-rw-r--r-- | elf/restest1.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/elf/restest1.c b/elf/restest1.c index e4eca55..2b649c0 100644 --- a/elf/restest1.c +++ b/elf/restest1.c @@ -1,5 +1,6 @@ #include <dlfcn.h> #include <error.h> +#include <mcheck.h> #include <stdio.h> #include <stdlib.h> @@ -13,6 +14,8 @@ main (void) int res1; int res2; + mtrace (); + h1 = dlopen ("testobj1.so", RTLD_LAZY); if (h1 == NULL) error (EXIT_FAILURE, 0, "while loading `%s': %s", "testobj1.so", @@ -37,6 +40,11 @@ main (void) res2 = fp2 (10); printf ("fp1(10) = %d\nfp2(10) = %d\n", res1, res2); + if (dlclose (h1) != 0) + error (EXIT_FAILURE, 0, "cannot close testobj1.so: %s\n", dlerror ()); + if (dlclose (h2) != 0) + error (EXIT_FAILURE, 0, "cannot close testobj1_1.so: %s\n", dlerror ()); + return res1 != 42 || res2 != 72; } |