Bugzilla Bug 280984: need to pass the L_IGNOREUNLOAD flag to loadquery so

that shared libraries that have been dlclose'd but with nonzero ref count
will be listed.  Also use function address test, which is more reliable
than file name test.  The patch is contributed by Philip K. Warren (IBM)
<pkwarren@gmail.com>. r=wtc.
This commit is contained in:
wtchang%redhat.com 2005-02-05 01:56:54 +00:00
Родитель 3e7ddbbd34
Коммит 9381f49b94
1 изменённых файлов: 4 добавлений и 2 удалений

Просмотреть файл

@ -1760,7 +1760,7 @@ PR_GetLibraryFilePathname(const char *name, PRFuncPtr addr)
return NULL;
}
/* If buffer is too small, loadquery fails with ENOMEM. */
if (loadquery(L_GETINFO, info, info_length) != -1) {
if (loadquery(L_GETINFO | L_IGNOREUNLOAD, info, info_length) != -1) {
break;
}
PR_Free(info);
@ -1776,7 +1776,9 @@ PR_GetLibraryFilePathname(const char *name, PRFuncPtr addr)
for (infop = info;
;
infop = (struct ld_info *)((char *)infop + infop->ldinfo_next)) {
if (strstr(infop->ldinfo_filename, name) != NULL) {
unsigned long start = (unsigned long)infop->ldinfo_dataorg;
unsigned long end = start + infop->ldinfo_datasize;
if (start <= (unsigned long)addr && end > (unsigned long)addr) {
result = PR_Malloc(strlen(infop->ldinfo_filename)+1);
if (result != NULL) {
strcpy(result, infop->ldinfo_filename);