Merge "Look into ld_preloads before current library" into lmp-dev

This commit is contained in:
Dmitriy Ivanov 2014-09-01 21:08:54 +00:00 committed by Android (Google) Code Review
commit c191a8adee

View File

@ -495,6 +495,15 @@ static ElfW(Sym)* soinfo_do_lookup(soinfo* si, const char* name, soinfo** lsi, s
*lsi = si;
goto done;
}
/* Next, look for it in the preloads list */
for (int i = 0; g_ld_preloads[i] != NULL; i++) {
s = soinfo_elf_lookup(g_ld_preloads[i], elf_hash, name);
if (s != NULL) {
*lsi = g_ld_preloads[i];
goto done;
}
}
} else {
/* Order of symbol lookup is controlled by DT_SYMBOLIC flag */
@ -512,6 +521,15 @@ static ElfW(Sym)* soinfo_do_lookup(soinfo* si, const char* name, soinfo** lsi, s
*lsi = somain;
goto done;
}
/* Next, look for it in the preloads list */
for (int i = 0; g_ld_preloads[i] != NULL; i++) {
s = soinfo_elf_lookup(g_ld_preloads[i], elf_hash, name);
if (s != NULL) {
*lsi = g_ld_preloads[i];
goto done;
}
}
}
/* Look for symbols in the local scope (the object who is
@ -543,16 +561,16 @@ static ElfW(Sym)* soinfo_do_lookup(soinfo* si, const char* name, soinfo** lsi, s
*lsi = somain;
goto done;
}
}
}
}
/* Next, look for it in the preloads list */
for (int i = 0; g_ld_preloads[i] != NULL; i++) {
s = soinfo_elf_lookup(g_ld_preloads[i], elf_hash, name);
if (s != NULL) {
*lsi = g_ld_preloads[i];
goto done;
/* Next, look for it in the preloads list */
for (int i = 0; g_ld_preloads[i] != NULL; i++) {
s = soinfo_elf_lookup(g_ld_preloads[i], elf_hash, name);
if (s != NULL) {
*lsi = g_ld_preloads[i];
goto done;
}
}
}
}
}