]> sourceware.org Git - glibc.git/commitdiff
Update.
authorUlrich Drepper <drepper@redhat.com>
Tue, 15 Aug 2000 08:23:49 +0000 (08:23 +0000)
committerUlrich Drepper <drepper@redhat.com>
Tue, 15 Aug 2000 08:23:49 +0000 (08:23 +0000)
* elf/constload1.c: Call mtrace.  Check return value of dlclose call.
* elf/constload2.c: Add destructor to unload constload3.

ChangeLog
elf/constload1.c
elf/constload2.c

index 963b03b7c1e2667a2af079db6f2f98081a1ab720..4dcd26372696eed9474bfdcb7ef5e0ed76d86d9f 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,8 @@
 2000-08-15  Ulrich Drepper  <drepper@redhat.com>
 
+       * elf/constload1.c: Call mtrace.  Check return value of dlclose call.
+       * elf/constload2.c: Add destructor to unload constload3.
+
        * include/link.h: Include sysd-link.h.
        * sysdeps/generic/sysd-link.h: New file.
        * sysdeps/unix/sysv/linux/sysd-link.h: New file.
index 1435284c62012d0ca6f759cf0abcc2bab042fd3b..4640b774cb34889c8fb46b9b7f4656b2f0dedd90 100644 (file)
@@ -1,6 +1,7 @@
 #include <dlfcn.h>
 #include <errno.h>
 #include <error.h>
+#include <mcheck.h>
 #include <stdlib.h>
 
 int
@@ -10,11 +11,17 @@ main (void)
   void *h;
   int ret;
 
+  mtrace ();
+
   h = dlopen ("constload2.so", RTLD_LAZY | RTLD_GLOBAL);
   if (h == NULL)
     error (EXIT_FAILURE, errno, "cannot load module \"constload2.so\"");
   foo = dlsym (h, "foo");
   ret = foo ();
-  dlclose (h);
+  if (dlclose (h) != 0)
+    {
+      puts ("failed to close");
+      exit (EXIT_FAILURE);
+    }
   return ret;
 }
index f109838cb8b760cf980754657e6537572d520d58..d20e6dcbb81c06046a248e46dcf83bbc39eb6f49 100644 (file)
@@ -1,4 +1,6 @@
 #include <dlfcn.h>
+#include <stdio.h>
+#include <stdlib.h>
 
 extern int bar (void);
 
@@ -21,4 +23,24 @@ __attribute__ ((__constructor__))
 init (void)
 {
   h = dlopen ("constload3.so", RTLD_GLOBAL | RTLD_LAZY);
+  if (h == NULL)
+    {
+      puts ("failed to load constload3");
+      exit (1);
+    }
+  else
+    puts ("succeeded loading constload3");
+}
+
+static void
+__attribute__ ((__destructor__))
+fini (void)
+{
+  if (dlclose (h) != 0)
+    {
+      puts ("failed to unload constload3");
+      exit (1);
+    }
+  else
+    puts ("succeeded unloading constload3");
 }
This page took 0.054994 seconds and 5 git commands to generate.