diff options
author | Andreas Kling <kling@serenityos.org> | 2021-02-23 20:32:52 +0100 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2021-02-23 20:33:32 +0100 |
commit | b33a6a443e700cd80325d312f21c985b0687bb97 (patch) | |
tree | 57a1e4343242fa751a481613c722eb281a8022c1 /Userland/Libraries | |
parent | 4ed85e9b9e183fc5c817129c1fbef67d3a3abaf5 (diff) | |
download | serenity-b33a6a443e700cd80325d312f21c985b0687bb97.zip |
LibELF: Inline DynamicObject::hash_section()
This was high up in profiles and gets almost entirely optimized out
when inlined, so let's do that.
Diffstat (limited to 'Userland/Libraries')
-rw-r--r-- | Userland/Libraries/LibELF/DynamicObject.cpp | 8 | ||||
-rw-r--r-- | Userland/Libraries/LibELF/DynamicObject.h | 8 |
2 files changed, 7 insertions, 9 deletions
diff --git a/Userland/Libraries/LibELF/DynamicObject.cpp b/Userland/Libraries/LibELF/DynamicObject.cpp index 8b3bd8c0bb..9505a87809 100644 --- a/Userland/Libraries/LibELF/DynamicObject.cpp +++ b/Userland/Libraries/LibELF/DynamicObject.cpp @@ -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")); diff --git a/Userland/Libraries/LibELF/DynamicObject.h b/Userland/Libraries/LibELF/DynamicObject.h index 3a1a183728..075b176508 100644 --- a/Userland/Libraries/LibELF/DynamicObject.h +++ b/Userland/Libraries/LibELF/DynamicObject.h @@ -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; |