Please sign in to comment.
bionic/linker: keep track of opened libraries by basename
Prior to this change, the dynamic loader kept track of opened libraries either by their base name (i.e., libfoo.so instead of /system/lib/libfoo.so) when the shared library was loaded through the DT_NEEDED tag in an ELF header, or by whatever name was passed to dlopen(). This created a number of problems, among which: 1. dlopen("libfoo.so") and dlopen("/path/to/libfoo.so") would open the same library twice; 2. dlopen("/path/to/libfoo.so") and then dlopen("libbar.so"), where libbar.so depends on libfoo.so, would open libfoo.so twice. This patch makes the dynamic loader keep track of each loaded library by basename, which resolves the above ambiguity. The patch also enforces library lookup by base name, which means that it will refuse to load another library that has the same name. Thanks for the inspiration Iliyan. Signed-off-by: Erik Gilling <email@example.com> Cc: Iliyan Malchev <firstname.lastname@example.org>
- Loading branch information...