elf2rpl: Remove fixSectionAlign.

Not needed.
This commit is contained in:
James Benton 2018-05-30 22:40:53 +01:00
parent c15e185762
commit ae70d3a4a9

View File

@ -563,30 +563,6 @@ fixFileHeader(ElfFile &file)
} }
/**
* Fix the .addralign field for sections.
*/
static bool
fixSectionAlign(ElfFile &file)
{
for (auto &section : file.sections) {
if (section->header.type == elf::SHT_PROGBITS) {
section->header.addralign = 32u;
} else if (section->header.type == elf::SHT_NOBITS) {
section->header.addralign = 64u;
} else if (section->header.type == elf::SHT_RPL_IMPORTS) {
section->header.addralign = 4u;
} else if (section->header.type == elf::SHT_RPL_EXPORTS) {
section->header.addralign = 4u;
} else if (section->header.type == elf::SHT_STRTAB) {
section->header.addralign = 1u;
}
}
return true;
}
/** /**
* .rodate requires W flag. * .rodate requires W flag.
*/ */
@ -959,11 +935,6 @@ int main(int argc, char **argv)
return -1; return -1;
} }
if (!fixSectionAlign(elf)) {
fmt::print("ERROR: fixSectionAlign failed.\n");
return -1;
}
if (!fixLoaderVirtualAddresses(elf)) { if (!fixLoaderVirtualAddresses(elf)) {
fmt::print("ERROR: fixLoaderVirtualAddresses failed.\n"); fmt::print("ERROR: fixLoaderVirtualAddresses failed.\n");
return -1; return -1;