mirror of
https://github.com/SerenityOS/serenity
synced 2024-09-06 17:06:31 +00:00
LibELF: Remove unused m_program_interpreter member from DynamicLoader
While profiling I realized that this member is unused, so the StringBuilder and String allocation are completely un-necessary.
This commit is contained in:
parent
39f924a731
commit
7d667b9f69
|
@ -122,11 +122,9 @@ bool DynamicLoader::validate()
|
|||
auto* elf_header = (ElfW(Ehdr)*)m_file_data;
|
||||
if (!validate_elf_header(*elf_header, m_file_size))
|
||||
return false;
|
||||
StringBuilder interpreter_path_builder;
|
||||
auto result_or_error = validate_program_headers(*elf_header, m_file_size, { m_file_data, m_file_size }, &interpreter_path_builder);
|
||||
auto result_or_error = validate_program_headers(*elf_header, m_file_size, { m_file_data, m_file_size });
|
||||
if (result_or_error.is_error() || !result_or_error.value())
|
||||
return false;
|
||||
m_program_interpreter = interpreter_path_builder.string_view();
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
|
@ -135,7 +135,6 @@ private:
|
|||
ssize_t negative_offset_from_tls_block_end(ssize_t tls_offset, size_t value_of_symbol) const;
|
||||
|
||||
String m_filename;
|
||||
String m_program_interpreter;
|
||||
size_t m_file_size { 0 };
|
||||
int m_image_fd { -1 };
|
||||
void* m_file_data { nullptr };
|
||||
|
|
|
@ -13,6 +13,6 @@
|
|||
namespace ELF {
|
||||
|
||||
bool validate_elf_header(ElfW(Ehdr) const& elf_header, size_t file_size, bool verbose = true);
|
||||
ErrorOr<bool> validate_program_headers(ElfW(Ehdr) const& elf_header, size_t file_size, ReadonlyBytes buffer, StringBuilder* interpreter_path_builder, bool verbose = true);
|
||||
ErrorOr<bool> validate_program_headers(ElfW(Ehdr) const& elf_header, size_t file_size, ReadonlyBytes buffer, StringBuilder* interpreter_path_builder = nullptr, bool verbose = true);
|
||||
|
||||
} // end namespace ELF
|
||||
|
|
Loading…
Reference in a new issue