small dynamic linker module search fix
authorRich Felker <dalias@aerifal.cx>
Fri, 5 Oct 2012 16:09:54 +0000 (12:09 -0400)
committerRich Felker <dalias@aerifal.cx>
Fri, 5 Oct 2012 16:09:54 +0000 (12:09 -0400)
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.

src/ldso/dynlink.c

index f2bcd0f3d401e8dca13178d3b1a8dba64866dd0d..3f9bc1451fefa2e4c2dbfb730288f4c443def4c9 100644 (file)
@@ -483,7 +483,8 @@ static struct dso *load_library(const char *name)
                        /* If this library was previously loaded with a
                         * pathname but a search found the same inode,
                         * 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);
                        p->refcnt++;
                        return p;