LibELF: Set ELF::Loader::m_symbol_count in constructor

Setting it in load() excludes users of ELF::Loader that don't actually
call load() but only use the Loader for symbolication purposes.

Perhaps the factoring here is not ideal.
This commit is contained in:
Andreas Kling 2020-08-11 12:22:19 +02:00
parent c3b6df60b7
commit 8d73355c38
Notes: sideshowbarker 2024-07-19 03:54:07 +09:00

View file

@ -43,6 +43,8 @@ namespace ELF {
Loader::Loader(const u8* buffer, size_t size, bool verbose_logging)
: m_image(buffer, size, verbose_logging)
{
if (m_image.is_valid())
m_symbol_count = m_image.symbol_count();
}
Loader::~Loader()
@ -57,8 +59,6 @@ bool Loader::load()
if (!m_image.is_valid())
return false;
m_symbol_count = m_image.symbol_count();
if (!layout())
return false;