mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 10:48:11 +00:00
LibELF: Avoid calling strlen() in DynamicObject::hash_section()
The long-term fix here is to make StringView recognize compile-time string literals and do the right thing automatically.
This commit is contained in:
parent
d6af3302e8
commit
cc00df0f0f
1 changed files with 3 additions and 1 deletions
|
@ -235,7 +235,9 @@ DynamicObject::Section DynamicObject::fini_array_section() const
|
|||
|
||||
DynamicObject::HashSection DynamicObject::hash_section() const
|
||||
{
|
||||
const char* section_name = m_hash_type == HashType::SYSV ? "DT_HASH" : "DT_GNU_HASH";
|
||||
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);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue