commit | ce44166c737b6737c3a0820bef10b074a5e36cf8 | [log] [tgz] |
---|---|---|
author | Dmitriy Ivanov <dimitry@google.com> | Tue Jun 17 15:56:38 2014 -0700 |
committer | Dmitriy Ivanov <dimitry@google.com> | Tue Jun 17 16:18:18 2014 -0700 |
tree | a4d48a5f20e3eddd69205504086e980ed6c675c5 | |
parent | 1d2b4c022c419e1e85336fa44e644772eefb8b64 [diff] [blame] |
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
diff --git a/linker/dlfcn.cpp b/linker/dlfcn.cpp index 6d63ad6..0b60ef5 100644 --- a/linker/dlfcn.cpp +++ b/linker/dlfcn.cpp
@@ -118,7 +118,7 @@ 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); }