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
Change-Id: I017a6975d1a62abb0218a7eb59ae4deba458e324
diff --git a/linker/dlfcn.cpp b/linker/dlfcn.cpp
index efb829e..8ebf357 100644
--- a/linker/dlfcn.cpp
+++ b/linker/dlfcn.cpp
@@ -111,8 +111,7 @@
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) {