From 2ea440c90ee6ecf576c6c68bc271704913be731a Mon Sep 17 00:00:00 2001 From: James Benton Date: Wed, 30 May 2018 14:45:28 +0100 Subject: [PATCH] elf2rpl: Add flag to toggle whether IS_RPX flag is set in file info. --- tools/elf2rpl/main.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/tools/elf2rpl/main.cpp b/tools/elf2rpl/main.cpp index 8cc9584..ef7c823 100644 --- a/tools/elf2rpl/main.cpp +++ b/tools/elf2rpl/main.cpp @@ -319,7 +319,8 @@ reorderSectionIndex(ElfFile &file) * Generate SHT_RPL_FILEINFO section. */ static bool -generateFileInfoSection(ElfFile &file) +generateFileInfoSection(ElfFile &file, + uint32_t flags) { elf::RplFileInfo info; info.version = 0xCAFE0402u; @@ -337,7 +338,7 @@ generateFileInfoSection(ElfFile &file) info.stackSize = 0x10000u; info.heapSize = 0x8000u; info.filename = 0u; - info.flags = elf::RPL_IS_RPX; // TODO: Add .rpl support + info.flags = flags; info.minVersion = 0x5078u; info.compressionLevel = -1; info.fileInfoPad = 0u; @@ -994,7 +995,7 @@ int main(int argc, char **argv) return -1; } - if (!generateFileInfoSection(elf)) { + if (!generateFileInfoSection(elf, isRpl ? 0 : elf::RPL_IS_RPX)) { fmt::print("ERROR: generateFileInfoSection failed.\n"); return -1; }