am fde8642f: bionic/linker: keep track of opened libraries by basename
Merge commit 'fde8642fc43bdd224e43e5ee9583a49a758fb03c' * commit 'fde8642fc43bdd224e43e5ee9583a49a758fb03c': bionic/linker: keep track of opened libraries by basename
This commit is contained in:
commit
8b09aa39c3
|
@ -976,6 +976,7 @@ load_library(const char *name)
|
||||||
int cnt;
|
int cnt;
|
||||||
unsigned ext_sz;
|
unsigned ext_sz;
|
||||||
unsigned req_base;
|
unsigned req_base;
|
||||||
|
const char *bname;
|
||||||
soinfo *si = NULL;
|
soinfo *si = NULL;
|
||||||
Elf32_Ehdr *hdr;
|
Elf32_Ehdr *hdr;
|
||||||
|
|
||||||
|
@ -1009,7 +1010,8 @@ load_library(const char *name)
|
||||||
* same thing would happen if we failed during linking. Configuring the
|
* same thing would happen if we failed during linking. Configuring the
|
||||||
* soinfo struct here is a lot more convenient.
|
* soinfo struct here is a lot more convenient.
|
||||||
*/
|
*/
|
||||||
si = alloc_info(name);
|
bname = strrchr(name, '/');
|
||||||
|
si = alloc_info(bname ? bname + 1 : name);
|
||||||
if (si == NULL)
|
if (si == NULL)
|
||||||
goto fail;
|
goto fail;
|
||||||
|
|
||||||
|
@ -1078,9 +1080,11 @@ init_library(soinfo *si)
|
||||||
soinfo *find_library(const char *name)
|
soinfo *find_library(const char *name)
|
||||||
{
|
{
|
||||||
soinfo *si;
|
soinfo *si;
|
||||||
|
const char *bname = strrchr(name, '/');
|
||||||
|
bname = bname ? bname + 1 : name;
|
||||||
|
|
||||||
for(si = solist; si != 0; si = si->next){
|
for(si = solist; si != 0; si = si->next){
|
||||||
if(!strcmp(name, si->name)) {
|
if(!strcmp(bname, si->name)) {
|
||||||
if(si->flags & FLAG_ERROR) return 0;
|
if(si->flags & FLAG_ERROR) return 0;
|
||||||
if(si->flags & FLAG_LINKED) return si;
|
if(si->flags & FLAG_LINKED) return si;
|
||||||
DL_ERR("OOPS: %5d recursive link to '%s'", pid, si->name);
|
DL_ERR("OOPS: %5d recursive link to '%s'", pid, si->name);
|
||||||
|
|
Loading…
Reference in New Issue