Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
* dlfcn/Makefile: Add rules to build and run bug-atexit3.
* dlfcn/bug-atexit3.c: New file. * dlfcn/bug-atexit3-lib.cc: New file.
- Loading branch information
Ulrich Drepper
committed
Jul 27, 2006
1 parent
3a975ff
commit 6de1f62
Showing
4 changed files
with
55 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
#include <unistd.h> | ||
|
||
struct statclass | ||
{ | ||
statclass() | ||
{ | ||
write (1, "statclass\n", 10); | ||
} | ||
~statclass() | ||
{ | ||
write (1, "~statclass\n", 11); | ||
} | ||
}; | ||
|
||
struct extclass | ||
{ | ||
~extclass() | ||
{ | ||
static statclass var; | ||
} | ||
}; | ||
|
||
extclass globvar; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
#include <dlfcn.h> | ||
#include <stdio.h> | ||
|
||
static int | ||
do_test (void) | ||
{ | ||
void *handle = dlopen ("$ORIGIN/bug-atexit3-lib.so", RTLD_LAZY); | ||
if (handle == NULL) | ||
{ | ||
printf ("dlopen failed: %s\n", dlerror ()); | ||
return 1; | ||
} | ||
dlclose (handle); | ||
return 0; | ||
} | ||
|
||
#define TEST_FUNCTION do_test () | ||
#include "../test-skeleton.c" |