summary refs log tree commit diff
path: root/elf/multiload.c
diff options
context:
space:
mode:
Diffstat (limited to 'elf/multiload.c')
-rw-r--r--elf/multiload.c26
1 files changed, 26 insertions, 0 deletions
diff --git a/elf/multiload.c b/elf/multiload.c
index 724c1ed562..3727d97f6a 100644
--- a/elf/multiload.c
+++ b/elf/multiload.c
@@ -1,5 +1,6 @@
 #include <dlfcn.h>
 #include <errno.h>
+#include <mcheck.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
@@ -16,6 +17,8 @@ main (void)
   char *base;
   char *buf;
 
+  mtrace ();
+
   /* Change to the binary directory.  */
   if (chdir (OBJDIR) != 0)
     {
@@ -68,6 +71,29 @@ main (void)
       exit (EXIT_FAILURE);
     }
 
+  if (dlclose (a) != 0)
+    {
+      puts ("closing `a' failed");
+      exit (EXIT_FAILURE);
+    }
+  if (dlclose (b) != 0)
+    {
+      puts ("closing `a' failed");
+      exit (EXIT_FAILURE);
+    }
+  if (dlclose (c) != 0)
+    {
+      puts ("closing `a' failed");
+      exit (EXIT_FAILURE);
+    }
+  if (dlclose (d) != 0)
+    {
+      puts ("closing `a' failed");
+      exit (EXIT_FAILURE);
+    }
+
+  free (wd);
+
   return 0;
 }