소스 검색

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.
Rich Felker 12 년 전
부모
커밋
5f88c0edd5
1개의 변경된 파일2개의 추가작업 그리고 1개의 파일을 삭제
  1. 2 1
      src/ldso/dynlink.c

+ 2 - 1
src/ldso/dynlink.c

@@ -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;