about summary refs log tree commit diff
path: root/elf/tst-dlmopen1mod.c
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2004-10-27 20:27:40 +0000
committerUlrich Drepper <drepper@redhat.com>2004-10-27 20:27:40 +0000
commitb1f68750871f1d447fb7d36b24590084239730b5 (patch)
treeecdd086d98ff3bf509a78a866f1e765876751fe0 /elf/tst-dlmopen1mod.c
parent778cddad1775602453d3a8ca5797e39f2632de66 (diff)
downloadglibc-b1f68750871f1d447fb7d36b24590084239730b5.tar.gz
glibc-b1f68750871f1d447fb7d36b24590084239730b5.tar.xz
glibc-b1f68750871f1d447fb7d36b24590084239730b5.zip
Update.
2004-10-27  Ulrich Drepper  <drepper@redhat.com>

	* elf/dl-fini.c (_dl_fini): Fix search for map in maps array.
	Reverse order of namespaces.
	* elf/Makefile: Add rules to build and run tst-dlmopen3.
	* elf/tst-dlmopen3.c: New file.
	* elf/tst-dlmopen1mod.c: Add check whether constructor runs.
Diffstat (limited to 'elf/tst-dlmopen1mod.c')
-rw-r--r--elf/tst-dlmopen1mod.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/elf/tst-dlmopen1mod.c b/elf/tst-dlmopen1mod.c
index 40a4c8fa44..142488098a 100644
--- a/elf/tst-dlmopen1mod.c
+++ b/elf/tst-dlmopen1mod.c
@@ -3,6 +3,16 @@
 #include <gnu/lib-names.h>
 
 
+static int cnt;
+
+static void
+__attribute ((constructor))
+constr (void)
+{
+  ++cnt;
+}
+
+
 int
 foo (Lmid_t ns2)
 {
@@ -34,5 +44,16 @@ foo (Lmid_t ns2)
       return 1;
     }
 
+  if (cnt == 0)
+    {
+      puts ("constructor did not run");
+      return 1;
+    }
+  else if (cnt != 1)
+    {
+      puts ("constructor did not run exactly once");
+      return 1;
+    }
+
   return 0;
 }