summaryrefslogtreecommitdiffstats
path: root/runtime/elf_file.cc
diff options
context:
space:
mode:
authorYevgeny Rouban <yevgeny.y.rouban@intel.com>2014-11-24 13:40:56 +0600
committerYevgeny Rouban <yevgeny.y.rouban@intel.com>2014-11-24 13:40:56 +0600
commitacb01387a9863654924891e1d1dfea274f1c9028 (patch)
treecbfe1417d6364e0e732b58d1e9fb88f28487ea2e /runtime/elf_file.cc
parentc6c88d2079f0d47eb86a2e2e2f53cab25b0503c1 (diff)
downloadart-acb01387a9863654924891e1d1dfea274f1c9028.zip
art-acb01387a9863654924891e1d1dfea274f1c9028.tar.gz
art-acb01387a9863654924891e1d1dfea274f1c9028.tar.bz2
ART: ELF symbol table lookup is fixed
ELF loader could not find some symbols in the OAT's symbol table (e.g. oatdata, oatexec). There was a bug in the symbol hash table lookup: if a valid index of a chain got greater or equal than the number of hash buckets then the chain was cut off. The fix is to compare the chain index with the chains array length rather than with the number of buckets. Change-Id: I20940957c3045913fd426031a51314d4f87ac1bd Signed-off-by: Yevgeny Rouban <yevgeny.y.rouban@intel.com>
Diffstat (limited to 'runtime/elf_file.cc')
-rw-r--r--runtime/elf_file.cc2
1 files changed, 1 insertions, 1 deletions
diff --git a/runtime/elf_file.cc b/runtime/elf_file.cc
index 37c5f9c..6597235 100644
--- a/runtime/elf_file.cc
+++ b/runtime/elf_file.cc
@@ -794,7 +794,7 @@ template <typename Elf_Ehdr, typename Elf_Phdr, typename Elf_Shdr, typename Elf_
Elf_Word ElfFileImpl<Elf_Ehdr, Elf_Phdr, Elf_Shdr, Elf_Word,
Elf_Sword, Elf_Addr, Elf_Sym, Elf_Rel, Elf_Rela, Elf_Dyn, Elf_Off>
::GetHashChain(size_t i, bool* ok) const {
- if (i >= GetHashBucketNum()) {
+ if (i >= GetHashChainNum()) {
*ok = false;
return 0;
}