elf2rpl: Remove fixBssNoBits transform.

Not needed since we updated linker script to have (NOLOAD)!
This commit is contained in:
James Benton 2018-05-30 22:40:41 +01:00
parent 00b6fa3940
commit c15e185762

View File

@ -150,32 +150,6 @@ readElf(ElfFile &file, const std::string &filename)
}
/**
* Our linker script sometimes converts .bss from NOBITS to PROGBITS.
*/
static bool
fixBssNoBits(ElfFile &file)
{
auto section = getSectionByName(file, ".bss");
if (!section) {
return true;
}
// Ensure there is actually all 0 in the .bss section
for (const auto c : section->data) {
if (c) {
return false;
}
}
// Set type back to NOBITS
section->header.type = elf::SHT_NOBITS;
section->header.offset = 0u;
section->data.clear();
return true;
}
/**
* Reorder sections index.
*
@ -975,11 +949,6 @@ int main(int argc, char **argv)
return -1;
}
if (!fixBssNoBits(elf)) {
fmt::print("ERROR: fixBssNoBits failed.\n");
return -1;
}
if (!reorderSectionIndex(elf)) {
fmt::print("ERROR: reorderSectionIndex failed.\n");
return -1;