small dynamic linker module search fix

libraries loaded more than once by pathname should not get shortnames
that would cause them to later be used to satisfy non-pathname load
requests.
This commit is contained in:
Rich Felker 2012-10-05 12:09:54 -04:00
parent dcd6037150
commit 5f88c0edd5
1 changed files with 2 additions and 1 deletions

View File

@ -483,7 +483,8 @@ static struct dso *load_library(const char *name)
/* If this library was previously loaded with a /* If this library was previously loaded with a
* pathname but a search found the same inode, * pathname but a search found the same inode,
* setup its shortname so it can be found by name. */ * setup its shortname so it can be found by name. */
if (!p->shortname) p->shortname = strrchr(p->name, '/')+1; if (!p->shortname && pathname != name)
p->shortname = strrchr(p->name, '/')+1;
close(fd); close(fd);
p->refcnt++; p->refcnt++;
return p; return p;