mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 08:57:34 +00:00
LibELF: Rename lookup_elf_symbol() => lookup_sysv_symbol()
We have two kinds of lookup, SYSV and GNU hash. Both are ELF lookups.
This commit is contained in:
parent
cc00df0f0f
commit
46a94a9a9e
2 changed files with 3 additions and 3 deletions
|
@ -251,7 +251,7 @@ DynamicObject::RelocationSection DynamicObject::plt_relocation_section() const
|
||||||
return RelocationSection(Section(*this, m_plt_relocation_offset_location, m_size_of_plt_relocation_entry_list, m_size_of_relocation_entry, "DT_JMPREL"));
|
return RelocationSection(Section(*this, m_plt_relocation_offset_location, m_size_of_plt_relocation_entry_list, m_size_of_relocation_entry, "DT_JMPREL"));
|
||||||
}
|
}
|
||||||
|
|
||||||
auto DynamicObject::HashSection::lookup_elf_symbol(const StringView& name, u32 hash_value) const -> Optional<Symbol>
|
auto DynamicObject::HashSection::lookup_sysv_symbol(const StringView& name, u32 hash_value) const -> Optional<Symbol>
|
||||||
{
|
{
|
||||||
u32* hash_table_begin = (u32*)address().as_ptr();
|
u32* hash_table_begin = (u32*)address().as_ptr();
|
||||||
size_t num_buckets = hash_table_begin[0];
|
size_t num_buckets = hash_table_begin[0];
|
||||||
|
|
|
@ -191,12 +191,12 @@ public:
|
||||||
Optional<Symbol> lookup_symbol(const StringView& name, u32 gnu_hash, u32 sysv_hash) const
|
Optional<Symbol> lookup_symbol(const StringView& name, u32 gnu_hash, u32 sysv_hash) const
|
||||||
{
|
{
|
||||||
if (m_hash_type == HashType::SYSV)
|
if (m_hash_type == HashType::SYSV)
|
||||||
return lookup_elf_symbol(name, sysv_hash);
|
return lookup_sysv_symbol(name, sysv_hash);
|
||||||
return lookup_gnu_symbol(name, gnu_hash);
|
return lookup_gnu_symbol(name, gnu_hash);
|
||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
Optional<Symbol> lookup_elf_symbol(const StringView& name, u32 hash) const;
|
Optional<Symbol> lookup_sysv_symbol(const StringView& name, u32 hash_value) const;
|
||||||
Optional<Symbol> lookup_gnu_symbol(const StringView& name, u32 hash) const;
|
Optional<Symbol> lookup_gnu_symbol(const StringView& name, u32 hash) const;
|
||||||
|
|
||||||
HashType m_hash_type {};
|
HashType m_hash_type {};
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue