mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-25 09:00:22 +00:00
LibELF: Inline DynamicObject::hash_section()
This was high up in profiles and gets almost entirely optimized out when inlined, so let's do that.
This commit is contained in:
parent
4ed85e9b9e
commit
b33a6a443e
Notes:
sideshowbarker
2024-07-18 21:58:49 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/b33a6a443e7
2 changed files with 7 additions and 9 deletions
|
@ -233,14 +233,6 @@ DynamicObject::Section DynamicObject::fini_array_section() const
|
|||
return Section(*this, m_fini_array_offset, m_fini_array_size, sizeof(void (*)()), "DT_FINI_ARRAY");
|
||||
}
|
||||
|
||||
DynamicObject::HashSection DynamicObject::hash_section() const
|
||||
{
|
||||
auto section_name = m_hash_type == HashType::SYSV
|
||||
? StringView { "DT_HASH", 7 }
|
||||
: StringView { "DT_GNU_HASH", 11 };
|
||||
return HashSection(Section(*this, m_hash_table_offset, 0, 0, section_name), m_hash_type);
|
||||
}
|
||||
|
||||
DynamicObject::RelocationSection DynamicObject::relocation_section() const
|
||||
{
|
||||
return RelocationSection(Section(*this, m_relocation_table_offset, m_size_of_relocation_table, m_size_of_relocation_entry, "DT_REL"));
|
||||
|
|
|
@ -217,7 +217,13 @@ public:
|
|||
Section init_array_section() const;
|
||||
Section fini_array_section() const;
|
||||
|
||||
HashSection hash_section() const;
|
||||
HashSection hash_section() const
|
||||
{
|
||||
auto section_name = m_hash_type == HashType::SYSV
|
||||
? StringView { "DT_HASH", 7 }
|
||||
: StringView { "DT_GNU_HASH", 11 };
|
||||
return HashSection(Section(*this, m_hash_table_offset, 0, 0, section_name), m_hash_type);
|
||||
}
|
||||
|
||||
RelocationSection relocation_section() const;
|
||||
RelocationSection plt_relocation_section() const;
|
||||
|
|
Loading…
Reference in a new issue