Support big-endian PPC64 ELFv2
Author: rui314Created Sep 29, 2026Updated Sep 29, 2026
mold supports PPC64 ELFv1 (big-endian) and ELFv2 (little-endian). Big-endian ELFv2 objects, which musl uses on big-endian PPC64 and some distributions such as ArchPOWER use with glibc, are rejected with "unknown machine type".
Adding it would mean a big-endian variant of the ppc64v2 target, as we already have for other targets. The harder part is testing: the Debian/Ubuntu powerpc64-linux-gnu toolchain is ELFv1, so the tests would need a big-endian ELFv2 toolchain, e.g. powerpc64-linux-musl with qemu-ppc64.
Requested in https://github.com/rui314/mold/discussions/1643#discussioncomment-18603572
Source: rui314/mold