diff --git a/tools/elf2rpl/main.cpp b/tools/elf2rpl/main.cpp index 3008d66..5d713ee 100644 --- a/tools/elf2rpl/main.cpp +++ b/tools/elf2rpl/main.cpp @@ -569,6 +569,14 @@ calculateSectionOffsets(ElfFile &file) auto offset = file.header.shoff; offset += align_up(static_cast(file.sections.size() * sizeof(elf::SectionHeader)), 64); + for (auto §ion : file.sections) { + if (section->header.type == elf::SHT_NOBITS || + section->header.type == elf::SHT_NULL) { + section->header.offset = 0u; + section->data.clear(); + } + } + for (auto §ion : file.sections) { if (section->header.type == elf::SHT_RPL_CRCS) { section->header.offset = offset;