mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-06-11 02:13:56 +09:00
LibELF: Avoid doing strlen() on everything while iterating GNU hash
It's a lot faster to iterate the GNU hash tables if we don't have to compute the length of every symbol name before rejecting it anyway while comparing the first character. :^)
This commit is contained in:
parent
46a94a9a9e
commit
22b8110554
Notes:
sideshowbarker
2024-07-18 21:59:04 +09:00
Author: https://github.com/awesomekling
Commit: 22b8110554
2 changed files with 9 additions and 5 deletions
|
@ -75,6 +75,7 @@ public:
|
|||
}
|
||||
|
||||
StringView name() const { return m_dynamic.symbol_string_table_string(m_sym.st_name); }
|
||||
const char* raw_name() const { return m_dynamic.raw_symbol_string_table_string(m_sym.st_name); }
|
||||
unsigned section_index() const { return m_sym.st_shndx; }
|
||||
unsigned value() const { return m_sym.st_value; }
|
||||
unsigned size() const { return m_sym.st_size; }
|
||||
|
@ -264,6 +265,7 @@ private:
|
|||
explicit DynamicObject(VirtualAddress base_address, VirtualAddress dynamic_section_address);
|
||||
|
||||
StringView symbol_string_table_string(Elf32_Word) const;
|
||||
const char* raw_symbol_string_table_string(Elf32_Word) const;
|
||||
void parse();
|
||||
|
||||
template<typename F>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue