From b1f68750871f1d447fb7d36b24590084239730b5 Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Wed, 27 Oct 2004 20:27:40 +0000 Subject: Update. 2004-10-27 Ulrich Drepper * 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. --- elf/tst-dlmopen1mod.c | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'elf/tst-dlmopen1mod.c') 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 +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; } -- cgit v1.2.3