To make memory_size bigger than file_size, set memory_size prior calling 'save' function

This commit is contained in:
Serge Lamikhov-Center 2012-06-24 08:50:29 +03:00
parent b3b7aed245
commit 2cddbab258
2 changed files with 3 additions and 2 deletions

View File

@ -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();

View File

@ -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 );