Fix weak function lookups
* Linker now correctly resolves function defined with __attribute__((weak)). Bug: https://code.google.com/p/android/issues/detail?id=70206 Change-Id: I82efb905676c25fefb1b11a13f5fecb0f1384657
This commit is contained in:
@@ -118,7 +118,7 @@ void* dlsym(void* handle, const char* symbol) {
|
||||
if (sym != NULL) {
|
||||
unsigned bind = ELF_ST_BIND(sym->st_info);
|
||||
|
||||
if (bind == STB_GLOBAL && sym->st_shndx != 0) {
|
||||
if ((bind == STB_GLOBAL || bind == STB_WEAK) && sym->st_shndx != 0) {
|
||||
return reinterpret_cast<void*>(sym->st_value + found->load_bias);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user