summaryrefslogtreecommitdiff
path: root/platform/linux/platform_linux.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'platform/linux/platform_linux.cpp')
-rw-r--r--platform/linux/platform_linux.cpp36
1 files changed, 24 insertions, 12 deletions
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<Architecture> ppc = Architecture::GetByName("ppc");
- Ref<Architecture> ppcle = Architecture::GetByName("ppc_le");
- if (ppc && ppcle)
+ Ref<Architecture> ppcvle = Architecture::GetByName("ppcvle");
+ Ref<Architecture> 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> platform;
- Ref<Platform> platformle;
+ Ref<Platform> ppcPlatform;
+ Ref<Platform> ppcvlePlatform;
+ Ref<Platform> 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<Architecture> ppc64 = Architecture::GetByName("ppc64");