aboutsummaryrefslogtreecommitdiffstats
path: root/linker/linker.cpp
diff options
context:
space:
mode:
authorChris Dearman <chris.dearman>2013-11-13 17:22:33 -0800
committerDuane Sand <duane.sand@imgtec.com>2015-02-04 17:16:27 -0800
commit8e5538193915885ea859ac90a72b46ab04440cea (patch)
treeefa5bd0494d5afffd61b90ece4233f7ff178e7e7 /linker/linker.cpp
parent86d9896273e81941d16034fdbf781a3f2bf94b81 (diff)
downloadandroid_bionic-8e5538193915885ea859ac90a72b46ab04440cea.tar.gz
android_bionic-8e5538193915885ea859ac90a72b46ab04440cea.tar.bz2
android_bionic-8e5538193915885ea859ac90a72b46ab04440cea.zip
linker: Use load_bias to adjust search address in elf_addr_lookup
load_bias is the delta between a symbols address in memory and the value contained in the symbol table. Change-Id: I35c87b69025b64f7e4a1418ca766618f4533fb3e
Diffstat (limited to 'linker/linker.cpp')
-rw-r--r--linker/linker.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/linker/linker.cpp b/linker/linker.cpp
index f7bcd2750..39344849e 100644
--- a/linker/linker.cpp
+++ b/linker/linker.cpp
@@ -798,7 +798,7 @@ static bool symbol_matches_soaddr(const ElfW(Sym)* sym, ElfW(Addr) soaddr) {
}
ElfW(Sym)* soinfo::gnu_addr_lookup(const void* addr) {
- ElfW(Addr) soaddr = reinterpret_cast<ElfW(Addr)>(addr) - base;
+ ElfW(Addr) soaddr = reinterpret_cast<ElfW(Addr)>(addr) - load_bias;
for (size_t i = 0; i < nbucket_; ++i) {
uint32_t n = bucket_[i];
@@ -819,7 +819,7 @@ ElfW(Sym)* soinfo::gnu_addr_lookup(const void* addr) {
}
ElfW(Sym)* soinfo::elf_addr_lookup(const void* addr) {
- ElfW(Addr) soaddr = reinterpret_cast<ElfW(Addr)>(addr) - base;
+ ElfW(Addr) soaddr = reinterpret_cast<ElfW(Addr)>(addr) - load_bias;
// Search the library's symbol table for any defined symbol which
// contains this address.