diff --git a/elfio/elfio.hpp b/elfio/elfio.hpp index 705dae2..7ef6ec0 100644 --- a/elfio/elfio.hpp +++ b/elfio/elfio.hpp @@ -479,7 +479,8 @@ class elfio } segments[i]->set_file_size( current_data_pos - current_file_pos ); - segments[i]->set_memory_size( current_data_pos - current_file_pos ); + segments[i]->set_memory_size( current_data_pos - current_file_pos + + segments[i]->get_memory_size() ); segments[i]->save( f, (std::streamoff)segment_header_position, (std::streamoff)current_file_pos ); current_file_pos = current_data_pos; segment_header_position += header->get_segment_entry_size(); diff --git a/elfio/elfio_section.hpp b/elfio/elfio_section.hpp index 811ee4c..04f8498 100644 --- a/elfio/elfio_section.hpp +++ b/elfio/elfio_section.hpp @@ -36,7 +36,7 @@ class section public: virtual ~section() {}; - virtual Elf_Half get_index() const = 0; + virtual Elf_Half get_index() const = 0; ELFIO_GET_SET_ACCESS_DECL( std::string, name ); ELFIO_GET_SET_ACCESS_DECL( Elf_Word, type );