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
* elf/dl-close.c (_dl_close): If dependency is not unloaded make
sure no reference to the unloaded map's search list remains in the dependency's scope. 2006-09-16 Jakub Jelinek <jakub@redhat.com> * elf/Makefile: Add rules to build and run unload7 test. * elf/unload7.c: New test. * elf/unload7mod1.c: New file. * elf/unload7mod2.c: New file.
- Loading branch information
Ulrich Drepper
committed
Sep 19, 2006
1 parent
0466106
commit 1ee2ff2
Showing
6 changed files
with
90 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
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,39 @@ | ||
#include <dlfcn.h> | ||
#include <stdio.h> | ||
|
||
int | ||
main (void) | ||
{ | ||
void *h = dlopen ("$ORIGIN/unload7mod1.so", RTLD_LAZY); | ||
if (h == NULL) | ||
{ | ||
puts ("dlopen unload7mod1.so failed"); | ||
return 1; | ||
} | ||
|
||
int (*fn) (void); | ||
fn = dlsym (h, "foo"); | ||
if (fn == NULL) | ||
{ | ||
puts ("dlsym failed"); | ||
return 1; | ||
} | ||
|
||
int ret = 0; | ||
if (fn () == 0) | ||
++ret; | ||
|
||
void *h2 = dlopen ("$ORIGIN/unload7mod2.so", RTLD_LAZY); | ||
if (h2 == NULL) | ||
{ | ||
puts ("dlopen unload7mod2.so failed"); | ||
return 1; | ||
} | ||
dlclose (h2); | ||
|
||
if (fn () == 0) | ||
++ret; | ||
|
||
dlclose (h); | ||
return ret; | ||
} |
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,11 @@ | ||
#include <dlfcn.h> | ||
#include <stdio.h> | ||
|
||
int | ||
foo (int i) | ||
{ | ||
if (dlsym (RTLD_DEFAULT, "unload7_nonexistent_symbol") == NULL) | ||
return 1; | ||
puts ("dlsym returned non-NULL"); | ||
return 0; | ||
} |
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 @@ | ||
int x; |