From e8206bc27e1633c7e4c99907f43bf67d2f200cd5 Mon Sep 17 00:00:00 2001 From: Galen Williamson Date: Sun, 29 Jun 2025 11:23:58 -0400 Subject: [powerpc] Full merge of PowerPC disassembler PRs, including: * Remove dependency on capstone for PowerPC disassembly #6292 * Add support for PowerPC VLE instruction set #6740 * Add support for paired-single instructions #6821 * Various post-merge fixes and tweaks to disassembly and lifting * Removal of dependence on capstone for assembler's scoring mechanism (capstone currently disabled, but not removed from codebase yet) --- platform/linux/platform_linux.cpp | 36 ++++++++++++++++++++++++------------ 1 file changed, 24 insertions(+), 12 deletions(-) (limited to 'platform/linux/platform_linux.cpp') diff --git a/platform/linux/platform_linux.cpp b/platform/linux/platform_linux.cpp index 20a258d6..51434323 100644 --- a/platform/linux/platform_linux.cpp +++ b/platform/linux/platform_linux.cpp @@ -416,21 +416,33 @@ extern "C" } Ref ppc = Architecture::GetByName("ppc"); - Ref ppcle = Architecture::GetByName("ppc_le"); - if (ppc && ppcle) + Ref ppcvle = Architecture::GetByName("ppcvle"); + Ref ppcLE = Architecture::GetByName("ppc_le"); + // TODO: VLEPEM says that VLE always uses big-endian instruction + // encoding, but doesn't say anything about data + // endianness, so in theory little-endian PPC should be + // possible? + if (ppc && ppcvle && ppcLE) { - Ref platform; - Ref platformle; + Ref ppcPlatform; + Ref ppcvlePlatform; + Ref ppcLEPlatform; + + ppcPlatform = new LinuxPpc32Platform(ppc, "linux-ppc32"); + ppcvlePlatform = new LinuxPpc32Platform(ppcvle, "linux-ppcvle32"); + ppcLEPlatform = new LinuxPpc32Platform(ppcLE, "linux-ppc32_le"); + + Platform::Register("linux", ppcPlatform); + Platform::Register("linux", ppcvlePlatform); + Platform::Register("linux", ppcLEPlatform); - platform = new LinuxPpc32Platform(ppc, "linux-ppc32"); - platformle = new LinuxPpc32Platform(ppcle, "linux-ppc32_le"); - Platform::Register("linux", platform); - Platform::Register("linux", platformle); // Linux binaries sometimes have an OS identifier of zero, even though 3 is the correct one - BinaryViewType::RegisterPlatform("ELF", 0, platform); - BinaryViewType::RegisterPlatform("ELF", 3, platform); - BinaryViewType::RegisterPlatform("ELF", 0, platformle); - BinaryViewType::RegisterPlatform("ELF", 3, platformle); + BinaryViewType::RegisterPlatform("ELF", 0,ppcPlatform); + BinaryViewType::RegisterPlatform("ELF", 3,ppcPlatform); + BinaryViewType::RegisterPlatform("ELF", 0,ppcvlePlatform); + BinaryViewType::RegisterPlatform("ELF", 3,ppcvlePlatform); + BinaryViewType::RegisterPlatform("ELF", 0,ppcLEPlatform); + BinaryViewType::RegisterPlatform("ELF", 3,ppcLEPlatform); } Ref ppc64 = Architecture::GetByName("ppc64"); -- cgit v1.3.1