Fix dlsym(3) to do breadth first search.

dlsym(3) with handle != RTLD_DEFAULT|RTLD_NEXT performs
  breadth first search through the dependency tree.

Bug: 16653281

(cherry picked from commit aa0f2bdbc2)

Change-Id: I0ba8c2034ab341f8a279cdb4e2e7e47f1aef7897
This commit is contained in:
Dmitriy Ivanov
2014-07-28 17:32:20 -07:00
parent 2ea0a58e01
commit 422106a24d
7 changed files with 128 additions and 19 deletions

View File

@@ -111,8 +111,7 @@ void* dlsym(void* handle, const char* symbol) {
sym = dlsym_linear_lookup(symbol, &found, caller_si->next, caller_si);
}
} else {
found = reinterpret_cast<soinfo*>(handle);
sym = dlsym_handle_lookup(found, symbol, caller_si);
sym = dlsym_handle_lookup(reinterpret_cast<soinfo*>(handle), &found, symbol, caller_si);
}
if (sym != NULL && sym->st_shndx != 0) {