1 #ifndef AESALON_MONITOR_ELF_SECTION_H
2 #define AESALON_MONITOR_ELF_SECTION_H
8 #include "misc/SmartPointer.h"
16 #if AESALON_PLATFORM == AESALON_PLATFORM_x86_64
17 typedef Elf64_Shdr section_t
;
18 #elif AESALON_PLATFORM == AESALON_PLATFORM_x86
19 typedef Elf32_Shdr section_t
;
26 Misc::SmartPointer
<Block
> content
;
30 std::size_t get_content_size() const { return data
.sh_size
; }
36 Misc::SmartPointer
<Block
> get_content() {
37 if(!content
.is_valid()) read_content();
41 std::string
get_name() const { return name
; }
42 void set_name(std::string new_name
) { name
= new_name
; }
44 Word
get_name_offset() const { return data
.sh_name
; }
45 Word
get_data_offset() const { return data
.sh_offset
; }
47 Word
get_virtual_address() const { return data
.sh_addr
; }
49 bool is_string_table() const { return data
.sh_type
== SHT_STRTAB
; }
53 } // namespace Monitor
54 } // namespace Aesalon