From ae70d3a4a98a9a363f1c3eef51acc274c199c970 Mon Sep 17 00:00:00 2001 From: James Benton Date: Wed, 30 May 2018 22:40:53 +0100 Subject: [PATCH] elf2rpl: Remove fixSectionAlign. Not needed. --- tools/elf2rpl/main.cpp | 29 ----------------------------- 1 file changed, 29 deletions(-) diff --git a/tools/elf2rpl/main.cpp b/tools/elf2rpl/main.cpp index 009c3c2..4607159 100644 --- a/tools/elf2rpl/main.cpp +++ b/tools/elf2rpl/main.cpp @@ -563,30 +563,6 @@ fixFileHeader(ElfFile &file) } -/** - * Fix the .addralign field for sections. - */ -static bool -fixSectionAlign(ElfFile &file) -{ - for (auto §ion : 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. */ @@ -959,11 +935,6 @@ int main(int argc, char **argv) return -1; } - if (!fixSectionAlign(elf)) { - fmt::print("ERROR: fixSectionAlign failed.\n"); - return -1; - } - if (!fixLoaderVirtualAddresses(elf)) { fmt::print("ERROR: fixLoaderVirtualAddresses failed.\n"); return -1;