Bug 651892 part 1 - Add a helper function to lookup symbols in a ElfSymtab_Section. r=tglek

This commit is contained in:
Mike Hommey
2011-06-23 04:07:30 +02:00
parent 8f2d06c3bc
commit d0d08e1e9d
3 changed files with 22 additions and 9 deletions

View File

@@ -830,6 +830,19 @@ ElfSymtab_Section::serialize(std::ofstream &file, char ei_class, char ei_data)
}
}
Elf_SymValue *
ElfSymtab_Section::lookup(const char *name, unsigned int type_filter)
{
for (std::vector<Elf_SymValue>::iterator sym = syms.begin();
sym != syms.end(); sym++) {
if ((type_filter & (1 << ELF32_ST_TYPE(sym->info))) &&
(strcmp(sym->name, name) == 0)) {
return &*sym;
}
}
return NULL;
}
const char *
ElfStrtab_Section::getStr(unsigned int index)
{