Look into local group on dlsym with RTLD_DEFAULT
Fix dlsym to look into local group when called with RTLD_DEFAULT and RTLD_NEXT. Bug: 17512583 Change-Id: I541354e89539c712af2ea4ec751e546913027084
This commit is contained in:
@@ -101,16 +101,11 @@ void* dlsym(void* handle, const char* symbol) {
|
||||
|
||||
soinfo* found = nullptr;
|
||||
ElfW(Sym)* sym = nullptr;
|
||||
if (handle == RTLD_DEFAULT) {
|
||||
sym = dlsym_linear_lookup(symbol, &found, nullptr);
|
||||
} else if (handle == RTLD_NEXT) {
|
||||
void* caller_addr = __builtin_return_address(0);
|
||||
soinfo* si = find_containing_library(caller_addr);
|
||||
void* caller_addr = __builtin_return_address(0);
|
||||
soinfo* caller = find_containing_library(caller_addr);
|
||||
|
||||
sym = nullptr;
|
||||
if (si && si->next) {
|
||||
sym = dlsym_linear_lookup(symbol, &found, si->next);
|
||||
}
|
||||
if (handle == RTLD_DEFAULT || handle == RTLD_NEXT) {
|
||||
sym = dlsym_linear_lookup(symbol, &found, caller, handle);
|
||||
} else {
|
||||
sym = dlsym_handle_lookup(reinterpret_cast<soinfo*>(handle), &found, symbol);
|
||||
}
|
||||
|
Reference in New Issue
Block a user