Do not blow up when in GetHashBucket if GetHashBucketNum is zero.
Instead back-step to ElfFileOpen, which prints which symbol was
missing from which file.
Bug:
17422404
Change-Id: I3b890dd1c31c08b1ccc0f7f668afcceee95f8d00
}
const Elf32_Sym* ElfFile::FindDynamicSymbol(const std::string& symbol_name) const {
+ if (GetHashBucketNum() == 0) {
+ // No dynamic symbols at all.
+ return nullptr;
+ }
Elf32_Word hash = elfhash(symbol_name.c_str());
Elf32_Word bucket_index = hash % GetHashBucketNum();
Elf32_Word symbol_and_chain_index = GetHashBucket(bucket_index);