Search code examples
linuxelfabiinstruction-setfat-binaries

Multiple ISA in same ELF file


Is it possible to have an ELF file that contains executable instructions from two ISAs. That is have a single ELF file that can be run on two architectures, say a x86 and a PowerPC.

One example of this that comes to mind was the Apple Universal Binaries that were used a few years ago. Is there any way to achieve something similar in a Linux distro? I have come across FatELF project which aimed at doing this, but it seems to be dead


Solution

  • That is called a fat binary. There have been some proposals, namely FatELF, but they haven't succeeded.

    Most Linux software is free software, so there is less incentive for fat binaries: if you can get the source code, you could compile the program from source. Also, fat binaries are indeed fat (e.g. bigger than ordinary binaries), and you'll eat more bandwidth to download them.

    Also, in practice, processor architectures are less diverse today than 30 years ago. We basically have x86-64 (also called AMD64) on desktops/laptops and ARM64 (also called AArch64) on phones/tablets and Macs.