ELFImage: Sprinkle some constification love

This commit is contained in:
Robin Burchell 2019-07-18 12:13:57 +02:00 committed by Andreas Kling
parent 1498a3be32
commit 7de79d3bbb
Notes: sideshowbarker 2024-07-19 13:11:00 +09:00
2 changed files with 4 additions and 4 deletions

View file

@ -29,7 +29,7 @@ static const char* object_file_type_to_string(Elf32_Half type)
} }
} }
const char* ELFImage::section_index_to_string(unsigned index) const char* ELFImage::section_index_to_string(unsigned index) const
{ {
if (index == SHN_UNDEF) if (index == SHN_UNDEF)
return "Undefined"; return "Undefined";
@ -43,7 +43,7 @@ unsigned ELFImage::symbol_count() const
return section(m_symbol_table_section_index).entry_count(); return section(m_symbol_table_section_index).entry_count();
} }
void ELFImage::dump() void ELFImage::dump() const
{ {
kprintf("ELFImage{%p} {\n", this); kprintf("ELFImage{%p} {\n", this);
kprintf(" is_valid: %u\n", is_valid()); kprintf(" is_valid: %u\n", is_valid());

View file

@ -9,7 +9,7 @@ class ELFImage {
public: public:
explicit ELFImage(const u8*); explicit ELFImage(const u8*);
~ELFImage(); ~ELFImage();
void dump(); void dump() const;
bool is_valid() const { return m_valid; } bool is_valid() const { return m_valid; }
bool parse(); bool parse();
@ -132,7 +132,7 @@ private:
const Elf32_Phdr& program_header_internal(unsigned) const; const Elf32_Phdr& program_header_internal(unsigned) const;
const char* table_string(unsigned offset) const; const char* table_string(unsigned offset) const;
const char* section_header_table_string(unsigned offset) const; const char* section_header_table_string(unsigned offset) const;
const char* section_index_to_string(unsigned index); const char* section_index_to_string(unsigned index) const;
const u8* m_buffer { nullptr }; const u8* m_buffer { nullptr };
bool m_valid { false }; bool m_valid { false };