4
0
mirror of https://github.com/QuasarApp/ELFIO.git synced 2025-05-12 19:09:34 +00:00

Ignore sections of zero size. Thanks to Martin Bickel

This commit is contained in:
Serge Lamikhov-Center 2016-12-20 20:11:20 +02:00
parent 446e0c215c
commit 878247108f

@ -632,7 +632,8 @@ class elfio
// Fix up the alignment
if ( !section_generated[index] && sec->is_address_initialized()
&& SHT_NOBITS != sec->get_type()
&& SHT_NULL != sec->get_type() ) {
&& SHT_NULL != sec->get_type()
&& 0 != sec->get_size() ) {
// Align the sections based on the virtual addresses
// when possible (this is what matters for execution)
Elf64_Off req_offset = sec->get_address() - seg->get_virtual_address();