elf2rpl: Fix SHT_RPL_CRCS section

This commit is contained in:
James Benton 2018-05-23 15:36:07 +01:00
parent 9bcf22e40f
commit 541676ce38

View File

@ -405,7 +405,7 @@ generateFileInfoSection(ElfFile &file)
static bool
generateCrcSection(ElfFile &file)
{
std::vector<uint32_t> crcs;
std::vector<be_val<uint32_t>> crcs;
for (auto &section : file.sections) {
auto crc = uint32_t { 0u };
@ -417,6 +417,9 @@ generateCrcSection(ElfFile &file)
crcs.push_back(crc);
}
// Insert a 0 crc for this section
crcs.insert(crcs.end() - 1, 0);
auto section = std::make_unique<ElfFile::Section>();
section->header.name = 0u;
section->header.type = elf::SHT_RPL_CRCS;